/* ========================================================================
   Anna Developer Hub — namespaced under .dh-
   Reuses brand tokens from pages.css (--anna-warm, --bg-deep, etc.).
   No new color tokens introduced; all spacing on the 4/8/12/16/24/32/48/72
   scale; motion limited to 180–240ms cubic-bezier(.4,0,.2,1).
   ======================================================================== */

.dh-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dh-body code, .dh-body pre {
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
}

/* ── Skip link & utilities ────────────────────────────────────────── */
.dh-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--anna-warm);
    color: #08090E;
    padding: 8px 16px;
    border-radius: 6px;
    z-index: 9999;
}
.dh-skip-link:focus { left: 16px; top: 16px; }

.dh-grad {
    background: linear-gradient(135deg, var(--anna-warm), var(--anna-glow));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.dh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-decoration: none;
    transition: transform .2s cubic-bezier(.4,0,.2,1), box-shadow .2s, background .2s, color .2s;
    border: 1px solid transparent;
    cursor: pointer;
}
.dh-btn--primary {
    color: #08090E;
    background: linear-gradient(135deg, var(--anna-warm), var(--anna-glow));
    box-shadow: 0 0 18px rgba(255, 158, 108, 0.28);
}
.dh-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 28px rgba(255, 158, 108, 0.45);
    color: #08090E;
}
:root[data-theme="light"] .dh-btn--primary { color: #fff; }
:root[data-theme="light"] .dh-btn--primary:hover { color: #fff; }
.dh-btn--ghost {
    color: var(--text-primary);
    background: transparent;
    border-color: var(--border-warm);
}
.dh-btn--ghost:hover {
    border-color: var(--anna-warm);
    color: var(--anna-warm);
}

/* ============================================================
   Landing page  (Apple Developer × LangChain inspired)
   ============================================================ */
.dh-landing { flex: 1; }

/* ── Hero ─────────────────────────────────────────────────────── */
/* Full-bleed background, centered content (Apple Developer pattern). */
.dh-hero {
    position: relative;
    padding: clamp(96px, 14vh, 168px) clamp(20px, 4vw, 60px) clamp(72px, 10vh, 120px);
    width: 100%;
    margin: 0;
    overflow: hidden;
    isolation: isolate;
}
.dh-hero__inner {
    max-width: 720px;
    margin: 0 auto;
    width: min(100%, 1220px);
    position: relative;
    z-index: 2;
}
/* Re-anchor the inner box to the centered grid so left/right balance match the section grid below */
.dh-hero__inner {
    margin-left: max(env(safe-area-inset-left), calc((100vw - 1220px) / 2));
    margin-right: auto;
    max-width: min(720px, calc(100vw - 2 * max(20px, 4vw)));
}
@media (max-width: 1260px) {
    .dh-hero__inner { margin-left: clamp(20px, 4vw, 60px); }
}

/* Background grid + orbs */
.dh-hero__bg {
    position: absolute;
    inset: -10% -5% -10% -5%;
    z-index: 0;
    pointer-events: none;
}
.dh-hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border-subtle) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 60% 60% at 30% 35%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 60% 60% at 30% 35%, #000 30%, transparent 75%);
    opacity: 0.55;
}
.dh-hero__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.55;
    animation: dhOrb 16s ease-in-out infinite alternate;
}
.dh-hero__orb--warm {
    width: 480px; height: 480px;
    top: -120px; left: -80px;
    background: radial-gradient(circle, var(--anna-warm), transparent 65%);
}
.dh-hero__orb--cool {
    width: 560px; height: 560px;
    top: 10%; right: -160px;
    background: radial-gradient(circle, var(--anna-accent), transparent 65%);
    opacity: 0.35;
    animation-delay: -6s;
}
@keyframes dhOrb {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(40px, -30px, 0) scale(1.08); }
}
.dh-hero__noise {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 3px 3px;
    mix-blend-mode: overlay;
    opacity: 0.6;
}
:root[data-theme="light"] .dh-hero__orb { opacity: 0.28; }
:root[data-theme="light"] .dh-hero__orb--cool { opacity: 0.18; }

.dh-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--anna-warm);
    padding: 6px 14px;
    border: 1px solid var(--border-warm);
    border-radius: 999px;
    margin-bottom: 28px;
    background: rgba(255, 158, 108, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.dh-eyebrow__pulse {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--anna-warm);
    box-shadow: 0 0 8px var(--anna-warm);
    animation: dhPulseDot 1.8s ease-in-out infinite;
}
@keyframes dhPulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

.dh-hero__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(44px, 6.6vw, 84px);
    line-height: 1.02;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 28px;
}
.dh-grad {
    background: linear-gradient(135deg, var(--anna-warm), var(--anna-glow));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.dh-grad-cool {
    background: linear-gradient(135deg, var(--anna-accent), var(--anna-blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dh-hero__sub {
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 600px;
}

.dh-hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 56px;
}

.dh-hero__meta {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 0; margin: 0;
    font-size: 13px;
    color: var(--text-tertiary);
}
.dh-hero__meta li { display: inline-flex; align-items: center; gap: 8px; }
.dh-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--anna-warm);
    display: inline-block;
}
.dh-dot--live {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
    animation: dhPulseDot 1.8s ease-in-out infinite;
}

/* ── Hero orbital mockup ──────────────────────────────────────── */
/* Anchor to the centered 1220 grid; never closer than 24px to viewport edge */
.dh-orbit {
    position: absolute;
    top: 50%;
    width: 460px;
    height: 460px;
    right: max(24px, calc((100vw - 1220px) / 2));
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
    color: var(--text-secondary);
}
@media (max-width: 1100px) { .dh-orbit { display: none; } }

.dh-orbit__core {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 96px; height: 96px;
    border-radius: 50%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px;
    background: radial-gradient(circle, rgba(255, 158, 108, 0.18), rgba(255, 158, 108, 0.02));
    border: 1px solid var(--border-warm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 3;
    box-shadow: 0 0 60px rgba(255, 158, 108, 0.25);
}
.dh-orbit__avatar {
    width: 36px; height: 36px;
    color: var(--anna-warm);
    display: flex; align-items: center; justify-content: center;
}
.dh-orbit__avatar svg { width: 100%; height: 100%; }
.dh-orbit__label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--anna-warm);
}

.dh-orbit__ring {
    position: absolute;
    top: 50%; left: 50%;
    border: 1px dashed var(--border-warm);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.dh-orbit__ring--inner  { width: 236px;  height: 236px; animation: dhSpin 32s linear infinite; }
.dh-orbit__ring--mid    { width: 320px;  height: 320px; animation: dhSpin 50s linear infinite reverse; opacity: 0.7; }
.dh-orbit__ring--outer  { width: 440px;  height: 440px; animation: dhSpin 70s linear infinite; opacity: 0.45; }
@keyframes dhSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.dh-orbit__chip,
.dh-orbit__app {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%)
        rotate(var(--angle))
        translateX(var(--r))
        rotate(calc(var(--angle) * -1));
    background: rgba(18, 20, 28, 0.78);
    border: 1px solid var(--border-warm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 999px;
    padding: 7px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-primary);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
:root[data-theme="light"] .dh-orbit__chip,
:root[data-theme="light"] .dh-orbit__app {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 20px rgba(224, 122, 58, 0.12);
}
.dh-orbit__chip-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--anna-warm);
    box-shadow: 0 0 6px var(--anna-warm);
}
.dh-orbit__app {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    border-radius: 12px;
    padding: 10px 14px;
    border-color: rgba(179, 136, 255, 0.28);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
}
.dh-orbit__app strong { color: var(--anna-accent); font-weight: 600; }
.dh-orbit__app-kicker {
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* ── Stats strip ──────────────────────────────────────────────── */
.dh-stats {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 60px);
}
.dh-stats__inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    background-color: var(--bg-card);
}
@media (max-width: 760px) { .dh-stats__inner { grid-template-columns: repeat(2, 1fr); } }

.dh-stat {
    background: var(--bg-card);
    padding: 28px 24px;
    text-align: left;
}
.dh-stat__num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(28px, 3.4vw, 38px);
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--anna-warm), var(--anna-glow));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 6px;
}
.dh-stat__label {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── Generic section header ───────────────────────────────────── */
.dh-section {
    max-width: 1220px;
    margin: 0 auto;
    padding: clamp(72px, 9vh, 112px) clamp(20px, 4vw, 60px);
}
.dh-section__head { margin-bottom: 40px; max-width: 760px; }
.dh-section__kicker {
    display: inline-block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--anna-warm);
    margin-bottom: 14px;
}
.dh-section__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 600;
    letter-spacing: -0.018em;
    line-height: 1.1;
    margin-bottom: 14px;
}
.dh-section__sub {
    color: var(--text-secondary);
    font-size: 17px;
    line-height: 1.6;
}

/* ── Pillars ──────────────────────────────────────────────────── */
.dh-pillars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
@media (max-width: 960px) { .dh-pillars { grid-template-columns: 1fr; } }

.dh-pillar {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    color: var(--text-primary);
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    transition: transform .25s cubic-bezier(.4,0,.2,1), border-color .25s, background .25s;
}
.dh-pillar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 0%, rgba(255, 158, 108, 0.10), transparent 55%);
    opacity: 0;
    transition: opacity .25s;
    z-index: -1;
}
.dh-pillar:hover {
    transform: translateY(-3px);
    border-color: var(--border-warm);
    background: var(--bg-card-hover);
}
.dh-pillar:hover::before { opacity: 1; }
.dh-pillar__icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 200, 162, 0.14), rgba(255, 158, 108, 0.04));
    border: 1px solid var(--border-warm);
    color: var(--anna-warm);
    margin-bottom: 12px;
}
.dh-pillar__icon svg { width: 24px; height: 24px; }
.dh-pillar__kicker {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-tertiary);
}
.dh-pillar__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.dh-pillar__body { color: var(--text-secondary); font-size: 14.5px; line-height: 1.65; }
.dh-pillar__example { font-size: 12px; color: var(--text-tertiary); }
.dh-pillar__example code,
.dh-pillar__body code {
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bg-card-hover);
    font-size: 0.9em;
    color: var(--anna-warm);
}
.dh-pillar__more {
    margin-top: auto;
    padding-top: 8px;
    color: var(--anna-warm);
    font-size: 13px;
    font-weight: 600;
    transition: gap .2s;
}
.dh-pillar:hover .dh-pillar__more { letter-spacing: 0.4px; }

/* ── Quickstart strip ────────────────────────────────────────── */
.dh-quickstart {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
@media (max-width: 1100px) { .dh-quickstart { grid-template-columns: 1fr; } }

.dh-code-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s, transform .2s;
}
.dh-code-card:hover { border-color: var(--border-warm); transform: translateY(-2px); }
.dh-code-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, var(--bg-card-hover), var(--bg-card));
}
.dh-code-card__lang {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--anna-warm);
}
.dh-code-card__link {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .2s;
}
.dh-code-card__link:hover { color: var(--anna-warm); }
.dh-code-card pre {
    margin: 0;
    padding: 18px;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    color: var(--text-primary);
    background: transparent;
}

/* ── Live flow ───────────────────────────────────────────────── */
.dh-section--flow .dh-flow {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 12px;
    align-items: stretch;
}
@media (max-width: 960px) {
    .dh-section--flow .dh-flow { grid-template-columns: 1fr; }
    .dh-flow__rail { display: none; }
}

.dh-flow__panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 340px;
}
.dh-flow__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-card-hover);
}
.dh-flow__lights { display: inline-flex; gap: 6px; }
.dh-flow__lights i {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--text-tertiary);
    opacity: 0.4;
}
.dh-flow__lights i:nth-child(1) { background: #ff5f57; opacity: 0.7; }
.dh-flow__lights i:nth-child(2) { background: #febc2e; opacity: 0.7; }
.dh-flow__lights i:nth-child(3) { background: #28c840; opacity: 0.7; }
.dh-flow__title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-tertiary);
}
.dh-flow__body { padding: 20px; flex: 1; }

.dh-flow__chat { display: flex; flex-direction: column; gap: 12px; }
.dh-flow__bubble {
    max-width: 92%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid var(--border-subtle);
}
.dh-flow__bubble--user {
    align-self: flex-end;
    background: var(--bg-card-hover);
    border-color: var(--border-subtle);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}
.dh-flow__bubble--anna {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(255, 158, 108, 0.10), rgba(179, 136, 255, 0.06));
    border-color: var(--border-warm);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}
.dh-flow__bubble--anna em {
    color: var(--text-secondary);
    font-style: normal;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
}
.dh-flow__bubble--anna code {
    color: var(--anna-warm);
    background: var(--bg-card);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.dh-flow__cursor {
    color: var(--anna-warm);
    font-weight: 700;
    margin-right: 4px;
    animation: dhBlink 1s step-end infinite;
}
@keyframes dhBlink { 50% { opacity: 0; } }

.dh-flow__rail {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dh-flow__rail::before {
    content: "";
    position: absolute;
    inset: 50% 0 50% 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-warm), transparent);
}
.dh-flow__pulse {
    position: absolute;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--anna-warm);
    box-shadow: 0 0 12px var(--anna-warm);
    animation: dhRail 2.4s linear infinite;
}
@keyframes dhRail {
    0%   { left: 0%;  opacity: 0; }
    15%  { opacity: 1; }
    85%  { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

.dh-flow__code {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.65;
    color: var(--text-primary);
    background: transparent;
    overflow-x: auto;
}
.dh-tok-c { color: var(--text-tertiary); }
.dh-tok-k { color: var(--anna-blue); }
.dh-tok-s { color: var(--anna-warm); }
.dh-tok-n { color: var(--anna-accent); }

/* ── Anatomy ─────────────────────────────────────────────────── */
.dh-anatomy {
    background:
        radial-gradient(ellipse at top right, rgba(179, 136, 255, 0.06), transparent 55%),
        radial-gradient(ellipse at bottom left, rgba(255, 158, 108, 0.06), transparent 55%),
        var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 32px;
    overflow-x: auto;
}
.dh-anatomy__svg { width: 100%; height: auto; min-width: 600px; color: var(--text-primary); }

/* ── Distribution surfaces ────────────────────────────────────── */
.dh-surfaces {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
@media (max-width: 1100px) { .dh-surfaces { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .dh-surfaces { grid-template-columns: 1fr; } }

.dh-surface {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    transition: border-color .25s, transform .25s, background .25s;
}
.dh-surface:hover {
    border-color: var(--border-warm);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}
.dh-surface__icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 158, 108, 0.08);
    border: 1px solid var(--border-warm);
    color: var(--anna-warm);
    margin-bottom: 16px;
}
.dh-surface__icon svg { width: 20px; height: 20px; }
.dh-surface h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.005em;
}
.dh-surface p {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}
.dh-surface code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
    color: var(--anna-warm);
    background: var(--bg-card-hover);
    padding: 1px 5px;
    border-radius: 4px;
}

/* ── Resources ───────────────────────────────────────────────── */
.dh-resources {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
@media (max-width: 1100px) { .dh-resources { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .dh-resources { grid-template-columns: 1fr; } }

.dh-resource {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color .2s, background .2s, transform .2s;
}
.dh-resource:hover {
    border-color: var(--border-warm);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}
.dh-resource__kicker {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-tertiary);
}
.dh-resource h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 17px;
    font-weight: 600;
}
.dh-resource p { color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; margin: 0; }

/* ── Footer CTA ───────────────────────────────────────────────── */
.dh-cta {
    margin: 48px clamp(20px, 4vw, 60px) 96px;
}
.dh-cta__inner {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(56px, 9vh, 96px) clamp(28px, 5vw, 56px);
    text-align: center;
    border: 1px solid var(--border-warm);
    border-radius: 28px;
    background:
        radial-gradient(ellipse at top, rgba(255, 158, 108, 0.14), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(179, 136, 255, 0.08), transparent 55%),
        var(--bg-card);
    overflow: hidden;
    isolation: isolate;
}
.dh-cta__halo {
    position: absolute;
    inset: -50% -20% auto -20%;
    height: 280px;
    background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(255, 158, 108, 0.18), transparent 70%);
    z-index: -1;
}
.dh-cta__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 8px 0 12px;
}
.dh-cta__sub {
    color: var(--text-secondary);
    font-size: 17px;
    line-height: 1.6;
    max-width: 580px;
    margin: 0 auto 28px;
}
.dh-cta__buttons { justify-content: center; margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
    .dh-hero__orb,
    .dh-orbit__ring,
    .dh-eyebrow__pulse,
    .dh-dot--live,
    .dh-flow__pulse,
    .dh-flow__cursor { animation: none !important; }
}

/* ============================================================
   Doc shell
   ============================================================ */
.dh-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 220px;
    gap: 0;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
}
@media (max-width: 1280px) {
    .dh-shell { grid-template-columns: 260px minmax(0, 1fr); }
    .dh-toc { display: none; }
}
@media (max-width: 960px) {
    .dh-shell { grid-template-columns: 1fr; }
}

/* Sidebar */
.dh-sidebar {
    position: sticky;
    top: 64px;
    align-self: start;
    height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 24px 16px 48px;
    border-right: 1px solid var(--border-subtle);
}
.dh-sidebar__close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}
.dh-sidebar__search {
    position: relative;
    margin-bottom: 16px;
}
.dh-sidebar__search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}
.dh-sidebar__search input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
.dh-sidebar__search input:focus { border-color: var(--anna-warm); }

.dh-sidebar__nav { display: flex; flex-direction: column; gap: 8px; }
.dh-section-group { display: flex; flex-direction: column; }
.dh-section-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
}
.dh-section-group__head:hover { color: var(--text-primary); background: var(--bg-card); }
.dh-section-group__chev { transition: transform .2s; }
.dh-section-group[data-collapsed="true"] .dh-section-group__chev { transform: rotate(-90deg); }
.dh-section-group[data-collapsed="true"] .dh-section-group__items { display: none; }
.dh-section-group__items {
    list-style: none;
    padding: 4px 0 12px 4px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dh-section-group__items a {
    display: block;
    padding: 6px 12px;
    font-size: 13.5px;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: color .2s, background .2s, border-color .2s;
}
.dh-section-group__items a:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}
.dh-section-group__items a[aria-current="page"] {
    color: var(--anna-warm);
    background: var(--bg-card);
    border-left-color: var(--anna-warm);
    font-weight: 500;
}
.dh-subgroup__head {
    margin: 4px 12px 2px;
    padding: 6px 0 4px;
    color: var(--text-secondary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: 0.75;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}
.dh-subgroup__items {
    padding: 2px 0 8px 12px;
}
.dh-section-group[data-collapsed="true"] .dh-subgroup__head { display: none; }

/* Overlay (mobile) */
.dh-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 80;
}
.dh-overlay.open { display: block; }

/* Content */
.dh-content {
    padding: 48px clamp(24px, 4vw, 56px) 96px;
    min-width: 0;
}
.dh-article { max-width: 760px; }

.dh-article h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(30px, 4vw, 40px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}
.dh-article__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
    color: var(--text-tertiary);
    font-size: 13px;
}
.dh-article__lead {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 32px;
}
.dh-article h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 600;
    margin: 48px 0 16px;
    scroll-margin-top: 80px;
}
.dh-article h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin: 32px 0 12px;
    scroll-margin-top: 80px;
}
.dh-article p { margin: 12px 0; line-height: 1.75; color: var(--text-primary); }
.dh-article ul, .dh-article ol { margin: 12px 0 12px 24px; line-height: 1.75; color: var(--text-primary); }
.dh-article li { margin: 4px 0; }

/* Task lists (GFM `- [ ]` / `- [x]`) */
.dh-article ul.dh-task-list {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}
.dh-article ul.dh-task-list li.dh-task {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 10px;
    margin: 4px 0;
    border-radius: 8px;
    transition: background .15s;
}
.dh-article ul.dh-task-list li.dh-task:hover { background: var(--bg-card); }
.dh-task__box {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 4px;
    border: 1.5px solid var(--border-warm);
    border-radius: 5px;
    background: var(--bg-card);
    cursor: pointer;
    position: relative;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.dh-task__box:hover { border-color: var(--anna-warm); }
.dh-task__box:focus-visible { outline: 2px solid var(--anna-warm); outline-offset: 2px; }
.dh-task__box:checked {
    background: linear-gradient(135deg, var(--anna-warm), var(--anna-glow));
    border-color: transparent;
    box-shadow: 0 0 0 1px var(--anna-warm), 0 0 12px rgba(255, 158, 108, 0.35);
}
.dh-task__box:checked::after {
    content: "";
    position: absolute;
    left: 5px; top: 1px;
    width: 5px; height: 10px;
    border: solid #08090E;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
:root[data-theme="light"] .dh-task__box:checked::after { border-color: #fff; }
.dh-task__label { flex: 1; line-height: 1.6; }
.dh-task--done .dh-task__label {
    color: var(--text-tertiary);
    text-decoration: line-through;
    text-decoration-color: var(--border-warm);
}
.dh-article a {
    color: var(--anna-warm);
    text-decoration: underline;
    text-decoration-color: var(--border-warm);
    text-underline-offset: 3px;
}
.dh-article a:hover { color: var(--anna-glow); }
.dh-article blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 3px solid var(--border-warm);
    background: var(--bg-card);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
}
.dh-article blockquote p { margin: 0; }

.dh-article code {
    background: var(--bg-card-hover);
    color: var(--anna-warm);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.dh-article pre {
    background: linear-gradient(180deg, var(--bg-card-hover), var(--bg-card));
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 18px 18px 18px 18px;
    overflow-x: auto;
    margin: 20px 0;
    position: relative;
    font-size: 13px;
    line-height: 1.7;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}
:root[data-theme="light"] .dh-article pre { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); }
.dh-article pre code { background: none; color: var(--text-primary); padding: 0; font-size: inherit; }

/* ── Syntax highlighting (highlight.js theme override, brand palette) ── */
.dh-article pre code.hljs { background: transparent; padding: 0; }
.hljs { color: var(--text-primary); background: transparent; }

/* keywords / control flow */
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-meta-keyword,
.hljs-name,
.hljs-tag           { color: var(--anna-accent); }

/* strings */
.hljs-string,
.hljs-doctag,
.hljs-regexp,
.hljs-template-tag,
.hljs-template-variable,
.hljs-meta .hljs-string { color: var(--anna-warm); }

/* numbers / literals */
.hljs-number,
.hljs-literal,
.hljs-symbol,
.hljs-bullet        { color: #ffb86c; }

/* identifiers / functions / titles */
.hljs-title,
.hljs-title.class_,
.hljs-title.function_,
.hljs-section,
.hljs-attr,
.hljs-attribute     { color: var(--anna-blue); }

/* types / classes */
.hljs-type,
.hljs-class .hljs-title,
.hljs-selector-class { color: #82e1ff; }

/* params / variables */
.hljs-variable,
.hljs-params,
.hljs-property      { color: #cdb4ff; }

/* punctuation / operators */
.hljs-punctuation,
.hljs-operator,
.hljs-subst         { color: var(--text-secondary); }

/* comments + meta */
.hljs-comment,
.hljs-quote,
.hljs-meta          { color: var(--text-tertiary); font-style: italic; }

/* deletion / addition */
.hljs-deletion      { color: #ff7a7a; }
.hljs-addition      { color: #66e3a1; }
.hljs-emphasis      { font-style: italic; }
.hljs-strong        { font-weight: 600; }

/* light-theme tweaks (override the dark-base values above) */
:root[data-theme="light"] .hljs-keyword,
:root[data-theme="light"] .hljs-tag,
:root[data-theme="light"] .hljs-name      { color: #7c3aed; }
:root[data-theme="light"] .hljs-string,
:root[data-theme="light"] .hljs-meta .hljs-string { color: #c2410c; }
:root[data-theme="light"] .hljs-title,
:root[data-theme="light"] .hljs-attr,
:root[data-theme="light"] .hljs-section   { color: #1d4ed8; }
:root[data-theme="light"] .hljs-number,
:root[data-theme="light"] .hljs-literal   { color: #b45309; }
:root[data-theme="light"] .hljs-variable,
:root[data-theme="light"] .hljs-property,
:root[data-theme="light"] .hljs-params    { color: #6d28d9; }
:root[data-theme="light"] .hljs-type      { color: #0e7490; }
:root[data-theme="light"] .hljs-comment,
:root[data-theme="light"] .hljs-quote,
:root[data-theme="light"] .hljs-meta      { color: #6b7280; }

.dh-codeblock {
    position: relative;
    margin: 20px 0;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}
:root[data-theme="light"] .dh-codeblock { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); }

.dh-codeblock__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 8px 14px;
    background: linear-gradient(180deg, var(--bg-card-hover), var(--bg-card));
    border-bottom: 1px solid var(--border-subtle);
    font-family: 'Space Grotesk', sans-serif;
}

.dh-codeblock__lang {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--anna-warm);
}
.dh-codeblock__dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--anna-warm);
    box-shadow: 0 0 6px rgba(255, 158, 108, 0.6);
}

/* Per-language accent (cosmetic; falls back to warm) */
.dh-codeblock[data-lang="python"]    .dh-codeblock__dot,
.dh-codeblock[data-lang="py"]        .dh-codeblock__dot { background: #ffd24d; box-shadow: 0 0 6px rgba(255, 210, 77, 0.55); }
.dh-codeblock[data-lang="javascript"] .dh-codeblock__dot,
.dh-codeblock[data-lang="js"]        .dh-codeblock__dot,
.dh-codeblock[data-lang="json"]      .dh-codeblock__dot { background: #f0db4f; box-shadow: 0 0 6px rgba(240, 219, 79, 0.55); }
.dh-codeblock[data-lang="typescript"] .dh-codeblock__dot,
.dh-codeblock[data-lang="ts"]        .dh-codeblock__dot { background: #3b82f6; box-shadow: 0 0 6px rgba(59, 130, 246, 0.55); }
.dh-codeblock[data-lang="go"]        .dh-codeblock__dot { background: #5eead4; box-shadow: 0 0 6px rgba(94, 234, 212, 0.55); }
.dh-codeblock[data-lang="rust"]      .dh-codeblock__dot,
.dh-codeblock[data-lang="rs"]        .dh-codeblock__dot { background: #f97316; box-shadow: 0 0 6px rgba(249, 115, 22, 0.55); }
.dh-codeblock[data-lang="bash"]      .dh-codeblock__dot,
.dh-codeblock[data-lang="sh"]        .dh-codeblock__dot,
.dh-codeblock[data-lang="shell"]     .dh-codeblock__dot,
.dh-codeblock[data-lang="zsh"]       .dh-codeblock__dot,
.dh-codeblock[data-lang="console"]   .dh-codeblock__dot { background: #a3e635; box-shadow: 0 0 6px rgba(163, 230, 53, 0.55); }
.dh-codeblock[data-lang="yaml"]      .dh-codeblock__dot,
.dh-codeblock[data-lang="yml"]       .dh-codeblock__dot { background: #c084fc; box-shadow: 0 0 6px rgba(192, 132, 252, 0.55); }
.dh-codeblock[data-lang="dockerfile"].dh-codeblock__dot,
.dh-codeblock[data-lang="docker"]    .dh-codeblock__dot { background: #60a5fa; box-shadow: 0 0 6px rgba(96, 165, 250, 0.55); }

.dh-codeblock pre {
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
.dh-codeblock pre,
.dh-article .dh-codeblock pre {
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.05));
}
:root[data-theme="light"] .dh-codeblock pre,
:root[data-theme="light"] .dh-article .dh-codeblock pre {
    background: linear-gradient(180deg, #fafafa, #f5f5f7);
}

.dh-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    letter-spacing: 0.6px;
    transition: color .15s, border-color .15s, background .15s;
}
.dh-copy:hover { color: var(--anna-warm); border-color: var(--anna-warm); background: var(--bg-card-hover); }
.dh-copy:focus-visible { outline: 2px solid var(--anna-warm); outline-offset: 2px; }
.dh-copy svg { flex-shrink: 0; }

.dh-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}
.dh-article th, .dh-article td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
}
.dh-article th { color: var(--text-secondary); font-weight: 600; }

/* ── Inline figures (concept SVGs in articles) ── */
.dh-article .dh-figure {
    margin: 22px 0 26px;
    padding: 26px 22px;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(255, 158, 108, 0.10), transparent 55%),
        radial-gradient(120% 140% at 0% 100%, rgba(179, 136, 255, 0.09), transparent 55%),
        linear-gradient(180deg, var(--bg-card-hover), var(--bg-card));
    border: 1px solid var(--border-warm);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.18);
}
:root[data-theme="light"] .dh-article .dh-figure {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(255, 158, 108, 0.14), transparent 55%),
        radial-gradient(120% 140% at 0% 100%, rgba(179, 136, 255, 0.10), transparent 55%),
        #FFFFFF;
}
.dh-article .dh-figure::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 200, 162, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 200, 162, 0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    mask-image: radial-gradient(80% 80% at 50% 50%, #000 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(80% 80% at 50% 50%, #000 30%, transparent 80%);
}
.dh-article .dh-figure svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.dh-article .dh-figure figcaption,
.dh-article .dh-figure .dh-figure__caption {
    margin-top: 14px;
    text-align: center;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary, var(--text-secondary));
    position: relative;
    z-index: 1;
}

/* Light-mode repaint of the embedded SVG palette. The figures are authored
   against the dark palette; here we remap each opaque dark fill/stroke to a
   warm-light equivalent so contrast holds without rewriting the markup. */
:root[data-theme="light"] .dh-article .dh-figure svg [fill="#12141C"] { fill: #FFFFFF; }
:root[data-theme="light"] .dh-article .dh-figure svg [fill="#0A0B11"] { fill: #F4ECE0; }
:root[data-theme="light"] .dh-article .dh-figure svg [fill="#0F1118"] { fill: #FAF3E9; }
:root[data-theme="light"] .dh-article .dh-figure svg [fill="#1B1D27"] { fill: #FBF6F0; }
:root[data-theme="light"] .dh-article .dh-figure svg [fill="#E6E7EE"] { fill: #1A1B22; }
:root[data-theme="light"] .dh-article .dh-figure svg [fill="#A6A8B5"] { fill: #6B6E7C; }
:root[data-theme="light"] .dh-article .dh-figure svg [stroke="#FFC8A2"] { stroke: #E08850; }
:root[data-theme="light"] .dh-article .dh-figure svg [stroke="#FF9E6C"] { stroke: #E07840; }
:root[data-theme="light"] .dh-article .dh-figure svg [stroke="#B388FF"] { stroke: #7C4DFF; }
:root[data-theme="light"] .dh-article .dh-figure svg [stroke="#82B1FF"] { stroke: #4A7FE0; }
:root[data-theme="light"] .dh-article .dh-figure svg [fill="#FFC8A2"]   { fill: #E08850; }
:root[data-theme="light"] .dh-article .dh-figure svg [fill="#82B1FF"]   { fill: #4A7FE0; }
:root[data-theme="light"] .dh-article .dh-figure svg [fill="#B388FF"]   { fill: #7C4DFF; }

/* Gradient-filled chips/pills/frames don't theme via attribute remap (CSS
   can't reach gradient stops). Repaint the gradient *usage* instead. The
   wsBrand / aiAppGrad / lcLive / anActive gradients stay as-is — they are
   the brand "live" surfaces and read fine on white. */
:root[data-theme="light"] .dh-article .dh-figure svg [fill="url(#aiChip)"],
:root[data-theme="light"] .dh-article .dh-figure svg [fill="url(#wsTool)"],
:root[data-theme="light"] .dh-article .dh-figure svg [fill="url(#lcDraft)"],
:root[data-theme="light"] .dh-article .dh-figure svg [fill="url(#anFrame)"] {
    fill: #FFFFFF;
    stroke-opacity: 0.55;
}

/* Brand-gradient strokes (orange→purple) wash out on the light cream
   figure card. Repaint stroke usage to a solid, darker brand tone and
   bump opacity so connector lines/arrows actually read. */
:root[data-theme="light"] .dh-article .dh-figure svg [stroke="url(#wsBrand)"],
:root[data-theme="light"] .dh-article .dh-figure svg [stroke="url(#aiAppGrad)"],
:root[data-theme="light"] .dh-article .dh-figure svg [stroke="url(#lcLive)"],
:root[data-theme="light"] .dh-article .dh-figure svg [stroke="url(#anActive)"] {
    stroke: #B86A40;
    stroke-opacity: 0.85;
}

/* Admonitions */
.dh-admonition {
    margin: 16px 0;
    padding: 12px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-card);
}
.dh-admonition__head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.dh-admonition--note { border-color: rgba(130, 177, 255, 0.35); }
.dh-admonition--note .dh-admonition__head { color: var(--anna-blue); }
.dh-admonition--tip { border-color: rgba(179, 136, 255, 0.35); }
.dh-admonition--tip .dh-admonition__head { color: var(--anna-accent); }
.dh-admonition--warning { border-color: rgba(255, 158, 108, 0.45); }
.dh-admonition--warning .dh-admonition__head { color: var(--anna-warm); }
.dh-admonition--important { border-color: rgba(255, 158, 108, 0.45); }
.dh-admonition--important .dh-admonition__head { color: var(--anna-warm); }

/* Skeletons */
.dh-article__skeleton { animation: dhPulse 1.4s ease-in-out infinite; }
.dh-skel { background: var(--bg-card); border-radius: 6px; margin-bottom: 12px; }
.dh-skel--title { height: 36px; width: 60%; }
.dh-skel--line { height: 14px; width: 100%; }
.dh-skel--line.short { width: 70%; }
@keyframes dhPulse { 50% { opacity: 0.6; } }

/* Prev / Next */
.dh-prevnext {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 64px;
    max-width: 760px;
}
@media (max-width: 600px) { .dh-prevnext { grid-template-columns: 1fr; } }
.dh-prevnext a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color .2s, transform .2s, background .2s;
}
.dh-prevnext a:hover { border-color: var(--anna-warm); background: var(--bg-card); transform: translateY(-1px); }
.dh-prevnext__kicker { font-size: 11px; color: var(--text-tertiary); letter-spacing: 1.2px; text-transform: uppercase; }
.dh-prevnext__title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; }
.dh-prevnext__next { text-align: right; }

/* On-page TOC — rail-and-marker pattern (Stripe / Vercel / Linear style) */
.dh-toc {
    position: sticky;
    top: 64px;
    align-self: start;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 48px 8px 48px 28px;
    font-size: 12.5px;
    /* hide scrollbar visually but keep functional */
    scrollbar-width: thin;
    scrollbar-color: var(--border-subtle) transparent;
}
.dh-toc::-webkit-scrollbar { width: 6px; }
.dh-toc::-webkit-scrollbar-track { background: transparent; }
.dh-toc::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
}
.dh-toc:hover::-webkit-scrollbar-thumb { background: var(--border-subtle); }

.dh-toc__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin: 0 0 16px 12px;
}

/* The rail: a single 1px guide on the left of the list */
.dh-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    border-left: 1px solid var(--border-subtle);
}
.dh-toc__list li { margin: 0; }
.dh-toc__list a {
    position: relative;
    display: block;
    padding: 6px 12px 6px 16px;
    margin-left: -1px;                   /* overlap the rail so the marker can replace it */
    border-left: 2px solid transparent;
    color: var(--text-tertiary);
    text-decoration: none;
    line-height: 1.5;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.dh-toc__list a:hover {
    color: var(--text-primary);
    border-left-color: var(--border-strong, var(--text-tertiary));
}
.dh-toc__list a.active {
    color: var(--anna-warm);
    border-left-color: var(--anna-warm);
    font-weight: 500;
}

/* H3 nesting — clear indent + smaller weight */
.dh-toc__list li[data-level="3"] a {
    padding-left: 28px;
    font-size: 12px;
    color: var(--text-tertiary);
}
.dh-toc__list li[data-level="3"] a:hover { color: var(--text-secondary); }
.dh-toc__list li[data-level="3"] a.active { color: var(--anna-warm); }

/* Tighten gap between consecutive H2 groups so H3 children read as a cluster */
.dh-toc__list li[data-level="2"] + li[data-level="2"] > a { margin-top: 2px; }

/* Mobile toggle */
.dh-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 70;
    width: 48px;
    height: 48px;
    border-radius: 24px;
    border: none;
    background: linear-gradient(135deg, var(--anna-warm), var(--anna-glow));
    color: #08090E;
    box-shadow: 0 8px 24px rgba(255, 158, 108, 0.4);
    cursor: pointer;
}
@media (max-width: 960px) {
    .dh-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        background: var(--bg-deep);
        z-index: 90;
        transform: translateX(-100%);
        transition: transform .25s cubic-bezier(.4,0,.2,1);
    }
    .dh-sidebar.open { transform: translateX(0); }
    .dh-sidebar__close { display: block; }
    .dh-mobile-toggle { display: flex; align-items: center; justify-content: center; }
}

/* Toast */
.dh-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 18px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-warm);
    border-radius: 999px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 9999;
}
.dh-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Figure / image-zoom ──────────────────────────────────────────── */
.dh-figure {
    position: relative;
    margin: 24px 0;
    padding: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.dh-figure:hover {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.dh-figure > img,
.dh-figure > svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 6px;
    margin: 0;
}
.dh-figure__caption {
    margin: 8px 4px 4px;
    font-size: 12px;
    color: var(--text-muted, #64748b);
    text-align: center;
    line-height: 1.5;
}
.dh-figure__zoom {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-warm);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--text-primary);
    cursor: zoom-in;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .15s ease, transform .15s ease, background .15s ease;
    padding: 0;
    z-index: 2;
}
.dh-figure:hover .dh-figure__zoom,
.dh-figure:focus-within .dh-figure__zoom {
    opacity: 1;
    transform: translateY(0);
}
.dh-figure__zoom:hover {
    background: #ffffff;
    border-color: rgba(99, 102, 241, 0.5);
    color: #6366f1;
}
.dh-figure__zoom:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    opacity: 1;
}
/* Always show the button on touch devices */
@media (hover: none) {
    .dh-figure__zoom { opacity: 1; transform: none; }
}

/* Lightbox */
body.dh-no-scroll { overflow: hidden; }

.dh-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
}
.dh-lightbox.open { display: block; }
.dh-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    animation: dhLbFade .18s ease forwards;
    cursor: zoom-out;
}
.dh-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.6);
    color: #f8fafc;
    cursor: pointer;
    z-index: 2;
    transition: background .15s ease, transform .15s ease;
    padding: 0;
}
.dh-lightbox__close:hover {
    background: rgba(15, 23, 42, 0.9);
    transform: scale(1.05);
}
.dh-lightbox__close:focus-visible {
    outline: 2px solid #f8fafc;
    outline-offset: 2px;
}
.dh-lightbox__stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 32px;
    cursor: zoom-out;
}
.dh-lightbox__inner {
    width: min(95vw, 1600px);
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    opacity: 0;
    transform: scale(0.96);
    animation: dhLbPop .22s cubic-bezier(.4,0,.2,1) forwards;
}
.dh-lightbox__inner > img,
.dh-lightbox__inner > svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    object-fit: contain;
}

@keyframes dhLbFade {
    to { opacity: 1; }
}
@keyframes dhLbPop {
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .dh-lightbox__stage { padding: 64px 12px 12px; }
    .dh-lightbox__close { top: 12px; right: 12px; }
}
