/* Cerberus — public landing page.
 * Editorial take on the Sentinel · Amber system: warm paper, ink, one amber
 * accent, a serif italic for the words that matter, mono for machine voice.
 * Everything renders in its finished state without JS; landing.js only adds
 * motion on top (html.lp-js), and prefers-reduced-motion switches it off. */

@font-face {
  font-family: "Inter Tight";
  src: url("fonts/inter-tight.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
/* Traditional Chinese accent serif, subset to the landing page's serif copy
   by scripts/build_landing_cjk_font.py. unicode-range keeps it off Latin
   text, which stays in Instrument Serif. */
@font-face {
  font-family: "Noto Serif TC Landing";
  src: url("fonts/noto-serif-tc-landing.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+00B7, U+2014, U+2026, U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 500; font-style: normal; font-display: swap;
}

html.lp-document { scroll-padding-top: 88px; }
/* Marketing pages skip vendor/utilities.css (see base.html), so restate the
   bits of its reset these pages rely on. */
html.lp-document body { margin: 0; }
html.lp-document *, html.lp-document *::before, html.lp-document *::after { box-sizing: border-box; }
html.lp-document img { max-width: 100%; }

.lp-page {
  --lp-paper: var(--bg);
  --lp-paper-2: #F3EEE3;
  --lp-card: #FFFDF9;
  --lp-ink: #17140F;
  --lp-ink-2: #3A342B;
  --lp-muted: #655D50;
  --lp-faint: #9C9486;
  --lp-rule: #E6DECD;
  --lp-rule-strong: #D6CAB2;
  --lp-accent: var(--accent);
  --lp-accent-deep: var(--accent-deep);
  --lp-keep: #2F7A4B;
  --lp-drop: #B4232F;
  --lp-perf: #95610A;
  --lp-night: #15120E;
  --lp-night-text: #F3EEE3;
  --lp-night-muted: #BDB3A2;
  --lp-unlit: #938B7E;
  /* Brand amber deepened just enough for white button text to pass WCAG AA
     (4.6:1; --lp-accent is 3.5:1). Large accent type keeps --lp-accent. */
  --lp-cta: #C94C1B;

  --lp-sans: "Inter Tight", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  --lp-serif: "Instrument Serif", "Noto Serif TC Landing", "Songti TC", "Noto Serif TC", Georgia, serif;
  --lp-mono: var(--font-mono);

  --lp-ease: cubic-bezier(.16, 1, .3, 1);
  --lp-gutter: clamp(20px, 4vw, 56px);
  --lp-max: 1320px;

  position: relative;
  min-height: 100vh;
  background: var(--lp-paper);
  color: var(--lp-ink);
  font-family: var(--lp-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* Dark: follows the same preference as the app (preferences.js sets
   data-theme from the saved choice or the OS). The finale stays the darkest
   band so the page still ends on a change of register. */
html[data-theme="dark"].lp-document,
html[data-theme="dark"].lp-document body { background: #14110D; }
html[data-theme="dark"] .lp-page {
  --lp-paper: #14110D;
  --lp-paper-2: #1B1712;
  --lp-card: #1F1A15;
  --lp-ink: #F2ECE1;
  --lp-ink-2: #DDD5C7;
  --lp-muted: #ABA190;
  --lp-rule: #2E2820;
  --lp-rule-strong: #4A4034;
  --lp-accent: #F4764A;
  --lp-accent-deep: #F7A07C;
  --lp-keep: #6FCB93;
  --lp-drop: #F4838B;
  --lp-perf: #E0A64A;
  --lp-unlit: #6B6357;
  --lp-faint: #9A907F;
  --lp-night: #0A0806;
}
html[data-theme="dark"] .lp-finale { border-top: 1px solid var(--lp-rule); }
html[data-theme="dark"] .lp-console { box-shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 40px 100px -50px rgba(0, 0, 0, .8); }
html[data-theme="dark"] .lp-demo--config { border-color: var(--lp-rule); }
html[data-theme="dark"] .lp-msg__avatar { background: var(--lp-ink); color: var(--lp-paper); }
html[data-theme="dark"] .lp-btn--primary::before { background: var(--lp-ink); }
html[data-theme="dark"] .lp-btn--primary:hover { color: var(--lp-paper); }

.lp-page ::selection { background: var(--lp-accent); color: #fff; }
.lp-page :focus-visible { outline: 2px solid var(--lp-accent); outline-offset: 3px; border-radius: 4px; }

/* Paper grain — one fixed layer, never intercepts input. */
.lp-page::after {
  content: "";
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


.lp-wrap { max-width: var(--lp-max); margin: 0 auto; padding-inline: var(--lp-gutter); position: relative; }

/* ─── Header (shared macro, landing skin) ─────────────────────────── */

.lp-page .marketing-header {
  position: sticky; top: 0; z-index: 60;
  padding: 16px var(--lp-gutter);
  background: color-mix(in srgb, var(--lp-paper) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .4s;
}
.lp-page .marketing-header.is-scrolled { border-bottom-color: var(--lp-rule); }
.lp-page .marketing-header__name { font-size: 17px; letter-spacing: -0.03em; color: var(--lp-ink); }
/* The switcher reuses sidebar colours tuned for the app; restate them in page
   tokens so they hold contrast in both themes. */
.lp-page .marketing-header__lang a { color: var(--lp-muted); }
.lp-page .marketing-header__lang a.active,
.lp-page .marketing-header__lang a:hover { color: var(--lp-ink); }
.lp-page .marketing-header__glyph svg { transition: transform .8s var(--lp-ease); }
.lp-page .marketing-header__brand:hover .marketing-header__glyph svg { transform: rotate(120deg); }
.lp-page .marketing-header__link { font-size: 14px; color: var(--lp-muted); transition: color .2s; }
.lp-page .marketing-header__link:hover { color: var(--lp-ink); }
.lp-page .marketing-header__cta {
  height: 38px; padding: 0 16px; border-radius: 999px;
  font-size: 13px; box-shadow: none;
  background: var(--lp-cta);
  transition: background .25s, color .25s;
}
.lp-page .marketing-header__cta:hover { background: var(--lp-ink); }
/* Over the night finale the header inverts rather than floating a pale bar. */
.lp-page .marketing-header.is-dark {
  background: color-mix(in srgb, var(--lp-night) 82%, transparent);
  border-bottom-color: rgba(243, 238, 227, .1);
}
.lp-page .marketing-header.is-dark .marketing-header__name,
.lp-page .marketing-header.is-dark .marketing-header__lang a.active,
.lp-page .marketing-header.is-dark .marketing-header__link:hover { color: var(--lp-night-text); }
.lp-page .marketing-header.is-dark .marketing-header__link,
.lp-page .marketing-header.is-dark .marketing-header__lang a { color: var(--lp-night-muted); }
.lp-page .marketing-header.is-dark .marketing-header__cta:hover { background: var(--lp-night-text); color: var(--lp-night); }
.lp-page .marketing-header__name,
.lp-page .marketing-header__lang a { transition: color .4s; }

/* ─── Shared type ─────────────────────────────────────────────────── */

.lp-eyebrow {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 28px;
  font: 500 12px/1 var(--lp-mono);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--lp-muted);
}
.lp-eyebrow::before {
  content: ""; width: 28px; height: 1px; background: currentColor; opacity: .5;
}
.lp-hero__eyebrow { flex-wrap: wrap; row-gap: 8px; }
.lp-hero__eyebrow > span { white-space: nowrap; }
.lp-hero__eyebrow::before { display: none; }
.lp-eyebrow__sep { color: var(--lp-rule-strong); }

.lp-h2 {
  margin: 0;
  font-size: clamp(1.875rem, 3.2vw, 3rem);
  font-weight: 600; line-height: 1.02; letter-spacing: -0.04em;
  text-wrap: balance;
}
.lp-h3 {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 1.6vw, 1.5rem);
  font-weight: 600; line-height: 1.2; letter-spacing: -0.02em;
}
.lp-body {
  margin: 0;
  font-size: 16px; line-height: 1.65; color: var(--lp-muted);
  text-wrap: pretty;
}
.lp-page em {
  font-family: var(--lp-serif); font-style: italic; font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--lp-accent);
}
.lp-page code {
  font-family: var(--lp-mono); font-size: .86em;
  padding: .12em .4em; border-radius: 4px;
  background: var(--lp-paper-2); border: 1px solid var(--lp-rule);
  color: var(--lp-ink-2);
  white-space: nowrap;
}
.lp-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--lp-ink);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size .45s var(--lp-ease);
}
.lp-link:hover { background-size: 100% 1px; }
.lp-link span { transition: transform .45s var(--lp-ease); }
.lp-link:hover span { transform: translateX(3px); }

/* ─── Buttons ─────────────────────────────────────────────────────── */

.lp-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 56px; padding: 0 26px;
  border-radius: 999px; border: 1px solid transparent;
  font: 600 15px/1 var(--lp-sans); letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap;
  transition: color .35s var(--lp-ease), border-color .35s, transform .35s var(--lp-ease);
}
.lp-btn:active { transform: scale(.98); }
.lp-btn--primary { background: var(--lp-cta); color: #fff; }
.lp-btn--primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--lp-ink); border-radius: inherit;
  transform: translateY(101%);
  transition: transform .5s var(--lp-ease);
}
.lp-btn--primary:hover::before { transform: none; }
.lp-btn__arrow {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; margin-right: -12px;
  border-radius: 50%; background: rgba(255, 255, 255, .18);
  transition: transform .5s var(--lp-ease), background .35s;
}
.lp-btn--primary:hover .lp-btn__arrow { transform: translateX(3px) rotate(-45deg); background: var(--lp-accent); }
.lp-btn--ghost { color: var(--lp-ink); border-color: var(--lp-rule-strong); background: var(--lp-paper); }
.lp-btn--ghost:hover { border-color: var(--lp-ink); }

/* ─── Hero ────────────────────────────────────────────────────────── */

.lp-hero {
  position: relative;
  padding: clamp(56px, 11vh, 132px) 0 clamp(56px, 9vh, 104px);
}
.lp-hero__glyph {
  position: absolute; z-index: 0;
  top: clamp(-40px, -2vw, 0px); right: calc(-1 * clamp(80px, 12vw, 220px));
  width: clamp(420px, 58vw, 900px); height: auto;
  fill: none; stroke: var(--lp-rule-strong); stroke-width: .05;
  pointer-events: none;
}
.lp-hero__glyph path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.lp-hero__glyph path:nth-child(3) { stroke: var(--lp-accent); fill: var(--lp-accent); fill-opacity: .06; }
.lp-hero .lp-wrap { z-index: 1; }

.lp-hero__title {
  margin: 0;
  font-size: clamp(2.5rem, 6.4vw, 6.5rem);
  font-weight: 600; line-height: .94; letter-spacing: -0.052em;
}
.lp-hero__title em { font-size: 1.06em; letter-spacing: -0.02em; margin-right: -.05em; }
.lp-line { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.lp-line > span { display: inline-block; }

.lp-hero__foot {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px var(--lp-gutter);
  margin-top: clamp(40px, 7vh, 80px);
  padding-top: 32px; border-top: 1px solid var(--lp-rule);
}
.lp-hero__lede {
  grid-column: 1 / span 6; margin: 0; max-width: 36ch;
  font-size: clamp(1rem, 1.15vw, 1.125rem); line-height: 1.55; color: var(--lp-ink-2);
  text-wrap: pretty;
}
.lp-hero__cta { grid-column: 8 / -1; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.lp-fine { margin: 0; max-width: 46ch; font: 400 12px/1.6 var(--lp-mono); color: var(--lp-muted); }

.lp-pulse {
  position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--lp-accent);
}
.lp-pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--lp-accent);
  animation: lp-ping 2.4s var(--lp-ease) infinite;
}

/* Intro motion — pure CSS so it never depends on script timing. */
.lp-hero__title .lp-line > span { animation: lp-rise 1.2s var(--lp-ease) both; }
.lp-hero__title .lp-line:nth-child(2) > span { animation-delay: .12s; }
.lp-hero [data-intro] { animation: lp-fade 1.1s var(--lp-ease) .35s both; }
.lp-hero__foot[data-intro] { animation-delay: .5s; }
.lp-hero__glyph path { animation: lp-draw 2.4s var(--lp-ease) both; }
.lp-hero__glyph path:nth-child(2) { animation-delay: .25s; }
.lp-hero__glyph path:nth-child(3) { animation: lp-draw 2.4s var(--lp-ease) .5s both, lp-fill 1.2s ease 1.6s both; }

/* ─── Review console ──────────────────────────────────────────────── */

.lp-stage {
  padding: 0;
  background: linear-gradient(180deg, transparent 0 34%, var(--lp-paper-2) 34% 100%);
}
.lp-console {
  margin: 0 auto; max-width: 1120px;
  background: var(--lp-card);
  border: 1px solid var(--lp-rule); border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(23, 20, 15, .03),
    0 24px 48px -24px rgba(90, 55, 20, .18),
    0 60px 120px -60px rgba(90, 55, 20, .25);
  overflow: hidden;
}
.lp-console__bar {
  display: flex; align-items: center; gap: 14px;
  height: 48px; padding: 0 18px;
  border-bottom: 1px solid var(--lp-rule);
  background: var(--lp-paper-2);
  font: 500 12px/1 var(--lp-mono); color: var(--lp-muted);
}
.lp-console__dots { display: flex; gap: 7px; }
.lp-console__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--lp-rule-strong); }
.lp-console__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-console__replay {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--lp-rule-strong); background: var(--lp-card);
  font: 500 12px/1 var(--lp-mono); color: var(--lp-ink); cursor: pointer;
  transition: border-color .2s, background .2s;
}
.lp-console__replay:hover { border-color: var(--lp-ink); }
.lp-console__replay[hidden] { display: none; }

.lp-console__body { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.lp-rail {
  list-style: none; margin: 0; padding: 24px 0;
  border-right: 1px solid var(--lp-rule);
}
.lp-rail__step {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  font: 400 13px/1.3 var(--lp-sans); color: var(--lp-ink-2);
  transition: color .4s;
}
.lp-rail__idx { font: 500 11px/1 var(--lp-mono); color: var(--lp-accent-deep); }
.lp-rail__step::before {
  content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 2px;
  background: var(--lp-accent); transform: scaleY(0); transition: transform .5s var(--lp-ease);
}
.lp-rail__step.is-active::before { transform: none; }

.lp-console__main { position: relative; }
.lp-findings { list-style: none; margin: 0; padding: 8px 0; }

/* Stage 1 overlay: the files being read for context. Only shown mid-playback. */
.lp-reading {
  position: absolute; inset: 0; z-index: 1;
  list-style: none; margin: 0; padding: 28px 24px;
  display: flex; flex-direction: column; gap: 14px;
  font: 400 13px/1 var(--lp-mono); color: var(--lp-muted);
  opacity: 0; visibility: hidden;
  transition: opacity .4s, visibility .4s;
}
.lp-reading li { display: flex; align-items: center; gap: 12px; }
.lp-reading li::before { content: "→"; color: var(--lp-accent); }
.lp-reading li::after {
  content: ""; flex: 0 1 180px; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--lp-rule) 0 40%, var(--lp-rule-strong) 50%, var(--lp-rule) 60% 100%) 0 0 / 300% 100%;
  animation: lp-shimmer 1.4s linear infinite;
}
.lp-console.is-reading .lp-reading { opacity: 1; visibility: visible; }
.lp-console.is-reading .lp-reading li { animation: lp-fade .6s var(--lp-ease) calc(var(--i) * .15s) both; }
.lp-finding {
  position: relative;
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; column-gap: 18px; align-items: baseline;
  padding: 18px 24px;
  border-bottom: 1px solid var(--lp-rule);
  transition: opacity .6s var(--lp-ease), transform .6s var(--lp-ease), background .4s;
}
.lp-finding:last-child { border-bottom: 0; }
.lp-finding__text { margin: 0; font: 400 14px/1.6 var(--lp-mono); color: var(--lp-ink); }
.lp-finding code { font-size: .92em; }
.lp-finding s, .lp-demo s {
  text-decoration: none;
  background: linear-gradient(var(--lp-drop), var(--lp-drop)) 0 58% / 100% 1.5px no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size .7s var(--lp-ease);
}
.lp-finding--dropped .lp-finding__text { color: var(--lp-muted); }
.lp-finding__why {
  grid-column: 2 / -1; margin: 8px 0 0;
  font: italic 400 17px/1.4 var(--lp-serif); color: var(--lp-drop);
}
.lp-finding__why code { font-style: normal; font-size: 13px; }

.lp-tag {
  justify-self: start;
  padding: 4px 7px; border-radius: 4px;
  font: 500 10.5px/1 var(--lp-mono); letter-spacing: .06em;
  border: 1px solid currentColor;
}
.lp-tag--bug { color: var(--lp-drop); }
.lp-tag--perf { color: var(--lp-perf); }
.lp-tag--style { color: var(--lp-muted); }
.lp-tag--quality { color: var(--lp-keep); }

.lp-verdict { font: 500 12px/1 var(--lp-mono); white-space: nowrap; }
.lp-verdict__wait { display: none; color: var(--lp-muted); }
.lp-verdict--keep .lp-verdict__done { color: var(--lp-keep); }
.lp-verdict--drop .lp-verdict__done { color: var(--lp-drop); }

.lp-console__foot {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--lp-rule);
  background: color-mix(in srgb, var(--lp-keep) 7%, var(--lp-card));
  font: 400 13px/1.5 var(--lp-mono); color: var(--lp-keep);
  transition: opacity .6s var(--lp-ease), transform .6s var(--lp-ease);
}
.lp-console__check {
  display: grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--lp-keep); color: #fff; font-size: 12px;
}

/* Scripted playback (landing.js adds .is-armed, then steps through). */
.lp-console.is-armed .lp-rail__step:not(.is-active):not(.is-done),
.lp-console.is-armed .lp-rail__step:not(.is-active):not(.is-done) .lp-rail__idx { color: var(--lp-muted); }
.lp-console.is-armed .lp-finding:not(.is-in) { opacity: 0; transform: translateY(10px); }
.lp-console.is-armed .lp-finding:not(.is-done) .lp-verdict__done { display: none; }
.lp-console.is-armed .lp-finding.is-checking .lp-verdict__wait { display: inline; animation: lp-blink 1s steps(2) infinite; }
.lp-console.is-armed .lp-finding.is-checking::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--lp-accent) 9%, transparent), transparent);
  animation: lp-scan 1.1s var(--lp-ease) infinite;
}
.lp-console.is-armed .lp-finding--dropped:not(.is-done) .lp-finding__text { color: var(--lp-ink); }
.lp-console.is-armed .lp-finding--dropped:not(.is-done) s { background-size: 0 1.5px; }
.lp-console.is-armed .lp-finding--dropped .lp-finding__why { transition: opacity .6s var(--lp-ease) .3s, transform .6s var(--lp-ease) .3s; }
.lp-console.is-armed .lp-finding--dropped:not(.is-done) .lp-finding__why { opacity: 0; transform: translateY(-4px); }
.lp-console.is-armed:not(.is-complete) .lp-console__foot { opacity: 0; transform: translateY(6px); }

/* ─── Product screenshot ──────────────────────────────────────────── */

.lp-product { padding: clamp(80px, 12vh, 152px) 0 clamp(88px, 13vh, 160px); background: var(--lp-paper-2); border-bottom: 1px solid var(--lp-rule); }
.lp-product__head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px var(--lp-gutter); align-items: end;
  margin-bottom: clamp(40px, 7vh, 72px);
}
.lp-product__head > div { grid-column: 1 / span 7; }
.lp-product__head .lp-h2 { max-width: 14ch; }
.lp-product__lede { grid-column: 8 / -1; max-width: 40ch; }
.lp-shot { margin: 0; perspective: 1800px; }
.lp-shot__frame {
  overflow: hidden; border-radius: 14px;
  border: 1px solid var(--lp-rule);
  background: var(--lp-card);
  box-shadow: 0 1px 0 rgba(23, 20, 15, .03), 0 30px 60px -30px rgba(90, 55, 20, .22), 0 80px 140px -70px rgba(90, 55, 20, .3);
  transform-origin: 50% 0;
}
.lp-shot__img, .lp-shot__img img { display: block; width: 100%; height: auto; }
.lp-shot__img--dark { display: none; }
html[data-theme="dark"] .lp-shot__img--light { display: none; }
html[data-theme="dark"] .lp-shot__img--dark { display: block; }
html[data-theme="dark"] .lp-shot__frame { box-shadow: 0 40px 100px -50px rgba(0, 0, 0, .8); }
.lp-shot__caption { margin-top: 16px; font: 400 12px/1.5 var(--lp-mono); color: var(--lp-muted); text-align: center; }
/* The screenshot tilts up into place as it scrolls in (JS only). */
html.lp-js .lp-shot[data-reveal] { transform: none; opacity: 1; }
html.lp-js .lp-shot .lp-shot__frame {
  transform: rotateX(14deg) translateY(40px) scale(.96); opacity: 0;
  transition: transform 1.4s var(--lp-ease), opacity 1s var(--lp-ease);
}
html.lp-js .lp-shot.is-visible .lp-shot__frame { transform: none; opacity: 1; }

/* ─── Manifesto ───────────────────────────────────────────────────── */

.lp-manifesto { padding: clamp(80px, 14vh, 176px) 0; }
.lp-manifesto__text {
  margin: 0; max-width: 21ch;
  font-size: clamp(1.75rem, 3.8vw, 3.75rem);
  font-weight: 500; line-height: 1.04; letter-spacing: -0.045em;
  text-wrap: balance;
}
.lp-manifesto__text > span { display: block; }
.lp-manifesto__turn { margin-top: .35em; }
.lp-manifesto__text em { letter-spacing: -0.015em; }
/* landing.js sets --n (word count) and each word's --i once, then only the
   block's scroll progress --p per frame; CSS derives every word's ink. Words
   ink in by colour, not opacity: the unlit grey still clears WCAG's 3:1 for
   large text, so the text is readable at every scroll position. */
.lp-manifesto__text { --lp-lit: var(--lp-ink); }
.lp-manifesto__text em { --lp-lit: var(--lp-accent); }
html.lp-js .lp-w {
  --k: clamp(0, var(--p, 0) * var(--n, 1) - var(--i, 0), 1);
  color: color-mix(in srgb, var(--lp-lit) calc(var(--k) * 100%), var(--lp-unlit));
}

/* ─── Three safeguards ────────────────────────────────────────────── */

.lp-heads { padding: clamp(64px, 10vh, 128px) 0 clamp(80px, 12vh, 160px); }
.lp-heads__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 var(--lp-gutter); }
.lp-heads__intro {
  grid-column: 1 / span 5; align-self: start;
  position: sticky; top: 120px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 28px;
}
.lp-heads__intro .lp-eyebrow { margin: 0; }
.lp-heads__intro .lp-h2 { max-width: 12ch; }
/* One triangle per safeguard; landing.js lights the one being read. */
.lp-heads__glyph {
  width: clamp(160px, 17vw, 260px); height: auto; margin-top: 24px;
  fill: none; stroke: var(--lp-rule-strong); stroke-width: .22;
  overflow: visible;
}
.lp-heads__glyph path { transition: stroke .6s var(--lp-ease), fill-opacity .6s var(--lp-ease), stroke-width .6s var(--lp-ease); fill: var(--lp-accent); fill-opacity: 0; }
.lp-heads__intro[data-active="1"] .lp-heads__glyph path:nth-child(1),
.lp-heads__intro[data-active="2"] .lp-heads__glyph path:nth-child(2),
.lp-heads__intro[data-active="3"] .lp-heads__glyph path:nth-child(3) { stroke: var(--lp-accent); stroke-width: .4; fill-opacity: .08; }
.lp-heads__intro:not([data-active]) .lp-heads__glyph path:nth-child(3) { stroke: var(--lp-accent); }
.lp-heads__list { grid-column: 7 / -1; list-style: none; margin: 0; padding: 0; }
.lp-head {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 20px;
  padding: 36px 0 64px;
  border-top: 1px solid var(--lp-rule);
}
.lp-head:first-child { border-top-color: var(--lp-ink); }
.lp-head__num {
  grid-row: 1 / span 2;
  font: italic 400 56px/.8 var(--lp-serif); color: var(--lp-accent);
  font-variant-numeric: lining-nums;
}
.lp-head__copy { max-width: 52ch; }

.lp-demo {
  grid-column: 2; margin-top: 28px;
  padding: 22px; border-radius: 12px;
  background: var(--lp-paper-2); border: 1px solid var(--lp-rule);
}
.lp-demo__ask { margin: 0 0 16px; font: italic 400 26px/1.1 var(--lp-serif); color: var(--lp-ink); }
.lp-demo__row {
  display: flex; gap: 12px; align-items: baseline;
  padding: 12px 0; border-top: 1px dashed var(--lp-rule-strong);
  font: 400 13px/1.55 var(--lp-mono); color: var(--lp-ink);
}
.lp-demo__row > span:first-child { flex: none; font-weight: 500; }
.lp-demo__row.is-kept > span:first-child { color: var(--lp-keep); }
.lp-demo__row.is-dropped { color: var(--lp-muted); }
.lp-demo__row.is-dropped > span:first-child { color: var(--lp-drop); }
.lp-demo code { background: var(--lp-card); }

.lp-msg { display: flex; gap: 12px; align-items: flex-start; }
.lp-msg + .lp-msg { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--lp-rule-strong); }
.lp-msg__avatar {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--lp-ink); color: var(--lp-paper);
  font: 600 12px/1 var(--lp-sans);
}
.lp-msg--bot .lp-msg__avatar { background: var(--lp-card); color: var(--lp-accent); border: 1px solid var(--lp-rule-strong); }
.lp-msg b { font: 500 12px/1 var(--lp-mono); color: var(--lp-muted); }
.lp-msg p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--lp-ink); }
.lp-msg--bot p { color: var(--lp-ink-2); }

.lp-demo--config { background: var(--lp-night); border-color: var(--lp-night); }
.lp-demo--config pre {
  margin: 0; overflow-x: auto;
  font: 400 13px/1.75 var(--lp-mono); color: var(--lp-night-text);
}
.lp-demo--config .c { color: var(--lp-night-muted); }
.lp-demo--config .k { color: #F39A72; }

/* ─── Setup ───────────────────────────────────────────────────────── */

.lp-setup { padding: clamp(80px, 12vh, 160px) 0; background: var(--lp-paper-2); border-block: 1px solid var(--lp-rule); }
.lp-setup .lp-h2 { max-width: 16ch; }
.lp-steps {
  list-style: none; margin: clamp(48px, 8vh, 88px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--lp-gutter);
}
.lp-step { position: relative; padding-top: 28px; }
.lp-step::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--lp-ink); transform-origin: left;
}
.lp-step__num {
  display: block; margin-bottom: 36px;
  font: italic 400 clamp(64px, 7vw, 104px)/.8 var(--lp-serif); color: var(--lp-accent);
}
.lp-step .lp-body { max-width: 32ch; }
.lp-setup__note { margin: clamp(40px, 6vh, 64px) 0 0; font-size: 15px; line-height: 1.6; color: var(--lp-muted); }

/* ─── Trust ───────────────────────────────────────────────────────── */

.lp-trust { padding: clamp(80px, 12vh, 152px) 0; }
.lp-trust__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0; border-top: 1px solid var(--lp-rule);
}
.lp-trust__item { padding: 32px var(--lp-gutter) 8px 0; }
.lp-trust__item + .lp-trust__item { padding-left: var(--lp-gutter); border-left: 1px solid var(--lp-rule); }
.lp-trust dt { margin-bottom: 18px; font: 500 12px/1 var(--lp-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lp-accent-deep); }
.lp-trust dd { margin: 0; font-size: clamp(1.25rem, 1.8vw, 1.625rem); font-weight: 500; line-height: 1.3; letter-spacing: -0.02em; text-wrap: pretty; }

/* ─── Finale (night) ──────────────────────────────────────────────── */

.lp-finale {
  position: relative; overflow: hidden;
  padding: clamp(112px, 20vh, 240px) 0 clamp(88px, 14vh, 160px);
  background: var(--lp-night); color: var(--lp-night-text);
}
.lp-finale__glyph {
  position: absolute; right: -16vw; bottom: -20vw;
  width: clamp(480px, 70vw, 1100px); height: auto;
  fill: none; stroke: rgba(243, 238, 227, .16); stroke-width: .04;
  pointer-events: none;
}
.lp-finale__glyph path { stroke-dasharray: 1; }
.lp-finale__glyph path:nth-child(3) { stroke: var(--lp-accent); fill: var(--lp-accent); fill-opacity: .1; }
.lp-finale__title {
  margin: 0; max-width: 13ch;
  font-size: clamp(2.25rem, 5.4vw, 5.5rem);
  font-weight: 600; line-height: .96; letter-spacing: -0.05em;
  text-wrap: balance;
}
.lp-finale__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px;
  margin-top: clamp(48px, 8vh, 88px); padding-top: 32px;
  border-top: 1px solid rgba(243, 238, 227, .14);
}
.lp-finale .lp-body { color: var(--lp-night-muted); font-size: 17px; max-width: 42ch; }
.lp-finale .lp-btn--primary::before { background: var(--lp-night-text); }
.lp-finale .lp-btn--primary:hover { color: var(--lp-night); }

.lp-page .marketing-footer {
  background: var(--lp-night); color: var(--lp-night-muted);
  border-top: 1px solid rgba(243, 238, 227, .1);
  padding: 28px var(--lp-gutter);
}
.lp-page .marketing-footer p { margin: 0; }

/* ─── Features page (features.html) ──────────────────────────────── */

.ft-hero { position: relative; overflow: clip; padding: clamp(56px, 10vh, 120px) 0 clamp(48px, 8vh, 96px); border-bottom: 1px solid var(--lp-rule); }
.ft-hero .lp-wrap { z-index: 1; }
.ft-hero__glyph { top: -40px; width: clamp(320px, 42vw, 640px); }
.ft-hero__title {
  margin: 0; max-width: 14ch;
  font-size: clamp(2.25rem, 4.8vw, 4.5rem); font-weight: 600; line-height: .98; letter-spacing: -0.045em;
  text-wrap: balance;
  animation: lp-fade 1.1s var(--lp-ease) .1s both;
}
.ft-hero__lede { margin: 32px 0 0; max-width: 46ch; font-size: clamp(1rem, 1.15vw, 1.125rem); line-height: 1.6; color: var(--lp-ink-2); text-wrap: pretty; }
.ft-hero [data-intro] { animation: lp-fade 1.1s var(--lp-ease) .3s both; }

.ft-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 var(--lp-gutter); padding-block: clamp(64px, 10vh, 128px); }
.ft-toc { grid-column: 1 / span 4; align-self: start; position: sticky; top: 110px; }
.ft-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--lp-rule); }
.ft-toc a {
  display: flex; gap: 12px; padding: 10px 0 10px 18px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 14px; line-height: 1.4; color: var(--lp-muted); text-decoration: none;
  transition: color .25s, border-color .35s var(--lp-ease);
}
.ft-toc a:hover { color: var(--lp-ink); }
.ft-toc a[aria-current="true"] { color: var(--lp-ink); border-left-color: var(--lp-accent); }
.ft-toc__num { flex: none; font: 500 11px/1.9 var(--lp-mono); color: var(--lp-accent-deep); }

.ft-stages { grid-column: 6 / -1; }
.ft-stage {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 20px;
  padding: 36px 0 64px; border-top: 1px solid var(--lp-rule); scroll-margin-top: 96px;
}
.ft-stage:first-child { border-top-color: var(--lp-ink); }
.ft-stage > * { grid-column: 2; }
.ft-stage__num { grid-column: 1; grid-row: 1 / span 6; font: italic 400 56px/.8 var(--lp-serif); color: var(--lp-accent); }
.ft-stage__title { font-size: clamp(1.375rem, 2vw, 1.75rem); margin-bottom: 16px; text-wrap: balance; }
.ft-stage .lp-body + .lp-body { margin-top: 14px; }
.ft-list { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.ft-list li { position: relative; padding-left: 22px; font-size: 15px; line-height: 1.6; color: var(--lp-muted); text-wrap: pretty; }
.ft-list li::before { content: ""; position: absolute; left: 0; top: .78em; width: 10px; height: 1px; background: var(--lp-accent); }
.ft-commands { margin: 22px 0; padding: 6px 0; border-radius: 12px; background: var(--lp-night); color: var(--lp-night-text); }
html[data-theme="dark"] .ft-commands { border: 1px solid var(--lp-rule); }
.ft-commands > div { display: grid; grid-template-columns: minmax(0, 14em) minmax(0, 1fr); gap: 16px; padding: 13px 20px; border-top: 1px solid rgba(243, 238, 227, .08); }
.ft-commands > div:first-child { border-top: 0; }
.ft-commands dt, .ft-commands dd { margin: 0; }
.ft-commands dd { font-size: 14px; line-height: 1.55; color: var(--lp-night-muted); }
.lp-page .ft-commands code { background: none; border: 0; padding: 0; color: #F39A72; font-size: 13px; }

:lang(zh) .ft-hero__title,
:lang(zh) .ft-stage__title { word-break: keep-all; overflow-wrap: anywhere; font-feature-settings: "palt"; letter-spacing: 0; line-height: 1.2; }
:lang(zh) .ft-hero__title { max-width: 11em; }
:lang(zh) .ft-list li { line-height: 1.85; letter-spacing: .02em; }

@media (max-width: 1024px) {
  .ft-toc { display: none; }
  .ft-stages { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .ft-stage { grid-template-columns: 1fr; padding: 28px 0 48px; }
  .ft-stage > *, .ft-stage__num { grid-column: 1; grid-row: auto; }
  .ft-stage__num { margin-bottom: 18px; font-size: 44px; }
  .ft-commands > div { grid-template-columns: 1fr; gap: 6px; }
  .ft-hero__glyph { top: auto; bottom: -45vw; right: -38vw; width: 90vw; opacity: .5; }
}

/* ─── Scroll reveals (JS only; content is visible without it) ────── */

html.lp-js [data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity 1s var(--lp-ease), transform 1s var(--lp-ease);
  transition-delay: var(--d, 0s);
}
html.lp-js [data-reveal].is-visible { opacity: 1; transform: none; }
html.lp-js .lp-steps .lp-step::before { transform: scaleX(0); transition: transform 1.2s var(--lp-ease) calc(var(--i) * .15s); }
html.lp-js .lp-steps.is-visible .lp-step::before { transform: none; }
html.lp-js .lp-steps .lp-step__num { opacity: 0; transform: translateY(30%); transition: opacity 1s var(--lp-ease), transform 1s var(--lp-ease); transition-delay: calc(.2s + var(--i) * .15s); }
html.lp-js .lp-steps.is-visible .lp-step__num { opacity: 1; transform: none; }
html.lp-js .lp-finale__glyph path { stroke-dashoffset: 1; transition: stroke-dashoffset 2.6s var(--lp-ease); }
html.lp-js .lp-finale__glyph path:nth-child(2) { transition-delay: .2s; }
html.lp-js .lp-finale__glyph path:nth-child(3) { transition-delay: .4s; }
html.lp-js .lp-finale.is-visible .lp-finale__glyph path { stroke-dashoffset: 0; }

/* ─── Keyframes ───────────────────────────────────────────────────── */

@keyframes lp-rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes lp-fade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes lp-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes lp-fill { from { fill-opacity: 0; } }
@keyframes lp-ping { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(3); opacity: 0; } }
@keyframes lp-blink { 50% { opacity: .35; } }
@keyframes lp-shimmer { to { background-position: -150% 0; } }
@keyframes lp-scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ─── Locale tuning ───────────────────────────────────────────────── */

/* CJK glyphs are already tightly set; the Latin display tracking crushes them. */
/* Headings break only at spaces and punctuation, so phrases stay whole
   ("Cerberus / 在意的是，/ 找到的…") — overflow-wrap is the safety valve for a
   phrase wider than the line. palt sets punctuation proportionally, closing
   the half-em gaps full-width 。，leave at display sizes. */
:lang(zh) .lp-hero__title,
:lang(zh) .lp-h2,
:lang(zh) .lp-h3,
:lang(zh) .lp-manifesto__text,
:lang(zh) .lp-finale__title,
:lang(zh) .lp-trust dd {
  word-break: keep-all; overflow-wrap: anywhere;
  font-feature-settings: "palt";
}
:lang(zh) .lp-hero__title,
:lang(zh) .lp-finale__title { letter-spacing: 0; line-height: 1.14; }
/* The accent phrase is one unit: never split it, but let the line break on
   either side of it (keep-all would otherwise glue it to its neighbours). */
:lang(zh) .lp-page em { display: inline-block; }
:lang(zh) .lp-h2,
:lang(zh) .lp-manifesto__text { letter-spacing: 0; line-height: 1.24; }
:lang(zh) .lp-heads__intro .lp-h2,
:lang(zh) .lp-setup .lp-h2,
:lang(zh) .lp-finale__title { max-width: 10em; }
/* CJK body copy needs more leading and a touch of tracking to breathe. */
:lang(zh) .lp-body,
:lang(zh) .lp-hero__lede,
:lang(zh) .lp-msg p { line-height: 1.85; letter-spacing: .02em; }
:lang(zh) .lp-trust dd { line-height: 1.5; letter-spacing: .01em; }
/* No true italic exists for CJK; the synthesized slant looks broken. */
.lp-page:lang(zh) { font-synthesis-style: none; }
:lang(zh) .lp-manifesto__text { max-width: 15em; }

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .lp-hero__lede, .lp-hero__cta { grid-column: 1 / -1; }
  .lp-heads__intro { grid-column: 1 / -1; position: static; margin-bottom: 56px; }
  .lp-heads__glyph { display: none; }
  .lp-heads__list { grid-column: 1 / -1; }
  .lp-product__head > div, .lp-product__lede { grid-column: 1 / -1; }
  .lp-shot { max-width: 420px; margin-inline: auto; }
}

@media (max-width: 760px) {
  .lp-page .marketing-header { flex-wrap: nowrap; gap: 12px; padding-block: 12px; }
  .lp-page .marketing-header__nav { flex-wrap: nowrap; gap: 14px; }
  .lp-page .marketing-header__cta { height: 34px; padding: 0 14px; font-size: 12.5px; }
  /* Sit behind the lede, not the headline, so it never crosses the type. */
  .lp-hero__glyph { top: auto; bottom: -24px; right: -38vw; width: 92vw; opacity: .55; }
  .lp-hero__foot { gap: 28px; }
  .lp-actions { width: 100%; }
  .lp-actions .lp-btn { flex: 1 1 100%; }

  .lp-console { border-radius: 12px; }
  .lp-console__body { grid-template-columns: 1fr; }
  /* 2×2 grid rather than a sideways-scrolling strip: every step stays in
     view and there's no scroll region to make keyboard-focusable. */
  .lp-rail {
    display: grid; grid-template-columns: 1fr 1fr;
    padding: 6px 0; border-right: 0; border-bottom: 1px solid var(--lp-rule);
  }
  .lp-rail__step { padding: 10px 16px; font-size: 12px; }
  .lp-rail__step::before { left: 0; top: 10px; bottom: 10px; }
  .lp-finding { grid-template-columns: auto 1fr; row-gap: 10px; padding: 18px; }
  .lp-finding .lp-tag { grid-row: 1; }
  .lp-finding .lp-verdict { grid-row: 1; grid-column: 2; justify-self: end; }
  .lp-finding__text { grid-column: 1 / -1; font-size: 13px; }
  .lp-finding__why { grid-column: 1 / -1; margin-top: 0; }
  .lp-console__foot { padding: 14px 18px; font-size: 12px; align-items: flex-start; }

  .lp-head { grid-template-columns: 1fr; padding: 28px 0 48px; }
  .lp-head__num { grid-row: auto; margin-bottom: 20px; font-size: 44px; }
  .lp-demo { grid-column: 1; }

  .lp-steps { grid-template-columns: 1fr; gap: 48px; }
  .lp-step__num { margin-bottom: 20px; }
  .lp-trust__grid { grid-template-columns: 1fr; }
  .lp-trust__item, .lp-trust__item + .lp-trust__item { padding: 28px 0; border-left: 0; }
  .lp-trust__item + .lp-trust__item { border-top: 1px solid var(--lp-rule); }
  .lp-finale__glyph { right: -40vw; bottom: -30vw; width: 130vw; }
  .lp-finale__foot .lp-btn { width: 100%; }
}

@media (max-width: 440px) {
  /* The hero's "See how it works" button covers the same destination. */
  .lp-page .marketing-header__link { display: none; }
  .lp-page .marketing-header__name { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-page *, .lp-page *::before, .lp-page *::after {
    animation: none !important; transition: none !important;
  }
  html.lp-js .lp-page [data-reveal] { opacity: 1; transform: none; }
  html.lp-js .lp-w { color: var(--lp-lit); }
}
