/* CalcSage website: shared styles for index, privacy and terms.
   Built from the approved mockup (Mockups/website-v2.html). Mobile first:
   a light page with one dark chapter (AI), CSS phone frames around every
   screenshot, and auto-playing demos driven by assets/site.js. */

@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(/assets/fonts/inter-400.woff) format("woff"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(/assets/fonts/inter-500.woff) format("woff"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/assets/fonts/inter-600.woff) format("woff"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(/assets/fonts/inter-700.woff) format("woff"); }

:root {
  --page: #fbfbfd;
  --page-2: #f2f3f7;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --blue: #0A84FF;
  --blue-ink: #0066CC;
  --indigo: #5E5CE6;
  --violet: #BF5AF2;
  --grad: linear-gradient(100deg, #0A84FF 0%, #5E5CE6 55%, #BF5AF2 100%);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--page); color: var(--ink);
  line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* ---------- Type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em; color: var(--blue-ink);
}
.dark .eyebrow { color: #64B5FF; }
h1, h2 { font-weight: 700; letter-spacing: -0.045em; line-height: 1.02; text-wrap: balance; }
h1 { font-size: clamp(2.9rem, 11.5vw, 5.6rem); }
h2 { font-size: clamp(2.3rem, 9vw, 4.2rem); margin-top: 14px; }
.lead { font-size: clamp(1.08rem, 3.6vw, 1.3rem); color: var(--ink-2); line-height: 1.45; margin-top: 18px; max-width: 30em; }
.dark .lead { color: #a1a1a6; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 251, 253, 0.72);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background .3s;
}
.nav.scrolled { border-color: var(--line); }
.nav .wrap { height: 56px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: none; gap: 30px; font-size: 0.88rem; color: var(--ink-2); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue); color: #fff; font-weight: 600; font-size: 0.86rem;
  padding: 8px 16px; border-radius: 99px; transition: transform .2s var(--ease), background .2s;
}
.pill-btn:hover { background: #0077ED; }
.pill-btn:active { transform: scale(.96); }
@media (min-width: 820px) { .nav-links { display: flex; } }

/* ---------- Device frame (shared) ----------
   One component for every screenshot. --w sets the phone width; every inner
   measurement is a fraction of it, so the frame scales cleanly from a 240 px
   carousel card to a 340 px hero phone. */
.phone {
  --w: 300px;
  position: relative; width: var(--w); aspect-ratio: 9 / 19.6; flex: none;
  padding: calc(var(--w) * 0.028);
  border-radius: calc(var(--w) * 0.155);
  background: linear-gradient(150deg, #3a3d44 0%, #121317 35%, #050506 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255,255,255,.14),
    inset 0 0 0 calc(var(--w) * 0.012) #0b0c0e,
    0 calc(var(--w) * .18) calc(var(--w) * .3) calc(var(--w) * -.08) rgba(20, 30, 80, .35),
    0 calc(var(--w) * .05) calc(var(--w) * .1) rgba(0, 0, 0, .12);
}
.phone::before, .phone::after {   /* side buttons */
  content: ""; position: absolute; right: calc(var(--w) * -0.008); width: calc(var(--w) * 0.012);
  border-radius: 0 3px 3px 0; background: #2a2c31;
}
.phone::before { top: 19%; height: 9%; }
.phone::after  { top: 31%; height: 15%; }
.screen {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  border-radius: calc(var(--w) * 0.128);
  background: var(--scr, #f5f7fb);
  display: flex; flex-direction: column;
  font-size: calc(var(--w) * 0.043);   /* 1em inside the screen scales with the phone */
  isolation: isolate;
}
.screen > img { width: 100%; height: auto; flex: none; }
.sbar {
  flex: none; height: 2.3em; padding: 0 1.9em; display: flex; align-items: center; justify-content: space-between;
  font-size: .82em; font-weight: 600; color: var(--sbar-ink, #1d1d1f); position: relative; z-index: 3;
}
.sbar svg { height: .95em; width: auto; }
.sbar .icons { display: flex; gap: .35em; align-items: center; }
.glare {   /* faint glass reflection over the screen */
  position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 32%);
  mix-blend-mode: soft-light;
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 56px 0 40px; }
.aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
/* Fade the glow out where its section meets the next one, so no hard edge shows */
.hero .aurora { -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.final .aurora { -webkit-mask-image: linear-gradient(transparent, #000 30%); mask-image: linear-gradient(transparent, #000 30%); }
.aurora i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 18s var(--ease) infinite alternate; }
.aurora i:nth-child(1) { width: 70vw; height: 70vw; max-width: 720px; max-height: 720px; background: #8EC5FF; left: -20%; top: 30%; }
.aurora i:nth-child(2) { width: 60vw; height: 60vw; max-width: 640px; max-height: 640px; background: #B9B6FF; right: -18%; top: 42%; animation-delay: -6s; }
.aurora i:nth-child(3) { width: 50vw; height: 50vw; max-width: 520px; max-height: 520px; background: #E2C6FF; left: 30%; top: 70%; animation-delay: -12s; opacity: .4; }
@keyframes drift { to { transform: translate3d(6%, -8%, 0) scale(1.12); } }
.dots {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(29,29,31,.10) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 30%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 70% 50% at 50% 30%, #000 0%, transparent 70%);
}
.hero h1 { margin-top: 0; }
.hero .lead { max-width: 24em; }
.cta-row { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.play-badge img { height: 58px; width: auto; margin: -7px; }   /* official artwork incl. clear space, unaltered */
.ghost-link { font-size: .95rem; font-weight: 500; color: var(--blue-ink); display: inline-flex; align-items: center; gap: 6px; }
.ghost-link svg { transition: transform .3s var(--ease); }
.ghost-link:hover svg { transform: translateY(3px); }

@media (min-width: 820px) {
  .hero { padding-top: 88px; }
  .cta-row { flex-direction: row; justify-content: center; gap: 28px; }
}
/* Desktop: the headline, text and buttons shrink with the window's height, so
   the tops of the three phones are on screen without scrolling, even in a
   short browser window. */
@media (min-width: 900px) {
  .hero { padding-top: clamp(28px, 6vh, 88px); }
  .hero h1 { font-size: clamp(2.9rem, min(7vw, 10vh), 5.6rem); }
  .hero .lead { margin-top: clamp(10px, 2vh, 18px); font-size: clamp(1.02rem, 2.3vh, 1.3rem); }
  .cta-row { margin-top: clamp(16px, 3vh, 30px); }
  .hero-rail { margin-top: clamp(24px, 5vh, 64px); }
}

/* ---------- Numbers strip ---------- */
.numbers { padding: 28px 0 8px; position: relative; z-index: 6; }
.numbers .grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line);
  border-radius: 24px; overflow: hidden; border: 1px solid var(--line);
}
.numbers .cell { background: var(--page); padding: 22px 18px; }
.numbers .num { font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
.numbers .lbl { margin-top: 8px; font-size: .86rem; color: var(--ink-2); }
@media (min-width: 820px) { .numbers .grid { grid-template-columns: repeat(4, 1fr); } .numbers .cell { padding: 30px 28px; } }

/* ---------- Chapters ---------- */
.chapter { padding: 92px 0; position: relative; overflow: hidden; }
.chapter.dark { background: #000; color: #f5f5f7; }
.chapter.tint { background: var(--page-2); }
.split { display: grid; gap: 56px; align-items: center; }
.split .visual { display: flex; flex-direction: column; align-items: center; position: relative; }
@media (min-width: 900px) {
  .chapter { padding: 150px 0; }
  .split { grid-template-columns: 1fr 1fr; gap: 80px; }
  .split.flip .visual { order: -1; }
}

/* ---------- AI chapter ---------- */
.ai-glow { position: absolute; width: 140%; aspect-ratio: 1; left: -20%; top: 4%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(10,132,255,.38), rgba(94,92,230,.18) 50%, transparent 72%); filter: blur(20px); }
.split .visual .phone { z-index: 1; --w: min(76vw, 330px); }
.feat-grid { margin-top: 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feat {
  border-radius: 20px; padding: 18px 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
}
.feat svg { width: 24px; height: 24px; color: #64B5FF; }
.feat b { display: block; margin-top: 12px; font-size: .98rem; font-weight: 600; letter-spacing: -0.01em; }
.feat span { display: block; margin-top: 2px; font-size: .84rem; color: #a1a1a6; }

/* App UI rebuilt in HTML inside the frame (crisp at any size, and it can animate). */
.app-top { flex: none; display: flex; align-items: center; gap: .5em; padding: .25em .85em .6em; }
.seg { flex: 1; display: flex; gap: .15em; padding: .22em; border-radius: 99px; background: #fff; border: 1px solid #e6e8ef; font-size: .72em; color: #5b6478; }
.seg span { flex: 1; text-align: center; padding: .55em .2em; border-radius: 99px; white-space: nowrap; font-weight: 500; }
.seg .on { background: #E5EEFE; color: #0A84FF; font-weight: 600; }
.seg svg { width: 1em; height: 1em; margin-right: .3em; vertical-align: -.15em; }
.round { flex: none; height: 2.3em; min-width: 2.3em; padding: 0 .6em; border-radius: 99px; background: #fff; border: 1px solid #e6e8ef; display: grid; place-items: center; font-size: .72em; font-weight: 600; }
.round.credit { color: #1d1d1f; }
.round.credit { display: flex; gap: .2em; }

.chat { flex: 1; min-height: 0; padding: .2em .85em 1em; display: flex; flex-direction: column; gap: .7em; overflow: hidden; color: #1d1d1f; }
.msg-scan {
  align-self: flex-end; width: 78%; border-radius: 1em; overflow: hidden; background: #0A84FF; position: relative;
  box-shadow: 0 .4em 1em rgba(10,132,255,.25);
}
.msg-scan img { width: 100%; height: auto; display: block; }
.msg-scan .cap { display: flex; align-items: center; justify-content: center; gap: .45em; color: #fff; font-size: .68em; font-weight: 600; padding: .55em 0 .6em; }
.msg-scan .cap svg { width: 1.1em; height: 1.1em; }
.msg-scan .sweep { position: absolute; left: 0; right: 0; top: 0; height: 20%; background: linear-gradient(180deg, transparent, rgba(10,132,255,.55), transparent); opacity: 0; }
.ai.play .msg-scan .sweep { animation: sweep 1.3s .5s ease-in-out 2; }
@keyframes sweep { 0% { top: -20%; opacity: 1; } 100% { top: 72%; opacity: 1; } }
.typing { align-self: flex-start; display: flex; gap: .3em; padding: .8em 1em; background: #fff; border: 1px solid #e9ebf1; border-radius: 1em; }
.typing i { width: .45em; height: .45em; border-radius: 50%; background: #a9b1c2; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; transform: translateY(-.15em); } }
.answer { align-self: flex-start; width: 92%; background: #fff; border: 1px solid #e9ebf1; border-radius: 1em; padding: .85em 1em .7em; font-size: .78em; line-height: 1.45; }
.answer p + p { margin-top: .6em; }
.answer b { font-weight: 600; }
.answer mark { background: none; color: inherit; font-weight: 700; padding: .1em .4em; border-radius: .4em; box-shadow: 0 0 0 .14em #0A84FF, 0 0 1.2em rgba(10,132,255,.45); }
.answer .listen { display: flex; align-items: center; justify-content: flex-end; gap: .3em; color: #5b6478; font-size: .9em; margin-top: .5em; }
/* step-by-step reveal */
.js .ai .typing-1, .js .ai .answer-1, .js .ai .answer > * { opacity: 0; }
.js .ai .msg-scan { opacity: 0; transform: translateY(1em) scale(.96); transform-origin: right bottom; }
.ai .msg-scan, .ai .answer, .ai .answer > *, .ai .typing { transition: opacity .5s var(--ease), transform .6s var(--spring); }
.js .ai .answer > * { transform: translateY(.5em); }
.ai.s1 .msg-scan { opacity: 1; transform: none; }
.ai.s2 .typing-1 { opacity: 1; }
.ai.s3 .typing-1 { display: none; }
.ai.s3 .answer-1 { opacity: 1; }
.ai .answer > .show { opacity: 1; transform: none; }
/* follow-up question: hidden (no space taken) until it is sent */
.ai .later { display: none; }
.ai .later.on { display: block; animation: bubble-in .55s var(--spring) both; }
.ai .typing.later.on { display: flex; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(1em) scale(.96); } }
.msg-user {
  align-self: flex-end; max-width: 80%; padding: .75em 1em; border-radius: 1em; transform-origin: right bottom;
  background: #0A84FF; color: #fff; font-size: .78em; line-height: 1.4;
}
.replay { position: relative; z-index: 1; margin-top: 22px; font-size: .86rem; font-weight: 500; color: #64B5FF; display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Check lists (plans) ---------- */
.ticks { margin-top: 30px; display: grid; gap: 14px; list-style: none; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; font-size: 1rem; }
.ticks li::before {
  content: ""; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%;
  background: #E5EEFE url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A84FF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.ticks span { color: var(--ink-2); }

/* ---------- Swipe gallery ---------- */
.rail {
  margin-top: 56px; display: flex; gap: 0; overflow-x: auto; scroll-snap-type: x mandatory;
  --cw: min(66vw, 280px);
  padding: 10px calc(50% - var(--cw) / 2) 30px; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.rail::-webkit-scrollbar { display: none; }
.card { flex: none; width: var(--cw); scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; transform-origin: 50% 40%; will-change: transform; }
.card .phone { --w: calc(var(--cw) * .89); }
.hero-rail { --cw: min(74vw, 320px); margin-top: 44px; }
.hero-rail .card h3 { font-size: 1.05rem; }
@media (min-width: 820px) { .hero-rail { margin-top: 64px; } }
.card h3 { margin-top: 26px; font-size: 1.12rem; font-weight: 600; letter-spacing: -0.02em; }
.card p { font-size: .9rem; color: var(--ink-2); margin-top: 2px; text-align: center; }
.card .meta { transition: opacity .4s; text-align: center; }
.rail-nav { display: flex; justify-content: center; align-items: center; gap: 14px; }
.rail-nav[hidden] { display: none; }
.dotsnav { display: flex; gap: 7px; padding: 10px 14px; border-radius: 99px; background: rgba(0,0,0,.05); }
.dotsnav button { width: 7px; height: 7px; border-radius: 99px; background: rgba(0,0,0,.22); transition: width .35s var(--ease), background .35s; }
.dotsnav button.on { width: 22px; background: var(--ink); }
.arrow { display: none; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.05); place-items: center; transition: background .2s; }
.arrow:hover { background: rgba(0,0,0,.09); }
@media (min-width: 820px) { .arrow { display: grid; } }
/* Wide screens: the screenshots sit side by side (site.js adds .static and
   hides the dots/arrows). The middle phone leads; the outer two sit slightly
   lower and smaller, like a fan. Hovering a phone lifts it. */
@media (min-width: 900px) {
  .rail.static { overflow: visible; scroll-snap-type: none; justify-content: center; gap: clamp(24px, 4vw, 64px); padding: 10px 22px 40px; }
  .rail.static .card { --cw: min(26vw, 300px); transition: transform .5s var(--ease); }
  .rail.static .card:nth-child(odd) { transform: translateY(36px) scale(.92); }
  .rail.static .card:hover { transform: translateY(-6px); }
  .rail.static .card:nth-child(odd):hover { transform: translateY(28px) scale(.94); }
  .hero-rail.static .card { --cw: min(28vw, 320px); }
}

/* ---------- Tool marquee ----------
   Three rows of tool chips drifting sideways, alternate rows in opposite
   directions. JS duplicates each row's chips once so a -50% translate loops
   seamlessly. Icons and colours come from the app (lucide icons from
   ToolsScreen.tsx, category palette from tools/registry.ts). */
.marquee {
  margin-top: 40px; display: grid; gap: 10px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.mrow { list-style: none; display: flex; gap: 10px; width: max-content; animation: marquee var(--dur, 50s) linear infinite; }
.mrow[data-rev] { animation-direction: reverse; }
.marquee.paused .mrow { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 5px)); } }
.tchip {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 99px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 10px -4px rgba(16,30,70,.10);
  font-size: .86rem; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; color: var(--ink);
}
@media (min-width: 820px) { .tchip { font-size: .92rem; } }
.tchip svg {
  width: 30px; height: 30px; padding: 7px; border-radius: 10px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.tchip.fin svg { color: #047857; background: #10B98133; }
.tchip.hea svg { color: #BE123C; background: #F43F5E33; }
.tchip.trv svg { color: #1D4ED8; background: #3B82F633; }
.tchip.evd svg { color: #9333EA; background: #9333EA33; }
.legend { margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: .84rem; font-weight: 500; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.legend .fin::before { background: #10B981; } .legend .hea::before { background: #F43F5E; }
.legend .trv::before { background: #3B82F6; } .legend .evd::before { background: #9333EA; }
.mnote { margin-top: 8px; font-size: .84rem; color: var(--ink-2); }
@media (min-width: 820px) { .marquee { margin-top: 56px; gap: 14px; } .mrow { gap: 14px; } @keyframes marquee { to { transform: translateX(calc(-50% - 7px)); } } }
@media (prefers-reduced-motion: reduce) {
  .marquee { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: none; mask-image: none; padding: 0 22px; }
}

/* ---------- Themes ---------- */
.themes { transition: background .7s var(--ease), color .7s var(--ease); background: var(--page); }
.themes[data-t="dark"] { background: #0b1120; color: #f5f5f7; }
.themes[data-t="midnight"] { background: #000; color: #f5f5f7; }
.themes[data-t="sepia"] { background: #eee4d1; color: #3b2f22; }
.themes .lead { transition: color .7s; }
.themes[data-t="dark"] .lead, .themes[data-t="midnight"] .lead { color: #a1a1a6; }
.themes[data-t="sepia"] .lead { color: #7a6650; }
.switch {
  position: relative; margin: 36px auto 0; display: inline-grid; grid-template-columns: repeat(4, 1fr);
  padding: 4px; border-radius: 99px; background: rgba(127,127,127,.14);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.switch button { position: relative; z-index: 1; padding: 9px clamp(12px, 4vw, 22px); font-size: .88rem; font-weight: 600; border-radius: 99px; transition: color .4s; opacity: .7; }
.switch button.on { opacity: 1; }
.switch .thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; border-radius: 99px; background: rgba(255,255,255,.95); box-shadow: 0 3px 10px rgba(0,0,0,.12); transition: transform .45s cubic-bezier(.3, 1.3, .5, 1), width .45s cubic-bezier(.3, 1.3, .5, 1), background .6s; }   /* a small settle, not a big bounce */
.themes[data-t="dark"] .thumb, .themes[data-t="midnight"] .thumb { background: rgba(255,255,255,.16); }
.themes[data-t="sepia"] .thumb { background: #f8f1e4; }
.theme-phone { margin: 48px auto 0; }
.theme-phone .phone { --w: min(70vw, 310px); margin: 0 auto; }
/* Each theme screenshot is one layer covering the whole screen, top to bottom:
   its padding fills the status-bar strip with the screenshot's own top colour,
   and object-fit fills the rest (the frame is a little shorter than the
   screenshots, so it crops their bottom edge). Nothing behind the layers
   shows at the top or the bottom.
   Switching themes: the new layer fades in on top while the old one stays
   fully visible underneath (.prev), then the old one is hidden. A plain fade,
   no zoom, and no half-transparent moment where both layers let the screen
   behind them show through. */
.theme-phone .screen > img {
  position: absolute; inset: 0; width: 100%; height: 100%; box-sizing: border-box;
  padding-top: calc(2.3em * .82); object-fit: cover; object-position: top;
  opacity: 0; z-index: 0;
  /* Safari (Mac and iPhone) doesn't apply the screen's rounded overflow clip to
     a layer while its opacity is animating, so mid-fade the screenshot showed
     square corners outside the frame. Each screenshot carries its own rounded
     clip (the screen's radius) so it stays inside in every browser. */
  clip-path: inset(0 round calc(var(--w) * 0.128));
}
.theme-phone .screen > img.prev {
  opacity: 1; z-index: 1;
  /* The screen's rounded corners are smoothed (anti-aliased), so the outermost
     pixels of the top screenshot are partly see-through. If the old screenshot
     underneath reached those pixels, a light one showed through as a hair-thin
     silver arc at each corner. Pulling it in by 2px means only the screen's
     own background (already the new theme's colour) sits under that edge. */
  clip-path: inset(2px round calc(var(--w) * 0.128 - 2px));
}
.theme-phone .screen > img.on { opacity: 1; z-index: 2; transition: opacity .6s var(--ease); }
.theme-phone .screen > img[data-t="light"] { background: #f6f7fb; }
.theme-phone .screen > img[data-t="dark"] { background: #060a15; }
.theme-phone .screen > img[data-t="midnight"] { background: #000; }
.theme-phone .screen > img[data-t="sepia"] { background: #f5efe3; }
.themes[data-t="dark"] .sbar, .themes[data-t="midnight"] .sbar { --sbar-ink: #f5f5f7; }
/* Dark and Midnight: the frame's grey bezel band sat between a black ring and a
   dark screen, so it read as a grey line around the phone. Here a black ring
   drawn around the screen covers that band (bezel padding .028w minus the
   .012w black ring = .016w), and the 1.5px light rim is toned down. Both are
   box-shadows, so they fade with the theme change instead of switching. */
.theme-phone .phone { transition: box-shadow .7s var(--ease); }
/* Trial: the black ring stays on in every theme, so it never changes size. */
.theme-phone .screen { box-shadow: 0 0 0 calc(var(--w) * 0.016) #050506; }
.themes[data-t="dark"] .theme-phone .phone,
.themes[data-t="midnight"] .theme-phone .phone {
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.07),
    inset 0 0 0 calc(var(--w) * 0.012) #0b0c0e,
    0 calc(var(--w) * .18) calc(var(--w) * .3) calc(var(--w) * -.08) rgba(0, 0, 0, .5),
    0 calc(var(--w) * .05) calc(var(--w) * .1) rgba(0, 0, 0, .3);
}

/* ---------- Plans ---------- */
.plans { margin-top: 56px; display: grid; gap: 16px; text-align: left; }
.plan { border-radius: 28px; padding: 30px 26px; background: #fff; border: 1px solid var(--line); position: relative; }
.plan h3 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; }
.plan .sub { color: var(--ink-2); font-size: .95rem; margin-top: 4px; }
.plan .ticks { margin-top: 22px; }
.plan .note { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--ink-2); }
.plan.pro { border: 0; background: #0b0b0f; color: #f5f5f7; overflow: hidden; isolation: isolate; }
.plan.pro::before { /* animated gradient rim */
  content: ""; position: absolute; inset: -60%; z-index: -2;
  background: conic-gradient(from 0deg, #0A84FF, #5E5CE6, #BF5AF2, #0A84FF);
  animation: spin 8s linear infinite;
}
.plan.pro::after { content: ""; position: absolute; inset: 1.5px; border-radius: 27px; background: linear-gradient(180deg, #14141b, #0b0b0f); z-index: -1; }
.plan.pro .sub, .plan.pro .ticks span { color: #a1a1a6; }
.plan.pro .note { color: #86868b; border-color: rgba(255,255,255,.1); }
.plan.pro .ticks li::before { background-color: rgba(10,132,255,.2); }
.plan .tag { position: absolute; top: 26px; right: 24px; font-size: .72rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--grad); color: #fff; }
@keyframes spin { to { transform: rotate(1turn); } }
@media (min-width: 820px) { .plans { grid-template-columns: 1fr 1fr; max-width: 880px; margin-left: auto; margin-right: auto; } .plan { padding: 38px 34px; } }

/* ---------- Final ---------- */
.final { padding: 110px 0 72px; text-align: center; position: relative; overflow: hidden; }
.final .icon-wrap { position: relative; width: 112px; height: 112px; margin: 0 auto 32px; }
.final .icon-wrap::before { content: ""; position: absolute; inset: -40px; border-radius: 50%; background: radial-gradient(closest-side, rgba(10,132,255,.35), transparent); animation: breathe 5s ease-in-out infinite; }
.final .icon-wrap img { position: relative; width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 24px 50px -10px rgba(10,60,160,.45); }
@keyframes breathe { 50% { transform: scale(1.2); opacity: .6; } }
.final .lead { margin-left: auto; margin-right: auto; }
.final .play-badge { display: inline-block; margin-top: 34px; }

footer { border-top: 1px solid var(--line); padding: 24px 0 max(24px, env(safe-area-inset-bottom)); font-size: .84rem; color: var(--ink-2); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; }
footer .links { display: flex; gap: 22px; }
footer a:hover { color: var(--ink); }
footer .foot-end { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
footer .legal { font-size: .76rem; opacity: .8; }
/* Back to top: "#top" scrolls to the top of the page without any script */
.to-top {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink); background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 14px -6px rgba(16,30,70,.25);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.to-top:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -8px rgba(16,30,70,.3); }
.to-top:active { transform: scale(.94); }

/* ---------- Scroll reveals ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* Chat composer at the bottom of the AI demo */
.composer {
  flex: none; margin: 0 .7em 1.1em; height: 3.2em; border-radius: 99px; background: #fff; border: 1px solid #e6e8ef;
  display: flex; align-items: center; gap: .7em; padding: 0 .35em 0 1.1em; font-size: .78em; color: #8a93a6;
}
.composer span { flex: 1; white-space: nowrap; overflow: hidden; }
.composer span.typed { color: #1d1d1f; }
.composer span.typed::after { content: ""; display: inline-block; width: 1.5px; height: 1.1em; margin-left: 1px; vertical-align: -.2em; background: #0A84FF; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.composer .scan-ic { width: 1.3em; height: 1.3em; border: 2px dashed #5b6478; border-radius: .3em; opacity: .7; }
.composer .send { width: 2.5em; height: 2.5em; border-radius: 50%; background: #E8ECF4; position: relative; transition: background .3s; }
.composer .send::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-left: .75em solid #fff; border-top: .45em solid transparent; border-bottom: .45em solid transparent; transform: translateX(.1em); }
.ai.s4 .composer .send { background: #0A84FF; }

.themes[data-t="dark"] .eyebrow, .themes[data-t="midnight"] .eyebrow { color: #64B5FF; }
.themes[data-t="sepia"] .eyebrow { color: #B8650A; }

/* ---------- Privacy Policy and Terms pages (generated by scripts/build-site.py) ---------- */
.doc { padding: 56px 0 88px; }
.doc .wrap { max-width: 760px; }
.doc-head { padding-bottom: 28px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.doc h1 { font-size: clamp(2rem, 7vw, 2.8rem); letter-spacing: -0.035em; line-height: 1.1; }
.doc-date { margin-top: 12px; color: var(--ink-2); font-size: 0.95rem; }
.doc h2 {
  font-size: clamp(1.3rem, 4vw, 1.6rem); letter-spacing: -0.02em; line-height: 1.25;
  margin: 44px 0 12px; scroll-margin-top: 80px;
}
.doc h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; margin: 28px 0 8px; scroll-margin-top: 80px; }
.doc p, .doc li { color: var(--ink-2); font-size: 1rem; line-height: 1.6; }
.doc p { margin: 10px 0; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc ul, .doc ol { margin: 10px 0 10px 1.3em; display: grid; gap: 6px; }
.doc li::marker { color: var(--blue); }
.doc code { font-size: 0.9em; background: var(--page-2); padding: 1px 6px; border-radius: 6px; }
.doc a { color: var(--blue-ink); text-decoration: underline; text-underline-offset: 2px; }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.doc th { background: var(--page-2); color: var(--ink); font-weight: 600; }
.doc td { color: var(--ink-2); }
.doc tr:last-child td { border-bottom: 0; }
/* Highlighted box ("> " lines in legal/*.md), e.g. the privacy summary */
.callout {
  margin: 28px 0 24px; padding: 22px 26px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
}
.callout .callout-title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
  color: var(--ink); font-size: 1.15rem; font-weight: 600;
}
.callout-icon { flex: none; color: var(--blue); }
.callout p:last-child { margin-bottom: 0; }
@media (max-width: 520px) { .callout { padding: 18px 18px; } }
