/* Palette pulled from the app's Theme.swift, so the site and the product
   look like the same thing. */
:root {
  --bg: #FAF9F7;
  --card: #FFFFFF;
  --hairline: #E4E0DA;
  --text-primary: #1B1814;
  --text-secondary: #6B635A;
  --text-faint: #A29A90;

  --blue: #2E7DDE;
  --orange: #F5821F;
  --red: #D9483B;

  --blue-tint: #E9F1FC;
  --shadow: 0 1px 2px rgba(27,24,20,0.05), 0 18px 40px -18px rgba(27,24,20,0.28);

  /* The mock iPhone: sized so the whole phone always fits the viewport. */
  --phone-w: min(300px, calc((100svh - 150px) * 0.44));
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110;
    --card: #23211F;
    --hairline: rgba(255,255,255,0.12);
    --text-primary: #F5F3F0;
    --text-secondary: #B3ADA6;
    --text-faint: #7B756E;
    --blue-tint: #1B2B40;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 18px 40px -18px rgba(0,0,0,0.7);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, .wordmark, .btn, .eyebrow {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 60%, transparent);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 21px;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark.small { font-size: 16px; gap: 6px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(46,125,222,0.6); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 40%, transparent); outline-offset: 3px; }
.btn-small { padding: 9px 18px; font-size: 15px; }
.btn-large { padding: 16px 30px; font-size: 18px; }
.btn-light { background: #fff; color: var(--blue); }

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

.hero {
  min-height: 100svh;
  padding: 96px 0 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 56px;
  align-items: center;
  width: 100%;
}

h1 {
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.accent { color: var(--blue); }

.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 34em;
  margin: 0 0 30px;
}

.fine { font-size: 14px; color: var(--text-faint); margin: 14px 0 0; }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.scroll-cue::after {
  content: "";
  display: block;
  width: 1px;
  height: 28px;
  margin: 8px auto 0;
  background: linear-gradient(var(--text-faint), transparent);
}

/* ---------- The phone ---------- */

.phone {
  width: var(--phone-w);
  padding: calc(var(--phone-w) * 0.033);
  border-radius: calc(var(--phone-w) * 0.17);
  background: #1A1A1C;
  box-shadow:
    inset 0 0 0 1.5px #3A3A3E,
    0 0 0 1px rgba(0,0,0,0.06),
    0 40px 70px -30px rgba(27,24,20,0.45);
}

.screen {
  position: relative;
  aspect-ratio: 600 / 1304;
  border-radius: calc(var(--phone-w) * 0.14);
  overflow: hidden;
  background: #FAF9F7;
  isolation: isolate;
}

.screen > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.screen > img.on { opacity: 1; z-index: 1; }

/* The outgoing card of a review deck: only the card itself (not the header
   around it) flies off to the right, the way "Looks right" sends it. */
.screen > img.swipe-out {
  opacity: 1;
  z-index: 3;
  clip-path: inset(17.8% 5% 13.2% 5% round 5%);
  transform: translate(118%, -4%) rotate(14deg);
  transition: transform 0.55s cubic-bezier(0.45, 0, 0.2, 1);
}
.screen > img.swipe-start {
  opacity: 1;
  z-index: 3;
  clip-path: inset(17.8% 5% 13.2% 5% round 5%);
  transform: none;
  transition: none;
}

.flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.flash.go { animation: flash 0.5s ease-out; }
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }

.hero-phone .phone { --phone-w: min(300px, 74vw); }

/* ---------- Scroll chapters ---------- */

html { scrollbar-gutter: stable; }
html.holding { overflow: hidden; }

.chapter {
  position: relative;
  height: 100svh;
  min-height: 560px;
}

.stage {
  position: relative;
  height: 100%;
  overflow: hidden;
}

/* Progress while a story plays; Replay and Next once it's done. */
.player {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
}
.player .bar {
  width: 120px;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--hairline);
}
.player .bar i {
  display: block;
  height: 100%;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
}
.player button {
  font: 600 14px/1 'Inter', -apple-system, sans-serif;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 8px 15px;
  cursor: pointer;
}
.player button:hover { color: var(--text-primary); }
.player button:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 40%, transparent); outline-offset: 2px; }
.player .next { display: none; background: var(--blue); border-color: var(--blue); color: #fff; }
.player .next:hover { color: #fff; }
.chapter.done .player .bar { display: none; }
.chapter.done .player .next { display: inline-block; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(3px); } }

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 40px;
  height: 100%;
  align-items: center;
  padding-top: 60px;
}

.captions {
  position: relative;
  height: 320px;
}

.cap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.cap.on { opacity: 1; transform: none; }

.cap h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.015em;
  margin: 10px 0 14px;
}
.cap h2.big { font-size: clamp(34px, 4.6vw, 58px); margin: 0; }
.cap p {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
  max-width: 28em;
}

.eyebrow {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
}
.eyebrow.before { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.eyebrow.after { background: var(--blue-tint); color: var(--blue); }

.visual {
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
}
.visual > * { grid-area: 1 / 1; }

.visual > .phone {
  opacity: 0;
  will-change: transform, opacity;
}

/* ---------- The handwritten list ---------- */

.paper {
  position: relative;
  width: min(420px, 86vw);
  padding: 30px 26px 30px 56px;
  background:
    linear-gradient(90deg, transparent 40px, rgba(217,72,59,0.45) 40px, rgba(217,72,59,0.45) 42px, transparent 42px),
    repeating-linear-gradient(transparent 0 35px, rgba(46,125,222,0.22) 35px 36px),
    #FFFDF5;
  background-position: 0 0, 0 22px, 0 0;
  color: #24305E;
}

/* Tossed as a whole; its drop-shadow follows the crumpled outline, where a
   box-shadow on the paper itself would be clipped away with the corners. */
.paper-toss {
  filter: drop-shadow(0 1px 1px rgba(27,24,20,0.08)) drop-shadow(0 14px 18px rgba(27,24,20,0.16));
  transform: rotate(-2deg);
  will-change: transform;
}

.paper-creases {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 30%, rgba(0,0,0,0.12) 31%, transparent 33%),
    linear-gradient(62deg, transparent 44%, rgba(0,0,0,0.10) 45%, transparent 47%),
    linear-gradient(160deg, transparent 58%, rgba(0,0,0,0.12) 59%, transparent 61%),
    linear-gradient(20deg, transparent 22%, rgba(255,255,255,0.7) 23%, transparent 25%),
    radial-gradient(circle at 38% 36%, rgba(255,255,255,0.5) 0%, transparent 30%, rgba(60,50,40,0.28) 62%);
}

.hand {
  font-family: 'Caveat', cursive;
  font-size: 25px;
  line-height: 36px;
  margin: 0;
  white-space: nowrap;
  clip-path: inset(0 100% 0 0);
}
.hand.title { font-weight: 700; font-size: 29px; }
.hand.second { margin-top: 8px; }
.hand s { text-decoration-thickness: 2px; color: #6A6F8A; }

/* ---------- The inbox ---------- */

.inbox {
  position: relative;
  width: min(390px, 86vw);
  padding: 18px 18px 14px;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  will-change: transform;
}

.inbox-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
  font-size: 16px;
  margin-bottom: 12px;
}
.search-icon {
  width: 14px;
  height: 14px;
  border: 2px solid var(--text-faint);
  border-radius: 50%;
  position: relative;
  flex: none;
}
.search-icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 2px;
  background: var(--text-faint);
  right: -6px;
  bottom: -3px;
  transform: rotate(45deg);
}
.caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--blue);
  vertical-align: middle;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.inbox-count, .inbox-missed-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 6px 4px 6px;
}
.inbox-missed-label { margin-top: 16px; }

.mail {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 10px;
  padding: 10px 6px;
  border-top: 1px solid var(--hairline);
  font-size: 15px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.mail.on { opacity: 1; transform: none; }
.mail b { font-weight: 600; }
.mail span { grid-column: 1; color: var(--text-secondary); font-size: 14px; }
.mail i { grid-row: 1; grid-column: 2; font-style: normal; font-size: 12px; color: var(--blue); }
.mail.missed { background: color-mix(in srgb, var(--red) 6%, transparent); border-radius: 10px; border-top: 0; }
.mail.missed.on { opacity: 0.75; }
.mail em {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: 6px;
  padding: 2px 6px;
  transform: rotate(-6deg);
}

.crt-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at center, #fff 0%, #DDEBFF 60%, #fff 100%);
  opacity: 0;
  pointer-events: none;
}

.flying {
  position: relative;
  width: min(390px, 86vw);
  height: 100%;
  pointer-events: none;
  z-index: 4;
}
.fly-mail {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 250px;
  margin: -34px 0 0 -125px;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 14px;
  display: grid;
  opacity: 0;
  will-change: transform, opacity;
}
.fly-mail b { font-weight: 600; }
.fly-mail span { color: var(--text-secondary); }

/* A notification sliding down over the phone's home screen. */
.notif {
  position: absolute;
  z-index: 4;
  top: 7%;
  left: 4%;
  right: 4%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 9px 11px;
  border-radius: 16px;
  background: rgba(245,245,247,0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.35);
  font-size: calc(var(--phone-w) * 0.037);
  line-height: 1.3;
  color: #1B1814;
  transform: translateY(-160%);
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.notif.on { transform: none; }
.notif img { border-radius: 5px; width: calc(var(--phone-w) * 0.07); height: auto; margin-top: 2px; }
.notif div { display: grid; }
.notif .dim { color: #6B635A; }
.notif time { font-size: 0.85em; color: #8E8E93; }

/* ---------- Talking ---------- */

.talk {
  width: min(380px, 86vw);
  display: grid;
  justify-items: center;
  gap: 26px;
}

.orb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7FB6FF, #2E7DDE 55%, #7360D3);
  box-shadow: 0 20px 50px -18px rgba(46,125,222,0.8);
}
.orb span {
  width: 6px;
  height: 46px;
  border-radius: 3px;
  background: rgba(255,255,255,0.92);
  transform: scaleY(0.3);
  animation: wave 1.1s ease-in-out infinite;
}
.orb span:nth-child(2) { animation-delay: -0.9s; }
.orb span:nth-child(3) { animation-delay: -0.3s; }
.orb span:nth-child(4) { animation-delay: -0.6s; }
.orb span:nth-child(5) { animation-delay: -0.15s; }
.orb span:nth-child(6) { animation-delay: -0.75s; }
.orb span:nth-child(7) { animation-delay: -0.45s; }
@keyframes wave { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }

.transcript {
  margin: 0;
  width: 100%;
  min-height: 9.5em;
  padding: 18px 20px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 18px;
  line-height: 1.5;
}

/* ---------- And more ---------- */

.more-grid {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding-top: 92px;
  text-align: center;
}
.more-head h2 { font-size: clamp(34px, 4.6vw, 58px); font-weight: 900; margin: 0; letter-spacing: -0.015em; }
.more-label { font-size: 19px; color: var(--text-secondary); margin: 10px 0 0; min-height: 1.5em; }

.ring-wrap {
  --ring-w: min(200px, calc((100svh - 260px) * 0.4));
  --ring-r: calc(var(--ring-w) * 1.75);
  position: relative;
  perspective: 1600px;
  display: grid;
  place-items: center;
}
.ring {
  position: relative;
  width: var(--ring-w);
  aspect-ratio: 0.47;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 1s cubic-bezier(0.6, 0, 0.3, 1);
}
.ring figure {
  position: absolute;
  inset: 0;
  margin: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: opacity 0.3s ease;
}
.ring .phone { --phone-w: var(--ring-w); }

/* ---------- CTA ---------- */

.cta {
  background: var(--blue);
  color: #fff;
  padding: 110px 0;
  text-align: center;
}
.cta-mark { filter: brightness(0) invert(1); margin-bottom: 18px; }
.cta h2 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 900; margin: 0 0 12px; letter-spacing: -0.015em; }
.cta p { font-size: 20px; margin: 0 0 32px; opacity: 0.9; }

.footer { padding: 30px 0 40px; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.footer-dim { color: var(--text-faint); }

/* ---------- Privacy and terms ---------- */

.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-left: auto; }
.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--text-primary); text-decoration: underline; }

.legal {
  max-width: 740px;
  margin: 0 auto;
  padding: 108px 24px 72px;
  font-size: 17px;
  line-height: 1.65;
}
.legal h1 { font-size: clamp(36px, 5vw, 50px); margin-bottom: 6px; }
.legal-date { color: var(--text-faint); margin: 0 0 32px; font-size: 15px; }
.legal h2 { font-size: 24px; font-weight: 800; margin: 44px 0 10px; letter-spacing: -0.01em; }
.legal h3 { font-size: 18px; font-weight: 600; margin: 28px 0 6px; }
.legal p, .legal li { color: var(--text-secondary); }
.legal strong { color: var(--text-primary); font-weight: 600; }
.legal ul { padding-left: 22px; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--blue); }

.legal-summary {
  background: var(--blue-tint);
  border-radius: var(--radius-md, 16px);
  padding: 6px 24px 18px;
}
.legal-summary h2 { margin-top: 18px; font-size: 20px; }

.legal-table { overflow-x: auto; margin: 12px 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--hairline); }
.legal th { font-weight: 600; color: var(--text-primary); }
.legal td { color: var(--text-secondary); }
.legal td:first-child { color: var(--text-primary); font-weight: 500; white-space: nowrap; }

/* ---------- Narrow screens: words on top, phone below ---------- */

@media (max-width: 820px) {
  .legal { font-size: 16px; padding-top: 92px; }
  .footer-links { margin-left: 0; }
  .legal td:first-child { white-space: normal; }
  :root { --phone-w: min(236px, calc((100svh - 380px) * 0.44), 60vw); }

  .hero { padding-top: 88px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .hero-phone { display: grid; place-items: center; }
  .hero-phone .phone { --phone-w: min(250px, 64vw); }
  .scroll-cue { display: none; }

  .stage-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 206px minmax(0, 1fr);
    gap: 6px;
    padding-top: 68px;
    padding-bottom: 60px;   /* room for the player under the phone */
    align-items: stretch;
  }
  .player { bottom: 14px; }
  .visual { min-height: 0; }
  .captions { height: 206px; }
  .cap { justify-content: flex-end; text-align: center; align-items: center; }
  .cap h2 { font-size: 25px; margin: 8px 0 8px; }
  .cap h2.big { font-size: 32px; }
  .cap p { font-size: 15px; }
  .eyebrow { align-self: center; font-size: 11px; }

  .paper { padding: 22px 16px 22px 46px; }
  .hand { font-size: 19px; line-height: 30px; }
  .hand.title { font-size: 24px; }
  .paper { background-position: 0 0, 0 16px, 0 0; background-size: auto, 100% 30px, auto; }
  .paper { background:
      linear-gradient(90deg, transparent 34px, rgba(217,72,59,0.45) 34px, rgba(217,72,59,0.45) 36px, transparent 36px),
      repeating-linear-gradient(transparent 0 29px, rgba(46,125,222,0.22) 29px 30px),
      #FFFDF5; background-position: 0 0, 0 16px, 0 0; }

  .inbox { padding: 14px 14px 10px; }
  .mail { padding: 8px 4px; }
  .talk { gap: 18px; }
  .orb { width: 100px; height: 100px; }
  .transcript { font-size: 16px; }

  .ring-wrap { --ring-w: min(150px, calc((100svh - 240px) * 0.42)); --ring-r: calc(var(--ring-w) * 1.45); }
  .more-grid { padding-top: 84px; }
  .more-label { font-size: 16px; padding: 0 12px; }
}

/* Short phones (iPhone SE and friends): tighter words, smaller props. */
@media (max-width: 820px) and (max-height: 740px) {
  :root { --phone-w: min(236px, calc((100svh - 320px) * 0.44), 60vw); }
  .stage-grid { grid-template-rows: 164px minmax(0, 1fr); padding-top: 64px; padding-bottom: 54px; }
  .captions { height: 164px; }
  .cap h2 { font-size: 21px; margin: 6px 0; }
  .cap h2.big { font-size: 27px; }
  .cap p { font-size: 14px; }
  .paper-toss, .inbox, .talk { scale: 0.8; }
}

@media (prefers-reduced-motion: reduce) {
  .caret, .orb span { animation: none; }
  .orb span { transform: scaleY(0.6); }
  .cap, .mail, .notif, .screen > img, .ring { transition-duration: 0.01s; }
  .chapter.done .player .next { animation: none; }
}
