/* ═════════════════════════════════════════════════════════════════════
   Heaven 3D depth — shared site layer, version 2 (30 Nov 2026)
   /styles/heaven-depth-v2.css
   v2 = v1 unchanged + section 4 (night fixes, inside prefers-color-scheme:
   dark only — the light theme renders pixel-identical to v1).

   THE single source of the depth language for new pages. Same light, same
   materials as /pro (app lib/pro/pro_depth.dart). The original inline blocks
   stay where they are (live, stable) and were extracted from:
     · professionals.html — "Heaven 3D depth" block (commit c35ffbe3)
     · index.html         — <style id="dp-97-pro-depth">   (a087f13c / a4c8e74d)
     · luna.html          — <style id="hh-luna-pro-depth"> (a087f13c / a4c8e74d)

   One light, high on the top-left:
     page (lit sky) < panels (frosted slabs) < pills, orbs, buttons (lit bodies)
     fields and the chosen chip sink IN; buttons press IN when used.
   Pastel/gold are FILLS only; text keeps its ink (every pair ≥ 4.5:1, large
   display text ≥ 3:1). Reduced motion respected. Light + dark themes.

   CHANGING THE DESIGN: Cloudflare caches fixed names for ~4 h, so never edit
   this file in place once it is live — copy it to heaven-depth-v3.css, change
   that, and update the <link> on every page (grep heaven-depth-v2).

   HOW TO USE
   1. Tokens (--hd-*) + utility classes are always available once linked:
        .hd-slab  .hd-slab-gold  .hd-float  .hd-pill  .hd-pill-gold
        .hd-pill-muted  .hd-orb  .hd-orb-gold  .hd-btn-gold  .hd-btn-ghost
        .hd-well  .hd-sky
   2. <body class="hd-depth"> also skins the shared seo-page.css /
      journey-pages.css components inside <main> (cards, tiles, steps,
      callouts, FAQ, tables, CTAs, page links, badges) and gives every
      control a visible focus ring. It never touches content outside <main>
      except the top bar's brand mark + CTA pill, so the shop and footer keep
      their own styles.
   3. Add class "hd-light" next to "hd-depth" on pages that are light-only
      (their own inline :root forces a light palette), and "hd-hub" on the
      research hubs (/research /protocols /compounds /blog) for section 3.
   ═════════════════════════════════════════════════════════════════════ */

:root {
  --hd-dusk: 46,78,126;                       /* the shade colour, rgb */
  --hd-gold: #B68A2E;
  --hd-gold-mid: #E9C46A;
  --hd-gold-light: #FFE8A8;
  --hd-gold-deep: #8C6A22;                    /* on white 5.0:1 */
  --hd-gold-ink: #6B4E14;                     /* on #FBEFCB 7.4:1 */
  --hd-gold-rim: rgba(233,196,106,.62);

  /* Frosted slab: sheen band on top, shaded foot, frost body. */
  --hd-frost-top: rgba(255,255,255,.988);
  --hd-frost-bottom: rgba(249,251,254,.94);
  --hd-sheen: linear-gradient(180deg, rgba(255,255,255,.70), rgba(255,255,255,0)) top / 100% 18px no-repeat;
  --hd-foot: linear-gradient(180deg, rgba(220,230,243,0), rgba(220,230,243,.55)) bottom / 100% 16px no-repeat;
  --hd-slab: var(--hd-sheen), var(--hd-foot), linear-gradient(180deg, var(--hd-frost-top), var(--hd-frost-bottom));
  --hd-slab-border: rgba(255,255,255,.95);
  --hd-slab-edge: inset 0 1.3px 0 #FFFFFF, inset 0 -1px 0 rgba(var(--hd-dusk),.08);

  /* Cast shadows: contact + key + wide ambient. */
  --hd-cast:
    0 1px 2px rgba(var(--hd-dusk),.10),
    0 6px 14px -4px rgba(var(--hd-dusk),.12),
    0 20px 42px -12px rgba(var(--hd-dusk),.17);
  --hd-cast-float:
    0 1px 2px rgba(var(--hd-dusk),.10),
    0 10px 22px -6px rgba(var(--hd-dusk),.14),
    0 26px 56px -12px rgba(var(--hd-dusk),.22);
  --hd-cast-gold: 0 8px 22px -8px rgba(233,196,106,.40);

  /* Small lit bodies (pills, badges, orbs). */
  --hd-lit-edge: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -1.5px 0 rgba(var(--hd-dusk),.07);
  --hd-lit-shadow: 0 1px 1.5px rgba(var(--hd-dusk),.14), 0 4px 10px -3px rgba(var(--hd-dusk),.16);
  --hd-lit-shadow-gold: 0 1px 1.5px rgba(182,138,46,.18), 0 4px 10px -3px rgba(182,138,46,.24);
  --hd-pill-bg: linear-gradient(180deg, #FFFFFF, #FBF7EC);
  --hd-pill-border: rgba(233,196,106,.75);
  --hd-pill-ink: #7A5C1D;                     /* on #FBF7EC 6.0:1 */
  --hd-muted-bg: linear-gradient(180deg, #FFFFFF, #EEF3FA);
  --hd-badge-gold-bg: linear-gradient(180deg, #FFF9E8, #FBEFCB);

  /* Orbs: a sphere lit from the top-left. */
  --hd-orb-gold: radial-gradient(circle at 34% 26%, #FFFFFF 0%, var(--hd-gold-light) 32%, var(--hd-gold-mid) 100%);
  --hd-orb-gold-cast: inset 0 -2px 4px rgba(140,106,34,.25), 0 1px 2px rgba(107,78,20,.25), 0 6px 12px -4px rgba(182,138,46,.5);
  --hd-orb-sky: radial-gradient(circle at 34% 26%, #FFFFFF 0%, #DCE9F8 38%, #A8C9EE 100%);

  /* Raised gold button + the press. */
  --hd-btn-gold-bg: linear-gradient(180deg, var(--hd-gold-light) 0%, #F3D98E 45%, var(--hd-gold-mid) 100%);
  --hd-btn-gold-cast:
    inset 0 1.5px 0 rgba(255,255,255,.85),
    inset 0 -2px 0 rgba(140,106,34,.22),
    0 0 18px -2px rgba(233,196,106,.45),
    0 1px 2px rgba(107,78,20,.22),
    0 8px 18px -6px rgba(182,138,46,.50);
  --hd-btn-ink-bg: linear-gradient(180deg, #2E3D60 0%, #1F2A44 100%);
  --hd-btn-ink-cast:
    inset 0 1px 0 rgba(255,255,255,.20),
    inset 0 -2px 0 rgba(0,0,0,.22),
    0 1px 2px rgba(var(--hd-dusk),.25),
    0 8px 18px -6px rgba(var(--hd-dusk),.45);
  --hd-press: inset 0 2px 5px rgba(var(--hd-dusk),.20), 0 1px 1px rgba(var(--hd-dusk),.12);
  --hd-press-gold: inset 0 2px 5px rgba(107,78,20,.28), inset 0 -1px 0 rgba(255,255,255,.6), 0 1px 1px rgba(var(--hd-dusk),.12);

  /* Sunk field (inputs, an outcome well). */
  --hd-well-bg: linear-gradient(180deg, #EBF1FA, #F8FBFE 60%);
  --hd-well-shadow: inset 0 2.5px 4px -1px rgba(var(--hd-dusk),.18), 0 1px 0 #FFFFFF;

  /* The lit sky: sun top-left, cooler lower right. */
  --hd-sky-base: #EEF3FA;
  --hd-sky:
    radial-gradient(ellipse 70% 55% at 6% -6%, rgba(255,255,255,1) 0%, rgba(255,248,228,.75) 22%, rgba(255,244,214,0) 60%),
    radial-gradient(ellipse 60% 45% at 18% 4%, rgba(255,232,168,.22), transparent 70%),
    radial-gradient(ellipse 80% 70% at 100% 105%, rgba(95,143,201,.22), transparent 70%),
    radial-gradient(ellipse 60% 50% at 70% 45%, rgba(168,201,238,.20), transparent 70%),
    linear-gradient(160deg, #FBFCFE 0%, #F2F6FB 42%, #E8EFF8 78%, #DFE8F4 100%);

  --hd-link: #7A5C1D;                      /* ≥ 5:1 on every part of the lit sky */
  --hd-focus: #8C6A22;
  --hd-ease: cubic-bezier(.22,.61,.36,1);
}

/* Dark theme: the same materials, lit from the same corner, at night.
   (Set on the body so the tokens inherit; the light-only pages opt out.) */
@media (prefers-color-scheme: dark) {
  body.hd-depth:not(.hd-light) {
    --hd-frost-top: rgba(26,40,72,.96);
    --hd-frost-bottom: rgba(16,28,54,.96);
    --hd-sheen: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,0)) top / 100% 18px no-repeat;
    --hd-foot: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.18)) bottom / 100% 16px no-repeat;
    --hd-slab: var(--hd-sheen), var(--hd-foot), linear-gradient(180deg, var(--hd-frost-top), var(--hd-frost-bottom));
    --hd-slab-border: rgba(168,201,238,.16);
    --hd-slab-edge: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.30);
    --hd-cast: 0 1px 2px rgba(0,0,0,.35), 0 8px 20px -6px rgba(0,0,0,.45);
    --hd-cast-float: 0 1px 2px rgba(0,0,0,.35), 0 14px 30px -8px rgba(0,0,0,.55);
    --hd-cast-gold: 0 8px 22px -10px rgba(233,196,106,.25);
    --hd-lit-edge: inset 0 1px 0 rgba(255,255,255,.10), inset 0 -1px 0 rgba(0,0,0,.25);
    --hd-lit-shadow: 0 1px 2px rgba(0,0,0,.35), 0 4px 10px -3px rgba(0,0,0,.40);
    --hd-lit-shadow-gold: var(--hd-lit-shadow);
    --hd-pill-bg: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
    --hd-pill-border: rgba(233,196,106,.45);
    --hd-pill-ink: #E9C46A;                   /* on #0E1A33 ≈ 10:1 */
    --hd-muted-bg: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
    --hd-badge-gold-bg: linear-gradient(180deg, rgba(233,196,106,.22), rgba(233,196,106,.12));
    --hd-gold-ink: #F3D98E;
    --hd-well-bg: linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.12) 60%);
    --hd-well-shadow: inset 0 2px 4px rgba(0,0,0,.40), 0 1px 0 rgba(255,255,255,.06);
    --hd-sky-base: #0B1020;
    --hd-sky:
      radial-gradient(ellipse 70% 55% at 6% -6%, rgba(168,201,238,.16), transparent 60%),
      radial-gradient(ellipse 60% 45% at 18% 4%, rgba(233,196,106,.07), transparent 70%),
      radial-gradient(ellipse 80% 70% at 100% 105%, rgba(95,143,201,.14), transparent 70%),
      linear-gradient(160deg, #0E1A33 0%, #0B1020 60%, #0A0F1E 100%);
    --hd-press: inset 0 2px 5px rgba(0,0,0,.45), 0 1px 0 rgba(255,255,255,.05);
    --hd-focus: #E9C46A;
    --hd-link: #E9C46A;                      /* on the night sky ≥ 8:1 */
  }
}

/* ═══ 1. Utility classes (opt-in, anywhere) ═══════════════════════════ */
.hd-sky { background-color: var(--hd-sky-base); background-image: var(--hd-sky); }
.hd-slab {
  background: var(--hd-slab);
  border: 1px solid var(--hd-slab-border);
  box-shadow: var(--hd-slab-edge), var(--hd-cast);
}
.hd-slab-gold {
  background: var(--hd-slab);
  border: 1px solid var(--hd-gold-rim);
  box-shadow: var(--hd-slab-edge), var(--hd-cast), var(--hd-cast-gold);
}
.hd-float { box-shadow: var(--hd-slab-edge), var(--hd-cast-float); }
.hd-pill, .hd-pill-gold, .hd-pill-muted { border-radius: 999px; box-shadow: var(--hd-lit-edge), var(--hd-lit-shadow); }
.hd-pill { background: var(--hd-pill-bg); border: 1px solid var(--hd-pill-border); color: var(--hd-pill-ink); box-shadow: var(--hd-lit-edge), var(--hd-lit-shadow-gold); }
.hd-pill-gold { background: var(--hd-badge-gold-bg); border: 1px solid rgba(233,196,106,.70); color: var(--hd-gold-ink); }
.hd-pill-muted { background: var(--hd-muted-bg); border: 1px solid var(--hd-slab-border); }
.hd-orb, .hd-orb-gold { border-radius: 50%; border: 1px solid rgba(255,255,255,.9); }
.hd-orb { background: var(--hd-orb-sky); box-shadow: inset 0 2px 3px rgba(255,255,255,.9), inset 0 -3px 6px rgba(var(--hd-dusk),.12), 0 1px 2px rgba(var(--hd-dusk),.16), 0 8px 16px -6px rgba(var(--hd-dusk),.30); }
.hd-orb-gold { background: var(--hd-orb-gold); color: #4A3608; box-shadow: var(--hd-orb-gold-cast); }
.hd-well { background: var(--hd-well-bg); box-shadow: var(--hd-well-shadow); }
.hd-btn-gold {
  color: #2A2110; background: var(--hd-btn-gold-bg);
  border: 1px solid rgba(255,255,255,.70); box-shadow: var(--hd-btn-gold-cast);
}
.hd-btn-ghost {
  color: var(--ink, #1F2A44); background: var(--hd-pill-bg);
  border: 1px solid var(--hd-pill-border);
  box-shadow: var(--hd-lit-edge), 0 1px 2px rgba(182,138,46,.18), 0 8px 18px -8px rgba(var(--hd-dusk),.28);
}
.hd-btn-gold:active { transform: translateY(1px); box-shadow: var(--hd-press-gold); }
.hd-btn-ghost:active { transform: translateY(1px); box-shadow: var(--hd-press); }

/* ═══ 2. The seo-page / journey-page skin (body.hd-depth) ══════════════ */

/* ── The lit sky ── */
body.hd-depth {
  background-color: var(--hd-sky-base);
  background-image: var(--hd-sky);
  background-attachment: fixed;
}
/* Phones: no fixed layer (iOS ignores it; repaints cost) — a sun in the top-left
   corner and a sky that settles into the base colour as you scroll. */
@media (max-width: 760px) {
  body.hd-depth {
    background-attachment: scroll;
    background-image:
      radial-gradient(520px 420px at 0 0, rgba(255,248,228,.85), rgba(255,244,214,0) 70%),
      radial-gradient(600px 700px at 100% 900px, rgba(168,201,238,.30), transparent 70%),
      linear-gradient(180deg, #FBFCFE 0, #F2F6FB 700px, var(--hd-sky-base) 1600px);
  }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) {
  body.hd-depth:not(.hd-light) {
    background-image:
      radial-gradient(520px 420px at 0 0, rgba(168,201,238,.14), transparent 70%),
      linear-gradient(180deg, #0E1A33 0, var(--hd-sky-base) 1400px);
  }
}

/* ── Top bar: the brand mark is a lit gold orb; the CTA a lit pill ── */
.hd-depth .topbar .brand-mark {
  background: radial-gradient(circle at 34% 28%, #FFFFFF 0%, var(--hd-gold-light) 22%, var(--hd-gold-mid) 55%, var(--hd-gold) 100%);
  box-shadow: 0 1px 2px rgba(107,78,20,.25), 0 5px 12px -2px rgba(182,138,46,.45), inset 0 -2px 3px rgba(140,106,34,.30), inset 0 2px 3px rgba(255,255,255,.75);
}
.hd-depth .topbar .top-cta {
  background: var(--hd-pill-bg);
  border: 1px solid var(--hd-pill-border);
  color: var(--hd-pill-ink);
  box-shadow: var(--hd-lit-edge), var(--hd-lit-shadow-gold);
  transition: background-color .2s, box-shadow .2s, transform .2s;
}
.hd-depth .topbar .top-cta:hover { background: linear-gradient(180deg, #FFF8E4, var(--hd-gold-light)); color: #5A4110; border-color: var(--hd-gold-mid); text-decoration: none; }
.hd-depth .topbar .top-cta:active { transform: translateY(1px); box-shadow: var(--hd-press); }

/* ── Text links: the sky is darker than the old flat page, so links take a
   deeper gold (#8C6A22 fell to ~4:1 on the lit sky, 3.4:1 at night). ── */
.hd-depth main a:not([class]) { color: var(--hd-link); text-decoration-color: rgba(182,138,46,.6); }
.hd-depth main a:not([class]):hover { color: var(--ink); }

/* ── Display gold: the italic accent in headings, kept ≥ 3:1 (large text) ── */
.hd-depth main h1 em {
  background: linear-gradient(120deg, #8C6A22 0%, #A27A26 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ── Frosted panels ── */
/* (details kept in their own selector: inside :is() they would raise the
   specificity of the whole list and beat the per-part tweaks below.) */
.hd-depth main :is(.card, .tile, .step, .cta, .status, .disclaimer, .stat, .stats, .thanks, .in-box, .privacy),
.hd-depth main :is(.qa, .faq) details {
  background: var(--hd-slab);
  border: 1px solid var(--hd-slab-border);
  box-shadow: var(--hd-slab-edge), var(--hd-cast);
}
.hd-depth main :is(.callout, .quick-answer, .core-message, .members) {
  background: var(--hd-sheen), linear-gradient(180deg, #FFFFFF 0%, #FCF8EE 100%);
  border: 1px solid var(--hd-gold-rim);
  box-shadow: var(--hd-slab-edge), var(--hd-cast), var(--hd-cast-gold);
}
.hd-depth main .core-message { border-left: 4px solid var(--hd-gold-mid); }
.hd-depth main .status { border-style: solid; border-color: var(--hd-gold-rim); }
.hd-depth main .status .dot { background: radial-gradient(circle at 35% 30%, #fff, var(--hd-gold-mid) 55%, var(--hd-gold)); box-shadow: 0 0 0 3px rgba(233,196,106,.22), 0 1px 2px rgba(107,78,20,.3); }
.hd-depth main .cta { border-radius: 22px; }

/* Cards lift on hover (seo-page.css already lifted them 2 px). */
.hd-depth main .card { transition: transform .25s var(--hd-ease), box-shadow .25s var(--hd-ease), border-color .25s; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hd-depth main .card:hover { transform: translateY(-3px); border-color: var(--hd-slab-border); box-shadow: var(--hd-slab-edge), var(--hd-cast-float); }
}

/* ── Tables: a slab; the header row a lit band ── */
.hd-depth main table {
  background: var(--hd-frost-top);
  border: 1px solid var(--hd-slab-border);
  border-radius: 14px;
  box-shadow: var(--hd-slab-edge), var(--hd-cast);
}
.hd-depth main th { background: var(--hd-muted-bg); box-shadow: inset 0 -1px 0 rgba(var(--hd-dusk),.08); }

/* ── Stats (About): four lit tiles ── */
.hd-depth main .stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 26px 0; }
.hd-depth main .stat { border-radius: 16px; padding: 16px 12px 14px; text-align: center; }
.hd-depth main .stat .num { font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: clamp(24px, 3vw, 30px); line-height: 1.1; color: var(--ink); }
.hd-depth main .stat .label { margin-top: 6px; font-size: 13px; line-height: 1.35; color: var(--ink-mute); letter-spacing: .02em; }
@media (max-width: 560px) { .hd-depth main .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── FAQ as details: a slab per question ── */
.hd-depth main :is(.faq, .qa) details { border-radius: 14px; padding: 0 18px; margin: 10px 0; }
.hd-depth main .faq summary {
  cursor: pointer; list-style: none; position: relative;
  padding: 15px 30px 15px 0; font-weight: 700; color: var(--ink); font-size: 17px;
}
.hd-depth main .faq summary::-webkit-details-marker { display: none; }
.hd-depth main .faq summary::after { content: '+'; position: absolute; right: 0; top: 12px; font-size: 22px; color: var(--hd-gold-deep); }
.hd-depth main .faq details[open] summary::after { content: '\2013'; }
.hd-depth main .faq details > p { margin: 0 0 14px; }

/* ── "Explore" link lists: lit pills ── */
.hd-depth main .related ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.hd-depth main .related li { margin: 0; }
.hd-depth main .related a {
  display: inline-block; padding: 9px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 15px;
  color: var(--ink); background: var(--hd-pill-bg); border: 1px solid var(--hd-pill-border);
  box-shadow: var(--hd-lit-edge), var(--hd-lit-shadow-gold);
}
.hd-depth main .related a:hover { background: linear-gradient(180deg, #FFFFFF, #FFF6DE); color: var(--ink); }
.hd-depth main .related a:active { transform: translateY(1px); box-shadow: var(--hd-press); }

/* ── Page links (journey pages): lit pills; the current one sits gold ── */
.hd-depth main .page-links a { background: var(--hd-muted-bg); border: 1px solid var(--hd-slab-border); box-shadow: var(--hd-lit-edge), var(--hd-lit-shadow); }
.hd-depth main .page-links a:hover { background: var(--hd-pill-bg); border-color: var(--hd-pill-border); }
.hd-depth main .page-links a[aria-current="page"] {
  color: #5A4110; background: linear-gradient(180deg, #FBF3E1, #F6E8C4);
  border: 1px solid #B68A2E; box-shadow: inset 0 2px 4px rgba(107,78,20,.20), 0 1px 0 #FFFFFF;
}

/* ── Badges + numbered orbs ── */
.hd-depth main .hello-badge {   /* Luna's status pill (language homepages) */
  color: var(--hd-pill-ink); background: var(--hd-pill-bg); border: 1px solid var(--hd-pill-border);
  box-shadow: var(--hd-lit-edge), var(--hd-lit-shadow-gold);
}
.hd-depth main .badge { background: var(--hd-muted-bg); border-color: var(--hd-slab-border); box-shadow: var(--hd-lit-edge), var(--hd-lit-shadow); }
.hd-depth main .badge.gold { background: var(--hd-badge-gold-bg); border-color: rgba(233,196,106,.70); color: #6B4E14; }
.hd-depth main .step-num, .hd-depth main .path li::before {
  background: var(--hd-orb-gold); color: #4A3608;
  border: 1px solid rgba(255,255,255,.85); box-shadow: var(--hd-orb-gold-cast);
}
.hd-depth main .outcome { background: var(--hd-well-bg); box-shadow: var(--hd-well-shadow); }
.hd-depth main .step { border-radius: 18px; }

/* ── Buttons: raised bodies that press in ── */
.hd-depth main .cta-primary {
  color: #FFFFFF; background: var(--hd-btn-ink-bg); border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--hd-btn-ink-cast);
}
.hd-depth main .cta-primary:hover { color: #FFFFFF; background: linear-gradient(180deg, #3A4B72, #24314F); text-decoration: none; }
.hd-depth main .cta-secondary {
  color: var(--ink); background: var(--hd-pill-bg); border: 1px solid var(--hd-pill-border);
  box-shadow: var(--hd-lit-edge), 0 1px 2px rgba(182,138,46,.18), 0 8px 18px -8px rgba(var(--hd-dusk),.28);
}
.hd-depth main .cta-secondary:hover { color: var(--ink); background: linear-gradient(180deg, #FFFFFF, #FFF6DE); border-color: var(--hd-gold-mid); text-decoration: none; }
.hd-depth main :is(.cta-primary, .cta-secondary):active { transform: translateY(1px); box-shadow: var(--hd-press); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hd-depth main :is(.cta-primary, .cta-secondary):hover { transform: translateY(-2px); }
}

/* ── Focus: one visible gold ring for every control ── */
.hd-depth :is(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--hd-focus); outline-offset: 3px; border-radius: 6px;
}
.hd-depth main :is(.cta-primary, .cta-secondary, .related a, .page-links a):focus-visible,
.hd-depth .topbar .top-cta:focus-visible { border-radius: 999px; }

/* ── Dark theme: ink buttons turn to lit gold (white-on-pale was 1.1:1) ── */
@media (prefers-color-scheme: dark) {
  .hd-depth:not(.hd-light) main .cta-primary { color: #2A2110; background: var(--hd-btn-gold-bg); box-shadow: var(--hd-btn-gold-cast); }
  .hd-depth:not(.hd-light) main .cta-primary:hover { color: #2A2110; background: linear-gradient(180deg, #FFF1C4, var(--hd-gold-mid)); }
  .hd-depth:not(.hd-light) main .cta-secondary:hover,
  .hd-depth:not(.hd-light) main .related a:hover { background: rgba(255,255,255,.12); color: var(--ink); }
  .hd-depth:not(.hd-light) main :is(.callout, .quick-answer, .core-message, .members) {
    background: var(--hd-sheen), linear-gradient(180deg, rgba(233,196,106,.10), rgba(233,196,106,.04)), linear-gradient(180deg, var(--hd-frost-top), var(--hd-frost-bottom));
  }
  .hd-depth:not(.hd-light) main .page-links a[aria-current="page"] { color: #2A2110; background: var(--hd-btn-gold-bg); }
  .hd-depth:not(.hd-light) .topbar .top-cta:hover { color: #2A2110; }
  .hd-depth:not(.hd-light) main h1 em {
    background: linear-gradient(120deg, #E9C46A, #FFE8A8); -webkit-background-clip: text; background-clip: text;
  }
  .hd-depth:not(.hd-light) main .badge.gold { color: #F3D98E; }
}

/* ═══ 3. Research hubs (body.hd-hub: /research /protocols /compounds /blog) ═
   These four pages carry their own light-only inline palette (--line,
   --accent, --muted); this section lifts their parts into the same depth. */
.hd-hub .topbar {
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(246,249,253,.78));
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,.9);
  box-shadow: inset 0 -1px 0 rgba(var(--hd-dusk),.07), 0 8px 24px -14px rgba(var(--hd-dusk),.25);
}
.hd-hub .topbar { gap: 12px; }
.hd-hub .topbar :is(.brand, .top-cta) { white-space: nowrap; }
@media (max-width: 420px) {
  .hd-hub .topbar { padding: 14px 16px; }
  .hd-hub .brand { font-size: 18px; gap: 8px; }
  .hd-hub .top-cta { padding: 8px 12px; font-size: 13px; }
}
@media (max-width: 350px) {
  .hd-hub .topbar { padding: 12px 12px; gap: 8px; }
  .hd-hub .brand { font-size: 16px; }
  .hd-hub .top-cta { padding: 7px 10px; font-size: 12px; }
}
.hd-hub .breadcrumb { background: transparent; border-bottom: 0; max-width: 880px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }
@media (max-width: 420px) { .hd-hub .breadcrumb { padding-left: 16px; padding-right: 16px; } }
/* #B68A2E on the page was 3.1:1 — links take the deep gold (5.0:1). */
.hd-hub main a:not([class]), .hd-hub .breadcrumb a:hover { color: var(--hd-link); text-decoration: underline; text-decoration-color: rgba(182,138,46,.55); text-underline-offset: 3px; }
.hd-hub main :is(.topic, .proto-card, .class-card, .post, .compare > div, .quick-fact) {
  background: var(--hd-slab);
  border: 1px solid var(--hd-slab-border);
  box-shadow: var(--hd-slab-edge), var(--hd-cast);
  transition: transform .25s var(--hd-ease), box-shadow .25s var(--hd-ease);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hd-hub main :is(.topic, .proto-card, .class-card, .post):hover { transform: translateY(-3px); box-shadow: var(--hd-slab-edge), var(--hd-cast-float); }
}
@media (prefers-reduced-motion: reduce) { .hd-hub main :is(.topic, .proto-card, .class-card, .post):hover { transform: none; } }
.hd-hub main .stats { border-radius: 18px; }
.hd-hub main .stats > div { min-width: 0; }
@media (max-width: 360px) {   /* three uppercase labels overflowed a 320 px phone */
  .hd-hub main .stats { grid-template-columns: 1fr; gap: 10px; padding: 16px; }
}
.hd-hub main code { background: #EEF3FA; color: #101319; }
.hd-hub main .step { border-left: 3px solid var(--hd-gold-mid); border-radius: 12px; }
.hd-hub main blockquote {
  background: var(--hd-sheen), linear-gradient(180deg, #FFFFFF 0%, #FCF8EE 100%);
  border: 1px solid var(--hd-gold-rim); border-left: 3px solid var(--hd-gold-mid);
  box-shadow: var(--hd-slab-edge), var(--hd-cast), var(--hd-cast-gold);
}
.hd-hub main .warning {
  background: var(--hd-sheen), linear-gradient(180deg, #FDF7F7, #FAEEEE);
  box-shadow: var(--hd-slab-edge), var(--hd-cast);
}
.hd-hub main .cta { border-radius: 22px; }

@media (prefers-reduced-motion: reduce) {
  .hd-depth main :is(.card, .tile, .cta-primary, .cta-secondary, .related a), .hd-btn-gold, .hd-btn-ghost { transition: none; }
  .hd-depth main :is(.cta-primary, .cta-secondary, .related a):active, .hd-btn-gold:active, .hd-btn-ghost:active { transform: none; }
}
@media print {
  body.hd-depth { background: #fff; }
  .hd-depth main :is(.card, .tile, .step, .cta, .callout, .quick-answer, .stat, table, .faq details, .qa details) { box-shadow: none; }
}

/* ═══ 4. Night fixes (v2) ════════════════════════════════════════════════
   Measured on the rendered pages (dark OS theme, 1440 + 390 wide): the deep
   gold #8C6A22 that reads well on the lit sky fell to 2.4–3.6:1 on the night
   slabs, and the small muted labels in the lit table header band to 3.9:1.
   Text takes the lit gold (#E9C46A, ≥ 7:1 on every night surface) or a lifted
   mute; nothing here applies in the light theme. */
@media (prefers-color-scheme: dark) {
  body.hd-depth:not(.hd-light) { --hd-gold-deep: var(--hd-gold-mid); }   /* FAQ "+" marks */
  .hd-depth:not(.hd-light) main :is(.quick-answer, .callout) h2,
  .hd-depth:not(.hd-light) main .eyebrow,
  .hd-depth:not(.hd-light) main .qa summary::after,
  .hd-depth:not(.hd-light) .lang-switch a:is(.active, :hover) { color: var(--hd-gold-mid); }
  .hd-depth:not(.hd-light) main :is(th, td) small { color: #A9B4CA; }   /* on the lit header band ≥ 5:1 */
}
