/* ========================================
           1. CSS Variables & Reset
           ======================================== */
        :root {
            /* Colors - Light Theme */
            --color-primary: #1B4D3E;
            --color-accent: #C5A572;
            --color-accent-hover: #D4B88A;
            --color-text: #2D2D2D;
            --color-text-secondary: #5A5A5A;
            --color-bg: #FFFFFF;
            --color-surface: #F7F5F0;
            --color-border: #E0DDD6;
            --color-alert: #8B2942;
            --color-success: #4A7C59;
            --color-danger: #C53030;
            
            /* Typography */
            --font-display: 'Playfair Display', Georgia, serif;
            --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            
            /* Sizes */
            --h1: clamp(2rem, 4vw, 3rem);
            --h2: clamp(1.5rem, 3vw, 2rem);
            --h3: clamp(1.25rem, 2.5vw, 1.5rem);
            --body: clamp(1rem, 1.5vw, 1.125rem);
            --small: clamp(0.875rem, 1.2vw, 1rem);
            
            /* Hero Typography */
            --hero-h1: clamp(2.5rem, 5vw, 4rem);
            
            /* Line Heights */
            --lh-heading: 1.2;
            --lh-body: 1.7;
            
            /* Weights */
            --fw-normal: 400;
            --fw-medium: 500;
            --fw-bold: 700;
            
            /* Spacing */
            --section-gap: clamp(3rem, 6vw, 5rem);
            --content-max-width: 800px;
            --content-padding: clamp(1rem, 4vw, 2rem);
        
    /* --- AUTO-FORCED DARK THEME --- */
    --color-text: #F0EDE8;
                --color-text-secondary: #A8A29E;
                --color-bg: #1A1A1A;
                --color-surface: #252525;
                --color-border: #3D3D3D;
                --color-primary: #2D7A64;
}

        

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

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: var(--font-body);
            font-size: var(--body);
            line-height: var(--lh-body);
            color: var(--color-text);
            background-color: var(--color-bg);
        }

        /* ========================================
           2. General Typography
           ======================================== */
        h1, h2, h3, h4 {
            font-family: var(--font-display);
            font-weight: var(--fw-bold);
            line-height: var(--lh-heading);
            color: var(--color-text);
            text-align: left;
        }

        h2 {
            font-size: var(--h2);
            margin-top: 0;
            margin-bottom: 1.25rem;
        }

        h3 {
            font-size: var(--h3);
            margin-top: 2rem;
            margin-bottom: 0.75rem;
            scroll-margin-top: 2rem;
        }

        p {
            text-align: left;
            margin-bottom: 1.25rem;
        }

        p:last-child {
            margin-bottom: 0;
        }

        a {
            color: var(--color-primary);
            text-decoration: underline;
            text-underline-offset: 2px;
            transition: color 0.2s ease;
        }

        a:hover {
            color: var(--color-accent);
        }

        a:focus {
            outline: 2px solid var(--color-accent);
            outline-offset: 2px;
        }

        strong {
            font-weight: var(--fw-bold);
        }

        em {
            font-style: italic;
        }

        ul, ol {
            text-align: left;
            margin-bottom: 1.25rem;
            padding-left: 1.5rem;
        }

        li {
            margin-bottom: 0.5rem;
        }

        blockquote {
            text-align: left;
            border-left: 3px solid var(--color-accent);
            padding-left: 1.5rem;
            margin: 1.5rem 0;
            font-style: italic;
            color: var(--color-text-secondary);
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin: 1.5rem 0;
            font-size: var(--small);
        }

        th, td {
            text-align: left;
            padding: 0.75rem 1rem;
            border-bottom: 1px solid var(--color-border);
        }

        th {
            font-weight: var(--fw-medium);
            background-color: var(--color-surface);
        }

        /* ========================================
           3. Layout - Sections
           ======================================== */
        header {
            position: relative;
        }

        main {
            width: 100%;
        }

        [data-content] {
            max-width: var(--content-max-width);
            margin-left: auto;
            margin-right: auto;
            padding: var(--section-gap) var(--content-padding);
        }

        [data-content] + [data-content] {
            padding-top: 0;
        }

        [data-content="hero"] {
            max-width: none;
            padding: 0;
        }

        [data-content="toc"] {
            padding-top: calc(var(--section-gap) * 0.75);
            padding-bottom: calc(var(--section-gap) * 0.75);
        }

        h2 {
            scroll-margin-top: 2rem;
        }

        /* ========================================
           4. Components
           ======================================== */
        
        /* --- Info Box --- */
        .info-box {
            background-color: var(--color-surface);
            border: 1px solid var(--color-border);
            border-left: 4px solid var(--color-accent);
            border-radius: 4px;
            padding: 1.25rem 1.5rem;
            margin: 1.5rem 0;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }

        .info-box p {
            text-align: left;
            color: var(--color-text);
            margin-bottom: 0.75rem;
        }

        .info-box p:last-child {
            margin-bottom: 0;
        }

        /* --- Odds Example --- */
        .odds-example {
            background-color: var(--color-primary);
            color: var(--color-surface);
            border-radius: 6px;
            padding: 1.5rem;
            margin: 1.5rem 0;
            text-align: center;
            box-shadow: 0 2px 8px rgba(27,77,62,0.2);
        }

        .odds-example p {
            text-align: center;
            color: var(--color-surface);
            margin-bottom: 0.5rem;
        }

        .odds-example p:last-child {
            margin-bottom: 0;
        }

        .odds-example strong {
            color: var(--color-accent);
        }

        @media (prefers-color-scheme: dark) {
            .odds-example {
                background-color: #1B4D3E;
                color: #F0EDE8;
            }
            .odds-example p {
                color: #F0EDE8;
            }
        }

        /* --- Callout --- */
        .callout {
            border-left: 4px solid var(--color-alert);
            background-color: var(--color-surface);
            padding: 1rem 1.5rem;
            margin: 1.5rem 0;
            border-radius: 0 4px 4px 0;
        }

        .callout p {
            text-align: left;
            color: var(--color-text);
            margin-bottom: 0;
        }

        /* --- Card Grid --- */
        .card-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin: 1.5rem 0;
        }

        .card-grid > div {
            background-color: var(--color-surface);
            border: 1px solid var(--color-border);
            border-radius: 6px;
            padding: 1.25rem;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }

        .card-grid p {
            text-align: left;
            color: var(--color-text);
            margin-bottom: 0;
        }

        .card-grid h4 {
            font-family: var(--font-display);
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
        }

        /* --- Comparison --- */
        .comparison {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin: 1.5rem 0;
        }

        .comparison > div {
            background-color: var(--color-surface);
            border: 1px solid var(--color-border);
            border-radius: 6px;
            padding: 1.25rem;
        }

        .comparison h4 {
            font-family: var(--font-body);
            font-size: var(--small);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--color-text-secondary);
            margin-bottom: 0.75rem;
            border-bottom: 2px solid var(--color-accent);
            padding-bottom: 0.5rem;
        }

        .comparison p {
            text-align: left;
            color: var(--color-text);
            margin-bottom: 0;
        }

        @media (max-width: 600px) {
            .comparison {
                grid-template-columns: 1fr;
            }
        }

        /* --- TL;DR --- */
        .tldr {
            background-color: var(--color-surface);
            border-left: 4px solid var(--color-accent);
            border-radius: 0 6px 6px 0;
            padding: 1.5rem;
            margin: 1.5rem 0;
        }

        .tldr h2 {
            font-family: var(--font-display);
            font-size: clamp(1.125rem, 2vw, 1.25rem);
            margin-bottom: 1rem;
            color: var(--color-text);
        }

        .tldr ul {
            margin-bottom: 0;
        }

        .tldr li {
            color: var(--color-text);
        }

        /* --- Key Takeaway --- */
        .key-takeaway {
            border-top: 2px solid var(--color-accent);
            padding-top: 1rem;
            margin: 2rem 0 1.5rem;
        }

        .key-takeaway p {
            text-align: left;
            font-family: var(--font-display);
            font-size: clamp(1.125rem, 2vw, 1.375rem);
            font-weight: var(--fw-bold);
            line-height: 1.4;
            color: var(--color-text);
            margin-bottom: 0;
        }

        /* --- Fun Fact --- */
        .fun-fact {
            position: relative;
            padding-left: 1.5rem;
            margin: 1.5rem 0;
        }

        .fun-fact::before {
            content: '\2014';
            position: absolute;
            left: 0;
            color: var(--color-accent);
            font-weight: var(--fw-bold);
        }

        .fun-fact p {
            text-align: left;
            font-style: italic;
            color: var(--color-text-secondary);
            margin-bottom: 0;
        }

        /* --- Glossary Term --- */
        .glossary-term {
            display: flex;
            align-items: baseline;
            gap: 0.75rem;
            margin: 1rem 0;
        }

        .glossary-term span:first-child {
            font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
            color: var(--color-primary);
            text-decoration: underline;
            text-underline-offset: 3px;
            white-space: nowrap;
        }

        .glossary-term span:last-child {
            color: var(--color-text-secondary);
        }

        @media (max-width: 500px) {
            .glossary-term {
                flex-direction: column;
                gap: 0.25rem;
            }
        }

        /* --- Dos and Don'ts --- */
        .dos-donts {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin: 1.5rem 0;
        }

        .dos-donts > div {
            padding: 1rem;
            border-radius: 6px;
        }

        .dos-donts > div:first-child {
            background-color: rgba(74, 124, 89, 0.1);
            border: 1px solid var(--color-success);
        }

        .dos-donts > div:last-child {
            background-color: rgba(197, 48, 48, 0.1);
            border: 1px solid var(--color-danger);
        }

        .dos-donts h4 {
            font-family: var(--font-body);
            font-size: var(--small);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.75rem;
        }

        .dos-donts > div:first-child h4 {
            color: var(--color-success);
        }

        .dos-donts > div:last-child h4 {
            color: var(--color-danger);
        }

        .dos-donts ul {
            margin-bottom: 0;
            padding-left: 1.25rem;
        }

        .dos-donts li {
            color: var(--color-text);
        }

        @media (max-width: 600px) {
            .dos-donts {
                grid-template-columns: 1fr;
            }
        }

        /* --- Pre-Bet Checklist --- */
        .pre-bet-checklist {
            margin: 1.5rem 0;
        }

        .pre-bet-checklist > p:first-child {
            font-family: var(--font-display);
            font-size: var(--small);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--color-accent);
            margin-bottom: 0.75rem;
        }

        .pre-bet-checklist ul {
            border-left: 2px solid var(--color-border);
            padding-left: 1.5rem;
            margin-bottom: 0;
            list-style: none;
        }

        .pre-bet-checklist li {
            position: relative;
            padding-left: 0.5rem;
        }

        .pre-bet-checklist li::before {
            content: '\2610';
            position: absolute;
            left: -1.25rem;
            color: var(--color-accent);
            background-color: var(--color-bg);
            padding: 0 2px;
        }

        /* --- At a Glance --- */
        .at-a-glance {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 0;
            margin: 1.5rem 0;
            border: 1px solid var(--color-border);
            border-radius: 6px;
            overflow: hidden;
        }

        .at-a-glance > div {
            padding: 1rem;
            text-align: center;
            border-right: 1px solid var(--color-border);
        }

        .at-a-glance > div:last-child {
            border-right: none;
        }

        .at-a-glance h4 {
            font-family: var(--font-display);
            font-size: 1.5rem;
            color: var(--color-primary);
            margin-bottom: 0.25rem;
        }

        .at-a-glance p {
            text-align: center;
            font-size: var(--small);
            color: var(--color-text-secondary);
            margin-bottom: 0;
        }

        @media (max-width: 500px) {
            .at-a-glance {
                grid-template-columns: 1fr 1fr;
            }
            .at-a-glance > div {
                border-bottom: 1px solid var(--color-border);
            }
            .at-a-glance > div:nth-child(2n) {
                border-right: none;
            }
            .at-a-glance > div:nth-last-child(-n+2) {
                border-bottom: none;
            }
        }

        /* --- Worked Example --- */
        .worked-example {
            background-color: var(--color-surface);
            border-radius: 6px;
            padding: 1.5rem;
            margin: 1.5rem 0;
            box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        }

        .worked-example > p:first-child {
            font-weight: var(--fw-bold);
            margin-bottom: 1rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid var(--color-border);
        }

        .worked-example p {
            text-align: left;
            color: var(--color-text);
            font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
            font-size: 0.9em;
        }

        .worked-example p:last-child {
            color: var(--color-primary);
            font-weight: var(--fw-bold);
        }

        /* --- Section Bridge --- */
        .section-bridge {
            text-align: center;
            margin: 2rem 0;
            position: relative;
        }

        .section-bridge::before,
        .section-bridge::after {
            content: '\2022 \2022 \2022';
            color: var(--color-accent);
            font-size: 0.75rem;
            letter-spacing: 0.5em;
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
        }

        .section-bridge::before {
            left: 0;
        }

        .section-bridge::after {
            right: 0;
        }

        .section-bridge p {
            text-align: center;
            display: inline-block;
            font-family: var(--font-display);
            font-style: italic;
            color: var(--color-accent);
            padding: 0 2rem;
            margin: 0;
            background-color: var(--color-bg);
        }

        /* ========================================
           5. Hero Section
           ======================================== */
        [data-content="hero"] {
            position: relative;
            width: 100vw;
            margin-left: calc(50% - 50vw);
            min-height: 60vh;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            padding: clamp(2rem, 6vw, 4rem) var(--content-padding);
            background: linear-gradient(135deg, rgba(27,77,62,0.92) 0%, rgba(45,45,45,0.95) 100%);
        }

        [data-content="hero"] .hero-content {
            max-width: var(--content-max-width);
            margin: 0 auto;
            width: 100%;
            position: relative;
            z-index: 2;
        }

        .hero-meta {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .date-badge {
            display: inline-flex;
            align-items: center;
            background-color: rgba(255,255,255,0.1);
            padding: 0.375rem 0.75rem;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: var(--fw-medium);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: rgba(255,255,255,0.9);
        }

        .trust-marker {
            font-size: 0.7rem;
            font-weight: var(--fw-medium);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--color-accent);
        }

        [data-content="hero"] h1 {
            font-family: var(--font-display);
            font-size: var(--hero-h1);
            font-weight: var(--fw-bold);
            line-height: 1.1;
            color: #FFFFFF;
            margin-bottom: 1.5rem;
            text-align: left;
        }

        [data-content="hero"] .hero-description {
            font-size: clamp(1rem, 1.5vw, 1.125rem);
            line-height: 1.6;
            color: rgba(255,255,255,0.85);
            max-width: 600px;
            margin-bottom: 2rem;
        }

        .hero-cta {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background-color: var(--color-accent);
            color: var(--color-text);
            font-weight: var(--fw-medium);
            padding: 0.875rem 1.5rem;
            border-radius: 6px;
            text-decoration: none;
            transition: background-color 0.2s ease, transform 0.2s ease;
        }

        .hero-cta:hover {
            background-color: var(--color-accent-hover);
            color: var(--color-text);
            transform: translateY(-1px);
        }

        .hero-cta:focus {
            outline: 2px solid #FFFFFF;
            outline-offset: 2px;
        }

        [data-content="hero"] figure {
            position: absolute;
            inset: 0;
            z-index: 1;
        }

        [data-content="hero"] figure img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            opacity: 1.3;
        }

        [data-content="hero"] figcaption {
            position: absolute;
            bottom: 0.5rem;
            right: 0.5rem;
            font-size: 0.7rem;
            color: rgba(255,255,255,0.5);
            text-align: right;
        }

        /* ========================================
           6. Table of Contents (Grid 2-Column)
           ======================================== */
        [data-content="toc"] {
            background-color: var(--color-surface);
            border-radius: 8px;
            padding: 1.5rem;
        }

        [data-content="toc"] h2 {
            font-size: 1.25rem;
            margin-bottom: 1.25rem;
            color: var(--color-text);
        }

        .toc-list {
            column-count: 2;
            column-gap: 2rem;
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .toc-list > li {
            break-inside: avoid;
            margin-bottom: 1rem;
        }

        .toc-list > li > a {
            font-weight: var(--fw-medium);
            color: var(--color-primary);
            text-decoration: none;
            font-size: 0.95rem;
        }

        .toc-list > li > a:hover {
            color: var(--color-accent);
            text-decoration: underline;
        }

        .toc-sublist {
            list-style: none;
            padding-left: 1rem;
            margin-top: 0.5rem;
        }

        .toc-sublist li {
            margin-bottom: 0.375rem;
        }

        .toc-sublist a {
            font-size: 0.875rem;
            color: var(--color-text-secondary);
            text-decoration: none;
        }

        .toc-sublist a:hover {
            color: var(--color-accent);
        }

        @media (max-width: 600px) {
            .toc-list {
                column-count: 1;
            }
        }

        /* ========================================
           7. FAQ Accordion
           ======================================== */
        details {
            border-bottom: 1px solid var(--color-border);
            padding: 1rem 0;
        }

        details:first-of-type {
            border-top: 1px solid var(--color-border);
        }

        summary {
            cursor: pointer;
            font-weight: var(--fw-medium);
            font-size: 1.05rem;
            color: var(--color-text);
            list-style: none;
            position: relative;
            padding-right: 2rem;
        }

        summary::-webkit-details-marker {
            display: none;
        }

        summary::after {
            content: '+';
            position: absolute;
            right: 0;
            top: 0;
            font-size: 1.25rem;
            color: var(--color-accent);
            transition: transform 0.2s ease;
        }

        details[open] summary::after {
            content: '\2212';
        }

        details::details-content {
            opacity: 1;
            block-size: 0;
            overflow: hidden;
            transition: opacity 1.3s ease, block-size 0.3s ease, content-visibility 0.3s ease allow-discrete;
        }

        details[open]::details-content {
            opacity: 1;
            block-size: auto;
        }

        details {
            interpolate-size: allow-keywords;
        }

        details > div {
            padding-top: 0.75rem;
        }

        details p {
            color: var(--color-text-secondary);
            line-height: 1.7;
        }

        /* Fallback for older browsers */
        @supports not selector(::details-content) {
            details[open] > *:not(summary) {
                animation: fade-in 0.3s ease forwards;
            }
            
            @keyframes fade-in {
                from { opacity: 1; }
                to { opacity: 1; }
            }
        }

        /* ========================================
           8. Images
           ======================================== */
        figure {
            margin: 1.5rem auto;
            max-width: 100%;
        }

        figure img {
            max-width: 100%;
            height: auto;
            display: block;
            margin: 0 auto;
            border-radius: 6px;
        }

        .hero-image {
            width: 100%;
            max-width: 100%;
        }

        .article-image {
            max-width: 100%;
            height: auto;
            border-radius: 6px;
        }

        figcaption {
            text-align: center;
            font-size: var(--small);
            color: var(--color-text-secondary);
            margin-top: 0.5rem;
        }

        img[loading="lazy"] {
            background-color: var(--color-surface);
        }

        /* ========================================
           10. Utility - Buttons
           ======================================== */
        .btn-scroll {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background-color: transparent;
            border: 1px solid var(--color-border);
            color: var(--color-text-secondary);
            font-size: var(--small);
            font-weight: var(--fw-medium);
            padding: 0.625rem 1rem;
            border-radius: 4px;
            text-decoration: none;
            transition: border-color 0.2s ease, color 0.2s ease;
        }

        .btn-scroll:hover {
            border-color: var(--color-accent);
            color: var(--color-accent);
        }

        .back-to-top {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            z-index: 100;
            opacity: 1;
            visibility: hidden;
            transition: opacity 1.3s ease, visibility 0.3s ease;
        }

        .back-to-top.visible {
            opacity: 1;
            visibility: visible;
        }

        @media (max-width: 600px) {
            .back-to-top {
                bottom: 1rem;
                right: 1rem;
            }
        }

        /* ========================================
           11. Media Queries
           ======================================== */
        @media (max-width: 900px) {
            [data-content="hero"] {
                min-height: 50vh;
            }
        }

        @media (max-width: 600px) {
            :root {
                --section-gap: 2.5rem;
            }

            [data-content="hero"] {
                min-height: 45vh;
                padding: 1.5rem var(--content-padding);
            }

            [data-content="hero"] h1 {
                font-size: clamp(1.75rem, 7vw, 2.5rem);
            }

            .hero-cta {
                width: 100%;
                justify-content: center;
            }
        }

/* =========================================
   UNIVERSAL DESKTOP & MOBILE MENU + LOGO
   ========================================= */

/* Header Base */
.site-header {
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border, #333);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-navigation-bar {
    max-width: 950px; /* Optimized width to keep menu centered but separated */
    margin: 0 auto;
    padding: 15px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pushes logo left and burger/menu right */
}

/* --- LOGO FIXES --- */
.site-logo img {
    max-height: 75px; /* Optimal height for most logos */
    width: auto !important; /* Prevents squishing */
    display: block;
    transition: transform 0.2s ease;
}

.site-logo img:hover {
    transform: scale(1.02);
}

/* --- DESKTOP MENU --- */
.site-nav--desktop {
    display: none; /* Hidden on mobile by default */
}

@media (min-width: 769px) {
    .site-nav--desktop {
        display: block;
    }
    .mobile-controls {
        display: none; /* Hide burger on desktop */
    }
    
    .menu-desktop {
        display: flex;
        gap: 30px;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .menu-desktop a {
        text-decoration: none;
        color: var(--color-text);
        font-family: var(--font-body, sans-serif);
        font-weight: 500;
        font-size: 16px;
        transition: color 0.2s ease;
    }
    
    .menu-desktop a:hover {
        color: var(--color-accent);
    }
}

/* --- MOBILE BURGER BUTTON --- */
.burger {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 5px;
    z-index: 1000;
}

.burger span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--color-text);
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 2px;
}

/* Burger Animation to X */
.burger.is-active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.burger.is-active span:nth-child(2) {
    opacity: 0;
}
.burger.is-active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* --- MOBILE MENU SLIDER --- */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden off-screen */
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--color-bg);
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
    padding: 60px 30px;
}

.mobile-menu.is-open {
    right: 0; /* Slide in */
}

.mobile-menu__close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 36px;
    line-height: 1;
    color: var(--color-text);
    cursor: pointer;
    transition: color 0.2s ease;
}

.mobile-menu__close:hover {
    color: var(--color-accent);
}

.menu-mobile {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.menu-mobile a {
    text-decoration: none;
    color: var(--color-text);
    font-size: 20px;
    font-family: var(--font-display, sans-serif);
    font-weight: 600;
    display: block;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.menu-mobile a:hover {
    color: var(--color-accent);
    padding-left: 10px; /* Nice slide effect on hover */
}

/* --- OVERLAY --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px); /* Beautiful blur effect */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    z-index: 998;
}

.mobile-menu-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* =========================================
   UNIVERSAL FOOTER STYLES
   ========================================= */
.site-footer {
    background-color: #121212;
    color: #a3a3a3;
    padding: 70px 20px 30px;
    margin-top: 80px;
    font-family: var(--font-body, sans-serif);
    border-top: 3px solid var(--color-primary); 
}

.footer-container { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 40px; margin-bottom: 50px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); gap: 40px; } }

.footer-title {
    color: #f5f5f5; font-size: 1.05rem; font-weight: 600; margin-bottom: 1.5rem; margin-top: 0;
    text-transform: uppercase; letter-spacing: 0.08em; position: relative; padding-bottom: 12px;
}
.footer-title::after {
    content: ''; position: absolute; left: 0; bottom: 0; width: 40px; height: 2px;
    background-color: var(--color-accent); 
}

.footer-text { font-size: 0.9rem; line-height: 1.7; margin-bottom: 1rem; color: #a3a3a3; }
.footer-text a { color: var(--color-accent); text-decoration: none; transition: color 0.2s ease; }
.footer-text a:hover { text-decoration: underline; opacity: 0.8; }

.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { margin-bottom: 0.8rem; }
.footer-list a {
    color: var(--color-primary); text-decoration: none; font-size: 0.95rem; font-weight: 500;
    transition: all 0.2s ease; display: inline-block;
}
.footer-list a:hover { color: var(--color-accent); transform: translateX(5px); }

.footer-bottom { border-top: 1px solid #2a2a2a; padding-top: 25px; text-align: center; }
.footer-bottom p { margin: 0; font-size: 0.85rem; color: #737373; text-align: center; }

/* FLOATING BACK TO TOP BUTTON */
.back-to-top-btn {
    position: fixed; bottom: 30px; right: 30px;
    background-color: var(--color-primary); color: #ffffff;
    width: 45px; height: 45px; border-radius: 50%; border: none; font-size: 1.2rem; font-weight: bold;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4); opacity: 0; visibility: hidden;
    transform: translateY(20px); transition: all 0.3s ease; z-index: 99;
}
.back-to-top-btn.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top-btn:hover { background-color: var(--color-accent); color: #121212; transform: translateY(-5px); }

body {
    overflow-x: clip;
}

[data-content="toc"] {
    margin: 40px auto 50px auto; 
}

/* Center the TLDR block */
.tldr {
    margin: 1.5rem auto; 
}

/* Убираем лишний воздух сверху на всех внутренних страницах */
body:not(.home) main {
    padding-top: 10px !important; /* Можешь сделать 20px или даже 0 */
}

/* На всякий случай прижимаем самую первую секцию внутри main */
body:not(.home) main > *:first-child {
    padding-top: 0 !important;
    margin-top: 0 !important;
}