/* atma — landing v4: split with sticky device left, prose right */

:root {
  --display-weight: 600;

  --bg-page: oklch(0.965 0.003 90);
  --bg-card: oklch(0.985 0.002 90);
  --bg-card-2: oklch(0.96 0.003 90);
  --rule: oklch(0.88 0.005 270);
  --rule-soft: oklch(0.93 0.004 270);

  --ink: oklch(0.16 0.005 270);
  --ink-2: oklch(0.32 0.005 270);
  --ink-3: oklch(0.5 0.006 270);
  --ink-4: oklch(0.7 0.005 270);

  --bubble-them-bg: oklch(0.92 0.004 270);
  --bubble-them-fg: oklch(0.16 0.005 270);

  --accent: oklch(0.62 0.13 245);
  --accent-2: oklch(0.55 0.14 250);
  --accent-fg: white;
  --accent-soft: oklch(0.62 0.13 245 / 0.10);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Inter Tight", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="ink"] {
  --bg-page: oklch(0.10 0.005 270);
  --bg-card: oklch(0.16 0.005 270);
  --bg-card-2: oklch(0.20 0.005 270);
  --rule: oklch(0.30 0.005 270);
  --rule-soft: oklch(0.24 0.005 270);
  --ink: oklch(0.97 0.003 90);
  --ink-2: oklch(0.86 0.004 90);
  --ink-3: oklch(0.66 0.005 270);
  --ink-4: oklch(0.46 0.005 270);
  --bubble-them-bg: oklch(0.28 0.005 270);
  --bubble-them-fg: oklch(0.95 0.003 90);
}

[data-accent="green"]    { --accent: oklch(0.62 0.12 155); --accent-2: oklch(0.55 0.13 158); --accent-soft: oklch(0.62 0.12 155 / 0.10); }
[data-accent="graphite"] { --accent: oklch(0.42 0.012 270); --accent-2: oklch(0.32 0.012 270); --accent-soft: oklch(0.42 0.012 270 / 0.10); }

* { box-sizing: border-box; }
svg { display: block; }
html, body { margin: 0; padding: 0; }
html {
  background:
    radial-gradient(ellipse 70% 50% at 12% -8%, color-mix(in oklch, var(--accent) 14%, transparent), transparent 55%),
    radial-gradient(ellipse 50% 40% at 92% 8%, color-mix(in oklch, oklch(0.78 0.10 320) 9%, transparent), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 105%, color-mix(in oklch, var(--accent) 7%, transparent), transparent 50%),
    var(--bg-page);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body { letter-spacing: -0.005em; min-height: 100vh; }
::selection { background: var(--accent); color: var(--accent-fg); }
a { color: inherit; }
button { font: inherit; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg-card);
  padding: 10px 14px; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ──────────────────────────────────────────────
   Page layout — sticky immersive phone + scroll triggers
   ────────────────────────────────────────────── */
.phone-zone {
  position: relative;
}
.phone-stage {
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 5;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: clamp(60px, 8vh, 96px) clamp(16px, 4vw, 48px) clamp(40px, 6vh, 64px);
}
@media (max-width: 900px) {
  .phone-stage {
    /* Pure phone — header overlays, phone fills the rest. No stage padding. */
    padding: 60px 0 0;
  }
}
.phone-stage > * { pointer-events: auto; }

.stage-inner {
  width: 100%;
  max-width: 1240px;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2.5vh, 28px);
  align-items: center;
}
@media (min-width: 900px) {
  .stage-inner {
    grid-template-rows: 1fr;
    grid-template-columns: minmax(360px, 1fr) minmax(440px, 580px);
    gap: clamp(40px, 5vw, 80px);
  }
}

.stage-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}
.stage-device {
  display: grid;
  place-items: center;
  min-height: 0;
}

.scroll-driver {
  position: relative;
  margin-top: -100dvh;
}
.scene-trigger {
  height: 100dvh;
  scroll-snap-align: start;
  /* `stop: always` made every flick land on the next scene; removing it lets
     a fast trackpad gesture skip past several scenes naturally. */
}
.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;
}

.scene-pips {
  position: absolute;
  bottom: clamp(20px, 3vh, 32px);
  left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 6px;
  padding: 6px 10px;
  background: color-mix(in oklch, var(--bg-card) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid color-mix(in oklch, var(--ink) 8%, transparent);
  border-radius: 999px;
  z-index: 12;
  pointer-events: auto;
  box-shadow: 0 4px 12px -6px rgba(0,0,0,0.18);
}
@media (max-width: 900px) {
  /* Float just above the iMessage input bar so the pips never overlap content */
  .scene-pips { bottom: 64px; }
}

.site-foot {
  position: relative;
  background: var(--bg-page);
  border-top: 1px solid var(--rule-soft);
  padding: 32px clamp(20px, 4vw, 48px);
  z-index: 6;
}
.site-foot__inner {
  display: inline-flex; flex-wrap: wrap; gap: 14px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-4);
}
.site-foot__inner a { color: var(--ink-3); text-decoration: none; }
.site-foot__inner a:hover { color: var(--ink); }
.site-foot__inner span { font-style: italic; margin-left: auto; }

/* ──────────────────────────────────────────────
   Reveal
   ────────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(6px);
  transition: opacity 480ms cubic-bezier(.22,.61,.36,1), transform 480ms cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

/* ──────────────────────────────────────────────
   Site header (top of page — logo + CTA)
   ────────────────────────────────────────────── */
.siteheader {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 48px);
  background: color-mix(in oklch, var(--bg-page) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid color-mix(in oklch, var(--ink) 6%, transparent);
}
.siteheader__brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 18px;
}
.siteheader__mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: oklch(0.10 0.02 250);
  background-image: url("assets/atma-mark.png");
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px oklch(0.10 0.02 250 / 0.4), 0 1px 2px rgba(0,0,0,0.12);
}
.siteheader__name { line-height: 1; }
.siteheader__cta {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px;
  padding: 0 16px 0 6px;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--rule);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;
  transition: transform 160ms ease, box-shadow 220ms ease;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 4px 12px -6px rgba(0,0,0,0.12);
}
.siteheader__cta-mark {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, oklch(0.78 0.18 145), oklch(0.62 0.20 148));
  display: grid; place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 1px 2px rgba(0,0,0,0.08);
}
.siteheader__cta-mark svg { display: block; }
.siteheader__cta-text { line-height: 1; }
.siteheader__cta:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 8px 18px -8px rgba(0,0,0,0.18);
}
.siteheader__cta:active { transform: translateY(0); }
@media (max-width: 540px) {
  .siteheader { padding: 14px 16px; }
  .siteheader__cta { font-size: 13px; height: 36px; padding: 0 14px 0 5px; gap: 8px; }
  .siteheader__cta-mark { width: 26px; height: 26px; }
}

/* ──────────────────────────────────────────────
   Brandline (legacy — no longer rendered)
   ────────────────────────────────────────────── */
.prose-col__hero { display: none; }
.brandline {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: var(--ink-3);
}
.brandline strong { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
.brandline__sep { color: var(--ink-4); }
.brandline__quiet { color: var(--ink-3); }

.brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: oklch(0.10 0.02 250);
  background-image: url("assets/atma-mark.png");
  background-size: cover;
  background-position: center;
  display: grid; place-items: center;
  position: relative;
  box-shadow: 0 0 0 1px oklch(0.10 0.02 250 / 0.5), 0 1px 2px rgba(0,0,0,0.15);
}
.brand-mark__dot { display: none; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50%      { box-shadow: 0 0 0 6px transparent; }
}

/* ──────────────────────────────────────────────
   Mac chrome
   ────────────────────────────────────────────── */
.mac {
  width: min(520px, 100%);
  height: min(720px, calc(100vh - 80px));
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5) inset,
    0 30px 80px -25px rgba(0,0,0,0.30),
    0 12px 30px -10px rgba(0,0,0,0.18);
  overflow: hidden;
  display: grid;
  grid-template-rows: 44px 1fr;
}
.mac__body {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  overflow: hidden;
}
.mac__chrome {
  display: grid;
  grid-template-columns: 80px 1fr 60px;
  align-items: center;
  background: oklch(0.94 0.004 90 / 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule);
  height: 44px;
}
[data-theme="ink"] .mac__chrome { background: oklch(0.22 0.005 270 / 0.92); }
.mac__lights { display: flex; gap: 8px; padding-left: 14px; }
.mac__light { width: 12px; height: 12px; border-radius: 50%; border: 0.5px solid rgba(0,0,0,0.15); }
.mac__title { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--ink); }
.mac__avatar {
  position: relative;
  width: 22px; height: 22px; border-radius: 50%;
  background: oklch(0.10 0.02 250);
  background-image: url("assets/atma-mark.png");
  background-size: cover;
  background-position: center;
  color: transparent;
  display: grid; place-items: center;
  font-size: 0;
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.3);
}
.mac__avatar::after,
.iphone__avatar::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: oklch(0.72 0.18 145);
  border: 1.5px solid var(--bg-card);
  animation: pulseAlive 2.4s ease-in-out infinite;
}
@keyframes pulseAlive {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklch, oklch(0.72 0.18 145) 55%, transparent); }
  50%      { box-shadow: 0 0 0 4px transparent; }
}
.mac__chrome-r { display: flex; justify-content: flex-end; padding-right: 12px; }
.mac__chrome-r button {
  background: transparent; border: 0; padding: 4px;
  color: var(--ink-3); border-radius: 6px;
  display: grid; place-items: center;
  cursor: default;
}

/* ──────────────────────────────────────────────
   iPhone — immersive (fills viewport) and small variants
   ────────────────────────────────────────────── */
.iphone {
  --pw: 320px; --ph: 660px;
  width: var(--pw); height: var(--ph);
  position: relative;
}

.iphone--immersive {
  /* The phone IS the page on mobile — fill it edge to edge, no cap. */
  width: 100%;
  height: 100%;
}

.iphone__frame {
  position: relative;
  width: 100%; height: 100%;
  background: linear-gradient(180deg, oklch(0.18 0.005 270), oklch(0.10 0.005 270));
  border-radius: 44px;
  padding: 8px;
  box-shadow:
    inset 0 0 0 1px oklch(0.32 0.005 270),
    inset 0 0 0 2px oklch(0.05 0.005 270),
    0 30px 60px -25px rgba(0,0,0,0.45),
    0 10px 30px -10px rgba(0,0,0,0.25);
}
.iphone--immersive .iphone__frame {
  border-radius: 32px;
}
/* On mobile: the phone IS the page. No frame, no notch, no home indicator —
   the user is literally inside an iMessage thread. */
@media (max-width: 900px) {
  .iphone--immersive .iphone__frame {
    border-radius: 0;
    padding: 0;
    background: var(--bg-card);
    box-shadow: none;
  }
  .iphone--immersive .iphone__notch { display: none; }
  .iphone--immersive .iphone__home { display: none; }
  .iphone--immersive .iphone__screen {
    border-radius: 0;
    grid-template-rows: 38px 50px 1fr 50px 0;
  }
}

.iphone__notch {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  width: 100px; height: 28px;
  background: #000; border-radius: 18px;
  z-index: 5;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 10px;
}
.iphone__notch span { width: 8px; height: 8px; border-radius: 50%; background: oklch(0.25 0.02 230); }

.iphone__screen {
  width: 100%; height: 100%;
  background: var(--bg-card);
  border-radius: 26px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 38px 44px 1fr 44px 12px;
  position: relative;
}
.iphone__status {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 22px 4px;
  font-size: 14px; font-weight: 600;
  color: var(--ink);
}
.iphone__statusicons { display: inline-flex; gap: 4px; align-items: center; color: var(--ink); }
.iphone__nav {
  display: grid; grid-template-columns: 32px 1fr 32px;
  align-items: center;
  padding: 0 10px 4px;
  border-bottom: 0.5px solid var(--rule-soft);
}
.iphone__back { color: var(--accent); display: grid; place-items: center; }
.iphone__contact { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.iphone__avatar {
  position: relative;
  width: 28px; height: 28px; border-radius: 50%;
  background: oklch(0.10 0.02 250);
  background-image: url("assets/atma-mark.png");
  background-size: cover;
  background-position: center;
  color: transparent;
  display: grid; place-items: center;
  font-size: 0;
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.3);
}
.iphone__name { font-size: 10px; color: var(--ink-3); }

/* ──────────────────────────────────────────────
   The iMessage-style input bar (used in BOTH phone + mac chrome)
   ────────────────────────────────────────────── */
.inputbar {
  display: grid; grid-template-columns: 28px 1fr 28px;
  align-items: end; gap: 8px;
  padding: 6px 10px;
  border-top: 0.5px solid var(--rule-soft);
  background: var(--bg-card);
}
.mac .inputbar {
  padding: 10px 14px;
  grid-template-columns: 30px 1fr 30px;
  gap: 10px;
}
.inputbar__plus {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-card-2);
  color: var(--ink-3);
  display: grid; place-items: center;
  font-size: 18px; font-weight: 300;
  line-height: 1;
}
.mac .inputbar__plus { width: 30px; height: 30px; font-size: 20px; }
.inputbar__input {
  min-height: 28px;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 14px;
  display: flex; align-items: center;
  padding: 0 12px;
  font-size: 12px;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden; white-space: nowrap;
  transition: border-color 200ms ease, background 200ms ease;
}
.mac .inputbar__input { min-height: 30px; height: auto; border-radius: 15px; font-size: 13px; }
.inputbar__input--active { border-color: var(--rule-strong, var(--rule)); }
.inputbar__placeholder { color: var(--ink-4); }
.inputbar__text { white-space: normal; word-wrap: break-word; overflow-wrap: anywhere; }
.inputbar__caret {
  display: inline-block;
  width: 1.5px; height: 14px;
  background: var(--accent);
  margin-left: 1px;
  animation: caretBlink 1s steps(1) infinite;
  vertical-align: middle;
}
@keyframes caretBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.inputbar__send {
  width: 28px; height: 28px; border-radius: 50%;
  border: 0; padding: 0;
  background: var(--accent);
  color: white;
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0; transform: scale(0.6);
  transition: opacity 200ms ease, transform 220ms cubic-bezier(.34,1.56,.64,1), background 200ms ease;
  pointer-events: none;
}
.mac .inputbar__send { width: 30px; height: 30px; }
.inputbar__send svg { display: block; }
.inputbar__send--shown {
  opacity: 1; transform: scale(1);
  pointer-events: auto;
}
.inputbar__send--firing {
  animation: sendPulse 200ms ease-out;
}
@keyframes sendPulse {
  0% { transform: scale(1); }
  40% { transform: scale(0.82); filter: brightness(1.15); }
  100% { transform: scale(1); }
}

.iphone__home {
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 4px;
}
.iphone__home::after {
  content: ""; width: 100px; height: 4px; border-radius: 2px;
  background: var(--ink); opacity: 0.85;
}

.iphone__thread {
  min-height: 0;
  display: grid;
  overflow: hidden;
}

/* ──────────────────────────────────────────────
   SceneTitle — editorial typography that lives BESIDE the device
   ────────────────────────────────────────────── */
.scene-title {
  max-width: 36ch;
}
@keyframes sceneFadeIn {
  from { opacity: 0; transform: translateY(8px); filter: blur(2px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
.scene-title > * {
  animation: sceneFadeIn 420ms cubic-bezier(.22,.61,.36,1) both;
}
.scene-title__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  margin: 0 0 18px;
  animation-delay: 0ms;
}
.scene-title__head { animation-delay: 60ms; }
.scene-title__sub { animation-delay: 140ms; }
.scene-title__body { animation-delay: 220ms; }
.scene-title__examples { animation-delay: 280ms; }
.scene-title__cta { animation-delay: 280ms; }
.scene-title__head {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  /* Sized so every headline fits in 1–2 lines, never wraps further. */
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.04;
  letter-spacing: -0.032em;
  margin: 0 0 14px;
  color: var(--ink);
  text-wrap: balance;
}
.scene-title__sub {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: var(--ink-3);
  margin: 0 0 14px;
  max-width: 30ch;
  text-wrap: balance;
}
.scene-title__body {
  font-size: clamp(13px, 0.95vw, 15px);
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
  max-width: 38ch;
  text-wrap: pretty;
}
.scene-title__examples {
  list-style: none;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--rule-soft);
  display: flex; flex-direction: column; gap: 4px;
  max-width: 38ch;
}
.scene-title__examples li {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-3);
  padding: 2px 0;
}
.scene-title__examples li::before { content: "› "; color: var(--ink-4); }
.scene-title__cta {
  margin-top: 24px;
}
.cta-pill--big {
  height: 52px;
  padding: 8px 26px 8px 8px;
  font-size: 16px;
  font-weight: 600;
}
.cta-pill--big .cta-pill__send {
  width: 36px; height: 36px;
}

/* Mobile (≤900px): the phone IS the experience. Prose is gone — the eyebrow
   slips into the iPhone chrome (status line) so the user always knows the
   scene without reading a separate text block. */
@media (max-width: 900px) {
  .stage-title { display: none; }
}

/* ──────────────────────────────────────────────
   Immersive Mac — single-pane Messages window
   ────────────────────────────────────────────── */
.mac--immersive {
  width: 100%;
  max-width: 580px;
  height: min(720px, 100%);
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--bg-card) 100%, white 4%), var(--bg-card) 18%, var(--bg-card));
  border: 1px solid color-mix(in oklch, var(--ink) 9%, transparent);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 -1px 0 rgba(0,0,0,0.05),
    0 1px 2px rgba(0,0,0,0.04),
    0 8px 24px -8px rgba(0,0,0,0.12),
    0 30px 80px -25px rgba(0,0,0,0.32),
    0 50px 120px -40px rgba(0,0,0,0.20);
  display: grid;
  grid-template-rows: 44px 1fr;
}
.mac--immersive .mac__pane {
  display: grid;
  grid-template-rows: 1fr 56px;
  min-height: 0;
}
.mac--immersive .mac__pane-thread {
  min-height: 0;
  display: grid;
  overflow: hidden;
}
.mac--immersive .inputbar {
  padding: 12px 16px;
  border-top: 0.5px solid var(--rule-soft);
}

/* ──────────────────────────────────────────────
   Thread (inside device)
   ────────────────────────────────────────────── */
.thread-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 14px 8px;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.thread-scroll::-webkit-scrollbar { display: none; }
.thread-inner {
  display: flex; flex-direction: column; gap: 4px;
  min-height: 100%;
}
.msg-anim {
  animation: msgPop 360ms cubic-bezier(.22,.61,.36,1) both;
}
@keyframes msgPop {
  0% { opacity: 0; transform: translateY(6px) scale(0.97); }
  100% { opacity: 1; transform: none; }
}

.row { display: flex; width: 100%; }
.row--me { justify-content: flex-end; }
.row--them { justify-content: flex-start; }

.bubble {
  max-width: 80%;
  padding: 8px 13px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.005em;
  word-wrap: break-word;
}
.bubble--them {
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--bubble-them-bg) 100%, white 3%),
    var(--bubble-them-bg));
  color: var(--bubble-them-fg);
  border-bottom-left-radius: 5px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 1px 1px rgba(0,0,0,0.04);
}
.bubble--me {
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--accent) 100%, white 8%),
    var(--accent),
    var(--accent-2));
  color: var(--accent-fg);
  border-bottom-right-radius: 5px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 1px 2px rgba(0,0,0,0.10),
    0 4px 10px -4px color-mix(in oklch, var(--accent) 45%, transparent);
}
.bubble--muted { opacity: 0.78; }

/* Typing → message swap animations */
.typing-enter {
  animation: typingEnter 220ms cubic-bezier(.22,.61,.36,1) both;
}
@keyframes typingEnter {
  0% { opacity: 0; transform: translateY(4px) scale(0.85); }
  100% { opacity: 1; transform: none; }
}
.bubble-swap-in {
  animation: bubbleSwapIn 320ms cubic-bezier(.22,.61,.36,1) both;
  transform-origin: left bottom;
}
@keyframes bubbleSwapIn {
  0% { opacity: 0; transform: translateY(2px) scale(0.7); }
  60% { opacity: 1; transform: translateY(0) scale(1.02); }
  100% { transform: none; }
}

/* Live drafting moved to .inputbar (in chrome) — no in-thread bubble. */

.bubble--voice {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  min-height: 34px;
}
.vplay {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: color-mix(in oklch, currentColor 18%, transparent);
  display: grid; place-items: center;
}
.vplay svg { display: block; margin-left: 1px; }
.vwave {
  display: inline-flex; align-items: center; gap: 2px;
  height: 16px;
}
.vwave span {
  display: inline-block;
  width: 2px;
  background: currentColor;
  opacity: 0.55;
  border-radius: 1px;
}
.vduration {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
  margin-left: 2px;
}

.bubble--typing {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 11px 14px;
  min-width: 48px;
}
.bubble--typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3);
  animation: typingDot 1.1s infinite;
}
.bubble--typing span:nth-child(2) { animation-delay: 140ms; }
.bubble--typing span:nth-child(3) { animation-delay: 280ms; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.timemark {
  align-self: center;
  font-size: 11px; font-weight: 500;
  color: var(--ink-4);
  margin: 14px 0 4px;
  font-variant-numeric: tabular-nums;
}
.stagenote {
  align-self: center;
  font-size: 11px; font-style: italic;
  color: var(--ink-4);
  margin: 6px 0 2px;
  text-align: center;
  max-width: 80%;
}

/* Dossier card inside thread */
.dcard {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0;
  font-family: var(--font-mono);
  max-width: 84%;
  position: relative;
}
.dcard::before {
  content: "";
  position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px; border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.dcard__head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; padding-bottom: 8px;
  border-bottom: 1px dashed var(--rule);
}
.dcard__icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--bg-card-2);
  border: 1px solid var(--rule);
  color: var(--ink);
  display: grid; place-items: center;
}
.dcard__title { font-size: 11.5px; font-weight: 600; color: var(--ink); }
.dcard__meta { color: var(--ink-4); font-weight: 400; }
.dcard__body { display: grid; gap: 4px; margin: 0; }
.dline { display: grid; grid-template-columns: 80px 1fr; gap: 8px; font-size: 11px; line-height: 1.4; }
.dline dt { color: var(--ink-4); }
.dline dd { margin: 0; color: var(--ink); }

/* Scene pips dot — used inside .scene-pips */
.pip {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-4); opacity: 0.4;
  transition: all 220ms cubic-bezier(.4,0,.2,1);
}
.pip--on { opacity: 1; background: var(--accent); width: 14px; border-radius: 3px; }

/* ──────────────────────────────────────────────
   CTA pill — used inside the prose card and the success modal
   ────────────────────────────────────────────── */
.cta-pill {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--rule);
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 20px 8px 8px;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: 15px; font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 6px 14px -8px rgba(0,0,0,0.15);
  transition: transform 200ms cubic-bezier(.4,0,.2,1), box-shadow 200ms;
}
.cta-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 12px 24px -10px rgba(0,0,0,0.2);
}
.cta-pill__send {
  width: 30px; height: 30px; border-radius: 50%;
  background:
    radial-gradient(ellipse at 30% 25%, rgba(255,255,255,0.30), transparent 55%),
    linear-gradient(180deg, color-mix(in oklch, var(--accent) 100%, white 8%), var(--accent-2));
  color: white;
  display: grid; place-items: center;
  flex: 0 0 auto;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 1px 2px rgba(0,0,0,0.10),
    0 0 0 0.5px color-mix(in oklch, var(--accent) 40%, transparent);
}
.cta-pill__send svg { display: block; }

/* ──────────────────────────────────────────────
   Waitlist modal
   ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: color-mix(in oklch, var(--ink) 35%, transparent);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  display: grid; place-items: center;
  padding: clamp(16px, 4vw, 32px);
  z-index: 100;
  animation: backdropIn 220ms cubic-bezier(.22,.61,.36,1);
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: clamp(24px, 4vw, 36px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 40px 80px -30px rgba(0,0,0,0.35),
    0 16px 32px -12px rgba(0,0,0,0.18);
  animation: modalIn 280ms cubic-bezier(.22,.61,.36,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.modal__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: 0; padding: 0;
  background: transparent;
  color: var(--ink-3);
  border-radius: 8px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.modal__close:hover { background: var(--bg-card-2); color: var(--ink); }

.modal__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: lowercase;
  margin-bottom: 14px;
}
.modal__title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(26px, 3.4vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.028em;
  margin: 0 0 12px;
  color: var(--ink);
  text-wrap: balance;
}
.modal__sub {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 22px;
  max-width: 38ch;
}

.modal__form {
  display: flex; flex-direction: column;
  gap: 14px;
}
.modal__field {
  display: flex; flex-direction: column;
  gap: 6px;
}
.modal__label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: lowercase;
}
.modal__input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--bg-page);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.modal__input::placeholder { color: var(--ink-4); }
.modal__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.modal__input[aria-invalid="true"] {
  border-color: oklch(0.58 0.18 25);
  box-shadow: 0 0 0 3px oklch(0.58 0.18 25 / 0.12);
}

.modal__error {
  font-size: 13px;
  color: oklch(0.50 0.18 25);
  line-height: 1.4;
}

.modal__submit {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 8px 18px -8px color-mix(in oklch, var(--accent) 70%, transparent);
  transition: transform 160ms cubic-bezier(.22,.61,.36,1), box-shadow 200ms ease, opacity 160ms ease;
}
.modal__submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 14px 24px -10px color-mix(in oklch, var(--accent) 70%, transparent);
}
.modal__submit:active:not(:disabled) { transform: translateY(0); }
.modal__submit:disabled { opacity: 0.65; cursor: progress; }
.modal__submit--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: none;
  margin-top: 6px;
}
.modal__submit--ghost:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -8px rgba(0,0,0,0.15);
  background: var(--bg-card-2);
}

.modal__fineprint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-4);
  margin-top: 4px;
  text-align: center;
}

.modal__done {
  display: flex; flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.modal__done .modal__title { margin: 0; }
.modal__done .modal__sub { margin: 0 0 4px; }
.modal__done-mark {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-fg);
  display: grid; place-items: center;
  margin-bottom: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 8px 18px -8px color-mix(in oklch, var(--accent) 60%, transparent);
}
.modal__done .modal__submit--ghost { width: 100%; }

@media (max-width: 540px) {
  .modal { padding: 24px 22px 22px; max-width: 100%; }
  .modal__title { font-size: 24px; }
}

/* ──────────────────────────────────────────────
   Mobile page — locked iPhone that auto-plays the timeline.
   No scroll driver, no progress bar. The page IS the iPhone.
   The conversation runs end-to-end like an animated demo reel.
   ────────────────────────────────────────────── */
.mobile-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
@media (max-width: 900px) {
  /* Body becomes a flex column: header at top, iPhone fills the rest. */
  body { overflow: hidden; height: 100dvh; }
  #root {
    display: flex;
    flex-direction: column;
    height: 100dvh;
  }
  /* Footer is hidden on mobile — the iPhone is the entire page. */
  .site-foot { display: none; }
}

/* Locked thread — bottom-anchored AND scrollable. The flex `margin-top: auto`
   pushes the inner to the bottom when content is short; once the conversation
   exceeds the viewport, normal scroll takes over. `overscroll-behavior:
   contain` keeps the page itself locked while the user scrolls the thread. */
.thread-scroll--locked {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
}
.thread-scroll--locked::-webkit-scrollbar { display: none; }
.thread-scroll--locked .thread-inner {
  position: static;
  margin-top: auto;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

/* ──────────────────────────────────────────────
   Chapter divider — editorial section break inside the thread
   ────────────────────────────────────────────── */
.chapter {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 22px 6px 12px;
  gap: 6px;
}
.chapter:first-child {
  margin-top: 8px;
}
.chapter__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
  width: 100%;
  justify-content: center;
}
.chapter__eyebrow::before,
.chapter__eyebrow::after {
  content: "";
  flex: 1 1 auto;
  max-width: 56px;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in oklch, var(--accent) 35%, transparent), transparent);
}
.chapter__eyebrow span {
  flex: 0 0 auto;
}
.chapter__head {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(24px, 6.4vw, 30px);
  line-height: 1.06;
  letter-spacing: -0.028em;
  margin: 2px 0 0;
  color: var(--ink);
  text-wrap: balance;
}
.chapter__sub {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-3);
  margin: 0;
  text-wrap: balance;
  max-width: 28ch;
}

/* Editorial body copy — sits with the chapter, NOT inside the conversation.
   No bubble, centered, ink-2 prose. Visually clearly distinct from messages. */
.chapter__body {
  align-self: center;
  text-align: center;
  margin: -2px 4px 14px;
  padding: 0 6px;
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: -0.003em;
  color: var(--ink-3);
  max-width: 36ch;
  text-wrap: pretty;
}

/* Centered row for the CTA bubble */
.row--center {
  justify-content: center;
  padding: 8px 0 4px;
}

/* ──────────────────────────────────────────────
   Reduced motion
   ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .msg-anim, .brand-mark__dot, .bubble--typing span { animation: none; }
  .thread-scroll { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
