/* ============================================
   DarkMatter Pages — "Underground Terminal" Aesthetic
   CRT scanlines, glitch text, terminal chrome,
   toxic green + amber dual-accent on void black
   ============================================ */

/* --- RESET --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9375rem;
    line-height: 1.75;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* --- VARIABLES --- */
:root {
    --color-bg: #0A0A0C;
    --color-surface: #0F0F13;
    --color-surface-raised: #141419;
    --color-surface-glow: #161620;

    --color-green: #00E87B;
    --color-green-dim: #00B85F;
    --color-green-dark: #003D1F;
    --color-green-glow: rgba(0, 232, 123, 0.08);
    --color-green-glow-strong: rgba(0, 232, 123, 0.15);

    --color-amber: #D4920B;
    --color-amber-dim: #A67208;
    --color-amber-glow: rgba(212, 146, 11, 0.1);

    --color-red: #FF3B4F;

    --color-text: #B8BCB9;
    --color-text-muted: #5E6360;
    --color-text-bright: #E0E4E1;

    --color-border: rgba(0, 232, 123, 0.06);
    --color-border-strong: rgba(0, 232, 123, 0.12);
    --color-border-amber: rgba(212, 146, 11, 0.15);

    --color-link: #00E87B;
    --color-link-hover: #4DFFAD;

    --color-code-bg: #060609;
    --color-code-text: #00E87B;

    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    --container-narrow: 740px;
    --container-default: 960px;

    --radius-sm: 2px;
    --radius-md: 4px;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;
}

/* --- CRT SCANLINE OVERLAY --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.03) 0px,
        rgba(0, 0, 0, 0.03) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 9999;
}

/* --- GRID BACKGROUND --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 232, 123, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 232, 123, 0.015) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: -1;
}

/* --- SKIP LINK --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-sm);
    background: var(--color-green);
    color: var(--color-bg);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: 10000;
    font-size: 0.8125rem;
}
.skip-link:focus {
    top: var(--space-sm);
}

/* --- LAYOUT --- */
.container {
    max-width: var(--container-default);
    margin: 0 auto;
    padding: 0 var(--space-md);
}
.container-narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* --- HEADER --- */
.site-header {
    border-bottom: 1px solid var(--color-border-strong);
    padding: 0;
    background: var(--color-surface);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
}

/* Terminal prompt-style logo */
.site-logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--color-green);
    letter-spacing: -0.01em;
    white-space: nowrap;
    position: relative;
}
.site-logo::before {
    content: '>';
    color: var(--color-text-muted);
    margin-right: 0.4em;
    font-weight: 400;
}
.site-logo:hover { color: var(--color-link-hover); }
.site-logo .logo-accent {
    color: var(--color-text-muted);
    font-weight: 400;
}

/* Nav as terminal command list */
.primary-nav ul {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.primary-nav a {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
    padding: 0.35em 0.75em;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, border-color 0.15s ease;
}
.primary-nav a:hover {
    color: var(--color-green);
    border-color: var(--color-border-strong);
}
.primary-nav a[aria-current="page"] {
    color: var(--color-green);
    border-color: var(--color-green-dim);
    background: var(--color-green-glow);
}

/* --- BREADCRUMB --- */
.breadcrumb-nav {
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}
.breadcrumb-nav ol {
    display: flex;
    gap: 0;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
}
.breadcrumb-nav li:not(:last-child)::after {
    content: ' / ';
    color: var(--color-text-muted);
    opacity: 0.4;
}
.breadcrumb-nav a {
    color: var(--color-text-muted);
}
.breadcrumb-nav a:hover { color: var(--color-green); }

/* --- MAIN CONTENT --- */
.site-main {
    padding: var(--space-xl) 0 var(--space-2xl);
}

/* --- ARTICLE --- */

/* H1 with glitch chromatic aberration effect */
.article-content h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--color-text-bright);
    letter-spacing: -0.04em;
    margin-bottom: var(--space-xs);
    position: relative;
    text-shadow:
        -1px 0 var(--color-red),
        1px 0 var(--color-green-dim);
}

/* Byline as terminal timestamp */
.article-byline {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    margin-bottom: var(--space-lg);
    padding-left: var(--space-sm);
    position: relative;
}
.article-byline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2em;
    bottom: 0.2em;
    width: 2px;
    background: var(--color-green-dim);
}

/* H2 — section headers with left accent + hash prefix */
.article-content h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-bright);
    letter-spacing: -0.02em;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    padding-left: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    position: relative;
}
.article-content h2::before {
    content: '##';
    position: absolute;
    left: 0;
    color: var(--color-green-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.6;
    top: 0.35em;
}

/* H3 */
.article-content h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text-bright);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-xs);
    padding-left: var(--space-md);
    position: relative;
}
.article-content h3::before {
    content: '###';
    position: absolute;
    left: 0;
    color: var(--color-amber-dim);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 400;
    opacity: 0.5;
    top: 0.45em;
}

/* Paragraphs */
.article-content p {
    margin-bottom: var(--space-md);
    max-width: 68ch;
}

/* Links — green underline glow */
.article-content a {
    color: var(--color-link);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 232, 123, 0.3);
    transition: border-color 0.15s ease, text-shadow 0.15s ease;
}
.article-content a:hover {
    color: var(--color-link-hover);
    border-color: var(--color-green);
    text-shadow: 0 0 8px rgba(0, 232, 123, 0.25);
}

/* Inline code — terminal green */
.article-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--color-code-bg);
    color: var(--color-code-text);
    padding: 0.15em 0.45em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-strong);
}

/* Fenced code blocks — terminal window with chrome */
.article-content pre {
    background: var(--color-code-bg);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    padding-top: 2.5rem;
    margin-bottom: var(--space-md);
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.6;
    position: relative;
}
/* Terminal window title bar */
.article-content pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.75rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
/* Terminal window dots */
.article-content pre::after {
    content: '● ● ●';
    position: absolute;
    top: 0.35rem;
    left: 0.75rem;
    font-size: 0.5rem;
    letter-spacing: 0.3em;
    color: var(--color-text-muted);
    z-index: 1;
}
.article-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-code-text);
    font-size: inherit;
    word-break: normal;
}

/* Strong / em */
.article-content strong {
    color: var(--color-text-bright);
    font-weight: 600;
}
.article-content em {
    font-style: italic;
    color: var(--color-text);
}

/* Lists inside article */
.article-content ul,
.article-content ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-md);
}
.article-content ul { list-style: none; }
.article-content ol { list-style: decimal; }
.article-content ul li {
    position: relative;
    padding-left: 1.2em;
}
.article-content ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--color-green-dim);
}
.article-content li {
    margin-bottom: var(--space-xs);
    max-width: 68ch;
}

/* --- DISCLAIMER (aside) — warning terminal --- */
.disclaimer {
    background: var(--color-surface);
    border: 1px solid var(--color-border-amber);
    border-left: 3px solid var(--color-amber);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    padding-top: 2.25rem;
    margin-bottom: var(--space-lg);
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    position: relative;
}
.disclaimer::before {
    content: '⚠ NOTICE';
    position: absolute;
    top: 0.5rem;
    left: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--color-amber);
    text-transform: uppercase;
}
.disclaimer p { margin-bottom: 0; max-width: none; }

/* --- HERO LINKS — quick-nav below H1 --- */
.hero-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}
.hero-links a {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--color-green);
    padding: 0.4em 0.9em;
    border: 1px solid var(--color-green-dim);
    border-radius: var(--radius-sm);
    background: var(--color-green-glow);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    letter-spacing: 0.02em;
}
.hero-links a:hover {
    background: rgba(0, 232, 123, 0.15);
    border-color: var(--color-green);
    box-shadow: 0 0 8px rgba(0, 232, 123, 0.2);
    color: var(--color-link-hover);
}

/* --- HERO ADDRESS — primary .onion in hero --- */
.hero-address {
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-left: 3px solid var(--color-green);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.hero-address code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--color-green);
    word-break: break-all;
    letter-spacing: 0.02em;
    line-height: 1.5;
}
.hero-address-label {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.hero-address-meta {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: var(--color-text-muted);
}

/* --- VERIFICATION TABLE — database readout --- */
.article-content table {
    margin-bottom: var(--space-md);
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.article-content thead {
    background: var(--color-surface);
}
.article-content th {
    font-weight: 600;
    color: var(--color-green);
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border-strong);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.article-content td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}
.article-content tbody tr:last-child td {
    border-bottom: none;
}
.article-content tbody tr {
    transition: background 0.15s ease;
}
.article-content tbody tr:hover {
    background: var(--color-green-glow);
}

/* --- ONION ADDRESSES — special amber glow --- */
.article-content p code,
.article-content td code {
    color: var(--color-amber);
    background: var(--color-amber-glow);
    border-color: var(--color-border-amber);
    text-shadow: 0 0 6px rgba(212, 146, 11, 0.2);
}

/* --- FOOTER — terminal style --- */
.site-footer {
    border-top: 1px solid var(--color-border-strong);
    padding: var(--space-lg) 0;
    background: var(--color-surface);
    position: relative;
}
.site-footer .container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Footer link columns */
.footer-links {
    display: flex;
    gap: var(--space-xl);
    flex-wrap: wrap;
}
.footer-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 140px;
}
.footer-col-label {
    font-size: 0.625rem;
    font-family: var(--font-mono);
    color: var(--color-green-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.footer-col a {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    transition: color 0.15s ease;
    line-height: 1.8;
}
.footer-col a:hover { color: var(--color-green); }

/* Legacy .footer-nav kept for compat */
.footer-nav {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}
.footer-nav a {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    transition: color 0.15s ease;
}
.footer-nav a:hover { color: var(--color-green); }

.footer-disclaimer {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    max-width: 60ch;
    line-height: 1.5;
    opacity: 0.6;
}
.footer-copyright {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    opacity: 0.4;
}

/* --- BACK TO TOP --- */
.back-to-top {
    position: fixed;
    bottom: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    color: var(--color-green);
    font-size: 1.1rem;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, box-shadow 0.2s ease;
    z-index: 90;
}
.back-to-top.visible {
    opacity: 0.7;
    pointer-events: auto;
    transform: translateY(0);
}
.back-to-top:hover {
    opacity: 1;
    background: var(--color-green-glow);
    border-color: var(--color-green-dim);
    box-shadow: 0 0 12px rgba(0, 232, 123, 0.15);
    color: var(--color-green);
}

/* --- ENTRANCE ANIMATIONS --- */
.fade-up {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 0.4s ease forwards;
}
@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}
.stagger-1 { animation-delay: 0s; }
.stagger-2 { animation-delay: 0.06s; }
.stagger-3 { animation-delay: 0.12s; }

/* --- H1 GLITCH FLICKER (subtle, runs once) --- */
.article-content h1 {
    animation: glitchIn 0.6s ease forwards;
}
@keyframes glitchIn {
    0% {
        opacity: 0;
        transform: translateY(12px);
        text-shadow:
            -3px 0 var(--color-red),
            3px 0 var(--color-green-dim);
    }
    40% {
        opacity: 1;
        transform: translateY(-1px);
        text-shadow:
            -2px 0 var(--color-red),
            2px 0 var(--color-green-dim);
    }
    60% {
        opacity: 1;
        transform: translateY(1px);
        text-shadow:
            1px 0 var(--color-red),
            -1px 0 var(--color-green-dim);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        text-shadow:
            -1px 0 var(--color-red),
            1px 0 var(--color-green-dim);
    }
}

/* --- SECTION MARKER — pulsing green dot --- */
.article-content section {
    position: relative;
}
.article-content section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -1.5rem;
    width: 6px;
    height: 6px;
    background: var(--color-green);
    border-radius: 50%;
    opacity: 0.4;
    box-shadow: 0 0 6px var(--color-green-glow-strong);
}

/* --- HORIZONTAL RULE STYLE --- */
.article-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, var(--color-green-dim), transparent 60%);
    margin: var(--space-xl) 0;
}

/* --- MOBILE NAV TOGGLE (CSS-only hamburger) --- */
.nav-toggle {
    display: none;
}
.nav-toggle-label {
    display: none;
    cursor: pointer;
    padding: 0.5rem;
    margin: -0.5rem;
    -webkit-tap-highlight-color: transparent;
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-green);
    border-radius: 1px;
    position: relative;
    transition: transform 0.25s ease, opacity 0.15s ease;
}
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    content: '';
    position: absolute;
    left: 0;
}
.nav-toggle-label span::before { top: -6px; }
.nav-toggle-label span::after  { top: 6px; }

/* Animate to X on open */
.nav-toggle:checked + .nav-toggle-label span {
    background: transparent;
}
.nav-toggle:checked + .nav-toggle-label span::before {
    top: 0;
    transform: rotate(45deg);
    background: var(--color-green);
}
.nav-toggle:checked + .nav-toggle-label span::after {
    top: 0;
    transform: rotate(-45deg);
    background: var(--color-green);
}

/* --- SCROLLABLE TABLE WRAPPER --- */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--space-md);
}
.table-scroll table {
    margin-bottom: 0;
}

/* --- RESPONSIVE --- */

/* Tablet: 769px – 1024px */
@media (max-width: 1024px) {
    .article-content h1 {
        font-size: 1.75rem;
    }
}

/* Mobile: ≤ 768px */
@media (max-width: 768px) {
    /* --- Hamburger menu activation --- */
    .nav-toggle-label {
        display: block;
    }
    .site-header .container {
        flex-wrap: wrap;
        position: relative;
    }
    .primary-nav {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.2s ease;
        opacity: 0;
    }
    .nav-toggle:checked ~ .primary-nav {
        max-height: 400px;
        opacity: 1;
    }
    .primary-nav ul {
        flex-direction: column;
        gap: 0;
        padding: var(--space-xs) 0 var(--space-sm);
    }
    .primary-nav a {
        display: block;
        padding: 0.75em 0.75em;
        font-size: 0.8125rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        border-radius: var(--radius-sm);
    }
    .primary-nav a:active {
        background: var(--color-green-glow);
    }

    /* Typography scaling */
    .article-content h1 {
        font-size: 1.45rem;
    }
    .article-content h2 {
        font-size: 1.05rem;
        padding-left: var(--space-md);
    }
    .article-content h3 {
        font-size: 0.95rem;
    }
    body {
        font-size: 0.875rem;
    }

    /* Table: horizontal scroll */
    .article-content table {
        font-size: 0.6875rem;
        min-width: 520px;
    }
    .article-content th,
    .article-content td {
        padding: var(--space-xs) var(--space-sm);
        white-space: nowrap;
    }

    /* Section dots hidden */
    .article-content section::before {
        display: none;
    }

    /* Hero links stack vertically */
    .hero-links {
        flex-direction: column;
    }
    .hero-links a {
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hero address */
    .hero-address code {
        font-size: 0.75rem;
    }

    /* Footer columns stack */
    .footer-links {
        gap: var(--space-lg);
    }
    .footer-col a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .footer-nav {
        flex-direction: column;
        gap: var(--space-xs);
    }
    .footer-nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Back to top: larger touch target on mobile */
    .back-to-top {
        width: 44px;
        height: 44px;
    }

    /* Disclaimer */
    .disclaimer {
        font-size: 0.75rem;
        padding: var(--space-sm);
        padding-top: 2rem;
    }

    /* Breadcrumb scrollable */
    .breadcrumb-nav ol {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

/* Small phone: ≤ 480px */
@media (max-width: 480px) {
    .article-content h1 {
        font-size: 1.25rem;
        letter-spacing: -0.02em;
    }
    .container,
    .container-narrow {
        padding: 0 var(--space-sm);
    }
    .article-content pre {
        font-size: 0.6875rem;
        padding: var(--space-sm);
        padding-top: 2.25rem;
        margin-left: calc(-1 * var(--space-sm));
        margin-right: calc(-1 * var(--space-sm));
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .article-content h2::before,
    .article-content h3::before {
        display: none;
    }
    .article-content h2,
    .article-content h3 {
        padding-left: 0;
    }
    .site-main {
        padding: var(--space-lg) 0 var(--space-xl);
    }
    .article-content p {
        max-width: 100%;
    }
    .article-content li {
        max-width: 100%;
    }

    /* Hero address: full width */
    .hero-address {
        margin-left: calc(-1 * var(--space-sm));
        margin-right: calc(-1 * var(--space-sm));
        border-radius: 0;
        border-left: 3px solid var(--color-green);
    }

    /* Disclaimer: full width */
    .disclaimer {
        margin-left: calc(-1 * var(--space-sm));
        margin-right: calc(-1 * var(--space-sm));
        border-radius: 0;
    }
}

/* Tiny phone: ≤ 360px */
@media (max-width: 360px) {
    .article-content h1 {
        font-size: 1.1rem;
    }
    .site-logo {
        font-size: 0.8125rem;
    }
    .article-content h2 {
        font-size: 1rem;
    }
    .hero-address code {
        font-size: 0.6875rem;
    }
}

/* --- PREFERS REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    .fade-up,
    .article-content h1 {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .article-content h1 {
        text-shadow:
            -1px 0 var(--color-red),
            1px 0 var(--color-green-dim);
    }
    .primary-nav {
        transition: none;
    }
}

/* --- CONTENT VISIBILITY — skip off-screen rendering --- */
.cv-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 400px;
}

/* --- TOUCH TARGETS — ensure 44px minimum for interactive elements --- */
@media (pointer: coarse) {
    .primary-nav a,
    .hero-links a,
    .footer-nav a,
    .breadcrumb-nav a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
    }
    .article-content a {
        padding-top: 0.15em;
        padding-bottom: 0.15em;
    }
}
