:root {
    /* Racing-inspired color palette */
    --color-primary: #e10600;
    --color-primary-dark: #b80500;
    --color-secondary: #1e1e1e;
    --color-accent: #f5a623;
    --color-accent-light: #ffd700;
    
    /* Neutrals (FORCED DARK MODE) */
    --color-bg: #0d0d0d;      /* Deep black background */
    --color-bg-alt: #1a1a1a;  /* Dark grey for cards/sections */
    --color-bg-dark: #000000;
    --color-text: #f3f4f6;    /* Light text */
    --color-text-muted: #9ca3af;
    --color-text-light: #6b7280;
    --color-border: #374151;  /* Dark borders */
    
    /* Semantic colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    
    /* Shadows (Darker shadows for dark mode) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    
    /* Typography */
    --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-heading: 'Segoe UI', system-ui, -apple-system, sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Layout */
    --max-width: 75rem;
    --content-width: 48rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
}

/* Reset and base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-primary);
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    z-index: 1000;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-md);
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    /* Forced dark gradient */
    background: linear-gradient(135deg, #000000 0%, var(--color-secondary) 100%);
    border-bottom: 3px solid var(--color-primary);
    min-height: 4rem;
}

/* Main content area */
main {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-md);
}

@media (min-width: 768px) {
    main {
        padding: var(--space-3xl) var(--space-xl);
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
    margin-bottom: var(--space-lg);
    position: relative;
    padding-bottom: var(--space-md);
}

h2 {
    font-size: clamp(1.5rem, 1.25rem + 1.25vw, 2.25rem);
    margin-top: var(--space-3xl);
    margin-bottom: var(--space-lg);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
    position: relative;
}

h2::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 3rem;
    height: 3px;
    background: var(--color-primary);
}

h3 {
    font-size: clamp(1.25rem, 1.1rem + 0.75vw, 1.625rem);
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

h3::before {
    content: '';
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    background: var(--color-primary);
    margin-right: var(--space-sm);
    transform: rotate(45deg);
    vertical-align: middle;
}

p {
    margin-bottom: var(--space-lg);
    color: var(--color-text);
}

/* Lead paragraph */
main > p:first-of-type {
    font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
    color: var(--color-text-muted);
    line-height: 1.8;
    border-left: 4px solid var(--color-primary);
    padding-left: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

/* Strong and emphasis */
strong {
    font-weight: 700;
    color: var(--color-text);
}

em {
    font-style: italic;
}

/* Links */
a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration-color: var(--color-accent);
}

/* Lists */
ul, ol {
    margin-bottom: var(--space-lg);
    padding-left: var(--space-xl);
}

li {
    margin-bottom: var(--space-sm);
    padding-left: var(--space-sm);
}

/* Nested lists */
li > ul, li > ol {
    margin-top: var(--space-sm);
    margin-bottom: var(--space-sm);
}

/* Blockquote */
blockquote {
    position: relative;
    margin: var(--space-2xl) 0;
    padding: var(--space-xl) var(--space-xl) var(--space-xl) var(--space-2xl);
    background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

blockquote::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

blockquote p {
    font-size: 1.125em;
    font-style: italic;
    color: var(--color-text-muted);
    margin-bottom: 0;
}

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

/* Images */
figure {
    margin: var(--space-2xl) 0;
}

.hero-image {
    width: 100%;
    margin: 0 0 2rem;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    /* Forced dark shadow */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.article-image {
    margin: 2rem 0;
    text-align: center;
}

.article-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .hero-image {
        margin: 0 0 1.5.rem;
        width: 100%;
    }
    
    .hero-image img {
        border-radius: 12px;
    }
    
    .article-image {
        margin: 1.5rem 0;
    }
    
    .article-image img {
        border-radius: 8px;
    }
}

figcaption {
    margin-top: var(--space-sm);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-align: center;
    font-style: italic;
}

/* Tables */
table {
    width: 100%;
    margin: var(--space-2xl) 0;
    border-collapse: collapse;
    font-size: 0.9375rem;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #2d2d2d 100%);
    color: white;
}

th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.025em;
}

td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

tbody tr {
    background: var(--color-bg);
    transition: background var(--transition-fast);
}

tbody tr:nth-child(even) {
    background: var(--color-bg-alt);
}

tbody tr:hover {
    background: color-mix(in srgb, var(--color-primary) 5%, var(--color-bg));
}

/* Code */
code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875em;
    padding: 0.2em 0.4em;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

pre {
    margin: var(--space-2xl) 0;
    padding: var(--space-lg);
    background: var(--color-secondary);
    color: #e5e7eb;
    border-radius: var(--radius-md);
    overflow-x: auto;
    box-shadow: var(--shadow-lg);
}

pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Horizontal rule */
hr {
    margin: var(--space-3xl) 0;
    border: none;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--color-border) 20%, 
        var(--color-primary) 50%, 
        var(--color-border) 80%, 
        transparent 100%);
}

/* Navigation (Table of Contents) */
nav[aria-label="Inhaltsverzeichnis"] {
    margin: var(--space-2xl) 0;
    padding: var(--space-xl);
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

nav[aria-label="Inhaltsverzeichnis"]::before {
    content: 'Inhaltsverzeichnis';
    display: block;
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

nav ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

nav li {
    padding-left: 0;
    margin-bottom: var(--space-xs);
}

nav a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    text-decoration: none;
    color: var(--color-text-muted);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

nav a:hover {
    color: var(--color-primary);
    transform: translateX(4px);
}

nav a:hover::before {
    transform: scale(1.5);
}

/* FAQ styling */
details {
    margin-bottom: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}

details:hover {
    box-shadow: var(--shadow-md);
}

details[open] {
    box-shadow: var(--shadow-lg);
}

summary {
    padding: var(--space-lg);
    font-weight: 600;
    cursor: pointer;
    background: var(--color-bg-alt);
    transition: background var(--transition-fast), color var(--transition-fast);
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

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

summary::before {
    content: '+';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 400;
    transition: transform var(--transition-base), background var(--transition-base);
}

details[open] summary::before {
    content: '-';
    transform: rotate(180deg);
    background: var(--color-accent);
}

summary:hover {
    background: color-mix(in srgb, var(--color-primary) 5%, var(--color-bg-alt));
}

details > div,
details > p {
    padding: var(--space-lg);
    border-top: 1px solid var(--color-border);
}

/* Racing checkered pattern for special sections */
.checkered-accent {
    position: relative;
    overflow: hidden;
}

.checkered-accent::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: repeating-conic-gradient(
        var(--color-secondary) 0% 25%, 
        transparent 0% 50%
    ) 0 0 / 20px 20px;
    opacity: 0.05;
    pointer-events: none;
}

/* Utility: Visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print styles */
@media print {
    header, footer {
        display: none;
    }
    
    main {
        max-width: 100%;
        padding: 0;
    }
    
    h1, h2, h3 {
        break-after: avoid;
    }
    
    figure, table, blockquote {
        break-inside: avoid;
    }
    
    a {
        text-decoration: none;
        color: var(--color-text);
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: var(--color-text-muted);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-border: currentColor;
    }
    
    h2::before, h1::after {
        background: currentColor;
    }
}

/* =========================================
   Desktop Menu Styling (F1 Style)
   ========================================= */

@media (min-width: 1024px) {

    /* 1. Navigation Container */
    .top-navigation-bar {
        display: flex;
        align-items: center;
        justify-content: center; /* Centers the menu horizontally */
        height: 100%;
        max-width: var(--max-width);
        margin: 0 auto;
        padding: 0 var(--space-md);
        position: relative;
    }

    /* 2. List Reset */
    .menu-desktop {
        display: flex;
        gap: var(--space-xl); /* Spacing between items */
        list-style: none;
        margin: 0;
        padding: 0;
    }

    /* 3. Link Styles */
    .menu-desktop a {
        position: relative;
        display: block;
        padding: 1.5rem 0; /* Increase clickable area */
        color: #ffffff; /* White text for contrast */
        font-family: var(--font-heading);
        font-size: 0.95rem;
        font-weight: 700;
        text-transform: uppercase; /* Aggressive racing style */
        letter-spacing: 0.05em;
        text-decoration: none;
        transition: color 0.3s ease;
    }

    /* 4. Hover Effect (Red underline) */
    .menu-desktop a::after {
        content: '';
        position: absolute;
        bottom: 15px;
        left: 0;
        width: 0; /* Hidden by default */
        height: 3px;
        background-color: var(--color-primary); /* F1 red color */
        transition: width 0.3s ease-in-out; /* Smooth acceleration animation */
        box-shadow: 0 0 10px rgba(225, 6, 0, 0.5); /* Slight glow */
    }

    /* Hover State */
    .menu-desktop a:hover {
        color: var(--color-accent-light); /* Yellow tint on hover */
    }

    .menu-desktop a:hover::after {
        width: 100%; /* Line expands to full width */
    }

    /* Active Menu Item */
    .menu-desktop .current-menu-item > a {
        color: var(--color-primary);
    }
    
    .menu-desktop .current-menu-item > a::after {
        width: 100%; /* Line always visible on active page */
    }

    /* 5. Sub-menu (Dropdown) */
    .menu-desktop .menu-item-has-children {
        position: relative;
    }

    .menu-desktop .sub-menu {
        position: absolute;
        top: 100%;
        left: 50%; /* Center align relative to parent */
        transform: translateX(-50%) translateY(10px); /* Adjust centering */
        background: var(--color-secondary); /* Dark background */
        min-width: 220px;
        padding: 10px 0;
        list-style: none;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        border-top: 3px solid var(--color-primary); /* Red top border */
        border-radius: 0 0 4px 4px;
        
        /* Hidden by default */
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }

    /* Show sub-menu on hover */
    .menu-desktop .menu-item-has-children:hover .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    .menu-desktop .sub-menu a {
        padding: 10px 20px;
        font-size: 0.9rem;
        text-transform: none; /* Normal case for sub-items */
        color: var(--color-text-muted);
        text-align: center; /* Optional: Center text in dropdown */
    }

    .menu-desktop .sub-menu a:hover {
        background: rgba(255,255,255,0.05);
        color: #fff;
    }
    
    .menu-desktop .sub-menu a::after {
        display: none; /* Remove underline for sub-items */
    }
}

/* =========================================
   Mobile Menu Styling (F1 Style)
   ========================================= */

@media (max-width: 1023px) {
    /* Hide Desktop Menu */
    .site-nav--desktop {
        display: none !important;
    }

    /* --- 1. Burger Button (The Trigger) --- */
    .mobile-controls {
        position: absolute; /* Fixed position relative to header */
        top: 20px;          /* Adjusted vertical position */
        right: 20px;        /* Adjust horizontal position */
        display: block;
        z-index: 2000;      /* Ensure it stays on top of everything */
        margin: 0;
    }

    .burger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 32px;
        height: 22px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        position: relative;
    }

    .burger span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #ffffff; /* White lines */
        border-radius: 2px;
        transition: all 0.3s ease-in-out;
        transform-origin: left;
    }

    /* Burger Hover State */
    .burger:hover span {
        background-color: var(--color-primary); /* Red on hover */
    }

    /* Burger Active State (Transforms into X) */
    .burger.is-active span:first-child {
        transform: rotate(45deg);
        background-color: var(--color-primary);
    }

    .burger.is-active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }

    .burger.is-active span:last-child {
        transform: rotate(-45deg);
        background-color: var(--color-primary);
    }

    /* --- 2. Mobile Menu Container (Off-canvas) --- */
    #mobile-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 85%; /* Cover most of the screen */
        max-width: 360px;
        height: 100vh;
        background-color: #1a1a1a; /* Dark background */
        z-index: 1000;
        padding: 80px 30px 40px; /* Top padding clears the close button area */
        box-shadow: -5px 0 20px rgba(0,0,0,0.5);
        
        /* Animation Logic */
        transform: translateX(100%); /* Hidden to the right */
        transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1); /* Fast "F1" easing */
        display: block; /* Override default hidden state if needed */
    }

    #mobile-menu.is-open {
        transform: translateX(0); /* Slide in */
    }

    /* Decorative Red Line on the left edge */
    #mobile-menu::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-accent) 100%);
    }

    /* --- 3. Close Button inside Menu --- */
    .mobile-menu__close {
        position: absolute;
        top: 25px;
        right: 25px;
        background: none;
        border: none;
        font-size: 2rem;
        color: #666;
        cursor: pointer;
        transition: color 0.3s;
    }

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

    /* --- 4. Menu Links Styling (Centered) --- */
    .menu-mobile {
        list-style: none; /* Remove default dots */
        padding: 0;
        margin: 0;
        text-align: center; /* Center align items */
    }

    /* Force remove custom markers if set via ::marker */
    .menu-mobile li::marker {
        content: none;
    }

    .menu-mobile li {
        margin-bottom: 0;
        border-bottom: 1px solid rgba(255,255,255,0.05); /* Subtle separator */
        opacity: 0; /* Hidden for animation */
        transform: translateX(20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    /* Staggered animation when menu opens */
    #mobile-menu.is-open .menu-mobile li {
        opacity: 1;
        transform: translateX(0);
    }
    
    /* Delays for each item for a "waterfall" effect */
    #mobile-menu.is-open .menu-mobile li:nth-child(1) { transition-delay: 0.1s; }
    #mobile-menu.is-open .menu-mobile li:nth-child(2) { transition-delay: 0.2s; }
    #mobile-menu.is-open .menu-mobile li:nth-child(3) { transition-delay: 0.3s; }
    #mobile-menu.is-open .menu-mobile li:nth-child(4) { transition-delay: 0.4s; }
    #mobile-menu.is-open .menu-mobile li:nth-child(5) { transition-delay: 0.5s; }

    .menu-mobile a {
        display: block;
        width: 100%;
        padding: 20px 0; /* More spacing top/bottom */
        color: #ffffff;
        font-family: var(--font-heading);
        font-size: 1.1rem;
        font-weight: 600;
        text-decoration: none;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        text-align: center; /* Ensure text is centered */
        transition: color 0.2s, letter-spacing 0.2s; /* Smooth transition */
    }

    .menu-mobile a:hover {
        color: var(--color-primary);
        letter-spacing: 0.15em; /* Text expands slightly on hover - speed effect */
        padding-left: 0; /* No left shift needed for centered menu */
    }

    /* --- 5. Overlay (Backdrop) --- */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7); /* Dark dimming */
        backdrop-filter: blur(3px); /* Glass effect */
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

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

/* =========================================
   Footer Styles (Reference Design)
   ========================================= */

.site-footer {
    background-color: #0d0d0d; /* Very dark background */
    color: #b0b0b0; /* Light grey text for readability */
    padding: 60px 20px 20px;
    margin-top: 50px;
    border-top: 3px solid var(--color-primary); /* Red line on top */
    font-size: 0.9rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* --- Grid Layout --- */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 Equal columns */
    gap: 30px;
    margin-bottom: 50px;
}

/* --- Column Typography --- */
.footer-heading {
    color: var(--color-accent); /* Yellow/Gold color for titles */
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none; /* Reset any default borders */
    padding: 0;
}

/* Reset headings pseudo-elements if any from global styles */
.footer-heading::before, 
.footer-heading::after {
    display: none; 
}

/* --- Lists styling --- */
.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 12px;
    line-height: 1.5;
    color: #cccccc;
}

/* Red Bullet Points */
.footer-list li::before {
    content: '•';
    color: var(--color-primary); /* Red bullet */
    position: absolute;
    left: 0;
    top: 0px;
    font-size: 1.2em;
    line-height: 1.2;
}

/* Links in Footer */
.footer-list a,
.text-link {
    color: #cccccc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-list a:hover,
.text-link:hover {
    color: var(--color-primary); /* Red on hover */
    text-decoration: underline;
}

/* --- Copyright Bar --- */
.footer-copyright {
    border-top: 1px solid #333;
    padding-top: 30px;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

/* --- Mobile Responsiveness for Footer --- */
@media (max-width: 1023px) {
    .footer-grid {
        grid-template-columns: 1fr; /* Stack columns vertically */
        gap: 40px;
    }

    .site-footer {
        padding-top: 40px;
        text-align: left; /* Keep left alignment for lists */
    }
    
    .footer-copyright {
        margin-top: 20px;
    }
}

/* =========================================
   404 Error Page Styling (F1 Style)
   ========================================= */

/* Container to center content and ensure footer stays at bottom */
.error-404-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh; /* Takes up most of the screen height */
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    background: radial-gradient(circle at center, #1e1e1e 0%, #0d0d0d 100%); /* Spotlight effect */
}

.error-content-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

/* The giant 404 number */
.error-code {
    font-family: var(--font-heading);
    font-size: clamp(6rem, 15vw, 12rem); /* Responsive giant text */
    font-weight: 900;
    line-height: 1;
    margin: 0;
    color: transparent;
    -webkit-text-stroke: 4px var(--color-primary); /* Outline style like racing numbers */
    position: relative;
    display: inline-block;
    font-style: italic; /* Speed look */
}

/* Optional: Add a "glitch" or shadow effect */
.error-code::after {
    content: '404';
    position: absolute;
    top: 5px;
    left: 5px;
    color: var(--color-primary);
    opacity: 0.1;
    z-index: -1;
    -webkit-text-stroke: 0;
}

/* Headline "Box Box" */
.error-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: #ffffff;
    margin-top: var(--space-md);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-top: none; /* Override default h2 styles */
    padding-top: 0;
}

.error-title::before {
    display: none; /* Remove the red line from standard h2 */
}

/* Description text */
.error-text {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}

/* F1 Style Button */
.f1-btn-primary {
    display: inline-block;
    padding: 15px 35px;
    background-color: var(--color-primary);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 2px solid var(--color-primary);
    letter-spacing: 0.05em;
}

.f1-btn-primary:hover {
    background-color: transparent;
    color: var(--color-primary);
    box-shadow: 0 0 15px rgba(225, 6, 0, 0.4);
    transform: translateY(-2px);
}
.articles-sitemap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.sitemap-header {
    text-align: center;
    margin-bottom: 60px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sitemap-header h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.sitemap-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    margin: 0;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.article-card {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    overflow: hidden;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-left: unset !important;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.0) 100%);
    z-index: 1;
}

.article-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.article-card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: end;
    color: #fff;
    padding: 1rem;
}

.article-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.article-link {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
}

.article-link:hover {
    color: #64b5f6;
}

.article-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    opacity: 0.9;
}

.article-children {
    margin-top: auto;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.children-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.child-item {
    margin: 0;
}

.child-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s;
}

.child-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateX(5px);
}

.child-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.child-title {
    font-size: 0.95rem;
    font-weight: 500;
}

.grandchildren-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 52px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grandchild-item {
    margin: 0;
}

.grandchild-item a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s;
    display: block;
}

.grandchild-item a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.article-card-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.article-date {
    font-style: italic;
}

.has-thumbnail {
    display: flex;
    align-items: center;
    gap: 5px;
}

.has-thumbnail svg {
    opacity: 0.8;
    transition: opacity 0.3s;
}

.has-thumbnail:hover svg {
    opacity: 1;
}

.sitemap-footer {
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.articles-count,
.last-updated {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #64b5f6;
}

.no-articles {
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    margin: 40px 0;
}

.no-articles p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

@media (max-width: 1200px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .articles-sitemap {
        padding: 30px 15px;
    }
    
    .sitemap-header h1 {
        font-size: 2.2rem;
    }
    
    .sitemap-header p {
        font-size: 1.1rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .article-card {
        min-height: 350px;
    }
    
    .article-card-content {
        padding: 25px;
    }
    
    .article-title {
        font-size: 1.6rem;
    }
    
    .footer-stats {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .sitemap-header h1 {
        font-size: 1.8rem;
    }
    
    .article-card {
        min-height: 320px;
    }
    
    .article-card-content {
        padding: 20px;
    }
    
    .article-title {
        font-size: 1.4rem;
    }
    
    .child-link {
        padding: 6px 10px;
    }
    
    .child-thumbnail {
        width: 35px;
        height: 35px;
    }
}

.article-card:not([style*="background-image"]) {
    background: linear-gradient(135deg, #ffffff 0%, #000000 100%);
}

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }
.article-card:nth-child(4) { animation-delay: 0.4s; }
.article-card:nth-child(5) { animation-delay: 0.5s; }
.article-card:nth-child(n+6) { animation-delay: 0.6s; }

.article-card {
    background-attachment: fixed;
}

@media (max-width: 768px) {
    .article-card {
        background-attachment: scroll;
    }
}