/*
  LSI inner pages — shared scenes for How it works, AI Employees, Compliance and Pricing.
  Patterns: sticky-device story with outline numerals (Two-Do), scroll-written CSS variables for 3D arrivals
  (Grail), a noise "dawn wipe" between acts (Flycrooked), colour-state chapter breaks (Grail).
  Every scene has a still state: no JS, phones and prefers-reduced-motion all read top to bottom.
*/

:root {
  --ivory: oklch(0.955 0.018 85);
  --ivory-2: oklch(0.91 0.025 85);
  --ink: oklch(0.2 0.02 262);
  --ink-2: oklch(0.36 0.02 262);
  --gold-deep: oklch(0.52 0.11 75);
}

/* ---------- Page hero ---------- */
.page-hero { position: relative; overflow: clip; margin-top: -72px; padding: calc(72px + clamp(40px, 7vw, 96px)) 0 clamp(56px, 8vw, 112px); }
.page-hero__grid { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.page-hero h1 { font-size: var(--step-4); line-height: 1.02; letter-spacing: -0.045em; font-weight: 650; max-width: 11em; }
.page-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.page-hero .lede { max-width: 31em; }
@media (max-width: 900px) { .page-hero__grid { grid-template-columns: minmax(0, 1fr); } }

/* Ambient warm light (Two-Do orbs, recoloured): cheap, GPU-composited, still under reduced motion. */
.orbs { position: absolute; inset: 0; pointer-events: none; overflow: clip; }
.orbs::before, .orbs::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(80px);
  animation: drift 34s ease-in-out infinite alternate;
}
.orbs::before { width: 46vmax; height: 46vmax; left: -12vmax; top: -18vmax; background: oklch(0.7 0.13 70 / 0.16); }
.orbs::after { width: 36vmax; height: 36vmax; right: -10vmax; bottom: -16vmax; background: oklch(0.6 0.09 250 / 0.14); animation-duration: 40s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.08); } }

/* ---------- Daylight window: the logo film, arriving in 3D as you scroll (Grail-style CSS variables) ---------- */
.daywindow { --p: 1; position: relative; perspective: 1400px; }
.daywindow__frame {
  position: relative; border-radius: calc(var(--r-lg) + 8px); overflow: clip; aspect-ratio: 16 / 10;
  border: 1px solid oklch(0.87 0.14 90 / 0.45);
  box-shadow: 0 0 0 6px oklch(0.8 0.135 86 / 0.08), 0 40px 120px -30px oklch(0.75 0.15 80 / 0.55), var(--shadow-2);
  transform: rotateX(calc((1 - var(--p)) * 16deg)) rotateY(calc((1 - var(--p)) * -20deg)) scale(calc(0.86 + 0.14 * var(--p)));
  transform-origin: 60% 80%;
  will-change: transform;
}
.daywindow video, .daywindow img { width: 100%; height: 100%; object-fit: cover; }
.daywindow__caption {
  position: absolute; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; font-size: 0.875rem; color: var(--ink);
  background: oklch(0.98 0.01 85 / 0.85); backdrop-filter: blur(8px);
}

/* ---------- Section heads with outline numerals (Two-Do) ---------- */
.numeral {
  display: block; font-size: clamp(4rem, 8vw, 7rem); font-weight: 700; line-height: 0.9; letter-spacing: -0.05em;
  color: transparent; -webkit-text-stroke: 1px oklch(0.97 0.006 262 / 0.28);
  transition: color 600ms var(--ease-out), -webkit-text-stroke-color 600ms var(--ease-out);
}
.is-active > .numeral, .is-active .numeral { color: var(--gold); -webkit-text-stroke-color: transparent; }

/* ---------- Story: chapters scroll past a sticky phone ---------- */
.story { position: relative; padding: var(--section) 0; }
.story__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: clamp(32px, 6vw, 96px); }
/* Extra room after the last chapter keeps the phone pinned while it is read. */
.story__chapters { display: grid; padding-bottom: 14vh; }
.chapter { position: relative; min-height: 78vh; display: grid; align-content: center; gap: 14px; padding-left: 28px; }
.chapter::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 2px; background: var(--line); }
.chapter::after {
  content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 2px; background: var(--gold);
  transform: scaleY(0); transform-origin: top; transition: transform 1200ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.chapter.is-active::after { transform: none; }
.chapter__time { font-family: var(--mono); font-size: 0.875rem; color: var(--gold); }
.chapter h3 { font-size: var(--step-3); line-height: 1.05; letter-spacing: -0.035em; max-width: 13em; }
.chapter p { color: var(--fg-2); font-size: var(--step-1); line-height: 1.5; max-width: 30em; }
.chapter .ticks { margin-top: 6px; }
.chapter__play { display: none; }
.story__stage { position: sticky; top: 0; height: 100dvh; display: grid; place-items: center; }

.phone {
  position: relative; width: min(100%, 360px); aspect-ratio: 9 / 19; border-radius: 44px; padding: 12px;
  background: linear-gradient(105deg, oklch(0.2 0.01 262), oklch(0.55 0.02 262) 6%, oklch(0.18 0.01 262) 14%, oklch(0.3 0.015 262) 50%, oklch(0.18 0.01 262) 90%, oklch(0.6 0.02 262) 97%);
  box-shadow: 0 50px 100px -40px oklch(0 0 0 / 0.8), 0 0 80px -20px oklch(0.8 0.15 86 / 0.25);
}
.phone__screen { position: relative; height: 100%; border-radius: 34px; overflow: clip; background: var(--canvas); display: grid; grid-template-rows: auto minmax(0, 1fr); }
.phone__bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px 8px; font-size: 0.75rem; color: var(--fg-2); }
.screen {
  grid-area: 2 / 1; padding: 8px 16px 16px; display: grid; align-content: start; gap: 10px;
  opacity: 0; transform: translateY(14px) scale(0.98); visibility: hidden;
  transition: opacity 420ms var(--ease-out), transform 520ms var(--ease-out), visibility 0s 420ms;
}
.screen.is-active { opacity: 1; transform: none; visibility: visible; transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out), visibility 0s; }
html:not(.js) .screen:first-of-type { opacity: 1; visibility: visible; transform: none; }
.screen__title { font-size: 1.125rem; font-weight: 650; letter-spacing: -0.02em; }
.screen__sub { font-size: 0.8125rem; color: var(--fg-3); margin-top: -6px; }
.screen .caption { margin: 0; }

.action { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 0.8125rem; }
.action__rank { font-family: var(--mono); color: var(--gold); font-size: 0.75rem; }
.action b { display: block; font-weight: 600; color: var(--fg); line-height: 1.3; }
.action__why { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 0.6875rem; background: oklch(0.72 0.17 18 / 0.14); color: oklch(0.82 0.12 25); }
.action__why--soon { background: oklch(0.8 0.135 86 / 0.14); color: var(--gold-hi); }
.action__stake { font-family: var(--mono); font-size: 0.75rem; color: var(--fg-2); text-align: right; }
.screen.is-active .action { animation: slide-in 500ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }

.radar { position: relative; aspect-ratio: 1; width: 82%; margin: 6px auto; border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 18%, var(--line) 18% calc(18% + 1px)), radial-gradient(circle, oklch(0.8 0.135 86 / 0.08), transparent 70%); border: 1px solid var(--line-strong); overflow: clip; }
.radar::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, oklch(0.8 0.135 86 / 0.35), transparent 70deg); animation: sweep 4s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.radar i { position: absolute; width: 10px; height: 10px; border-radius: 50%; translate: -50% -50%; background: var(--ok); box-shadow: 0 0 0 4px oklch(0.76 0.15 160 / 0.2); }
.radar i.is-stalled { background: var(--bad); box-shadow: 0 0 0 4px oklch(0.72 0.17 18 / 0.25); animation: blip 1.6s ease-in-out infinite; }
@keyframes blip { 50% { box-shadow: 0 0 0 9px oklch(0.72 0.17 18 / 0); } }

.mail { padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 0.8125rem; color: var(--fg-2); }
.mail b { color: var(--fg); }
.extract { display: grid; gap: 6px; }
.extract div { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: 8px; font-size: 0.8125rem; padding: 8px 10px; border-radius: 10px; background: oklch(0.8 0.135 86 / 0.07); border: 1px dashed oklch(0.8 0.135 86 / 0.35); }
.extract dt { color: var(--fg-3); }
.screen.is-active .extract div { animation: slide-in 450ms var(--ease-out) both; animation-delay: calc(400ms + var(--i, 0) * 120ms); }
.mini-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-btn { display: grid; place-items: center; min-height: 40px; border-radius: 12px; font-weight: 600; font-size: 0.8125rem; background: var(--surface-3); }
.mini-btn--gold { background: var(--gold); color: var(--on-gold); }

.chase { display: grid; gap: 6px; }
.chase li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 0.8125rem; }
.chase small { display: block; color: var(--fg-3); font-size: 0.6875rem; }
.chase .pill { font-size: 0.6875rem; padding: 2px 8px; }
.draft { position: relative; padding: 12px; border-radius: 14px 14px 4px 14px; font-size: 0.8125rem; line-height: 1.5; background: oklch(0.36 0.07 250); }
.draft--working { isolation: isolate; }
/* Conic "working" border while the draft is written (Two-Do) */
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.draft--working::before {
  content: ""; position: absolute; inset: -1.5px; border-radius: inherit; padding: 1.5px; z-index: -1;
  background: conic-gradient(from var(--a), transparent 0, var(--gold-hi) 26deg, transparent 60deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin-border 3.4s linear infinite;
}
@keyframes spin-border { to { --a: 360deg; } }

.proof-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: center; }
.proof-grid div { padding: 12px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.proof-grid b { display: block; font-family: var(--mono); font-size: 1.75rem; color: var(--gold-hi); line-height: 1.1; }
.proof-grid span { font-size: 0.6875rem; color: var(--fg-2); }
.streak { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.streak span { display: grid; justify-items: center; gap: 4px; font-size: 0.6875rem; color: var(--fg-3); }
.streak i { width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); }
.streak i.on { background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--sun)); box-shadow: 0 0 12px oklch(0.84 0.17 80 / 0.6); }

/* Phones: the mock-up sits above a row of chapter cards you swipe; each card that snaps into place drives it. */
@media (max-width: 900px) {
  .story__grid { display: flex; flex-direction: column; gap: 20px; }
  .story__stage { position: relative; height: 446px; order: -1; place-items: start center; }
  .phone { width: 300px; transform: scale(0.7); transform-origin: top center; }
  .story__chapters {
    display: flex; gap: 12px; padding: 0 0 16px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter);
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .story__chapters::-webkit-scrollbar { display: none; }
  .chapter {
    flex: 0 0 86%; min-height: 0; padding: 22px 20px; scroll-snap-align: center; align-content: start;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  }
  .chapter::before, .chapter::after { display: none; }
  .chapter.is-active { border-color: oklch(0.8 0.135 86 / 0.45); }
  .chapter h3 { font-size: var(--step-2); }
  .chapter p { font-size: 1rem; }
  .numeral { font-size: 2.75rem; }
}

/* ---------- Dawn wipe between acts (Flycrooked burn-through, in gold) ---------- */
.dawn { position: relative; height: 230vh; }
.dawn__stage { position: sticky; top: 0; height: 100dvh; overflow: clip; display: grid; }
.dawn__layer { grid-area: 1 / 1; display: grid; place-content: center; text-align: center; padding: 0 var(--gutter); }
.dawn__layer h2 { font-size: clamp(2.25rem, 1.2rem + 4.6vw, 5.5rem); line-height: 1; letter-spacing: -0.045em; max-width: 12em; margin-inline: auto; }
.dawn__layer p { margin: 18px auto 0; font-size: var(--step-1); max-width: 28em; }
.dawn__morning { background: radial-gradient(70% 60% at 50% 100%, oklch(0.9 0.08 85), var(--ivory) 70%); color: var(--ink); }
.dawn__morning p { color: var(--ink-2); }
.dawn__night { display: none; background: radial-gradient(60% 50% at 50% 0%, oklch(0.22 0.03 262), var(--canvas) 70%); color: var(--fg); mask-size: 100% 100%; -webkit-mask-size: 100% 100%; }
.dawn__night p { color: var(--fg-2); }
.dawn canvas { grid-area: 1 / 1; width: 100%; height: 100%; pointer-events: none; display: none; mix-blend-mode: screen; filter: blur(2px); }
.dawn.is-live .dawn__night, .dawn.is-live canvas { display: grid; }
.dawn.is-live canvas { display: block; }
.dawn__time { font-family: var(--mono); font-size: 0.875rem; letter-spacing: 0.04em; margin-bottom: 14px; }
.dawn__night .dawn__time { color: var(--gold); }
.dawn__morning .dawn__time { color: var(--gold-deep); }
@media (prefers-reduced-motion: reduce) { .dawn { height: auto; } .dawn__stage { position: relative; height: auto; min-height: 70vh; } }

/* ---------- Ivory band: a colour-state chapter break (Grail) ---------- */
.band-ivory { background: var(--ivory); color: var(--ink); padding: var(--section) 0; }
.band-ivory .eyebrow { color: var(--gold-deep); }
.band-ivory .section-head__sub { color: var(--ink-2); }
.never { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: clamp(32px, 5vw, 56px); }
.never li { padding: 24px; border-radius: var(--r-lg); background: var(--ivory-2); border: 1px solid oklch(0.2 0.02 262 / 0.08); }
.never b { display: block; font-size: 1.25rem; letter-spacing: -0.02em; margin-bottom: 8px; }
.never span { color: var(--ink-2); font-size: 0.9375rem; }
.never svg { width: 26px; height: 26px; color: var(--gold-deep); margin-bottom: 18px; }
@media (max-width: 900px) { .never { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .never { grid-template-columns: minmax(0, 1fr); } }
.band-ivory :focus-visible { outline-color: var(--gold-deep); }

/* ---------- Generic section + CTA ---------- */
.section { padding: var(--section) 0; }
.section--tight { padding-top: calc(var(--section) * 0.4); }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; font-size: 0.8125rem; font-weight: 500; }
.status--now { background: oklch(0.76 0.15 160 / 0.14); color: var(--ok); }
.status--next { background: oklch(0.8 0.135 86 / 0.14); color: var(--gold-hi); }
.status--later { background: oklch(1 0 0 / 0.06); color: var(--fg-2); }
.cta-band { position: relative; overflow: clip; padding: var(--section) 0 calc(var(--section) + 110px); text-align: center; }
.cta-band__inner { position: relative; z-index: 3; display: grid; justify-items: center; gap: 18px; }
.cta-band h2 { font-size: var(--step-3); letter-spacing: -0.035em; line-height: 1.06; max-width: 15em; }
.cta-band .horizon { transform: translateY(170px); }

/* ---------- Reveal ---------- */
/* `translate`, not `transform`, so a revealed element can still tilt or rotate. */
.js [data-reveal] { opacity: 0; translate: 0 28px; transition: opacity 900ms cubic-bezier(0.2, 0.7, 0.2, 1), translate 900ms cubic-bezier(0.2, 0.7, 0.2, 1), transform 400ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms), calc(var(--i, 0) * 80ms), 0ms; }
.js [data-reveal].is-in { opacity: 1; translate: none; }

@media (prefers-reduced-motion: reduce) {
  .orbs::before, .orbs::after, .radar::before, .radar i.is-stalled, .draft--working::before { animation: none; }
  .daywindow__frame { transform: none; }
  .js [data-reveal] { opacity: 1; translate: none; }
}

/* Stagger order and radar positions live here: the CSP forbids inline style attributes. */
.screen .action:nth-of-type(2), .extract div:nth-child(2), .never li:nth-child(2) { --i: 1; }
.screen .action:nth-of-type(3), .extract div:nth-child(3), .never li:nth-child(3) { --i: 2; }
.screen .action:nth-of-type(4), .never li:nth-child(4) { --i: 3; }
.screen .action:nth-of-type(5) { --i: 4; }
.radar i:nth-child(1) { left: 30%; top: 34%; }
.radar i:nth-child(2) { left: 62%; top: 28%; }
.radar i:nth-child(3) { left: 70%; top: 62%; }
.radar i:nth-child(4) { left: 40%; top: 70%; }
.radar i:nth-child(5) { left: 52%; top: 46%; }

/* ---------- Home: four doors (each tilts toward a fine pointer) and the daylight film ---------- */
.doors__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: clamp(28px, 4vw, 48px); perspective: 1400px; }
.door {
  --rx: 0deg; --ry: 0deg; position: relative; display: grid; gap: 14px; align-content: start; min-height: 300px; padding: 28px;
  border-radius: var(--r-lg); background: linear-gradient(160deg, var(--surface-2), var(--surface) 60%); border: 1px solid var(--line-strong);
  color: var(--fg); text-decoration: none; transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
  transition: transform 400ms var(--ease-out), border-color var(--t-state) var(--ease-out), box-shadow var(--t-state) var(--ease-out);
}
.door:hover { border-color: oklch(0.8 0.135 86 / 0.5); box-shadow: 0 30px 80px -40px oklch(0.8 0.15 86 / 0.55); }
.door__kicker { color: var(--gold); font-size: var(--step--1); font-weight: 500; }
.door__title { font-size: var(--step-2); line-height: 1.12; letter-spacing: -0.03em; max-width: 14em; }
.door__go { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--fg-2); font-weight: 500; }
.door__go svg { width: 18px; height: 18px; transition: transform var(--t-state) var(--ease-out); }
.door:hover .door__go { color: var(--gold-hi); }
.door:hover .door__go svg { transform: translateX(4px); }
.door__mini { display: grid; gap: 6px; transform: translateZ(30px); }
.door__mini--list span { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--canvas); border: 1px solid var(--line); font-size: 0.875rem; }
.door__mini--list i { font-style: normal; color: var(--gold); font-family: var(--mono); }
.door__mini--list em { font-style: normal; font-size: 0.75rem; color: oklch(0.82 0.12 25); }
.door__mini--team { display: flex; }
.door__mini--team .avatar { width: 44px; height: 44px; margin-right: -10px; border: 2px solid var(--surface); }
.door__mini--verdict { grid-template-columns: minmax(0, 1fr) auto; align-items: center; font-size: 0.875rem; padding: 12px; border-radius: 12px; background: var(--canvas); border: 1px solid var(--line); }
.door__mini--verdict em { font-style: normal; font-weight: 600; font-size: 0.8125rem; }
.door__mini--verdict .ok { color: var(--ok); }
.door__mini--verdict .bad { color: var(--bad); }
.door__mini--price { display: flex; align-items: baseline; gap: 8px; }
.door__mini--price .num { font-size: var(--step-4); font-weight: 650; letter-spacing: -0.05em; color: var(--gold-hi); line-height: 1; }
.door__mini--price em { font-style: normal; color: var(--fg-3); }
.door--gold { border-color: oklch(0.8 0.135 86 / 0.45); background: linear-gradient(160deg, oklch(0.8 0.135 86 / 0.12), var(--surface) 60%); }
@media (max-width: 760px) { .doors__grid { grid-template-columns: minmax(0, 1fr); } .door { min-height: 0; } }

.film__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 900px) { .film__grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .door { transform: none; } }

