/* Lux landing page.
   Tokens are copied from src/App.css (:root and [data-theme="dark"]) so the page and the app are one
   object; see docs/DESIGN_LANGUAGE.md. Inter for everything, Newsreader 400 for display moments only,
   the wordmark in Inter with the emerald gradient. Motion: transform and opacity only, off under
   prefers-reduced-motion (the last rule in this file). */

/* ---- Tokens ------------------------------------------------------------------------------ */
:root {
  --bg-primary: #F6F5F1; --bg-secondary: #FFFFFF; --bg-tertiary: #EFEDE7; --bg-hover: #E8E5DD; --bg-inset: #F3F1EC;
  --text-primary: #1C1B18; --text-secondary: #57534B; --text-tertiary: #6F6A60;
  --accent: #2D6A4F; --accent-light: #E3EFE7; --accent-soft: #3D8A65; --accent-subtle: rgba(45, 106, 79, 0.07);
  --accent-strong: #2D6A4F; --accent-strong-hover: #22553E; --on-accent: #FFFFFF;
  --border: #DEDAD1; --border-light: #E9E6DF; --border-medium: #CFCAC0;
  --logo-a: #2D6A4F; --logo-b: #3D8A65;
  --gradient-logo: linear-gradient(145deg, var(--logo-a) 0%, var(--logo-b) 100%);
  --shadow-xs: 0 1px 2px rgba(28,27,24,0.05);
  --shadow-md: 0 2px 4px rgba(28,27,24,0.04), 0 6px 12px rgba(28,27,24,0.05);
  --shadow-lg: 0 4px 8px rgba(28,27,24,0.04), 0 12px 28px rgba(28,27,24,0.08);
  --shadow-xl: 0 8px 16px rgba(28,27,24,0.06), 0 24px 56px rgba(28,27,24,0.14);
  --shadow-frame: 0 1px 1px rgba(28,27,24,0.04), 0 10px 24px -6px rgba(28,27,24,0.10), 0 40px 80px -24px rgba(28,27,24,0.18);
  --focus-ring: 0 0 0 2px var(--bg-primary), 0 0 0 4px rgba(45, 106, 79, 0.55);
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px; --radius-full: 9999px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --tracking-label: 0.12em;
  /* Motion (src/App.css, "Motion tokens") */
  --dur-1: 90ms; --dur-2: 160ms; --dur-3: 240ms; --dur-4: 380ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
  /* Page */
  --gutter: 24px;
  --nav-h: 64px;
  --section-pad: clamp(88px, 10vw, 140px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #111210; --bg-secondary: #181917; --bg-tertiary: #1F201D; --bg-hover: #272824; --bg-inset: #1C1D1A;
    --text-primary: #ECEAE3; --text-secondary: #ABA79C; --text-tertiary: #8A867B;
    --accent: #43B086; --accent-light: rgba(67, 176, 134, 0.13); --accent-soft: #359B73; --accent-subtle: rgba(67, 176, 134, 0.06);
    --accent-strong: #2A7D5B; --accent-strong-hover: #23704F; --on-accent: #FFFFFF;
    --border: #2E2F2A; --border-light: #262723; --border-medium: #3A3B36;
    --logo-a: #359B73; --logo-b: #43B086;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4), 0 4px 8px rgba(0,0,0,0.2);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.5), 0 8px 16px rgba(0,0,0,0.3);
    --shadow-frame: 0 1px 1px rgba(0,0,0,0.3), 0 10px 24px -6px rgba(0,0,0,0.45), 0 40px 80px -24px rgba(0,0,0,0.6);
    --focus-ring: 0 0 0 2px var(--bg-primary), 0 0 0 4px rgba(67, 176, 134, 0.6);
    color-scheme: dark;
  }
}

/* ---- Base -------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* Nothing decorative may widen the page (on phones it would zoom the whole page out) */
html, body { overflow-x: clip; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
ol, ul { list-style: none; }
::selection { background: var(--accent-light); color: var(--text-primary); }

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

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 10px 14px; border-radius: var(--radius-md); background: var(--accent-strong); color: var(--on-accent); font-size: 14px; font-weight: 500; transition: transform var(--dur-2) var(--ease-enter); }
.skip:focus { transform: translateY(64px); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---- Type -------------------------------------------------------------------------------- */
.eyebrow, .tile-k, .step-k, .caption-fig {
  font-size: 12px; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent);
}
.display {
  font-family: var(--font-display); font-weight: 400; font-optical-sizing: auto;
  font-size: clamp(36px, 4.6vw, 56px); line-height: 1.06; letter-spacing: -0.018em;
  color: var(--text-primary); text-wrap: balance;
}
.dek { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.6; color: var(--text-secondary); max-width: 34em; text-wrap: pretty; }
.fine { font-size: 13px; color: var(--text-tertiary); }
.num, .display-num { font-variant-numeric: tabular-nums lining-nums; }
.display-num { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; }
.eyebrow + .display { margin-top: 18px; }
.display + .dek { margin-top: 20px; }

/* ---- Buttons and the sign-up field ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: var(--radius-md); border: 1px solid transparent;
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-standard), border-color var(--dur-2) var(--ease-standard), color var(--dur-2) var(--ease-standard), box-shadow var(--dur-2) var(--ease-standard), transform var(--dur-1) var(--ease-standard);
}
.btn:active { transform: scale(0.975); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-primary { background: var(--accent-strong); color: var(--on-accent); box-shadow: 0 1px 2px rgba(28,27,24,0.12), inset 0 1px 0 rgba(255,255,255,0.08); }
.btn-primary:hover { background: var(--accent-strong-hover); }
.btn-quiet { background: transparent; color: var(--text-primary); border-color: var(--border-medium); }
.btn-quiet:hover { background: var(--bg-tertiary); border-color: var(--border-medium); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.signup {
  position: relative; display: flex; align-items: center; gap: 6px; width: 100%; max-width: 460px;
  padding: 5px; border-radius: 12px; background: var(--bg-secondary); border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-2) var(--ease-standard), box-shadow var(--dur-2) var(--ease-standard);
}
.signup:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.signup input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 0; background: transparent; outline: none; font-size: 16px;
}
.signup input::placeholder { color: var(--text-tertiary); opacity: 1; }
.signup .btn { height: 42px; }
.signup .btn:focus-visible { box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 4px var(--accent); }
.signup-status {
  position: absolute; left: 0; right: 0; top: calc(100% + 12px); font-size: 14px; color: var(--text-secondary);
  opacity: 0; transform: translateY(-4px); transition: opacity var(--dur-3) var(--ease-enter), transform var(--dur-3) var(--ease-enter);
}
.signup-status.is-shown { opacity: 1; transform: none; }
.signup-status.is-error { color: #B53B37; }
@media (prefers-color-scheme: dark) { .signup-status.is-error { color: #EE6B5F; } }
.signup.is-done input { color: var(--text-secondary); }

/* ---- Frames (product screenshots) -------------------------------------------------------- */
.frame {
  position: relative; overflow: hidden; border-radius: var(--radius-xl);
  background: var(--bg-secondary); border: 1px solid var(--border);
  box-shadow: var(--shadow-frame);
  isolation: isolate;
}
.frame img { width: 100%; }
/* A hairline of light inside the edge, so the frame reads as an object in both themes */
.frame::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }

.tag-soon {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--radius-full);
  border: 1px solid var(--border-medium); color: var(--text-tertiary);
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em; white-space: nowrap; vertical-align: 1px;
}

/* ---- Nav --------------------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-3) var(--ease-standard), border-color var(--dur-3) var(--ease-standard);
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg-primary) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom-color: var(--border-light);
}
.nav-inner { height: 100%; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; border-radius: var(--radius-md); }
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; filter: drop-shadow(0 1px 2px rgba(45,106,79,0.25)); }
.logo-stop-a { stop-color: var(--logo-a); }
.logo-stop-b { stop-color: var(--logo-b); }
.wordmark {
  font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1;
  background: var(--gradient-logo); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--accent);
}
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 8px 12px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; color: var(--text-secondary);
  transition: color var(--dur-2) var(--ease-standard), background-color var(--dur-2) var(--ease-standard);
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.nav-links a[aria-current] { color: var(--text-primary); background: linear-gradient(var(--accent), var(--accent)) no-repeat center bottom 3px / calc(100% - 24px) 1.5px; }
.nav .btn { flex-shrink: 0; }

/* ---- Hero -------------------------------------------------------------------------------- */
.hero { position: relative; padding-top: clamp(24px, 4.5vh, 56px); overflow-x: clip; }
/* One soft emerald light behind the face, nothing else */
.hero::before {
  content: ''; position: absolute; left: 50%; top: -120px; width: min(1100px, 140vw); height: 720px; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent-subtle), transparent 72%);
  pointer-events: none; z-index: -1;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-theo { width: 120px; height: 84px; margin-bottom: 14px; }
.hero-theo .theo-glasses { width: 92px; height: 58px; }
.hero-title {
  margin-top: 14px;
  font-family: var(--font-display); font-weight: 400; font-optical-sizing: auto;
  font-size: clamp(46px, 7vw, 86px); line-height: 1.0; letter-spacing: -0.028em; text-wrap: balance;
}
.hero-title-quiet { color: var(--text-tertiary); }
.hero-sub { margin-top: 20px; max-width: 30em; font-family: var(--font-display); font-size: clamp(21px, 2.1vw, 27px); line-height: 1.3; letter-spacing: -0.01em; color: var(--text-primary); text-wrap: balance; }
.hero-sub + .hero-dek { margin-top: 14px; }
.hero-dek { margin-top: 22px; max-width: 42em; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--text-secondary); text-wrap: pretty; }
.hero .signup { margin-top: 30px; }
.hero-note { margin-top: 18px; font-size: 13px; color: var(--text-tertiary); }
.hero .signup-status { text-align: left; padding-left: 4px; }
.hero .signup + .hero-note { transition: opacity var(--dur-3) var(--ease-standard); }
.hero .signup.has-status + .hero-note { opacity: 0; }

.hero-shot-wrap { margin-top: clamp(44px, 6vh, 64px); perspective: 2000px; }
.hero-shot { position: relative; }
/* A pool of accent light under the product, so it sits on the page rather than floating */
.hero-shot::before {
  content: ''; position: absolute; left: 6%; right: 6%; top: 18%; bottom: -8%;
  background: radial-gradient(closest-side, var(--accent-light), transparent);
  filter: blur(30px); opacity: 0.8; z-index: -1; pointer-events: none;
}
.frame-hero { border-radius: 18px; transform-origin: 50% 0%; }
.caption { margin-top: 18px; font-size: 13px; line-height: 1.5; color: var(--text-tertiary); text-align: center; max-width: 60em; margin-inline: auto; }
.caption-fig { margin-right: 8px; font-size: 11px; }

/* ---- Theo's face (copied from src/App.css, "Theo's face") -------------------------------- */
.theo-glasses {
  display: inline-block; flex-shrink: 0; overflow: visible; vertical-align: middle;
  color: var(--accent);
  --tg-catch: var(--bg-secondary); --tg-tint: 0.1;
}
.theo-glasses .tg-face { transform-box: view-box; transform-origin: 50% 62%; }
.theo-glasses .tg-frame { stroke: currentColor; stroke-width: 3.1; stroke-linecap: round; stroke-linejoin: round; }
.theo-glasses .tg-temple { stroke-width: 2.8; }
.theo-glasses .tg-lens { fill: currentColor; fill-opacity: var(--tg-tint); }
.theo-glasses .tg-pupil { fill: currentColor; }
.theo-glasses .tg-catch { fill: var(--tg-catch); }
.theo-glasses .tg-brow { stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; transform-box: fill-box; transform-origin: center; transition: transform var(--dur-3) var(--ease-spring); }
.theo-glasses .tg-smile { opacity: 0; transition: opacity var(--dur-2) var(--ease-standard); }
.theo-glasses .tg-smile path { stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.theo-glasses .tg-glint { stroke: var(--tg-catch); stroke-width: 1.6; stroke-linecap: round; opacity: 0; animation: tg-glint 9.4s var(--tg-offset, 0s) infinite; }
.theo-glasses.tg-small .tg-frame { stroke-width: 4; }
.theo-glasses.tg-small .tg-brow { stroke-width: 3.6; }
.theo-glasses.tg-small .tg-pupil { r: 4.1px; }
.theo-glasses.tg-small .tg-catch, .theo-glasses.tg-small .tg-glint { display: none; }
.theo-glasses .tg-look {
  transform: translate(calc((var(--tg-px, 0) + var(--tg-sx, 0)) * 1px), calc((var(--tg-py, 0) + var(--tg-sy, 0)) * 1px));
  transition: transform 200ms var(--ease-enter), opacity var(--dur-2) var(--ease-standard);
}
.theo-glasses:not([data-state="idle"]):not([data-state="listening"]) .tg-look { --tg-px: 0; --tg-py: 0; }
.theo-glasses .tg-eye { transform-box: fill-box; transform-origin: center; animation: tg-blink 9.4s var(--tg-offset, 0s) infinite; }
@keyframes tg-blink {
  0%, 20.6%, 23.4%, 59.6%, 62.4%, 82.8%, 85.2%, 86.2%, 88.6%, 100% { transform: scaleY(1); }
  22%, 61%, 84%, 87.4% { transform: scaleY(0.07); }
}
@keyframes tg-glint { 0%, 68%, 80%, 100% { opacity: 0; } 72%, 75% { opacity: 0.85; } }
.theo-glasses[data-state="listening"] { --tg-sy: 2; }
.theo-glasses[data-state="listening"] .tg-brow { transform: translateY(-1.4px); }
.theo-glasses[data-state="thinking"] .tg-drift { animation: tg-think 3.4s var(--ease-standard) infinite; }
.theo-glasses[data-state="thinking"] .tg-brow-l { animation: tg-brow-think 3.4s var(--ease-standard) infinite; }
.theo-glasses[data-state="thinking"] .tg-brow-r { transform: translateY(0.5px) rotate(3deg); }
@keyframes tg-think { 0%, 100% { transform: translate(2.6px, -2.6px); } 30% { transform: translate(-0.6px, -3.1px); } 62% { transform: translate(3.1px, -1.2px); } }
@keyframes tg-brow-think { 0%, 100% { transform: translateY(-1.8px) rotate(-8deg); } 50% { transform: translateY(-2.8px) rotate(-11deg); } }
.theo-glasses[data-state="reading"] .tg-drift { animation: tg-read 1.6s linear infinite; }
.theo-glasses[data-state="reading"] .tg-brow { transform: translateY(1px); }
.theo-glasses[data-state="writing"] { --tg-sy: 1.5; }
.theo-glasses[data-state="writing"] .tg-drift { animation: tg-read 2.4s linear infinite; }
.theo-glasses[data-state="writing"] .tg-brow { transform: translateY(0.7px); }
.theo-glasses[data-state="writing"] .tg-face { animation: tg-nod 2.4s var(--ease-standard) infinite; }
@keyframes tg-read { 0% { transform: translate(-3.4px, 0.4px); } 80% { transform: translate(3.4px, 0.4px); } 86% { transform: translate(3.4px, 1.1px); } 100% { transform: translate(-3.4px, 0.4px); } }
@keyframes tg-nod { 0%, 100% { transform: translateY(0); } 86% { transform: translateY(0.6px); } }
.theo-glasses[data-state="happy"] .tg-look { opacity: 0; }
.theo-glasses[data-state="happy"] .tg-smile { opacity: 1; }
.theo-glasses[data-state="happy"] .tg-brow { transform: translateY(-2px); }
.theo-glasses[data-state="happy"] .tg-face { animation: tg-bounce 820ms var(--ease-standard) 1; }
.theo-glasses[data-state="concerned"] { --tg-sy: 0.9; }
.theo-glasses[data-state="concerned"] .tg-brow-l { transform: translateY(-0.4px) rotate(-11deg); }
.theo-glasses[data-state="concerned"] .tg-brow-r { transform: translateY(-0.4px) rotate(11deg); }
@keyframes tg-bounce { 0% { transform: translateY(0) scale(1); } 26% { transform: translateY(-5px) scale(1.1); } 52% { transform: translateY(0) scale(0.98); } 72% { transform: translateY(-1.6px) scale(1.03); } 100% { transform: translateY(0) scale(1); } }

/* The large face: a soft light behind it, and it arrives a beat after the page */
.theo-hero { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 132px; height: 96px; }
.theo-hero::before { content: ''; position: absolute; inset: -8px -14px; border-radius: 50%; background: radial-gradient(closest-side, var(--accent-light) 0%, transparent 100%); opacity: 0.95; }
.theo-hero .theo-glasses { position: relative; }
.theo-hero-sm { width: 100px; height: 72px; }

/* ---- Sections ---------------------------------------------------------------------------- */
.section { padding-block: var(--section-pad); position: relative; }
.section + .section::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(1152px, calc(100% - 2 * var(--gutter))); height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 18%, var(--border) 82%, transparent);
}
.section-head { max-width: 760px; margin-bottom: clamp(48px, 7vw, 88px); }
.section-head-center { margin-inline: auto; text-align: center; }
.section-head-center .dek { margin-inline: auto; }

/* The problem */
.problem-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 7vw, 112px); align-items: start; }
.problem-head { position: sticky; top: calc(var(--nav-h) + 48px); }
.problem-head .fine { margin-top: 20px; }
.pains { counter-reset: pain; }
.pain { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; padding-block: 30px; border-top: 1px solid var(--border); }
.pain:last-child { border-bottom: 1px solid var(--border); }
.pain-n { font-family: var(--font-display); font-size: 26px; line-height: 1; color: var(--accent); padding-top: 2px; font-variant-numeric: lining-nums; }
.pain h3 { font-size: clamp(19px, 1.7vw, 22px); font-weight: 600; line-height: 1.3; letter-spacing: -0.012em; }
.pain p { margin-top: 6px; color: var(--text-secondary); }

/* How it works: a sticky frame on the right crossfades as the steps scroll past */
.how-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); }
.steps { position: relative; padding-left: 28px; }
/* The rail: a hairline with an emerald fill that follows the active step */
.steps::before, .steps::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; }
.steps::before { background: var(--border); }
.steps::after { background: var(--accent); transform-origin: top; transform: scaleY(var(--progress, 0.2)); transition: transform var(--dur-4) var(--ease-enter); }
.step { min-height: 64vh; display: flex; flex-direction: column; justify-content: center; padding-block: 48px; transition: opacity var(--dur-4) var(--ease-standard); }
.js .how-grid.is-staged .step:not(.is-active) { opacity: 0.32; }
.step-k { display: flex; align-items: baseline; gap: 10px; color: var(--text-tertiary); }
.step-k span { font-family: var(--font-display); font-size: 15px; letter-spacing: 0; color: var(--accent); }
.step h3 { margin-top: 14px; font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 2.8vw, 38px); line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; }
.step p { margin-top: 14px; color: var(--text-secondary); max-width: 30em; }
.step-soon { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.step-media { display: none; }

.stage { position: relative; }
.stage-inner { position: sticky; top: calc(var(--nav-h) + max(24px, (100vh - var(--nav-h) - 640px) / 2)); }
.stage-frame { aspect-ratio: 1276 / 1128; background: var(--bg-secondary); }
.stage-img { position: absolute; inset: 0; opacity: 0; transform: scale(1.012); transition: opacity var(--dur-4) var(--ease-standard), transform 700ms var(--ease-enter); }
.stage-img img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.stage-img.is-active { opacity: 1; transform: none; }
.stage-caption { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14px; color: var(--text-secondary); }
.stage-caption [data-stage-label] { transition: opacity var(--dur-2) var(--ease-standard); }
.stage-caption.is-swapping [data-stage-label] { opacity: 0; }
.stage-count { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-tertiary); font-size: 13px; }

/* What's different: tiles */
.tiles { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 28px; overflow: hidden;
  padding: clamp(24px, 3vw, 40px); border-radius: 20px; background: var(--bg-secondary); border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-3) var(--ease-enter), box-shadow var(--dur-3) var(--ease-standard), border-color var(--dur-3) var(--ease-standard);
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border); }
.tile-math { grid-column: span 7; }
.tile-rate { grid-column: span 5; }
.tile-research { grid-column: span 12; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: center; gap: clamp(28px, 4vw, 64px); }
.tile-scope { grid-column: span 7; }
.tile-change { grid-column: span 5; }
.tile h3 { margin-top: 10px; font-size: clamp(20px, 1.9vw, 24px); font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; text-wrap: balance; }
.tile-text p:not(.tile-k) { margin-top: 10px; color: var(--text-secondary); font-size: 16px; }
.tile-media { margin-top: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.tile-rate .tile-media { margin-inline: auto; width: 100%; max-width: 420px; }
.tile-change .tile-media { width: 100%; max-width: 380px; margin-inline: auto; }
.tile-scope .tile-media { aspect-ratio: 1280 / 820; }
.tile-scope .tile-media img { height: 100%; object-fit: cover; object-position: top center; }
.tile-scope .tile-media::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(to bottom, transparent, var(--bg-secondary)); z-index: 1; pointer-events: none; }
.tile-change .tile-media, .tile-rate .tile-media { background: var(--bg-secondary); }

/* The arithmetic, set as type */
.math { margin-top: auto; border-top: 1px solid var(--border); }
.math-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--border-light); font-size: 15px; color: var(--text-secondary); }
.math-row .num { color: var(--text-primary); font-weight: 500; white-space: nowrap; }
.math-fees span:first-child { font-size: 14px; }
.math-total { border-bottom: 0; padding-top: 18px; align-items: center; }
.math-total span:first-child { font-size: 12px; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent); }
.math-total .display-num { font-size: clamp(44px, 5vw, 64px); line-height: 1; font-weight: 400; color: var(--text-primary); }
.math-note { margin-top: 10px; font-size: 13px; color: var(--text-tertiary); }

/* The story */
.story-inner { max-width: 1100px; }
.story-inner > .eyebrow, .story-inner > .display { max-width: 760px; }
.story-grid { margin-top: 40px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
.story-photo { position: sticky; top: calc(var(--nav-h) + 24px); margin: 0; border-radius: var(--radius-xl); }
.story-photo img { display: block; width: 100%; height: auto; }
.story-grid .letter { margin-top: 0; }
@media (max-width: 860px) {
  .story-grid { grid-template-columns: 1fr; }
  .story-photo { position: static; }
}
.story .display { margin-top: 18px; }
.letter { margin-top: 40px; padding-left: clamp(20px, 3vw, 32px); border-left: 2px solid var(--accent-light); }
.letter p { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.7; color: var(--text-secondary); text-wrap: pretty; }
.letter p + p { margin-top: 1.1em; }
.letter p:first-child { color: var(--text-primary); }
.signature { display: flex; flex-direction: column; gap: 2px; margin-top: 2em !important; }
.signature-name { font-family: var(--font-display); font-size: 26px; color: var(--text-primary); letter-spacing: -0.01em; }
.signature-role { font-size: 14px; color: var(--text-tertiary); }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; max-width: 1080px; margin: 0 auto; }
.plan {
  display: flex; flex-direction: column; padding: 32px; border-radius: 20px; background: var(--bg-secondary);
  border: 1px solid var(--border-light); box-shadow: var(--shadow-xs);
  transition: transform var(--dur-3) var(--ease-enter), box-shadow var(--dur-3) var(--ease-standard);
}
.plan:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.plan-pro { border: 1.5px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-subtle), var(--shadow-md); }
.plan-name { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.plan-pro .plan-name { color: var(--accent); }
.plan-for { margin-top: 4px; font-size: 14px; color: var(--text-tertiary); }
.plan-price { margin-top: 24px; display: flex; align-items: baseline; gap: 6px; }
.plan-price .display-num { font-size: 56px; line-height: 1; }
.per { font-size: 15px; color: var(--text-tertiary); }
.plan-sub { margin-top: 8px; font-size: 14px; color: var(--text-secondary); }
.plan-list { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border-light); display: grid; gap: 12px; font-size: 15px; line-height: 1.45; color: var(--text-secondary); }
.plan-list li { position: relative; padding-left: 24px; }
.plan-list li::before {
  content: ''; position: absolute; left: 2px; top: 0.45em; width: 10px; height: 6px;
  border-left: 1.6px solid var(--accent); border-bottom: 1.6px solid var(--accent); transform: rotate(-45deg);
}
.plan-soon-k { margin-top: 22px; display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); }
.plan-soon-k::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }
.plan-list.plan-soon { margin-top: 14px; padding-top: 0; border-top: 0; color: var(--text-tertiary); }
/* Not built yet: a hollow ring instead of a tick */
.plan-soon li::before { left: 3px; top: 0.5em; width: 7px; height: 7px; border: 1.4px solid var(--border-medium); border-radius: 50%; transform: none; }
.plan .btn { margin-top: auto; }
.plan > .plan-list:last-of-type { margin-bottom: 32px; }
.pricing-foot { margin: 40px auto 0; max-width: 40em; text-align: center; font-size: 15px; color: var(--text-tertiary); }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.faq-head { position: sticky; top: calc(var(--nav-h) + 48px); }
.faq-list details { border-top: 1px solid var(--border); }
.faq-list details:last-child { border-bottom: 1px solid var(--border); }
.faq-list summary {
  position: relative; display: block; cursor: pointer; list-style: none; padding: 24px 48px 24px 0;
  font-size: clamp(17px, 1.6vw, 19px); font-weight: 500; letter-spacing: -0.01em; border-radius: 4px;
  transition: color var(--dur-2) var(--ease-standard);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:hover { color: var(--accent); }
.faq-list summary::before, .faq-list summary::after {
  content: ''; position: absolute; right: 8px; top: 50%; width: 14px; height: 1.5px; margin-top: -0.75px; background: currentColor; border-radius: 1px;
  transition: transform var(--dur-3) var(--ease-enter), opacity var(--dur-3) var(--ease-standard);
}
.faq-list summary::after { transform: rotate(90deg); }
.faq-list details[open] summary::after { transform: rotate(0deg); opacity: 0; }
.faq-list details[open] summary::before { transform: rotate(180deg); }
.faq-a { padding: 0 48px 28px 0; color: var(--text-secondary); max-width: 40em; }
.faq-list details[open] .faq-a { animation: faq-in var(--dur-3) var(--ease-enter) both; }
@keyframes faq-in { from { opacity: 0; transform: translateY(-4px); } }

/* Final call */
.access { text-align: center; overflow: hidden; }
.access::after {
  content: ''; position: absolute; left: 50%; bottom: -260px; width: min(1000px, 140vw); height: 620px; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent-subtle), transparent 70%); pointer-events: none; z-index: -1;
}
.access-inner { display: flex; flex-direction: column; align-items: center; }
.access .display { margin-top: 20px; }
.access .dek { margin-top: 16px; }
.access .signup { margin-top: 32px; }
.access .signup-status { text-align: center; }

/* Footer */
.footer { border-top: 1px solid var(--border-light); padding-block: 48px 56px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 28px 48px; align-items: start; }
.brand-text { display: flex; flex-direction: column; gap: 4px; }
.brand-sub { font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-tertiary); }
.footer-line { margin-top: 16px; font-size: 14px; color: var(--text-tertiary); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; color: var(--text-secondary); }
.footer-nav a { padding-block: 4px; transition: color var(--dur-2) var(--ease-standard); }
.footer-nav a:hover { color: var(--accent); }
.footer-legal { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--border-light); font-size: 13px; color: var(--text-tertiary); }

/* ---- Arrival and reveals (only with JavaScript, only when motion is welcome) ------------- */
@keyframes lp-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes theo-arrive { 0% { opacity: 0; transform: translateY(-8px) scale(0.6); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes lp-fade { from { opacity: 0; } }
@keyframes lp-tick { from { opacity: 0.15; transform: translateY(0.35em); } to { opacity: 1; transform: none; } }
@keyframes frame-settle { from { transform: rotateX(9deg) scale(0.965); } to { transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .js [data-rise] { animation: lp-rise 720ms var(--ease-enter) both; animation-delay: calc(var(--d, 0) * 70ms + 60ms); }
  .js .hero-theo { animation: none; }
  .js .hero-theo .theo-glasses { animation: theo-arrive 620ms var(--ease-spring) 300ms both; }
  .js .hero-theo::before { animation: lp-fade 900ms var(--ease-standard) 260ms both; }
  .js .hero-shot { animation-duration: 1000ms; }

  .js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 700ms var(--ease-enter), transform 900ms var(--ease-enter); transition-delay: calc(var(--d, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  /* A number arrives the way it does in the app: its text is final from the first frame, only it rises in */
  .js .tile-math .math-row { opacity: 0; }
  .js .tile-math.is-in .math-row { animation: lp-tick 640ms var(--ease-enter) both; animation-delay: calc(var(--i, 0) * 140ms + 260ms); }
  .js .tile[data-reveal].is-in { transition: opacity 700ms var(--ease-enter), transform var(--dur-3) var(--ease-enter), box-shadow var(--dur-3) var(--ease-standard), border-color var(--dur-3) var(--ease-standard); transition-delay: 0ms; }
  .js .plan[data-reveal].is-in { transition: opacity 700ms var(--ease-enter), transform var(--dur-3) var(--ease-enter), box-shadow var(--dur-3) var(--ease-standard); }

  /* The product settles flat as it scrolls into full view (where scroll-driven animation exists) */
  @supports (animation-timeline: view()) {
    .frame-hero { animation: frame-settle linear both; animation-timeline: view(); animation-range: entry 10% cover 42%; }
  }
}

/* ---- Narrower screens -------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .tile-math, .tile-rate, .tile-scope, .tile-change { grid-column: span 6; }
}
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav .btn { margin-left: auto; }
  .problem-grid, .faq-grid { grid-template-columns: 1fr; }
  .problem-head, .faq-head { position: static; }
  .how-grid { grid-template-columns: 1fr; }
  .stage { display: none; }
  .steps { padding-left: 0; }
  .steps::before, .steps::after { display: none; }
  .step { min-height: 0; padding-block: 0; }
  .step + .step { margin-top: 72px; }
  .js .how-grid.is-staged .step:not(.is-active) { opacity: 1; }
  .step-media { display: block; margin-top: 28px; border-radius: var(--radius-lg); }
  .tiles { grid-template-columns: 1fr; }
  .tile-math, .tile-rate, .tile-scope, .tile-change, .tile-research { grid-column: auto; }
  .tile-research { display: flex; }
  .plans { grid-template-columns: 1fr; max-width: 520px; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; --nav-h: 58px; }
  body { font-size: 16px; }
  .hero-theo { width: 108px; height: 80px; margin-bottom: 8px; }
  .hero-theo .theo-glasses { width: 84px; height: 53px; }
  .signup { flex-direction: column; align-items: stretch; padding: 6px; }
  .signup input { flex: none; height: 46px; } /* stacked, flex: 1 made its height 0 in Safari */
  .signup .btn { width: 100%; height: 46px; }
  .hero .signup-status { text-align: center; }
  /* On a phone the hero shows Theo's side of the screen (its own crop, set in the <picture>) */
  .frame-hero { border-radius: 14px; }
  .tile { padding: 22px; border-radius: 16px; }
  .plan { padding: 26px; }
  .math-fees { flex-direction: column; gap: 4px; }
  .faq-list summary { padding-right: 36px; }
  .faq-a { padding-right: 0; }
  .footer-inner { grid-template-columns: 1fr; }
}

/* ---- How it works, step 1: messy input arrives (an HTML scene, not a screenshot) -------------
   Lines of the brief type in, then the files drop in one by one while Theo reads. Plays when the
   scene comes into view (.is-playing, landing.js); without it, or with reduced motion, the
   finished card shows. Sized by its frame (container units), themed by the tokens. */
.bs-frame { aspect-ratio: 1276 / 1128; }
.brief-scene {
  position: absolute; inset: 0; display: flex; flex-direction: column; container-type: inline-size;
  background: var(--bg-secondary); text-align: left;
  --kind-pdf: #B4473B; --kind-xls: #2D6A4F; --kind-mail: #3B6290; --kind-img: #9A6B1E;
}
@media (prefers-color-scheme: dark) {
  .brief-scene { --kind-pdf: #E07A6E; --kind-xls: #43B086; --kind-mail: #7FA6D6; --kind-img: #D9A64B; }
}
.bs-head {
  display: grid; justify-items: center; gap: 1.2cqi; padding: 4.2cqi 8cqi 3.6cqi; text-align: center;
  background: linear-gradient(160deg, var(--accent-light) 0%, var(--bg-secondary) 85%);
  border-bottom: 1px solid var(--border-light);
}
.bs-face { width: max(7.5cqi, 36px); height: auto; color: var(--accent); }
.bs-title { font-family: var(--font-display); font-weight: 400; font-size: max(5cqi, 22px); line-height: 1.1; letter-spacing: -0.015em; color: var(--text-primary); }
.bs-sub { font-size: max(2.35cqi, 12.5px); line-height: 1.5; color: var(--text-secondary); max-width: 34em; }
.bs-body { flex: 1; display: flex; flex-direction: column; gap: 1.8cqi; padding: 2.6cqi 5.5cqi 2.6cqi; min-height: 0; }
.bs-field {
  display: grid; gap: 0; padding: 2.4cqi 3cqi; border-radius: 1.6cqi;
  border: 1px solid var(--accent); box-shadow: 0 0 0 0.6cqi var(--accent-subtle); background: var(--bg-secondary);
}
.brief-scene p { margin: 0; }
.bs-line { font-size: max(2.3cqi, 12.5px); line-height: 1.6; color: var(--text-primary); }
.bs-drop {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4cqi; padding: 1.4cqi; border-radius: 1.6cqi;
  border: 1px dashed var(--border-medium);
}
.bs-file {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 1.6cqi; align-items: center;
  padding: 1.1cqi 1.6cqi; border-radius: 1.2cqi; background: var(--bg-secondary); border: 1px solid var(--border-light);
  box-shadow: 0 1px 1px rgba(28,27,24,0.04), 0 2px 6px -3px rgba(28,27,24,0.10);
}
.bs-badge {
  grid-row: 1 / 3; display: grid; place-items: center; width: max(4.8cqi, 28px); height: max(5.6cqi, 33px); border-radius: 0.8cqi;
  font-size: max(1.45cqi, 8.5px); font-weight: 700; letter-spacing: 0.04em; color: var(--kind); border: 1px solid currentColor;
  background: color-mix(in srgb, var(--kind) 8%, transparent);
}
.bs-file[data-kind="pdf"] { --kind: var(--kind-pdf); }
.bs-file[data-kind="xls"] { --kind: var(--kind-xls); }
.bs-file[data-kind="mail"] { --kind: var(--kind-mail); }
.bs-file[data-kind="img"] { --kind: var(--kind-img); }
.bs-name { font-size: max(2.1cqi, 12px); font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-meta { font-size: max(1.8cqi, 11px); color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-status { display: flex; align-items: center; gap: 1.4cqi; margin-top: auto; font-size: max(2cqi, 11.5px); color: var(--text-secondary); }
.bs-dot { width: 1.2cqi; height: 1.2cqi; border-radius: 50%; background: var(--accent); }

/* The sequence (about 6.5 seconds), run each time the scene comes into view */
.brief-scene.is-playing .bs-line { animation: bs-type 700ms var(--ease-standard) both; animation-delay: calc(0.35s + var(--i) * 0.9s); }
.brief-scene.is-playing .bs-drop { animation: bs-zone 2.9s var(--ease-standard) both; animation-delay: 2.7s; }
.brief-scene.is-playing .bs-file { animation: bs-drop 760ms var(--ease-spring) both; animation-delay: calc(2.9s + var(--i) * 0.55s); }
.brief-scene.is-playing .bs-status { animation: lp-fade var(--dur-4) var(--ease-standard) both; animation-delay: 5.2s; }
.brief-scene.is-playing .bs-dot { animation: bs-pulse 1.6s var(--ease-standard) 5.2s 3 both; }
/* On a phone the card grows to its content instead of keeping the desktop frame's shape */
@media (max-width: 760px) {
  .bs-frame { aspect-ratio: auto; }
  .bs-frame .brief-scene { position: relative; inset: auto; }
  .bs-frame .bs-drop { grid-template-columns: 1fr; }
}
@keyframes bs-type { from { opacity: 0; transform: translateY(0.8cqi); } to { opacity: 1; transform: none; } }
@keyframes bs-drop {
  0% { opacity: 0; transform: translateY(-9cqi) rotate(-3deg) scale(0.94); }
  55% { opacity: 1; transform: translateY(0.6cqi) rotate(0.6deg) scale(1.01); }
  100% { opacity: 1; transform: none; }
}
@keyframes bs-zone {
  0%, 100% { border-color: var(--border-medium); background: transparent; }
  12%, 84% { border-color: var(--accent); background: var(--accent-subtle); }
}
@keyframes bs-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---- After sign-up: the follow-up card (a native <dialog>; landing.js) ----------------------- */
.welcome {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0;
  border: 1px solid var(--border-light); border-radius: var(--radius-xl); background: var(--bg-secondary);
  color: var(--text-primary); box-shadow: var(--shadow-xl); overflow: auto;
}
.welcome::backdrop { background: rgba(17, 18, 16, 0.42); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.welcome[open] { animation: welcome-in var(--dur-4) var(--ease-enter) both; }
.welcome[open]::backdrop { animation: lp-fade var(--dur-3) var(--ease-standard) both; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.welcome-form { padding: 28px 28px 24px; }
.welcome-step { display: grid; gap: 18px; }
.welcome-step[hidden] { display: none; }
.welcome-k { font-size: 12px; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent); }
.welcome-title { margin-top: -10px; font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.12; letter-spacing: -0.015em; }
.welcome-sub { margin-top: -8px; font-size: 15px; line-height: 1.55; color: var(--text-secondary); }
.welcome .field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.welcome .field-k { padding: 0; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.welcome input[type="text"], .welcome textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--border-medium);
  background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 15px; line-height: 1.45; resize: vertical;
}
.welcome input[type="text"]:focus, .welcome textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.welcome textarea::placeholder { color: var(--text-tertiary); opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: var(--radius-full);
  border: 1px solid var(--border-medium); font-size: 14px; color: var(--text-secondary); background: var(--bg-primary);
  transition: background-color var(--dur-2) var(--ease-standard), border-color var(--dur-2) var(--ease-standard), color var(--dur-2) var(--ease-standard);
}
.chip:hover span { border-color: var(--text-tertiary); color: var(--text-primary); }
.chip input:checked + span { background: var(--accent-light); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.chip input:focus-visible + span { box-shadow: var(--focus-ring); }
.welcome-status:empty { display: none; }
.welcome-status { font-size: 14px; color: #B53B37; }
@media (prefers-color-scheme: dark) { .welcome-status { color: #EE6B5F; } }
.welcome-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
@media (max-width: 560px) { .welcome-form { padding: 22px 18px 18px; } .welcome-title { font-size: 26px; } }

/* ---- Theo says hello (hero): a speech bubble beside the glasses -------------------------------
   Dots while Theo "thinks", then a line. Click for another. The first line is in the HTML, so
   without JS, or with reduced motion, it simply shows. */
.theo-say {
  position: absolute; left: calc(100% - 6px); bottom: 40%; z-index: 2; width: max-content; max-width: min(300px, 46vw);
  padding: 11px 15px 12px; border-radius: 16px 16px 16px 4px; border: 1px solid var(--border-light);
  background: var(--bg-secondary); box-shadow: var(--shadow-md); color: var(--text-primary);
  font: inherit; font-size: 14px; line-height: 1.45; text-align: left; cursor: pointer;
  transform-origin: 0 100%;
  transition: opacity var(--dur-4) var(--ease-standard), transform var(--dur-4) var(--ease-standard), border-color var(--dur-2) var(--ease-standard);
}
.theo-say:hover { border-color: var(--border-medium); }
.theo-say:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.theo-say-body { display: grid; gap: 2px; }
.theo-say-name { font-weight: 600; color: var(--text-primary); }
.theo-say-name:empty { display: none; }
.theo-say-text { color: var(--text-secondary); }
.theo-say-name:empty + .theo-say-text { color: var(--text-primary); }
/* Thinking: three soft beads that breathe in a slow wave */
.theo-say-dots { display: none; align-items: center; gap: 5px; height: 21px; padding: 0 3px; }
.theo-say-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: 0.25; animation: say-think 1.5s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
.theo-say-dots i:nth-child(2) { animation-delay: 0.18s; }
.theo-say-dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes say-think { 0%, 70%, 100% { opacity: 0.22; transform: translateY(0) scale(0.85); } 30% { opacity: 0.9; transform: translateY(-2.5px) scale(1); } }
.theo-say.is-typing { padding-top: 9px; padding-bottom: 9px; }
.theo-say.is-typing .theo-say-dots { display: inline-flex; }
.theo-say.is-typing .theo-say-body { display: none; }
.theo-say.is-hidden { opacity: 0; transform: translateY(4px) scale(0.92); pointer-events: none; }
.theo-say.is-in .theo-say-body { animation: say-in var(--dur-4) var(--ease-enter) both; }
@keyframes say-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.hero-theo { cursor: pointer; }
@media (max-width: 560px) {
  /* On a phone the bubble sits above the glasses, centred, so it never runs off the screen */
  .theo-say { left: 50%; bottom: calc(100% + 2px); max-width: calc(100vw - 48px); border-radius: 16px; transform: translateX(-50%); transform-origin: 50% 100%; }
  .theo-say.is-hidden { transform: translateX(-50%) translateY(4px) scale(0.92); }
  .hero-theo { margin-top: 64px; }
}

/* ---- Hero: Theo's panel opens over the budget ------------------------------------------------
   The budget is captured alone, at full width. The panel (400 of 1440 wide, as in the app:
   design/shots.spec.js) opens over the role and person columns rather than where it docks, so
   every rate, total and the all-in stay readable; it springs from the Theo button's direction.
   Without JS, or with reduced motion, it is simply there. */
.hero-panel { position: absolute; left: 41.5%; top: 27%; width: 27.778%; z-index: 1; display: block; }
.hero-panel img { display: block; width: 100%; height: auto; border-radius: 4% / 2.67%; box-shadow: 0 18px 36px rgba(20, 20, 18, 0.28), 0 2px 6px rgba(20, 20, 18, 0.12), 0 0 0 1px var(--border); }
@media (max-width: 560px) {
  /* The phone crop is the right half (x 741–1440): the panel sits over role and person, rates and totals stay clear */
  .hero-panel { left: 2%; top: 24%; width: 54%; }
}
.js .hero-panel { opacity: 0; transform: scale(0.18); transform-origin: 140% 110%; }
.js .hero-panel.is-open { animation: hero-panel-open 720ms var(--ease-spring) both; }
@keyframes hero-panel-open {
  0% { opacity: 0; transform: scale(0.18); }
  35% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
.caption strong { color: var(--text-primary); font-weight: 600; }

/* ---- Reduce motion: no travel, no loops (one rule, as in the app) ------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-reduced-motion: reduce) { .js .hero-panel { opacity: 1; transform: none; } }
