/* ============================================================
   HotVisa Heritage — Design System CSS
   This file is the canonical reference. The migration/
   SCSS files mirror these rules with $variable substitution.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* ===== TOKENS =================================================== */
:root {
  /* Color */
  --bg:       #e8ebe9;
  --bg-elev:  #eff2f0;
  --bg-deep:  #dce0dd;
  --ink:      #15211f;
  --ink-2:    #3f4d4a;
  --ink-3:    #6f7e7a;
  --accent:   #0e6b62;
  --accent-2: #c2954a;
  --accent-3: #0c2522;
  --line:     rgba(18, 40, 36, 0.10);
  --ok:       #1f8a6d;
  --warn:     #b5881f;

  /* Type */
  --font-sans:  "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono:  "Geist Mono", ui-monospace, Menlo, monospace;
  --font-serif: "Geist", serif;

  /* Space (4-pt base) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px;  --s-4: 16px;  --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px;  --s-9: 96px;  --s-10: 128px;

  /* Radius */
  --r-sm: 8px;  --r-md: 14px;  --r-lg: 22px;  --r-xl: 28px;  --r-pill: 999px;

  /* Shadow depth + intensity multipliers (for global tweaks) */
  --neu-depth: 1;
  --neu-radius: 1;

  /* Shadow recipes */
  --shadow-out:
    calc(-7px * var(--neu-depth)) calc(-7px * var(--neu-depth)) calc(18px * var(--neu-depth)) rgba(255,255,255,0.92),
    calc(8px  * var(--neu-depth)) calc(8px  * var(--neu-depth)) calc(20px * var(--neu-depth)) rgba(120,140,134,0.38);
  --shadow-in:
    inset calc(3px * var(--neu-depth)) calc(3px * var(--neu-depth)) calc(7px * var(--neu-depth)) rgba(120,140,134,0.45),
    inset calc(-3px * var(--neu-depth)) calc(-3px * var(--neu-depth)) calc(7px * var(--neu-depth)) rgba(255,255,255,0.88);
  --shadow-drop:
    0 24px 60px rgba(10, 35, 32, 0.20),
    0 4px 12px rgba(10, 35, 32, 0.10);

  /* Motion */
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 400ms;
  --easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE ===================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.serif-it { font-family: var(--font-serif); font-style: italic; font-weight: 300; }
.mono { font-family: var(--font-mono); }
.hv-tnum { font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums; }

@keyframes hv-pulse { 0%,100% { opacity: 0.35; transform: scale(1); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes hv-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ===== ATOMS ==================================================== */

/* Eyebrow */
.ds-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.ds-eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--lineColor, var(--ink-3));
}

/* Buttons */
.ds-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--t-base) var(--easing),
              background var(--t-base) var(--easing),
              color var(--t-base) var(--easing);
}
.ds-btn:hover { transform: translateY(-1px); }
.ds-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ds-btn-primary { background: var(--accent); color: #fff; }
.ds-btn-primary:hover { background: color-mix(in oklab, var(--accent) 90%, black); }
.ds-btn-dark { background: var(--ink); color: var(--bg); }
.ds-btn-dark:hover { background: var(--accent-3); }
.ds-btn-soft { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-out); }
.ds-btn-soft:hover { box-shadow: var(--shadow-in); transform: none; }
.ds-btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.ds-btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.ds-btn-link {
  background: transparent;
  color: var(--accent);
  padding-left: 0;
  padding-right: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.ds-btn-sm { padding: 8px 14px; font-size: 12.5px; }
.ds-btn-md { padding: 12px 20px; font-size: 13.5px; }
.ds-btn-lg { padding: 16px 28px; font-size: 15px; }

/* Pills */
.ds-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: var(--bg);
}
.ds-pill-inset { box-shadow: var(--shadow-in); }
.ds-pill:not(.ds-pill-inset) { box-shadow: var(--shadow-out); }

/* Stamp seal — circular embossed stamp */
.ds-stamp-seal {
  width: 130px; height: 130px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.92;
  position: relative;
}
.ds-stamp-seal .big {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
  text-transform: none;
}
.ds-stamp-seal::before,
.ds-stamp-seal::after {
  content: "";
  position: absolute;
  left: 50%; transform: translateX(-50%);
  width: 70%; height: 1px;
  background: currentColor;
  opacity: 0.4;
}
.ds-stamp-seal::before { top: 28%; }
.ds-stamp-seal::after  { bottom: 28%; }

/* Placeholder (used in mockups where real imagery will go) */
.ds-placeholder {
  position: relative;
  background:
    repeating-linear-gradient(45deg,
      rgba(18,40,36,0.05) 0 1px, transparent 1px 9px);
  background-color: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
}

/* ===== CARDS ==================================================== */

/* Passport card (3D, hero centerpiece) */
.ds-passport {
  border-radius: 28px;
  background: linear-gradient(155deg, #0b2723 0%, #184f47 55%, #0d2e29 100%);
  box-shadow: var(--shadow-drop),
    inset 0 1px 0 rgba(194,149,74,0.20),
    inset 0 0 0 1px rgba(194,149,74,0.10);
  color: #e8ece9;
  padding: 36px 30px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}
.ds-passport::before {
  content: ""; position: absolute; inset: 14px;
  border-radius: 18px;
  border: 1px solid rgba(232,236,233,0.15);
  pointer-events: none;
}
.ds-passport .crest {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1.5px solid rgba(232,236,233,0.4);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px; letter-spacing: -0.04em;
}
.ds-passport .stars {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: rgba(232,236,233,0.55);
}
.ds-passport h3 {
  font-family: var(--font-serif);
  font-style: italic; font-weight: 300;
  font-size: 30px;
  letter-spacing: -0.025em;
  margin: 0;
  color: rgba(232,236,233,0.95);
}
.ds-passport .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(232,236,233,0.55);
  margin-top: 14px;
}
.ds-passport .v {
  font-size: 14px;
  font-family: var(--font-mono);
  margin-top: 4px;
}
.ds-passport .v.big { font-size: 18px; font-family: var(--font-sans); font-weight: 500; }
.ds-passport .mrz {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  line-height: 1.6;
  color: rgba(232,236,233,0.7);
  border-top: 1px solid rgba(232,236,233,0.15);
  padding-top: 14px;
}

/* Country card */
.ds-country {
  background: var(--bg-elev);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-out);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t-base) var(--easing);
  height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.ds-country:hover { transform: translateY(-3px); }
.ds-country .emboss {
  position: absolute;
  top: -28px; right: -28px;
  width: 180px; height: 180px;
  border-radius: 50%;
  box-shadow: var(--shadow-in);
  background: var(--bg-elev);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 56px;
  letter-spacing: -0.04em;
  transform: rotate(-8deg);
  opacity: 0.85;
}
.ds-country .name {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  position: relative;
}
.ds-country .sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 8px;
  position: relative;
}
.ds-country .foot {
  display: flex;
  justify-content: space-between;
  align-items: end;
  position: relative;
}
.ds-country .time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
}
.ds-country .go {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-elev);
  box-shadow: var(--shadow-out);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* Feature card */
.ds-feat {
  background: var(--bg-elev);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-out);
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 22px;
  align-items: start;
}
.ds-feat .icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  box-shadow: var(--shadow-in);
  background: var(--bg-elev);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.ds-feat h3 {
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0 0 10px;
}
.ds-feat p {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

/* Step row */
.ds-step {
  background: var(--bg-elev);
  border-radius: var(--r-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow-out);
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 32px;
  align-items: center;
}
.ds-step .n {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 64px;
  color: var(--accent);
  letter-spacing: -0.04em;
  line-height: 1;
}
.ds-step h3 {
  font-size: 26px;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 6px;
}
.ds-step p {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  max-width: 56ch;
}
.ds-step .dur {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-in);
}

/* Stat card */
.ds-stat {
  background: var(--bg-elev);
  border-radius: var(--r-md);
  padding: 22px;
  box-shadow: var(--shadow-out);
}
.ds-stat .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.ds-stat .v {
  font-size: 42px;
  font-weight: 500;
  letter-spacing: -0.04em;
  margin-top: 8px;
  line-height: 1;
}
.ds-stat .v .unit {
  font-size: 24px;
  color: var(--ink-3);
  margin-left: 4px;
}
.ds-stat .cap {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 8px;
  line-height: 1.45;
}

/* FAQ row */
.ds-faq {
  background: var(--bg-elev);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-out);
  padding: 26px 32px;
  cursor: pointer;
}
.ds-faq + .ds-faq { margin-top: 14px; }
.ds-faq .q {
  font-size: 20px;
  letter-spacing: -0.02em;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.ds-faq .a {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
  margin-top: 16px;
  max-width: 80ch;
}
.ds-faq .plus {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-elev);
  box-shadow: var(--shadow-in);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  flex-shrink: 0;
}

/* ===== FORMS ==================================================== */
.ds-field { display: flex; flex-direction: column; gap: 8px; }
.ds-field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.ds-field .input-wrap {
  position: relative;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-in);
  background: var(--bg);
  transition: box-shadow var(--t-base) var(--easing);
}
.ds-field .input-wrap:focus-within {
  box-shadow: var(--shadow-in),
              inset 0 0 0 1.5px var(--accent);
}
.ds-field input,
.ds-field select,
.ds-field textarea {
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  outline: none;
}
.ds-field input::placeholder { color: var(--ink-3); }
.ds-field select { appearance: none; padding-right: 44px; }
.ds-field .chev {
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%) rotate(90deg);
  color: var(--ink-3);
  pointer-events: none;
}
.ds-field .hint {
  font-size: 12px;
  color: var(--ink-3);
}
.ds-field .err {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #c0322a;
  letter-spacing: 0.04em;
}
.ds-field.has-error .input-wrap {
  box-shadow: var(--shadow-in), inset 0 0 0 1.5px #c0322a;
}

/* ===== NAVIGATION ============================================== */
.ds-header {
  padding: 20px 28px;
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-out);
}
.ds-header .row {
  display: flex; align-items: center; gap: 32px;
}
.ds-header .nav {
  display: flex; gap: 24px; align-items: center;
}
.ds-header .nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  padding: 6px 0;
  transition: color var(--t-base) var(--easing);
}
.ds-header .nav a:hover { color: var(--accent); }
.ds-header .nav a.active { color: var(--ink); }
.ds-header .nav a.active::after {
  content: ""; position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.ds-header .right {
  margin-left: auto;
  display: flex; align-items: center; gap: 14px;
}

/* Footer */
.ds-footer {
  background: var(--bg-deep);
  border-radius: var(--r-lg);
  padding: 56px 48px 32px;
}
.ds-footer .grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.ds-footer p {
  color: var(--ink-2);
  margin: 16px 0 20px;
  font-size: 14px;
  max-width: 32ch;
  line-height: 1.5;
}
.ds-footer .socials { display: flex; gap: 8px; }
.ds-footer .soc {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow-out);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}
.ds-footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 18px;
  font-weight: 500;
}
.ds-footer ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 10px;
}
.ds-footer a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.ds-footer a:hover { color: var(--accent); }
.ds-footer .meta {
  display: flex;
  justify-content: space-between;
  color: var(--ink-3);
  font-size: 12px;
  font-family: var(--font-mono);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* ===== DOCUMENT SHELL =========================================== */
.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 56px 120px;
}
.cover {
  padding: 100px 0 60px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 80px;
}
.cover .ds-eyebrow { margin-bottom: 36px; }
.cover h1 {
  font-size: 116px;
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.92;
  margin: 0 0 24px;
  max-width: 14ch;
}
.cover h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}
.cover .lede {
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 36px;
}
.cover .meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  text-transform: uppercase;
}
.cover .meta strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  text-transform: none;
  letter-spacing: -0.01em;
  margin-top: 4px;
}

.chapter {
  padding: 80px 0;
  border-top: 1px solid var(--line);
}
.chapter:first-of-type { border-top: 0; }
.chapter-head {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 60px;
  margin-bottom: 56px;
  align-items: end;
}
.chapter-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  padding-top: 12px;
}
.chapter h2 {
  font-size: 64px;
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 500;
  margin: 0;
}
.chapter h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}
.chapter-blurb {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.55;
  max-width: 44ch;
}

.subsection {
  margin-bottom: 64px;
}
.subsection-head {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 60px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.subsection-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}
.subsection h3 {
  font-size: 28px;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0;
}
.subsection h3 small {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-left: 14px;
  text-transform: uppercase;
}

/* "Spec" panel — a soft, monospace-labelled exhibit container */
.spec {
  background: var(--bg-elev);
  border-radius: var(--r-lg);
  padding: 40px;
  box-shadow: var(--shadow-out);
  position: relative;
}
.spec-flat {
  background: var(--bg-deep);
  border-radius: var(--r-lg);
  padding: 40px;
}
.spec-label {
  position: absolute;
  top: 16px; left: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: var(--shadow-in);
}

/* Code block */
.code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--accent-3);
  color: #e8ece9;
  padding: 20px 24px;
  border-radius: var(--r-md);
  overflow-x: auto;
  white-space: pre;
}
.code .k { color: #cda85f; }
.code .v { color: #bfe0d8; }
.code .c { color: rgba(232,236,233,0.4); }

/* Sticky in-page nav */
.toc {
  position: fixed;
  top: 24px; right: 24px;
  width: 230px;
  background: var(--bg);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-out);
  padding: 18px 16px;
  z-index: 50;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.toc h5 {
  margin: 0 0 12px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.toc ol {
  list-style: none; padding: 0; margin: 0;
  counter-reset: toc;
  display: flex; flex-direction: column;
  gap: 4px;
}
.toc li {
  counter-increment: toc;
}
.toc a {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.toc a:hover { background: var(--bg-deep); }
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--ink-3);
  font-size: 10px;
  padding-top: 1px;
}

/* Mobile: collapse the fixed TOC sidebar into a small pill at top-left.
   Tap the heading to expand the full list as a dropdown panel. Toggling is
   wired up by the inline <script> at the bottom of index.html. */
@media (max-width: 1023px) {
  .toc {
    top: 16px;
    right: auto;
    left: 16px;
    width: auto;
    max-width: calc(100vw - 16px - 16px - 110px); /* leave room for the lang switcher */
    padding: 8px 14px;
    background: var(--bg-elev);
    cursor: pointer;
  }
  .toc h5 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    user-select: none;
  }
  .toc h5::after {
    content: "▾";
    font-size: 10px;
    opacity: 0.55;
    transition: transform .2s ease;
  }
  .toc ol {
    display: none;
    margin-top: 12px;
  }
  body.toc-open .toc h5::after { transform: rotate(180deg); }
  body.toc-open .toc ol { display: flex; }
}
