/*
 * Frank design system on the web (design/index.html is the reference board): paper and ink, with Frank
 * red reserved for anger and accents, night surfaces only for the big moments. --bg, --text and --accent
 * are brand.config.ts colors (checked by apps/mobile/__tests__/brand-consistency.test.ts).
 *
 * Fonts are the app's OFL files (apps/mobile/assets/fonts), served from /fonts with their licenses.
 */
@font-face {
  font-family: 'Archivo Condensed';
  font-weight: 900;
  font-display: swap;
  src: url('/fonts/Archivo-CondensedBlack.ttf') format('truetype');
}

@font-face {
  font-family: 'Archivo ExtraCondensed';
  font-weight: 900;
  font-display: swap;
  src: url('/fonts/Archivo-ExtraCondensedBlack.ttf') format('truetype');
}

@font-face {
  font-family: 'Archivo';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Archivo-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Archivo';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/Archivo-SemiBold.ttf') format('truetype');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/JetBrainsMono-Medium.ttf') format('truetype');
}

:root {
  --bg: #eeeae2;
  --bg-2: #e4dfd5;
  --surface: #fbf9f5;
  --border: #d7d1c5;
  --text: #151312;
  --ink-2: #2a2724;
  --muted: #66615a;
  --faint: #9a948a;
  --accent: #d3412a;
  --accent-soft: #f4d9d2;
  --coral: #f06a4e;
  --green: #3b7a55;
  --night: #121110;
  --night-2: #1f1d1b;
  --night-muted: #b9b2a6;
  --bone: #f7f3ec;
  --display: 'Archivo Condensed', 'Arial Narrow', 'Roboto Condensed', Impact, sans-serif;
  --numeral: 'Archivo ExtraCondensed', 'Archivo Condensed', 'Arial Narrow', Impact, sans-serif;
  --body: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 18px;
  --max: 1160px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

svg {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.nav,
main,
.footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

/* ---------- Type ---------- */

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.005em;
}

h1 {
  font-size: clamp(54px, 8vw, 104px);
  line-height: 0.88;
  margin: 14px 0 0;
}

h2 {
  font-size: clamp(38px, 5vw, 64px);
  line-height: 0.92;
  margin: 10px 0 0;
}

h3 {
  font-size: 28px;
  line-height: 1;
  margin: 14px 0 10px;
}

.eyebrow {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.lede {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
  max-width: 36ch;
  margin: 22px 0 32px;
}

.section-lede {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
  max-width: 46ch;
  margin: 16px 0 0;
}

/* ---------- Header ---------- */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
}

/* The app icon (Frank's eyes on red) in front of the name. */
.brand::before {
  content: '';
  width: 36px;
  height: 36px;
  flex: none;
  background: url('/favicon.svg') center / contain no-repeat;
}

.nav-cta,
.finale-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bone);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  padding: 40px 0 88px;
}

.waitlist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 540px;
}

.waitlist input[type='email'] {
  flex: 1 1 240px;
  min-height: 58px;
  padding: 0 24px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--border);
}

.waitlist input[type='email']::placeholder {
  color: var(--faint);
}

.waitlist input[type='email']:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--text);
}

.waitlist button {
  min-height: 58px;
  padding: 0 28px;
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone);
  background: var(--text);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.waitlist button:hover {
  background: var(--accent);
}

.waitlist button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.hp {
  position: absolute;
  left: -9999px;
}

.form-note {
  flex-basis: 100%;
  margin: 6px 0 0 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.form-note a {
  color: inherit;
}

.form-note.ok {
  color: var(--green);
}

.form-note.err {
  color: var(--accent);
}

.turnstile {
  flex-basis: 100%;
}

.hero-art {
  position: relative;
  max-width: 520px;
  justify-self: end;
  width: 100%;
}

/* Frank's face, cropped at the chin like the app's welcome screen. */
.hero-face {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 28px;
  background: var(--bg-2);
  box-shadow: inset 0 0 0 2.5px var(--text);
}

.hero-face svg {
  width: 110%;
  margin-left: -5%;
}

.bubble {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -44px 22px 0;
  padding: 12px 16px 12px 12px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bone);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
  box-shadow: 0 18px 30px -16px rgba(21, 19, 18, 0.55);
}

.bubble-face {
  width: 44px;
  flex: none;
}

/* ---------- Sections ---------- */

.section {
  padding: 22px 0 88px;
  border-top: 2px solid var(--text);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr minmax(0, 440px);
  grid-template-areas:
    'eyebrow eyebrow'
    'title lede';
  column-gap: 48px;
  align-items: end;
  margin-bottom: 40px;
}

.section-head .eyebrow {
  grid-area: eyebrow;
}

.section-head h2 {
  grid-area: title;
}

.section-head .section-lede {
  grid-area: lede;
  margin: 0;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--border);
  padding: 26px;
}

.card p {
  color: var(--muted);
  margin: 0;
}

.card h3:first-child {
  margin-top: 0;
}

.step {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.checks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.checks li {
  position: relative;
  padding-left: 36px;
  color: var(--muted);
}

/* The app's checked checkbox: a red dot with a white tick. */
.checks li::before,
.checks li::after {
  content: '';
  position: absolute;
}

.checks li::before {
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
}

.checks li::after {
  left: 6.5px;
  top: 7.5px;
  width: 9px;
  height: 5px;
  border-left: 2.2px solid #fff;
  border-bottom: 2.2px solid #fff;
  transform: rotate(-45deg);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: end;
}

.split p:not(.eyebrow) {
  color: var(--muted);
  font-size: 19px;
  margin: 18px 0 0;
}

/* ---------- Tones ---------- */

.tones {
  display: grid;
  grid-template-columns: 1fr minmax(0, 440px);
  gap: 56px;
  align-items: center;
}

.tone-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 32px;
  max-width: 540px;
}

.tone-switch button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px 14px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--border);
  cursor: pointer;
}

.tone-switch button:hover {
  box-shadow: inset 0 0 0 1.5px var(--text);
}

.tone-switch button svg {
  width: 78px;
  height: 78px;
}

.tone-switch b {
  font-family: var(--display);
  font-weight: 900;
  font-size: 24px;
  line-height: 1;
  text-transform: uppercase;
  margin-top: 8px;
}

.tone-switch span {
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--muted);
  margin-top: 4px;
}

.tone-switch button[aria-selected='true'] {
  background: var(--text);
  color: var(--bone);
  box-shadow: none;
}

.tone-switch button[aria-selected='true'] span {
  color: var(--night-muted);
}

/* A lock screen, as on the board (N1). */
.lock {
  border-radius: 40px;
  padding: 26px 14px 16px;
  background: linear-gradient(165deg, #1e1a17 0%, #3b2a23 45%, #a9472f 100%);
  color: var(--bone);
  box-shadow:
    0 0 0 10px #0e0d0c,
    0 40px 70px -24px rgba(20, 18, 16, 0.5);
  margin: 10px;
}

.lock-date {
  margin: 0;
  text-align: center;
  font-weight: 600;
  font-size: 17px;
  color: #e9e2d6;
}

.lock-time {
  margin: 0 0 28px;
  text-align: center;
  font-family: var(--numeral);
  font-weight: 900;
  font-size: 108px;
  line-height: 0.9;
}

.stack {
  display: grid;
  gap: 8px;
  min-height: 316px;
  align-content: start;
}

.note {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  grid-template-areas:
    'icon name time'
    'icon title title'
    'icon body body';
  column-gap: 12px;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: 22px;
  background: rgba(245, 241, 233, 0.84);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: var(--text);
  animation: drop 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.note:nth-child(2) {
  animation-delay: 80ms;
}

.note:nth-child(3) {
  animation-delay: 160ms;
}

.note header {
  display: contents;
}

.note header i {
  grid-area: icon;
  align-self: start;
  width: 38px;
  height: 38px;
  background: url('/favicon.svg') center / contain no-repeat;
}

.note header b {
  grid-area: name;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.note header span {
  grid-area: time;
  font-size: 12px;
  color: var(--faint);
}

.note strong {
  grid-area: title;
  font-weight: 600;
  font-size: 15px;
  margin-top: 1px;
}

.note p {
  grid-area: body;
  margin: 1px 0 0;
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--ink-2);
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

/* ---------- Full-bleed bands ---------- */

.band {
  position: relative;
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  clip-path: inset(0 -100vmax);
}

.math {
  --band: var(--night);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: center;
  padding: 96px 0;
  color: var(--bone);
}

.math .eyebrow {
  color: var(--coral);
}

.math h2 {
  font-size: clamp(34px, 4.4vw, 52px);
  max-width: 12ch;
}

.math-num {
  display: block;
  font-family: var(--numeral);
  font-size: clamp(150px, 22vw, 260px);
  line-height: 0.82;
  color: var(--coral);
}

.math p:not(.eyebrow) {
  color: var(--night-muted);
  font-size: 18px;
  max-width: 40ch;
  margin: 20px 0 0;
}

.math p.math-note {
  max-width: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6f695f;
}

.dots {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: clamp(7px, 1.2vw, 12px);
}

.dots i {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bone);
  opacity: 0.92;
}

.dots i.on {
  background: var(--coral);
  opacity: 1;
}

.math + .section {
  border-top: 0;
  padding-top: 88px;
}

.finale {
  --band: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 96px 0;
  color: var(--bone);
  text-align: center;
}

.finale-eyes {
  width: clamp(170px, 22vw, 240px);
}

.finale h2 {
  font-size: clamp(88px, 14vw, 168px);
  line-height: 0.86;
  margin: 26px 0 0;
}

.finale-tag {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.finale-cta {
  margin-top: 36px;
  min-height: 54px;
  padding: 0 28px;
  background: var(--bone);
  color: var(--text);
  font-size: 14px;
}

.finale-cta:hover {
  background: var(--text);
  color: var(--bone);
}

/* ---------- Moods ---------- */

.moods {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 28px 20px;
}

.moods li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
}

.moods svg {
  width: min(100%, 150px);
  height: auto;
}

.moods b {
  font-family: var(--display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  text-transform: uppercase;
  margin-top: 12px;
}

.moods span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------- Privacy ---------- */

.privacy-band {
  display: grid;
  grid-template-columns: 1fr minmax(0, 250px);
  gap: 32px 56px;
  align-items: center;
  margin-bottom: 88px;
  padding: clamp(36px, 6vw, 72px);
  border-radius: 28px;
  background: var(--text);
  color: var(--bone);
}

.privacy-band .eyebrow {
  color: var(--coral);
}

.privacy-band h2 {
  max-width: 16ch;
}

.privacy-face {
  width: 100%;
}

.privacy-band p:not(.eyebrow) {
  color: var(--night-muted);
  font-size: 19px;
  max-width: 44ch;
  margin: 18px 0 0;
}

/* ---------- FAQ (landing and support) ---------- */

.faq details {
  border-top: 1px solid var(--border);
  padding: 18px 0;
}

.faq details:last-of-type {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 19px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  font-family: var(--mono);
  font-weight: 500;
  color: var(--accent);
}

.faq details[open] summary::after {
  content: '−';
}

.faq details p {
  color: var(--muted);
  margin: 10px 0 0;
  max-width: 70ch;
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px 0 44px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.doc + .footer {
  border-top: 2px solid var(--text);
}

.footer nav {
  display: flex;
  gap: 22px;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
}

/* ---------- Legal and support pages ---------- */

.doc {
  max-width: 760px;
  padding: 40px 0 72px;
}

.doc h1 {
  font-size: clamp(48px, 8vw, 88px);
  line-height: 0.9;
  margin: 0 0 14px;
}

.doc h2 {
  font-size: 30px;
  line-height: 1;
  margin: 48px 0 12px;
}

.doc p,
.doc li {
  color: var(--muted);
}

.doc strong {
  color: var(--text);
  font-weight: 600;
}

.doc a {
  text-decoration-color: var(--accent);
}

.doc .meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.doc .draft {
  border-radius: 14px;
  padding: 14px 18px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 15px;
}

/* Pre-launch only: inline notes and [PLACEHOLDERS] that must be resolved before the store submission. */
.doc .draft-note {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 15px;
}

.doc .draft-note::before {
  content: '⚠ ';
}

.placeholder {
  color: var(--accent);
}

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  .hero,
  .tones,
  .split,
  .math,
  .grid.three,
  .grid.two,
  .section-head {
    grid-template-columns: 1fr;
  }

  .section-head {
    grid-template-areas:
      'eyebrow'
      'title'
      'lede';
  }

  .section-head .section-lede {
    margin-top: 16px;
  }

  .hero {
    gap: 40px;
    padding: 12px 0 72px;
  }

  .hero-art {
    order: -1;
    justify-self: center;
    max-width: 440px;
  }

  .tones,
  .math,
  .split {
    gap: 40px;
  }

  .privacy-band {
    grid-template-columns: 1fr;
  }

  .privacy-face {
    order: -1;
    width: 128px;
  }

  .lock {
    max-width: 420px;
    width: calc(100% - 20px);
    justify-self: center;
  }

  .moods {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .nav-cta {
    padding: 0 16px;
    font-size: 12px;
  }

  .brand {
    font-size: 26px;
  }

  .brand::before {
    width: 32px;
    height: 32px;
  }

  .lede {
    font-size: 18px;
  }

  .bubble {
    margin: -36px 12px 0;
    font-size: 15px;
  }

  .tone-switch {
    gap: 8px;
  }

  .tone-switch button {
    padding: 14px 4px 12px;
  }

  .tone-switch button svg {
    width: 62px;
    height: 62px;
  }

  .tone-switch b {
    font-size: 21px;
  }

  .tone-switch span {
    font-size: 11.5px;
  }

  .lock-time {
    font-size: 88px;
  }

  .card {
    padding: 22px;
  }

  .moods {
    gap: 24px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .note {
    animation: none;
  }
}
