/* page-specific token overrides */
:root {
  --danger: #ef4444;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    html { scroll-behavior: smooth; }

    body {
        font-family: var(--font-sans);
        background: var(--bg-primary);
        color: var(--text-primary);
        line-height: 1.7;
        -webkit-font-smoothing: antialiased;
        overflow-x: hidden;
    }

    /* Ambient glow at top */
    body::before {
        content: '';
        position: fixed;
        top: -200px;
        left: 50%;
        transform: translateX(-50%);
        width: 900px;
        height: 500px;
        background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
        pointer-events: none;
        z-index: 0;
    }

    .wrap {
        position: relative;
        z-index: 1;
        max-width: 760px;
        margin: 0 auto;
        padding: 0 24px;
    }

    /* ---- Masthead ---- */
    .masthead {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.75rem 0;
        border-bottom: 1px solid var(--border-subtle);
    }
    .brand {
        font-weight: 800;
        letter-spacing: -0.02em;
        font-size: 1.05rem;
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        text-decoration: none;
        color: var(--text-primary);
    }
    .brand .dot {
        width: 10px; height: 10px; border-radius: 50%;
        background: var(--accent-gradient);
        box-shadow: 0 0 14px var(--accent-glow);
    }
    .masthead .where {
        font-family: var(--font-mono);
        font-size: 0.72rem;
        color: var(--text-muted);
        letter-spacing: 0.04em;
    }

    /* ---- Article header ---- */
    .post-head {
        padding: 4.5rem 0 2.5rem;
        animation: rise 0.7s cubic-bezier(0.16,1,0.3,1) both;
    }
    .eyebrow {
        font-family: var(--font-mono);
        font-size: 0.74rem;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        color: var(--accent-purple);
        margin-bottom: 1.4rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    .eyebrow::after {
        content: '';
        flex: 1;
        height: 1px;
        background: linear-gradient(90deg, var(--accent-purple), transparent);
        opacity: 0.5;
    }
    h1 {
        font-size: clamp(2.1rem, 6vw, 3.4rem);
        line-height: 1.05;
        font-weight: 800;
        letter-spacing: -0.03em;
        margin-bottom: 1.3rem;
    }
    h1 .grad {
        background: var(--accent-gradient);
        -webkit-background-clip: text; background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    .dek {
        font-size: 1.2rem;
        color: var(--text-secondary);
        max-width: 60ch;
    }
    .byline {
        margin-top: 2rem;
        padding-top: 1.4rem;
        border-top: 1px solid var(--border-subtle);
        font-size: 0.85rem;
        color: var(--text-muted);
        font-family: var(--font-mono);
        letter-spacing: 0.02em;
    }
    .byline strong { color: var(--text-secondary); font-weight: 500; }

    /* ---- Body copy ---- */
    article { padding-bottom: 3rem; }
    article p { margin: 1.35rem 0; font-size: 1.06rem; color: #e4e4e7; }
    article p.lead { font-size: 1.18rem; color: var(--text-primary); }
    article h2 {
        font-size: 1.7rem;
        font-weight: 700;
        letter-spacing: -0.02em;
        margin: 3.2rem 0 0.4rem;
        line-height: 1.2;
    }
    article h2 .kicker {
        display: block;
        font-family: var(--font-mono);
        font-size: 0.72rem;
        font-weight: 500;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        color: var(--accent-blue);
        margin-bottom: 0.6rem;
    }
    article h2 .kicker.g { color: var(--success); }
    article h2 .kicker.n { color: var(--danger); }
    article a { color: var(--accent-purple); text-decoration: underline; text-underline-offset: 3px; }
    article strong { color: #fff; font-weight: 600; }
    article em { color: var(--text-primary); }
    article code {
        font-family: var(--font-mono);
        font-size: 0.85em;
        background: rgba(255,255,255,0.07);
        border: 1px solid var(--border-subtle);
        border-radius: 5px;
        padding: 0.1em 0.4em;
        color: #e2e8f0;
    }

    /* ---- Pull quote / the one rule ---- */
    .pull {
        margin: 2.6rem 0;
        padding: 0.4rem 0 0.4rem 1.6rem;
        border-left: 3px solid transparent;
        border-image: var(--accent-gradient) 1;
        font-size: 1.55rem;
        line-height: 1.3;
        font-weight: 700;
        letter-spacing: -0.01em;
        color: var(--text-primary);
    }

    /* ---- Firewall callout ---- */
    .callout {
        margin: 2.4rem 0;
        padding: 1.5rem 1.6rem;
        border: 1px solid rgba(168, 85, 247, 0.35);
        border-radius: var(--radius-md);
        background: linear-gradient(180deg, rgba(168, 85, 247, 0.07) 0%, rgba(59, 130, 246, 0.045) 100%);
    }
    .callout .label {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-family: var(--font-mono);
        font-size: 0.72rem;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        color: var(--accent-purple);
        margin-bottom: 0.85rem;
    }
    .callout p { margin: 0; font-size: 1.08rem; color: var(--text-primary); }
    .callout strong { color: #fff; }

    /* ---- Green light / Hard no rule lists ---- */
    .rules {
        margin: 1.9rem 0 1rem;
        display: grid;
        gap: 0.85rem;
    }
    .rule-item {
        display: flex;
        gap: 0.95rem;
        align-items: flex-start;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 1.1rem 1.25rem;
        transition: border-color 0.2s, background 0.2s;
    }
    .rules.green .rule-item { border-left: 3px solid var(--success); }
    .rules.red .rule-item { border-left: 3px solid var(--danger); }
    .rule-item:hover { background: var(--bg-card-hover); border-color: #3a3a40; }
    .rules.green .rule-item:hover { border-left-color: var(--success); }
    .rules.red .rule-item:hover { border-left-color: var(--danger); }
    .rule-item .icon {
        flex-shrink: 0;
        width: 1.5rem;
        height: 1.5rem;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        font-weight: 700;
        margin-top: 0.1rem;
    }
    .rules.green .rule-item .icon { background: rgba(34, 197, 94, 0.14); color: var(--success); }
    .rules.red .rule-item .icon { background: rgba(239, 68, 68, 0.14); color: var(--danger); }
    .rule-item .body { min-width: 0; }
    .rule-item p { margin: 0; font-size: 0.99rem; color: #e4e4e7; }
    .rule-item .lead { color: #fff; font-weight: 600; }

    /* ---- Honest list ---- */
    .honest {
        margin: 1.7rem 0 1rem;
        padding: 0;
        list-style: none;
        display: grid;
        gap: 0.8rem;
    }
    .honest li {
        position: relative;
        padding-left: 1.7rem;
        font-size: 1.02rem;
        color: #e4e4e7;
    }
    .honest li::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0.55em;
        width: 0.5rem;
        height: 0.5rem;
        border-radius: 50%;
        background: var(--accent-gradient);
        box-shadow: 0 0 10px var(--accent-glow);
    }
    .honest li strong { color: #fff; }

    .signoff {
        margin: 2.8rem 0 1rem;
        font-family: var(--font-mono);
        font-size: 0.95rem;
        color: var(--accent-purple);
    }

    /* ---- Footnote refs ---- */
    sup.fnref { line-height: 0; }
    sup.fnref a {
        text-decoration: none;
        color: var(--accent-purple);
        font-weight: 700;
        font-size: 0.72em;
        padding: 0 0.1em;
    }
    sup.fnref a:hover { text-decoration: underline; }

    /* ---- Footnotes section ---- */
    .footnotes {
        margin-top: 3rem;
        padding-top: 1.7rem;
        border-top: 1px solid var(--border-color);
    }
    .footnotes h2 {
        font-family: var(--font-mono);
        font-size: 0.72rem;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        color: var(--text-muted);
        margin-bottom: 1.1rem;
    }
    .footnotes ol {
        margin: 0;
        padding-left: 1.4rem;
        color: var(--text-muted);
        font-size: 0.85rem;
        line-height: 1.7;
    }
    .footnotes li { margin: 0.7rem 0; padding-left: 0.2rem; }
    .footnotes li:target {
        color: var(--text-secondary);
        background: rgba(168, 85, 247, 0.08);
        border-radius: 6px;
        box-shadow: 0 0 0 6px rgba(168, 85, 247, 0.08);
    }
    .footnotes strong { color: var(--text-secondary); }
    .footnotes code {
        font-family: var(--font-mono);
        font-size: 0.9em;
        background: rgba(255,255,255,0.06);
        border-radius: 4px;
        padding: 0.05em 0.35em;
        color: #cbd5e1;
    }
    .footnotes a.backref {
        text-decoration: none;
        margin-left: 0.35rem;
        color: var(--accent-purple);
        font-weight: 700;
    }
    .footnotes a.backref:hover { text-decoration: underline; }

    /* ---- Footer ---- */
    footer {
        margin-top: 4rem;
        border-top: 1px solid var(--border-color);
        padding: 2.5rem 0 3rem;
    }
    .footer-row {
        display: flex; justify-content: space-between; align-items: center;
        flex-wrap: wrap; gap: 1rem;
        font-size: 0.85rem; color: var(--text-secondary);
    }
    .footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
    .footer-links a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
    .footer-links a:hover { color: var(--text-primary); }
    .footer-love { text-align: center; margin-top: 1.4rem; font-size: 0.82rem; color: var(--text-muted); }

    a:focus-visible, .rule-item:focus-visible {
        outline: 2px solid var(--accent-purple);
        outline-offset: 3px;
        border-radius: 4px;
    }

    @keyframes rise {
        from { opacity: 0; transform: translateY(24px); }
        to { opacity: 1; transform: translateY(0); }
    }

    @media (max-width: 560px) {
        .pull { font-size: 1.3rem; }
        article p { font-size: 1.02rem; }
        .callout { padding: 1.2rem 1.15rem; }
        .callout p { font-size: 1.02rem; }
    }

    @media (prefers-reduced-motion: reduce) {
        * { animation: none !important; scroll-behavior: auto !important; }
    }
