/* ──────────────────────────────────────────────────────────────────────────
   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:        #877B68;     /* text-muted */
  --ink-4:        #B5A98D;     /* hairline labels */
  --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: 96px;

  color-scheme: light;
}

:root[data-density="compact"]  { --section-py: 64px; }
:root[data-density="regular"]  { --section-py: 96px; }
:root[data-density="spacious"] { --section-py: 144px; }

: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-head { max-width: 40ch; 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); }

.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); }
.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; }

/* In dark mode, swap the wordmark for its light-on-dark variant. */
:root[data-dark="1"] .wordmark-img,
:root[data-dark="1"] .hero-wordmark-img {
  content: url("sls-bnr-darkmode.svg");
}

/* 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);
}
.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(8px, 2vw, 24px) 0 clamp(40px, 5vw, 64px);
}
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 920px;
}
.hero-display {
  font-size: clamp(40px, 6.4vw, 96px);
  line-height: 1.0;
  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;
  margin: 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 { max-width: 56ch; 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.    */
.gallery-radio {
  position: absolute;
  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-4);
  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;
}
#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; }

/* 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 */
.doc-replica {
  padding: var(--space-5) var(--space-6) var(--space-6);
  background: var(--bg-2);
}
.doc-replica + .doc-replica { border-top: 1px solid var(--rule); }
.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-replica-stage {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: var(--space-4);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: var(--space-4);
  box-shadow: 0 18px 40px -22px color-mix(in oklab, var(--ink) 40%, transparent);
}
.doc-replica-page {
  background: #FFF;
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
}
.doc-replica-page img {
  display: block;
  width: 100%;
  height: auto;
}
.doc-replica-video {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.doc-replica-video video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #4F5450;
  border-radius: 6px;
  border: 1px solid var(--rule-2);
  display: block;
}
.doc-replica-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.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-open {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.doc-embed-open:hover { color: var(--ink); }
.doc-embed-frame {
  position: relative;
  width: 100%;
  height: clamp(520px, 78vh, 820px);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 40px -22px color-mix(in oklab, var(--ink) 40%, transparent);
}
.doc-embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ── 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;
  aspect-ratio: 16 / 10;
  padding: 16px;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.how-visual svg { width: 100%; height: 100%; 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 {
  max-width: 60ch;
  margin-bottom: var(--space-7);
}
.why-head .h-section {
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 1.05;
}
.why {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.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: 18ch;
}
.why-card p { color: var(--ink-2); font-size: 15.5px; margin: 0; max-width: 34ch; }

/* ── Journal ticker ─────────────────────────────────────────────────────── */
/* Slim marquee strip featuring the latest journal post. Hidden until app.js
   fills it from Sanity; 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(#blog-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 30s 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%); } }

.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-foot {
  border-top: 1px solid var(--rule);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  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; }

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

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  :root { --gutter: 22px; --section-py: 72px; }
  .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 { padding: var(--space-4) var(--space-4) var(--space-5); }
  .doc-replica-head { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .doc-replica-stage { grid-template-columns: 1fr; padding: var(--space-3); gap: var(--space-3); }
  .doc-embed { padding: var(--space-4) var(--space-4) var(--space-5); }
  .doc-embed-frame { height: clamp(440px, 70vh, 640px); }
  .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; }
  .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; }
}
