/* =============================================================================
   shell.css — shared shell chrome for the Sigildream tech wiki.
   Canonicalized union of every SHELL-classified rule that previously lived in
   the inline <style> blocks of the 21 tech pages (see _shell/css-classification.json
   and /tmp/tech-wf/shell/canonical-shell-spec.md for the audit trail).

   LOAD ORDER CONTRACT: this sheet is linked AFTER styles.css and animations.css
   (see _shell/master.html). styles.css stays the base; every rule here only
   ADDS the canonicalized chrome that used to be duplicated inline. Where a
   selector ties with styles.css on specificity (.top-actions a vs
   .lang-switch a, both 0,1,1), source order makes this sheet win — that is
   intentional and required for the switcher chips.

   NOT included (classified DUPLICATE, deleted at source, already in shared files):
   - services.html block 0: .hero{position:relative;overflow:hidden}   == animations.css §9.5
   - services.html block 0: .hero>*{position:relative;z-index:1}       superset of animations.css §9.5 hero-children rule
   - services.html block 0: .ch-hero-anim / .ch-hero-anim-svg base     superseded by animations.css §9.5
     (page said opacity:0.86 / min-height:340px; animations.css fixed value is
      contain:strict + svg opacity:0.32 — the 2026-07-09 legibility fix wins)
============================================================================= */

/* ---------------------------------------------------------------------------
   0. HOME-HEADER PARITY — 2026-07-10.
   The top-level site (sigildream/styles.css ~L280-380, .brandmark/.main-nav)
   uses a minimal premium language: mono-font uppercase links, no boxes, a
   thin animated underline on hover/current. The tech wiki topbar (below,
   .brand/.top-actions from tech/styles.css) still used the OLD boxed-button
   chrome (bordered pill buttons). This section overrides tech/styles.css's
   .brand and .top-actions rules — on purpose, in shell.css rather than
   editing styles.css, so the base stylesheet stays untouched for any other
   consumer and the override surface stays auditable in one place.
   Tech keeps its OWN --accent (gold e6c66d) rather than home's blue — only
   the INTERACTION LANGUAGE (typography, spacing, underline-on-hover/current,
   no boxes) is unified, not the color palette (intentionally different
   per top-level marketing site vs. technical wiki).
--------------------------------------------------------------------------- */

:root {
  /* tech/styles.css never defined mono/display font tokens (unlike the home
     styles.css); master.html already loads JetBrains Mono, so declare the
     token here instead of duplicating the raw stack at every selector. */
  --tech-mono-font: "JetBrains Mono", "SF Mono", "Menlo", monospace;
}

.topbar .brand {
  gap: 12px;
  text-transform: uppercase;
}

.brand img {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 14px rgba(230, 198, 109, 0.30));
  animation: techLogoBreath 6s ease-in-out infinite;
}

@keyframes techLogoBreath {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(230, 198, 109, 0.22)); }
  50%      { filter: drop-shadow(0 0 22px rgba(230, 198, 109, 0.55)); }
}

.brand span {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand strong {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
}

.brand small {
  font-family: var(--tech-mono-font);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--soft);
  margin-top: 2px;
}

/* Nav links ("← Sigildream" / overview / "Play Sigilwake →"): strip the
   boxed-button chrome from tech/styles.css .top-actions a, replace with the
   home .main-nav language — mono, uppercase, muted->text on hover, animated
   1px accent underline. is-current keeps the underline permanently shown. */
.top-actions {
  gap: 28px;
}

.top-actions a {
  position: relative;
  min-height: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0 0 4px;
  color: var(--muted);
  font-family: var(--tech-mono-font);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 240ms ease;
}

.top-actions a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 280ms ease, left 280ms ease;
}

.top-actions a:hover,
.top-actions a.is-current {
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

.top-actions a:hover::after,
.top-actions a.is-current::after {
  width: 100%;
  left: 0;
}

/* ---------------------------------------------------------------------------
   1. Language switcher — canonical, replaces 4 divergent per-page variants.
   Styles BOTH markup dialects in the wild:
     <span class="lang-switch" role="group"><a>EN</a>…      (canonical, generated)
     <span class="lang-switch"><a class="lang-chip">EN</a>… (legacy neural-ai / it/ai-architecture)
   Also fixes combat-server (x3 langs), whose .lang-switch markup currently
   ships with NO styling at all. None of lang-switch/lang-chip exists in
   styles.css, so these are pure additions.

   2026-07-10 UPDATE: restyled from filled pill chips to the same minimal
   mono text-link language as .top-actions above (home-header parity task),
   separated by a thin border-left divider instead of a filled box. Current
   language shows in --accent with the underline, no more solid gold pill.
--------------------------------------------------------------------------- */
.lang-switch {
  display: inline-flex;
  align-items: baseline;
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.lang-switch a,
.lang-chip {
  display: inline-flex;
  align-items: baseline;
  position: relative;
  min-height: auto;
  padding: 0 10px 4px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--tech-mono-font);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  /* CJK fallback so "中文" sits on the same baseline/weight as the mono
     Latin labels instead of dropping to the browser's serif default. */
  font-feature-settings: normal;
}

.lang-switch a:first-child,
.lang-chip:first-child {
  padding-left: 0;
}

.lang-switch a:not(:first-child),
.lang-chip:not(:first-child) {
  border-left: 1px solid var(--line);
}

.lang-switch a::after,
.lang-chip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 280ms ease, left 280ms ease;
}

.lang-switch a:hover,
.lang-chip:hover {
  color: var(--text);
}

.lang-switch a:hover::after,
.lang-chip:hover::after {
  width: calc(100% - 10px);
  left: 5px;
}

.lang-switch a.is-current,
.lang-chip.is-current {
  color: var(--accent);
  background: transparent;
  border-color: var(--line);
}

.lang-switch a.is-current::after,
.lang-chip.is-current::after {
  width: calc(100% - 10px);
  left: 5px;
}

/* ---------------------------------------------------------------------------
   2. Hero figure spacing — from matchmaking block 0 (".hero > figure").
   Normalizes the gap between the hero meta strip and an embedded animation
   figure; part of the page-to-page hero spacing drift. Not in styles.css.
--------------------------------------------------------------------------- */
.hero > figure { margin-top: 32px; }

/* ---------------------------------------------------------------------------
   3. Topbar small-viewport behaviour — from matchmaking block 0.
   (styles.css already stacks .topbar at 640px; this adds the 720px chip
   wrap + row gap that only matchmaking carried. row-gap is additive to the
   styles.css .top-actions gap:8px shorthand at ≤720px.)
--------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .lang-switch { margin-left: 0; }
  .top-actions { row-gap: 8px; }
}

/* ---------------------------------------------------------------------------
   4. .callout.security — violet callout variant, from matchmaking block 0.
   Promoted to shared because ai-architecture (en/it/zh) uses
   class="callout security" in markup with NO local definition — it currently
   renders as the default gold callout. Completes the styles.css callout
   family (.callout / .cyan / .red). Pure addition (styles.css has no
   .security modifier).
--------------------------------------------------------------------------- */
.callout.security {
  border-color: var(--violet);
  background: rgba(200, 166, 239, 0.09);
  color: #ecdefb;
}
.callout.security .eyebrow { color: var(--violet); margin-bottom: 4px; }

/* ---------------------------------------------------------------------------
   5. .src — source-citation line, from neural-ai block 0.
   Promoted to shared because services (en/it/zh) uses class="src" in markup
   with NO local definition. (The .security-callout .src display:block
   override stays page-local in neural-ai.) Pure addition.
--------------------------------------------------------------------------- */
.src {
  display: inline-block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--soft);          /* was hardcoded #868074 == var(--soft) */
  letter-spacing: 0.3px;
}
.src code { background: transparent; color: #a09a8b; padding: 0; }

/* ---------------------------------------------------------------------------
   6. .table-scroll — alias of styles.css .table-wrap, from matchmaking
   block 0. Near-DUPLICATE (identical overflow/border/radius/bg/margin;
   only adds -webkit-overflow-scrolling and a 720px table min-width).
   Carried here as an alias so matchmaking markup keeps working after its
   inline block is stripped; long-term fix is to rename the markup to
   .table-wrap and delete this.
--------------------------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 9, 8, 0.68);
  margin-top: 18px;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table { min-width: 720px; } /* CONFLICT[min-width]: styles.css table=760px, matchmaking=720px; kept at 720px scoped to the alias so the narrower matchmaking tables don't gain a scrollbar */

/* ---------------------------------------------------------------------------
   7. Mobile master-detail navigation — 2026-07-11 (CEO request).
   Everything below is gated behind the SAME `max-width: 1080px` breakpoint
   styles.css already uses to stack `.side-nav` (see styles.css ~L593), AND
   behind `html.js-nav` (set by app.js as a progressive-enhancement flag —
   see app.js "Mobile master-detail navigation"). Without that class (no JS),
   styles.css's existing static stacked side-nav is the only thing that ever
   renders — that is the no-JS fallback, untouched.

   With JS active, under 1080px:
     - `.chapter-bar` (injected once by app.js, right after `.topbar`) shows
       instead: current page label (left) + a chapters toggle (right).
     - the aside.side-nav DOM node itself (never cloned) becomes a fixed
       slide-in drawer, toggled by `.nav-open` on <html>.
     - `.nav-backdrop` (injected once by app.js) dims the page behind it.

   Reduced motion: every transition below collapses to instant automatically
   via the sitewide reduced-motion contract already in animations.css §10
   (`prefers-reduced-motion: reduce` + the manual `html[data-motion="off"]`
   toggle both force `transition-duration: 0.001ms !important` on `*`) — no
   duplicate media query needed here.

   Desktop (>1080px): every selector below is scoped inside the 1080px media
   query, so nothing here ever paints on a desktop viewport.
--------------------------------------------------------------------------- */
.chapter-bar { display: none; }

@media (max-width: 1080px) {
  html.js-nav .chapter-bar {
    position: sticky;
    top: var(--topbar-h, 76px);
    z-index: 19;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 50px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 9, 8, 0.92);
    backdrop-filter: blur(16px);
  }

  html.js-nav .chapter-bar-current {
    overflow: hidden;
    color: var(--text);
    font-family: var(--tech-mono-font);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.js-nav .chapter-bar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    cursor: pointer;
  }

  html.js-nav .chapter-bar-toggle:hover,
  html.js-nav .chapter-bar-toggle[aria-expanded="true"] {
    border-color: rgba(230, 198, 109, 0.5);
    color: var(--text);
  }

  html.js-nav .chapter-bar-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 13px;
    flex: 0 0 auto;
  }

  html.js-nav .chapter-bar-burger i {
    display: block;
    height: 1.5px;
    background: currentColor;
    border-radius: 1px;
  }

  /* The inline static list becomes the drawer instead of a stacked block. */
  html.js-nav .side-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 82vw;
    max-width: 340px;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 28px 22px 32px;
    z-index: 200;
    display: block;
    overflow-y: auto;
    background: rgba(9, 10, 9, 0.97);
    backdrop-filter: blur(22px);
    border-right: 1px solid var(--line);
    border-radius: 0;
    box-shadow: 40px 0 80px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 260ms ease, visibility 0s linear 260ms;
  }

  html.nav-open .side-nav {
    transform: translateX(0);
    visibility: visible;
    transition: transform 260ms ease, visibility 0s linear 0s;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(3, 4, 3, 0.78);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 0s linear 220ms;
  }

  html.nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 220ms ease, visibility 0s linear 0s;
  }

  html.nav-open body {
    overflow: hidden;
  }
}

/* ---------------------------------------------------------------------------
   8. Image zoom modal (lightbox) — 2026-07-11 (CEO request).
   Any <main> content image with a rendered width >=160px is flagged
   `.img-zoomable` by app.js ("Image zoom modal (lightbox)"); the modal itself
   is a single element injected once and reused across every image on the
   page. Applies at ALL viewport widths (not gated to mobile — the split-grid
   desktop layout benefits from it too). Reduced motion collapses the fade
   the same way as section 7 above (animations.css §10), no duplicate rule
   needed here either.
--------------------------------------------------------------------------- */
main img.img-zoomable {
  cursor: zoom-in;
}

.img-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background: rgba(3, 3, 3, 0.92);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 0s linear 200ms;
}

.img-modal[hidden] { display: none; }

.img-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms ease, visibility 0s linear 0s;
}

.img-modal:focus { outline: none; }

.img-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 94vw;
  max-height: 92vh;
  overflow-y: auto;
  margin: 0;
}

.img-modal-img {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 640px);
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 8px;
  cursor: zoom-out;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.img-modal-caption {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.img-modal-caption:empty { display: none; }
.img-modal-caption b { color: var(--text); font-weight: 700; }
.img-modal-caption code {
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.4);
  color: #dfeeff;
  font-size: 12px;
}

.img-modal-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 501;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  cursor: zoom-out;
}

.img-modal-close:hover {
  border-color: rgba(230, 198, 109, 0.55);
  background: rgba(230, 198, 109, 0.12);
}

@media (max-width: 640px) {
  .img-modal { padding: 24px 18px; }
  .img-modal-close { top: 12px; right: 12px; }
}

/* ---------------------------------------------------------------------------
   9. Side-nav sub-chapters — 2026-07-11 (CEO spec).
   build.py's render_sidenav() emits <ol class="side-nav-sub"> ONLY right
   after the CURRENT page's <a> entry (every other page entry stays the
   compact single-line style from styles.css .side-nav a, untouched). Since
   each page is a separate static build, this is naturally "subs only under
   the page you're on" — no JS needed to hide/show other pages' sublists,
   because they were never rendered in the first place.

   Indented + smaller + muted, with its own thin left rule that echoes the
   parent's accent-bar language (styles.css .side-nav a border-left, 2px).
   `.is-active` (set by the scrollspy IntersectionObserver in app.js) takes
   the gold accent, exactly one at a time.

   Same DOM node renders in both the desktop fixed sidebar and the mobile
   drawer (section 7 above reuses aside.side-nav verbatim) — no separate
   drawer-only styling required, this inherits into both for free.
--------------------------------------------------------------------------- */
.side-nav-sub {
  display: grid;
  gap: 1px;
  margin: 2px 0 10px 10px;
  padding: 3px 0 3px 12px;
  border-left: 2px solid var(--line);
  list-style: none;
}

.side-nav-sub li { margin: 0; }

.side-nav-sub a {
  display: block;
  padding: 5px 8px;
  border-radius: var(--radius);
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.side-nav-sub a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.side-nav-sub a.is-active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(230, 198, 109, 0.10);
}

/* ---------------------------------------------------------------------------
   10. Desktop sidebar scroll — 2026-07-11 (CEO). With every chapter published
   plus nested sub-chapters, the fixed side-nav grows taller than the
   viewport and its tail became unreachable (no overflow on the fixed box).
   Pin the bottom edge and let it scroll on its own, with a whisper-thin
   scrollbar. Scoped to desktop: on <=1080px the js-nav drawer (section 7)
   owns its own scrolling.
--------------------------------------------------------------------------- */
@media (min-width: 1081px) {
  .side-nav {
    bottom: 24px;
    overflow-y: auto;
    /* Pack entries at the top: the fixed top/bottom pinning makes .side-nav
       a full-height grid, and grid align-content defaults to stretch — with
       only a couple of published pages that spread them into huge gaps.
       'start' packs them tight; scroll still kicks in when there are many. */
    align-content: start;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
    padding-right: 6px;
  }
  .side-nav::-webkit-scrollbar { width: 5px; }
  .side-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 3px;
  }
  .side-nav::-webkit-scrollbar-track { background: transparent; }
}

/* ---------------------------------------------------------------------------
   11. Product glimpse — overview gallery (2026-07-11, CEO). Four real
   product shots on the landing: desktop arena (wide, spans both rows),
   mobile match (tall), character sheet + unlock card stacked. Fixed row
   height + object-fit cover keeps the mixed aspect ratios composed; the
   shared lightbox picks the images up automatically (>=160px in <main>).
--------------------------------------------------------------------------- */
.product-glimpse {
  display: grid;
  grid-template-columns: 1.55fr 0.85fr 1fr;
  grid-auto-rows: 285px;
  gap: 14px;
  margin-top: 8px;
}

.product-glimpse figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.product-glimpse .pg-wide { grid-row: span 2; }
.product-glimpse .pg-tall { grid-row: span 2; }

.product-glimpse img {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: cover;
  object-position: center top;
}

.product-glimpse figcaption {
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 1080px) {
  .product-glimpse { grid-template-columns: 1fr 1fr; grid-auto-rows: 250px; }
  .product-glimpse .pg-wide { grid-column: span 2; grid-row: span 1; }
  .product-glimpse .pg-tall { grid-row: span 2; }
}

@media (max-width: 640px) {
  .product-glimpse { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .product-glimpse .pg-wide,
  .product-glimpse .pg-tall { grid-column: auto; grid-row: auto; }
  .product-glimpse img { height: auto; object-fit: contain; background: #000; }
}

/* ---------------------------------------------------------------------------
   12. Background-music toggle — 2026-07-11 (CEO). Sits in the topbar where the
   removed back/overview links were; mirrors the home site's nav-sound button.
   Default = OFF icon shown; html.is-playing swaps to the ON (speaker-waves)
   icon. Same minimal language as the language chips.
--------------------------------------------------------------------------- */
.tech-audio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  margin-right: 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 200ms ease, transform 240ms var(--ease-out, ease);
}
.tech-audio svg { width: 18px; height: 18px; }
.tech-audio:hover { color: var(--text); transform: scale(1.06); }
.tech-audio .tech-audio-on { display: none; }
html.is-playing .tech-audio { color: var(--accent); }
html.is-playing .tech-audio .tech-audio-on  { display: inline-block; }
html.is-playing .tech-audio .tech-audio-off { display: none; }

/* ---------------------------------------------------------------------------
   13. Now-playing song title — 2026-07-11 (CEO). Sits to the LEFT of the
   speaker toggle; the speaker is pulled tight to the language chips. Each
   page is a new Sigilwake "waiting" song, so the title slide-fades in once
   on load (= on every page/song change). Goes gold while music plays.
--------------------------------------------------------------------------- */
.tech-song {
  display: inline-flex;
  align-items: center;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--tech-mono-font);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  /* reveal the width + slide the inner text in, once, on load */
  animation: tech-song-reveal 620ms var(--ease-out, cubic-bezier(.22,1,.36,1)) 260ms both;
}
.tech-song::before {
  content: "\266A";               /* ♪ */
  margin-right: 7px;
  color: var(--accent);
  font-size: 11px;
  opacity: 0.85;
}
.tech-song-inner {
  display: inline-block;
  animation: tech-song-slide 620ms var(--ease-out, cubic-bezier(.22,1,.36,1)) 260ms both;
}
@keyframes tech-song-reveal {
  from { max-width: 0;     opacity: 0; }
  to   { max-width: 42ch;  opacity: 1; }
}
@keyframes tech-song-slide {
  from { transform: translateX(14px); }
  to   { transform: translateX(0); }
}
html.is-playing .tech-song { color: var(--accent); }

/* Pull the speaker toggle tight to the language chips (CEO: "avvicinarsi a
   en it"). Was margin-right:6px; now it sits right beside the switcher. */
.tech-audio { margin-right: 12px; }

@media (max-width: 720px) {
  /* Topbar is tight on phones — the chips + speaker stay, the title yields. */
  .tech-song { display: none; }
}

/* Reduced motion: no slide/reveal, just show it. */
@media (prefers-reduced-motion: reduce) {
  .tech-song { animation: none; max-width: 42ch; }
  .tech-song-inner { animation: none; transform: none; }
}
:root[data-motion="off"] .tech-song { animation: none; max-width: 42ch; }
:root[data-motion="off"] .tech-song-inner { animation: none; transform: none; }

/* ---------------------------------------------------------------------------
   14. Read-next CTA — 2026-07-11 (CEO). A prominent card at the end of a page
   linking to the next doc, so a reader continues without opening the sidebar.
--------------------------------------------------------------------------- */
.read-next { border-top: 1px solid var(--line); padding-top: 30px; }
.read-next-card {
  display: block;
  max-width: 640px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(230,198,109,0.06), transparent 60%),
    rgba(255,255,255,0.02);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}
.read-next-card:hover {
  border-color: rgba(230,198,109,0.55);
  transform: translateY(-2px);
  background:
    linear-gradient(135deg, rgba(230,198,109,0.10), transparent 60%),
    rgba(255,255,255,0.03);
}
.read-next-kicker {
  display: block;
  font-family: var(--tech-mono-font);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.read-next-title {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.read-next-title .arrow { color: var(--accent); transition: transform 160ms ease; display: inline-block; }
.read-next-card:hover .read-next-title .arrow { transform: translateX(4px); }
.read-next-blurb { display: block; color: var(--muted); font-size: 14px; line-height: 1.55; }

/* ---------------------------------------------------------------------------
   15. Mobile drawer from the RIGHT — 2026-07-11 (CEO). The chapters button
   sits on the right of the chapter bar; the drawer now slides in from the
   right to match (was left), so the panel opens on the same side as the tap.
--------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  html.js-nav .side-nav {
    left: auto;
    right: 0;
    transform: translateX(102%);
    border-right: none;
    border-left: 1px solid var(--line);
  }
  html.nav-open .side-nav { transform: translateX(0); }
}

/* ---------------------------------------------------------------------------
   16. Overview hero compact — 2026-07-11 (CEO). The shared .hero reserves a
   near-full viewport and centers its content; on the overview, where 'The
   product' follows immediately, that left a big empty gap. Compact the
   overview hero to its content height and top-align it.
--------------------------------------------------------------------------- */
.hero-compact {
  min-height: auto;
  align-content: start;
  padding: 8px 0 24px;
}
.hero-lead-dim { color: var(--muted); }
