/* ──────────────────────────────────────────────────────────────────────────
   The Sign Language Studio — slstudio.io
   Editorial, warm, approachable. Mission-adjacent without preaching.
   Tokens are CSS custom properties; the Tweaks panel rewrites :root only.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  /* Content palette */
  --bg:           #FBF7EE;     /* canvas */
  --bg-2:         #F5EFE0;     /* surface */
  --bg-3:         #EBE0C7;     /* surface-2 (elevated / accents) */
  --ink:          #1F1A12;     /* text */
  --ink-2:        #5A4F3F;     /* text-2 */
  --ink-3:        #706656;     /* text-muted (AA on --bg and --bg-2) */
  --ink-4:        #B5A98D;     /* hairline labels — decorative only, not for text */
  --rule:         #D9C9A3;     /* border */
  --rule-2:       #E5D9BD;     /* softer hairline */

  --accent:       #3A4A2E;     /* primary accent (olive) */
  --accent-hover: #2A361F;     /* primary hover */
  --accent-ink:   #FBF7EE;     /* text on accent fill */
  --accent-soft:  color-mix(in oklab, var(--accent) 14%, var(--bg));

  --deep:         #7C4A66;     /* secondary button (dusty plum) */
  --deep-hover:   #623850;
  --deep-ink:     #FBF7EE;     /* text on deep fill */

  --link:         #6E3F58;     /* inline body link (plum) */

  --font-display: "DM Serif Display", "Source Serif 4", Georgia, serif;
  --font-sans:    "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  --maxw: 1200px;
  --gutter: 40px;
  --section-py: 48px;

  color-scheme: light;
}

/* Adjacent sections each contribute --section-py, so the visible seam
   between two sections is 2× this value. Sized so "regular" yields a
   ~96px seam on desktop rather than the ~128px it used to. */
:root[data-density="compact"]  { --section-py: 36px; }
:root[data-density="regular"]  { --section-py: 48px; }
:root[data-density="spacious"] { --section-py: 72px; }

:root[data-dark="1"] {
  --bg:           #14110B;
  --bg-2:         #1F1A12;
  --bg-3:         #2D2618;
  --ink:          #FBF7EE;
  --ink-2:        #C9BFA7;
  --ink-3:        #9A917E;
  --ink-4:        #6B6250;
  --rule:         #5A4F3F;
  --rule-2:       #3A332A;

  --accent:       #B5CB91;
  --accent-hover: #D2E2B5;
  --accent-ink:   #14110B;

  --deep:         #C089A6;
  --deep-hover:   #D2A2BC;
  --deep-ink:     #14110B;

  --link:         #E0B6CE;

  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Ensure the `hidden` attribute always wins over component display rules
   (e.g. .blade-body { display: flex }) so toggled panels stay hidden. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  transition: background 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }

::selection { background: var(--accent); color: var(--accent-ink); }

button { font: inherit; color: inherit; }

/* Skip link for keyboard users */
.skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 100;
}
.skip:focus { left: 12px; }

/* ── Typography ─────────────────────────────────────────────────────────── */
.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-wrap: balance;
}
.h-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.h-section {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.04;
  font-size: clamp(34px, 4.4vw, 52px);
  text-wrap: balance;
  margin: 0;
}
.lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
  text-wrap: pretty;
}
.body { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.caption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: var(--section-py) 0; }
.section.pt-0 { padding-top: 0; }
/* Section heads run the full wrap width so headings hold one line on
   desktop; they wrap naturally only when the viewport forces it. */
.section-head { margin-bottom: var(--space-7); }
.section-head .h-section { margin-top: 16px; }
.why-head .h-section, .why-head .h-eyebrow + .h-section { margin-top: 16px; }
.blade.blade-sm { width: min(440px, 92vw); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--deep);
  color: var(--deep-ink);
}
.btn-secondary:hover { background: var(--deep-hover); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink-3); background: color-mix(in oklab, var(--ink) 4%, transparent); }

.btn-link {
  background: transparent;
  color: var(--link);
  padding: 0;
  height: auto;
  border: 0;
  font-weight: 500;
}
.btn-link .arrow { display: inline-block; transition: transform 0.2s ease; }
.btn-link:hover { color: var(--accent-hover); }
.btn-link:hover .arrow { transform: translateX(3px); }

/* Status pill for not-yet-linked things (e.g. pricing while in private beta). */
.beta-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.btn-sm { height: 38px; padding: 0 16px; font-size: 13.5px; }

/* ── Nav / sticky banner ─────────────────────────────────────────────────── */
/* The brand mark and CTAs live large inside the hero (see .hero-wordmark and
   .hero-actions). This sticky bar is the compact "landing spot": it stays
   transparent and empty while the hero is on screen, then — once the hero mark
   has scrolled up past it — its compact mark + buttons zoom into place, so the
   big hero versions appear to shrink into the banner. The "is-stuck" class is
   toggled by app.js when the hero mark scrolls out of view. */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, backdrop-filter 0.3s ease,
              -webkit-backdrop-filter 0.3s ease, border-color 0.3s ease;
}
.nav.is-stuck {
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom-color: var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px 0;
  gap: 24px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  color: var(--ink);
}
/* Compact mark + CTAs are hidden and slightly enlarged until the banner goes
   active, then they zoom down into place — echoing the big hero originals. */
.nav .wordmark {
  opacity: 0;
  transform: translateY(-8px) scale(1.18);
  transform-origin: left center;
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(-8px) scale(1.18);
  transform-origin: right center;
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav.is-stuck .wordmark,
.nav.is-stuck .nav-actions {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
/* Near the foot of the page the banner CTAs fade back out, leaving the mark. */
.nav.is-stuck.hide-actions .nav-actions {
  opacity: 0;
  transform: translateY(-8px) scale(1.18);
  pointer-events: none;
}
.wordmark-img {
  display: block;
  height: 56px;
  width: auto;
}
.wordmark-sm .wordmark-img { height: 34px; }
.nav-actions .btn-link { font-size: 14px; color: var(--ink-2); }
.nav-actions .btn-link:hover { color: var(--ink); }

/* ── Theme toggle ─────────────────────────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0.5px solid var(--rule);
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg-2) 82%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: 0 8px 28px -12px rgba(0, 0, 0, 0.35);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
/* When the journal ticker bar is showing, lift the toggle above it so it
   never covers the ticker's "Read →" CTA (ticker is 54px tall). */
body:has(#journal-ticker:not([hidden])) .theme-toggle { bottom: 72px; }
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .ico-moon { display: none; }
:root[data-dark="1"] .theme-toggle .ico-sun { display: none; }
:root[data-dark="1"] .theme-toggle .ico-moon { display: block; }

/* Dark-mode wordmark. The inline sprite follows the theme on its own: its
   wordmark uses currentColor and the cube mark keeps fixed brand colors in
   both themes. Sub-pages that render the wordmark as an <img>
   ship both variants and toggle visibility here (robust cross-browser,
   unlike `content: url()` element replacement). */
.wordmark-img.wm-dark,
.hero-wordmark-img.wm-dark { display: none; }
:root[data-dark="1"] .wordmark-img.wm-dark,
:root[data-dark="1"] .hero-wordmark-img.wm-dark { display: block; }
:root[data-dark="1"] .wordmark-img.wm-light,
:root[data-dark="1"] .hero-wordmark-img.wm-light { display: none; }

/* Big brand mark that opens the hero and scrolls away under the banner. */
.hero-wordmark {
  display: inline-flex;
  align-self: flex-start;
  line-height: 1;
  color: var(--ink);
  /* Adds to .hero-inner's flex gap — the lockup is ~4× the body scale, so
     it needs more separation from the headline than the stack's 24px. */
  margin-bottom: var(--space-5);
}
.hero-wordmark-img {
  display: block;
  height: clamp(112px, 17vw, 188px);
  width: auto;
}
@media (max-width: 720px) {
  .wordmark-img { height: 48px; }
  .hero-wordmark-img { height: clamp(88px, 24vw, 140px); }
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  padding: clamp(16px, 2.5vw, 32px) 0 clamp(48px, 5vw, 64px);
}
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 920px;
}
.hero-display {
  font-size: clamp(32px, 5.1vw, 77px);
  /* 1.0 let the italic descenders of "for everyone." collide with the
     line above and crowd the sub below. */
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
.hero-display em {
  font-style: italic;
  color: var(--accent);
  font-feature-settings: "ss01";
  white-space: nowrap;
}
.hero-sub {
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 44ch;
  font-family: var(--font-sans);
  text-wrap: pretty;
  /* Extra clearance for the headline's italic descenders (adds to the
     stack's flex gap). */
  margin: var(--space-2) 0 0;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

/* ── See what you can produce (Media / Documents) ───────────────────────── */
.gallery {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
}
.gallery-head { margin-bottom: var(--space-7); }

/* The radio inputs that drive gallery state are visually hidden but */
/* remain keyboard-focusable so users can tab/arrow between them.    */
/* position:fixed (not absolute) pins them inside the viewport: when a
   label click moves focus onto one, the browser has nothing to scroll
   into view, so the page never jumps. Their :checked ~ sibling CSS is
   unaffected — DOM order is what matters there, not paint position.  */
.gallery-radio {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

.gallery-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  background: transparent;
  border: 0;
}
.gallery-inner {
  border: 1px solid var(--rule);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-2);
}
.tab-card {
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: var(--space-5) var(--space-5);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 6px;
  align-items: start;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.tab-card:hover { border-color: color-mix(in oklab, var(--accent) 40%, var(--rule)); transform: translateY(-1px); }
/* Active tab — driven by the matching radio's :checked state */
#gtab-media:checked     ~ .gallery-tabs label[for="gtab-media"],
#gtab-documents:checked ~ .gallery-tabs label[for="gtab-documents"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 18%, transparent);
}
/* Keyboard focus ring on the radio shows on its paired label */
#gtab-media:focus-visible     ~ .gallery-tabs label[for="gtab-media"],
#gtab-documents:focus-visible ~ .gallery-tabs label[for="gtab-documents"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tab-card .num {
  grid-row: 1 / span 2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  padding-top: 4px;
}
.tab-card .tab-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.tab-card .tab-title::after { content: " \203A"; color: var(--ink-3); }
.tab-card .tab-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* Panels — hidden by default, shown when matching tab radio is checked */
.panel { display: none; padding: 0; }
#gtab-media:checked     ~ .gallery-inner .panel[data-panel="media"],
#gtab-documents:checked ~ .gallery-inner .panel[data-panel="documents"] { display: block; }

.media-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

/* Video stage — one <video> per template, only the matching one is shown. */
.video-stage {
  background:
    radial-gradient(ellipse at 30% 40%, color-mix(in oklab, var(--accent) 20%, var(--bg-2)) 0%, var(--bg-2) 70%),
    var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-stage .video-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: none;
  opacity: 0;
  transition: opacity 0.18s cubic-bezier(0.22, 1, 0.36, 1),
              display 0.18s allow-discrete;
}
/* The active video (targeted by the existing :checked selectors) fades in. */
#gtmpl-1:checked ~ .gallery-inner .video-stage > video[data-tmpl="1"],
#gtmpl-2:checked ~ .gallery-inner .video-stage > video[data-tmpl="2"],
#gtmpl-3:checked ~ .gallery-inner .video-stage > video[data-tmpl="3"],
#gtmpl-4:checked ~ .gallery-inner .video-stage > video[data-tmpl="4"],
#gtmpl-5:checked ~ .gallery-inner .video-stage > video[data-tmpl="5"],
#gtmpl-6:checked ~ .gallery-inner .video-stage > video[data-tmpl="6"] {
  display: block;
  opacity: 1;
}
@starting-style {
  #gtmpl-1:checked ~ .gallery-inner .video-stage > video[data-tmpl="1"],
  #gtmpl-2:checked ~ .gallery-inner .video-stage > video[data-tmpl="2"],
  #gtmpl-3:checked ~ .gallery-inner .video-stage > video[data-tmpl="3"],
  #gtmpl-4:checked ~ .gallery-inner .video-stage > video[data-tmpl="4"],
  #gtmpl-5:checked ~ .gallery-inner .video-stage > video[data-tmpl="5"],
  #gtmpl-6:checked ~ .gallery-inner .video-stage > video[data-tmpl="6"] {
    opacity: 0;
  }
}

/* Stage tint per template — shows behind the video while it's loading */
#gtmpl-5:checked ~ .gallery-inner .video-stage { background: #9CA08F; }
#gtmpl-6:checked ~ .gallery-inner .video-stage { background: #5BB458; }

/* Template picker (Media panel) */
.template-picker {
  padding: var(--space-6);
  background: var(--bg-2);
}
.picker-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.012em;
  margin: 0 0 var(--space-4);
}
.picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-3);
}
.picker-btn {
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  text-align: center;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.picker-btn:hover { border-color: color-mix(in oklab, var(--accent) 50%, var(--rule)); transform: translateY(-1px); }
/* Active picker — driven by the matching template radio's :checked state */
#gtmpl-1:checked ~ .gallery-inner label.picker-btn[for="gtmpl-1"],
#gtmpl-2:checked ~ .gallery-inner label.picker-btn[for="gtmpl-2"],
#gtmpl-3:checked ~ .gallery-inner label.picker-btn[for="gtmpl-3"],
#gtmpl-4:checked ~ .gallery-inner label.picker-btn[for="gtmpl-4"],
#gtmpl-5:checked ~ .gallery-inner label.picker-btn[for="gtmpl-5"],
#gtmpl-6:checked ~ .gallery-inner label.picker-btn[for="gtmpl-6"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 25%, transparent);
}
/* Keyboard focus ring on the radio shows on its paired picker label */
#gtmpl-1:focus-visible ~ .gallery-inner label.picker-btn[for="gtmpl-1"],
#gtmpl-2:focus-visible ~ .gallery-inner label.picker-btn[for="gtmpl-2"],
#gtmpl-3:focus-visible ~ .gallery-inner label.picker-btn[for="gtmpl-3"],
#gtmpl-4:focus-visible ~ .gallery-inner label.picker-btn[for="gtmpl-4"],
#gtmpl-5:focus-visible ~ .gallery-inner label.picker-btn[for="gtmpl-5"],
#gtmpl-6:focus-visible ~ .gallery-inner label.picker-btn[for="gtmpl-6"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.picker-thumb {
  display: block;
  background: var(--bg-2);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 60 / 38;
}
.picker-thumb svg { display: block; width: 100%; height: 100%; }
.picker-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0;
}
#gtmpl-1:checked ~ .gallery-inner label.picker-btn[for="gtmpl-1"] .picker-label,
#gtmpl-2:checked ~ .gallery-inner label.picker-btn[for="gtmpl-2"] .picker-label,
#gtmpl-3:checked ~ .gallery-inner label.picker-btn[for="gtmpl-3"] .picker-label,
#gtmpl-4:checked ~ .gallery-inner label.picker-btn[for="gtmpl-4"] .picker-label,
#gtmpl-5:checked ~ .gallery-inner label.picker-btn[for="gtmpl-5"] .picker-label,
#gtmpl-6:checked ~ .gallery-inner label.picker-btn[for="gtmpl-6"] .picker-label { color: var(--ink); }

/* ── Documents panel ─────────────────────────────────────────────────────
   A replica of the studio's document viewer. The structure, tokens and
   control chrome below are ported from the viewer's own standalone HTML
   export (documents/templates/standalone-html.template.ts), which shares its
   token set with the in-app viewer — so when the viewer moves, this should
   move with it. Everything lives under .doc-viewer, and the --doc-* tokens
   are declared on that element rather than :root, so the viewer's palette
   can't bleed into the marketing page wrapped around it. */
.doc-replica-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.doc-replica-head .h-eyebrow { color: var(--ink-3); }
.doc-replica-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.012em;
  margin: 4px 0 0;
}
.doc-embed {
  padding: var(--space-5) var(--space-6) var(--space-6);
  background: var(--bg-2);
}
.doc-embed .doc-replica-head .h-eyebrow { color: var(--ink-3); }
.doc-embed-note {
  margin: var(--space-3) 0 0;
  max-width: 62ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-3);
}

/* ── Viewer replica ──────────────────────────────────────────────────── */
.doc-viewer {
  --doc-bg: #F5F5F7;
  --doc-bg-elevated: #FFFFFF;
  --doc-bg-panel: #0A0E1A;
  --doc-fg: #0A0E1A;
  --doc-fg-muted: #6B6B6B;
  --doc-fg-on-light: #0A0E1A;
  --doc-fg-on-panel: #FFFFFF;
  --doc-border: #E5E7EB;
  --doc-border-strong: #D1D5DB;
  --doc-accent: #E02020;
  --doc-accent-fg: #FFFFFF;
  --doc-overlay-hover: rgba(224, 32, 32, 0.10);
  --doc-overlay-active: rgba(224, 32, 32, 0.20);
  --doc-page-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --doc-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --doc-toggle-track: #2D3340;
  --doc-toggle-thumb: #FFFFFF;
  --doc-footer-bg: #0A0E1A;
  --doc-footer-fg: #FFFFFF;

  display: flex;
  flex-direction: column;
  background: var(--doc-bg);
  color: var(--doc-fg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 40px -22px color-mix(in oklab, var(--ink) 40%, transparent);
  /* The viewer is its own product surface — it does not inherit the marketing
     page's display face. */
  font-family: var(--font-sans);
}
.doc-viewer[data-doc-theme="dark"] {
  --doc-bg: #0A0E1A;
  --doc-fg: #FFFFFF;
  --doc-fg-muted: #9AA0A6;
  --doc-border: #1F2937;
  --doc-border-strong: #374151;
  --doc-page-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --doc-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* Header */
.doc-viewer .doc-header {
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-inline: 24px;
  background: var(--doc-bg);
  color: var(--doc-fg);
}
.doc-viewer .doc-header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.doc-viewer .doc-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}
.doc-viewer .doc-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.doc-viewer .doc-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 80px;
  height: 36px;
  padding: 4px;
  border: none;
  border-radius: 999px;
  background: var(--doc-toggle-track);
  cursor: pointer;
  box-sizing: border-box;
}
.doc-viewer .doc-theme-toggle-glyph {
  flex: 1;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--doc-toggle-thumb);
  opacity: 0.7;
  transition: background-color 120ms ease, opacity 120ms ease;
}
.doc-viewer .doc-theme-toggle-glyph[data-active="true"] {
  background: rgba(255, 255, 255, 0.15);
  opacity: 1;
}

/* Layout */
.doc-viewer .doc-main {
  flex: 1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  align-items: start;
  gap: 24px;
  padding: 24px;
}
.doc-viewer .doc-layout-pdf { min-width: 0; }

/* Page + regions */
.doc-viewer .doc-page {
  position: relative;
  background: #FFF;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--doc-page-shadow);
}
.doc-viewer .doc-page img { display: block; width: 100%; height: auto; }
/* The reader-facing viewer leaves idle regions fully transparent, since a
   recipient already knows to explore their own document. A visitor landing on
   this page does not, so idle regions borrow the visible treatment the studio
   uses in the translator's source pane. */
.doc-viewer .doc-region {
  position: absolute;
  padding: 0;
  border: 1px solid rgba(224, 32, 32, 0.45);
  border-radius: 4px;
  background: rgba(224, 32, 32, 0.07);
  cursor: pointer;
  transition: background-color 200ms ease-in, border-color 200ms ease-in;
}
.doc-viewer .doc-region:hover,
.doc-viewer .doc-region:focus-visible {
  background: var(--doc-overlay-hover);
  border-color: var(--doc-accent);
  outline: none;
}
.doc-viewer .doc-region[data-active="true"] {
  background: var(--doc-overlay-active);
  border: 1.5px solid var(--doc-accent);
}

/* Pagination */
.doc-viewer .doc-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 0 0;
}
.doc-viewer .doc-pagination-row { display: flex; align-items: center; gap: 8px; }
.doc-viewer .doc-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--doc-border);
  border-radius: 50%;
  background: transparent;
  color: var(--doc-fg);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.doc-viewer .doc-pagination-btn:hover:not(:disabled) { border-color: var(--doc-accent); }
.doc-viewer .doc-pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.doc-viewer .doc-pagination-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--doc-bg-elevated);
  color: var(--doc-fg-on-light);
  font-size: 13px;
  font-weight: 600;
}
.doc-viewer .doc-pagination-caption { font-size: 12px; color: var(--doc-fg-muted); }

/* Video card */
/* Offset clears the site's own sticky banner (77px here, 65px on a phone)
   so the panel parks below it rather than under it. */
.doc-viewer .doc-aside { position: sticky; top: 93px; align-self: start; }
.doc-viewer .doc-video-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: var(--doc-bg-panel);
  color: var(--doc-fg-on-panel);
  box-shadow: var(--doc-shadow);
}
.doc-viewer .doc-video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}
.doc-viewer .doc-video-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.doc-viewer .doc-controls { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.doc-viewer .doc-transport { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.doc-viewer .doc-transport-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--doc-fg-on-panel);
  cursor: pointer;
}
.doc-viewer .doc-transport-btn[data-variant="accent"] { color: var(--doc-accent); }
.doc-viewer .doc-transport-btn:hover:not(:disabled),
.doc-viewer .doc-transport-btn:focus-visible { background: rgba(255, 255, 255, 0.08); outline: none; }
.doc-viewer .doc-transport-btn:disabled { opacity: 0.4; cursor: not-allowed; }
/* Play/pause and mute each ship both glyphs; JS flips the state flag. */
.doc-viewer .doc-icon-pause,
.doc-viewer .doc-icon-muted { display: none; }
.doc-viewer .doc-transport-btn[data-playing="true"] .doc-icon-play,
.doc-viewer .doc-transport-btn[aria-pressed="true"] .doc-icon-unmuted { display: none; }
.doc-viewer .doc-transport-btn[data-playing="true"] .doc-icon-pause,
.doc-viewer .doc-transport-btn[aria-pressed="true"] .doc-icon-muted { display: block; }

/* Speed */
.doc-viewer .doc-speed-wrap { position: relative; margin-left: 4px; }
.doc-viewer .doc-speed-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border: 1.5px solid var(--doc-accent);
  border-radius: 999px;
  background: var(--doc-accent);
  color: var(--doc-accent-fg);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.doc-viewer .doc-speed-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 72px;
  padding: 4px;
  border: 1px solid var(--doc-border);
  border-radius: 8px;
  background: var(--doc-bg-elevated);
  color: var(--doc-fg-on-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.doc-viewer .doc-speed-menu[hidden] { display: none; }
.doc-viewer .doc-speed-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.doc-viewer .doc-speed-item:hover,
.doc-viewer .doc-speed-item:focus-visible { background: rgba(0, 0, 0, 0.06); outline: none; }
.doc-viewer .doc-speed-item[data-active="true"] { background: var(--doc-accent); color: var(--doc-accent-fg); }
.doc-viewer .doc-status { margin: 0; font-size: 12px; color: rgba(255, 255, 255, 0.7); text-align: center; }

/* Footer — dark navy in both themes */
.doc-viewer .doc-footer {
  height: 56px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-inline: 24px;
  margin-top: auto;
  background: var(--doc-footer-bg);
  color: var(--doc-footer-fg);
  font-size: 13px;
}
.doc-viewer .doc-footer-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--doc-footer-fg);
}
.doc-viewer .doc-footer-copyright { text-align: center; color: var(--doc-footer-fg); }
.doc-viewer .doc-footer-links { display: flex; justify-content: flex-end; gap: 6px; color: var(--doc-footer-fg); }
.doc-viewer .doc-footer-links a { color: var(--doc-footer-fg); text-decoration: underline; }
.doc-viewer .doc-footer-links a:hover { opacity: 0.8; }

/* ── How it works ───────────────────────────────────────────────────────── */
.how {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.how-step {
  background: var(--bg);
  padding: var(--space-7) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
}
.how-step .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
}
.how-step h3 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.05;
  margin: 0;
}
.how-step p { color: var(--ink-2); font-size: 15.5px; margin: 0; max-width: 32ch; }
.how-visual {
  background: var(--bg-2);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Size the graphics from the svg's own viewBox ratio (height:auto), not
   aspect-ratio + height:100%. WebKit resolves that combination cyclically
   inside 1fr grid tracks and inflates the boxes several times over. */
.how-visual svg { width: 100%; height: auto; display: block; }

/* Use dusty plum (the --deep token) as the local accent for the how-it-works
   graphics. Adapts per mode: #7C4A66 light, #C089A6 dark. Global --accent
   (olive) is unchanged elsewhere, including the template selector. */
.how-visual {
  --accent:     var(--deep);
  --accent-ink: var(--deep-ink);
}

/* ── Why SL Studio ──────────────────────────────────────────────────────── */
.why-head {
  margin-bottom: var(--space-7);
}
.why {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-7);
}
.why-card {
  padding: var(--space-6) 0 0;
  border-top: 1px solid var(--ink);
}
.why-card h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.1;
  margin: 0 0 var(--space-3);
  max-width: 22ch;
}
.why-card p { color: var(--ink-2); font-size: 15.5px; margin: 0; max-width: 46ch; }
/* Concept graphic at the foot of each card. Cards are flex columns and the
   visual takes margin-top:auto, so the three panels bottom-align across the
   row even when the copy lengths differ. */
.why-card { display: flex; flex-direction: column; }
.why-card p { margin-bottom: var(--space-5); }
.why-visual {
  background: var(--bg-2);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Same local plum accent as the feature graphics. */
  --accent:     var(--deep);
  --accent-ink: var(--deep-ink);
}
/* height:auto, not 100% — see .how-visual svg note (WebKit inflation). The
   max-width keeps the graphic at its drawn scale now that two cards split the
   row; without it each panel would stretch the artwork half the wrap wide. */
.why-visual svg { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; }

/* ── Journal ticker ─────────────────────────────────────────────────────── */
/* Slim marquee strip featuring the latest journal post. Hidden until app.js
   fills it from the journal API; the track is doubled so a -50% translate loops. */
.ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 54px;
  padding: 0 var(--gutter);
  border-top: 1px solid var(--rule);
  background: var(--bg-2);
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 -10px 30px -16px color-mix(in oklab, var(--ink) 40%, transparent);
}
/* Reserve room at the foot of the page so the fixed ticker never covers
   the footer — only while the ticker is actually shown (app.js unhides it). */
body:has(#journal-ticker:not([hidden])) { padding-bottom: 54px; }
.ticker-tag {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 5px 11px;
  border-radius: 999px;
}
.ticker-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: ticker-scroll 60s linear infinite;
}
.ticker:hover .ticker-track,
.ticker:focus-visible .ticker-track { animation-play-state: paused; }
.ticker-track .ti {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.ticker-track .ti-sep {
  color: var(--accent);
  font-size: 11px;
  margin: 0 26px;
  transform: translateY(-2px);
}
.ticker-cta {
  flex: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--link);
  white-space: nowrap;
}
.ticker:hover .ticker-cta { color: var(--accent-hover); }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}
@media (max-width: 600px) {
  .ticker-cta { display: none; }
  .ticker-track .ti { font-size: 16px; }
}

/* ── Pricing line ───────────────────────────────────────────────────────── */
.pricing-line {
  padding: var(--section-py) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-2);
}
.pricing-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
}
.pricing-inner .h-section { font-size: clamp(28px, 3vw, 38px); text-wrap: balance; }
.pricing-inner p { font-size: 17px; color: var(--ink-2); margin: 0; max-width: 56ch; }
.pricing-inner .actions { display: flex; gap: 12px; margin-top: var(--space-3); flex-wrap: wrap; justify-content: center; }

/* ── Closing CTA ────────────────────────────────────────────────────────── */
.closing {
  padding: var(--section-py) 0;
}
.closing-inner {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: var(--space-8);
  align-items: end;
}
.closing-inner h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 5vw, 72px);
  letter-spacing: -0.022em;
  line-height: 1;
  margin: 0;
  text-wrap: balance;
}
.closing-inner p { color: var(--ink-2); margin: 0 0 var(--space-5); max-width: 44ch; font-size: 17px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  padding: var(--space-7) 0 var(--space-7);
  border-top: 1px solid var(--rule);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.footer-left { display: flex; align-items: center; gap: var(--space-5); }
.footer-left .wordmark-img { height: 22px; }
.footer-contact {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.footer-contact:hover { color: var(--accent); }
.footer-links {
  display: flex;
  gap: var(--space-5);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.footer-links a:hover { color: var(--ink); }

/* ── Modal / Blade ──────────────────────────────────────────────────────── */
.scrim {
  position: fixed;
  inset: 0;
  background: color-mix(in oklab, var(--ink) 50%, transparent);
  z-index: 90;
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } }

.blade {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 92vw);
  background: var(--bg);
  z-index: 91;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px -10px color-mix(in oklab, var(--ink) 40%, transparent);
  animation: slide-in 0.25s cubic-bezier(.2,.7,.2,1);
}
@keyframes slide-in { from { transform: translateX(100%); } }

/* Exit: mirror slide-in / fade. `is-closing` is added to the dialog root by
   closeDialog(), then removed once the animation ends. */
.is-closing .blade {
  animation: slide-out 0.22s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes slide-out { to { transform: translateX(100%); } }

.is-closing .scrim {
  animation: fade-out 0.18s ease forwards;
}
@keyframes fade-out { to { opacity: 0; } }

.blade-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--rule);
}
.blade-hd h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0;
}
.blade-x {
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.blade-x:hover { background: color-mix(in oklab, var(--ink) 5%, transparent); border-color: var(--ink-3); }
.blade-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.blade-body {
  padding: 28px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.blade-body p { margin: 0; color: var(--ink-2); }
.blade-body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink-2);
  font-weight: 500;
}
.blade-body label .req { color: var(--accent); margin-left: 2px; }
.blade-body input, .blade-body select, .blade-body textarea {
  font: inherit;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.blade-body input:focus, .blade-body select:focus, .blade-body textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent);
}
.blade-body input[aria-invalid="true"] {
  border-color: var(--accent);
}
.blade-body .err {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--accent);
  margin-top: 2px;
}
.blade-body .help {
  font-size: 12.5px;
  color: var(--ink-3);
}
.blade-body .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.blade-body textarea { min-height: 96px; resize: vertical; }
.blade-body .checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.blade-body label.check {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}
.blade-body label.check input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  padding: 0;
  accent-color: var(--ink);
}
.blade-foot {
  border-top: 1px solid var(--rule);
  padding: 18px 24px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}
.blade-foot .legal { font-size: 12px; color: var(--ink-3); }

.success {
  text-align: center;
  padding: 32px 12px;
}
.success .ico {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 16%, var(--bg));
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.success h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0 0 8px;
}
.success p { color: var(--ink-2); max-width: 42ch; margin: 0 auto; }

/* Success confirmation entrance — plays whenever a "-success" panel is
   un-hidden (sign-up on every page; download gates on /standards/). The form
   is display:none'd instantly by JS; this animates the confirmation in over it.
   `both` holds the from-state before start and the end-state after. */
[id$="-success"]:not([hidden]) .success {
  animation: success-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes success-in {
  from { opacity: 0; transform: translateY(6px); }
}

[id$="-success"]:not([hidden]) .success .ico {
  animation: ico-pop 0.30s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}
@keyframes ico-pop {
  from { opacity: 0; transform: scale(0.85); }
}

/* ── Tweaks panel — palette swatch + custom controls live in styles below ── */

/* ── Illustration motion ────────────────────────────────────────────────── */
/* Hover-only, and gated on a real pointer so touch devices never trip these:
   a tap would latch :hover and strand a graphic mid-sweep. Every rule's end
   state equals the graphic's resting state, so an interrupted animation
   settles back into the static artwork rather than a half-built frame.
   Reduced motion opts out here rather than leaning on the global rule: that
   rule zeroes animation-duration but not animation-delay, so a staggered
   build with fill-mode:both would still hold its invisible start state
   through the delay and pop in — the exact flashing the setting exists to
   prevent. Gating the whole block means those users get the static art. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {

  /* Shared: draw a stroke on. Paths carry pathLength="1", so a dasharray of
     1 spans the whole path whatever its real length. Resting dashoffset is
     0 — fully drawn — and the keyframe only rewinds it during the animation. */
  .ai-branch, .ai-check, .wk-arrow { stroke-dasharray: 1; }
  @keyframes draw-on { from { stroke-dashoffset: 1; } }

  /* Shared: a sparkle winks, then flares. */
  .ai-spark, .bg-spark { transform-box: fill-box; transform-origin: center; }
  @keyframes glisten {
    0%, 100% { transform: scale(1);    opacity: 1; }
    35%      { transform: scale(0.72); opacity: 0.55; }
    70%      { transform: scale(1.32); opacity: 1; }
  }

  /* 01 AI-assisted workflows — the outputs flow out of the source document
     along the branches, then each check draws in behind them. */
  .how-step:hover .ai-branch   { animation: draw-on 0.4s ease-out 0.06s both; }
  .how-step:hover .ai-branch-2 { animation-delay: 0.16s; }
  .how-step:hover .ai-out-1 { animation: ai-out-a 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .how-step:hover .ai-out-2 { animation: ai-out-b 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both; }
  /* Each box starts where its branch leaves the document, so the offsets
     mirror: the top branch rises 10 units, the bottom one drops 10. */
  @keyframes ai-out-a { from { opacity: 0; transform: translate(-44px, 10px); } }
  @keyframes ai-out-b { from { opacity: 0; transform: translate(-44px, -10px); } }
  .how-step:hover .ai-check { animation: draw-on 0.32s ease-out 0.46s both; }
  .how-step:hover .ai-spark { animation: glisten 1.6s ease-in-out infinite; }

  /* 02 Background removal — the clean frame emerges out of the source frame
     (a 118-unit gap) while the clutter dims away behind it. */
  .bg-after { transform-box: fill-box; transform-origin: center; }
  .how-step:hover .bg-after { animation: bg-emerge 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both; }
  @keyframes bg-emerge { from { opacity: 0; transform: translateX(-118px) scale(0.94); } }
  .how-step:hover .bg-clutter { animation: clutter-clear 0.7s ease-out 0.08s both; }
  @keyframes clutter-clear { 45% { opacity: 0.2; } }
  .how-step:hover .bg-arrow { animation: arrow-nudge 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
  @keyframes arrow-nudge { 45% { transform: translateX(5px); } }
  .how-step:hover .bg-spark { animation: glisten 1.6s ease-in-out 0.5s infinite; }

  /* 03 Translate & edit — the playhead scrubs the timeline and each segment
     lights as it passes. Linear + alternate on a shared duration is what keeps
     the highlights locked to the head: the segment windows below are the
     playhead's real positions as a percentage of the sweep, and `alternate`
     mirrors both the travel and the windows on the way back. */
  .ed-seg { transform-box: fill-box; transform-origin: center; }
  .how-step:hover .ed-playhead { animation: ed-sweep 2.4s linear infinite alternate; }
  @keyframes ed-sweep {
    from { transform: translateX(-66px); }
    to   { transform: translateX(86px); }
  }
  .how-step:hover .ed-seg-1 { animation: ed-lit-1 2.4s linear infinite alternate; }
  .how-step:hover .ed-seg-2 { animation: ed-lit-2 2.4s linear infinite alternate; }
  .how-step:hover .ed-seg-3 { animation: ed-lit-3 2.4s linear infinite alternate; }
  @keyframes ed-lit-1 {
    0%,  18%  { fill: var(--accent); transform: scaleY(1.25); }
    30%, 100% { fill: var(--bg-3);   transform: scaleY(1); }
  }
  /* Segment two rests accent-filled, so it pops on opacity instead of fill. */
  @keyframes ed-lit-2 {
    0%,  22%  { opacity: 0.85; transform: scaleY(1); }
    30%, 56%  { opacity: 1;    transform: scaleY(1.25); }
    66%, 100% { opacity: 0.85; transform: scaleY(1); }
  }
  @keyframes ed-lit-3 {
    0%,  58%  { fill: var(--bg-3);   transform: scaleY(1); }
    68%, 84%  { fill: var(--accent); transform: scaleY(1.25); }
    94%, 100% { fill: var(--bg-3);   transform: scaleY(1); }
  }

  /* Why 01 — the AI stars float and twinkle. Mismatched durations keep the
     four from ever falling into step with each other. */
  .wf-spark { transform-box: fill-box; transform-origin: center; }
  .why-card:hover .wf-spark   { animation: twinkle 2.2s ease-in-out infinite; }
  .why-card:hover .wf-spark-2 { animation-duration: 2.9s; animation-delay: 0.35s; }
  .why-card:hover .wf-spark-3 { animation-duration: 2.5s; animation-delay: 0.70s; }
  .why-card:hover .wf-spark-4 { animation-duration: 3.1s; animation-delay: 0.15s; }
  @keyframes twinkle {
    0%, 100% { transform: translateY(0) scale(1);       opacity: 1; }
    30%      { transform: translateY(-3px) scale(0.78); opacity: 0.5; }
    65%      { transform: translateY(-1px) scale(1.22); opacity: 1; }
  }

  /* Why 02 — the handoff builds left to right: node, arrow, node, arrow, node. */
  .wk-node { transform-box: fill-box; transform-origin: center; }
  .why-card:hover .wk-node  { animation: wk-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .why-card:hover .wk-arrow { animation: draw-on 0.3s ease-out both; }
  @keyframes wk-pop { from { opacity: 0; transform: scale(0.55); } }
  .why-card:hover .wk-a { animation-delay: 0s; }
  .why-card:hover .wk-b { animation-delay: 0.14s; }
  .why-card:hover .wk-c { animation-delay: 0.28s; }
  .why-card:hover .wk-d { animation-delay: 0.42s; }
  .why-card:hover .wk-e { animation-delay: 0.56s; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  :root { --gutter: 22px; }
  /* Matches the density attribute's specificity so the small-screen cap
     applies even when app.js has set data-density on the root. */
  :root, :root[data-density] { --section-py: 56px; }
  .nav-actions .btn-ghost { display: none; }
  .media-stage { aspect-ratio: 16 / 10; }
  .gallery-tabs { grid-template-columns: 1fr; gap: var(--space-3); }
  .tab-card { padding: var(--space-4) var(--space-4); }
  .tab-card .tab-title { font-size: 18px; }
  .picker-grid { grid-template-columns: repeat(3, 1fr); }
  .picker-label { font-size: 11px; }
  .template-picker { padding: var(--space-5) var(--space-4); }
  .doc-replica-head { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .doc-embed { padding: var(--space-4) var(--space-4) var(--space-5); }
  /* Video above the page, and it stays put while the page scrolls under it —
     the same reversal the real viewer makes on a phone. */
  .doc-viewer .doc-main { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .doc-viewer .doc-aside { order: -1; position: sticky; top: 81px; z-index: 2; }
  .doc-viewer .doc-header { height: auto; padding: 12px 16px; gap: 8px; }
  .doc-viewer .doc-title { max-width: none; }
  /* Three columns can't fit a phone; drop the copyright and let the wordmark
     and links sit at the two ends. */
  .doc-viewer .doc-footer { grid-template-columns: 1fr auto; height: auto; padding: 12px 16px; }
  .doc-viewer .doc-footer-copyright { display: none; }
  .how { grid-template-columns: 1fr; }
  .how-step {
    display: grid;
    grid-template-columns: 92px 1fr;
    column-gap: var(--space-4);
    row-gap: 6px;
    align-items: start;
    padding: var(--space-5) var(--gutter);
  }
  .how-visual {
    grid-row: 1 / span 3;
    width: 92px;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 12px;
  }
  .how-step .num { grid-column: 2; align-self: end; }
  .how-step h3 { grid-column: 2; font-size: 23px; }
  .how-step p { grid-column: 2; max-width: none; }
  .why { grid-template-columns: 1fr; gap: var(--space-6); }
  /* Stacked, the concept graphic would run the full column and read as a
     large image above the fold-and-a-half. Demote it to a badge above the
     headline: order:-1 lifts it out of the flex column's tail. */
  .why-visual {
    order: -1;
    width: 120px;
    margin: 0 0 var(--space-4);
    padding: 8px 10px;
  }
  .why-card h3 { font-size: 23px; max-width: none; }
  .why-card p { max-width: none; margin-bottom: 0; }
  .closing-inner { grid-template-columns: 1fr; gap: var(--space-5); }
  .blade { width: 100vw; max-width: 100vw; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* Sticky banner: keep the mark + both CTAs on one row on small phones. */
@media (max-width: 480px) {
  .nav-inner { gap: 12px; padding: 10px var(--gutter); }
  .nav-actions { gap: 8px; }
  .nav .wordmark-img { height: 38px; }
  .nav-actions .btn-sm { height: 36px; padding: 0 13px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
