/* -------------------------------------
   VARIABLES & GLOBALS
---------------------------------------- */
:root {
    /* Colors - Alpine Dark Theme */
    --bg-color: #1a222e;
    --bg-alt: #232d3b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-hover: #7dd3fc;
    --border: #334155;

    /* Typography */
    --font-head: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing & Layout */
    --space-sm: 1rem;
    --space-md: 2.5rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    --container-w: 1400px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-color);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.6;
    position: relative;
    /* Prevent scroll jitter when loading */
    -webkit-font-smoothing: antialiased;
}

body.loading {
    overflow: hidden;
}

/* -------------------------------------
   TYPOGRAPHY
---------------------------------------- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-head);
    font-weight: 600;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.title {
    font-size: clamp(4rem, 15vw, 12rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    line-height: 0.85;
    margin-bottom: 0.5rem;
}

/* Typing cursor animation */
.typing-cursor::after {
    content: '|';
    animation: blink-cursor 0.75s step-end infinite;
    margin-left: 0.05em;
}

.typing-done::after {
    display: none;
}

@keyframes blink-cursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.super-title {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.9;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
    position: relative;
    max-width: 900px;
}

.box-title {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    color: var(--text-muted);
}

p {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.lead {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 400;
    color: var(--text-main);
    line-height: 1.4;
}

.accent {
    color: var(--accent);
    font-weight: 600;
}

.text-center {
    text-align: center;
}

/* -------------------------------------
   LAYOUT & CONTAINERS
---------------------------------------- */
.container {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 5%;
}

.section-spacing {
    padding: var(--space-xl) 0;
}

.has-bg {
    background-color: var(--bg-alt);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.align-start {
    align-items: flex-start;
}

/* -------------------------------------
   BUTTONS & LINKS
---------------------------------------- */
a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s var(--ease-out);
}

.btn-primary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.3s var(--ease-out);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--accent);
    color: #0f172a;
    border: 1px solid var(--accent);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--text-main);
}

/* -------------------------------------
   NAVIGATION
---------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    box-sizing: border-box;
    z-index: 100;
    color: #fff;
    transition: background 0.4s var(--ease-out), padding 0.4s var(--ease-out);
}

/* -------------------------------------
   LANGUAGE SWITCHER
---------------------------------------- */
.lang-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lang-btn:hover {
    color: var(--text-main);
}

.lang-btn.active {
    color: var(--text-main);
    text-decoration: underline;
}

.navbar.scrolled {
    padding: 1rem 5%;
    background: var(--bg-color);
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
}

.navbar.scrolled .lang-btn {
    color: var(--text-muted);
}

.navbar.scrolled .lang-btn:hover,
.navbar.scrolled .lang-btn.active {
    color: var(--text-main);
}

.hamburger {
    display: block;
    cursor: pointer;
    z-index: 101;
}

.nav-brand {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: var(--bg-alt);
    gap: 2rem;
    font-size: 1.5rem;
    font-weight: 500;
    transition: right 0.4s var(--ease-out);
    z-index: 100;
}

.nav-links.active {
    right: 0;
}

@media (min-width: 768px) {
    /* Removed empty .nav-links ruleset */
}

.nav-links a.btn-outline {
    padding: 0.5rem 1.25rem;
    background: transparent;
    border-color: var(--border);
    color: var(--text-main);
}

.nav-links a.btn-outline:hover {
    border-color: var(--text-main);
}

.navbar.scrolled .nav-links a.btn-outline {
    background: transparent;
    border-color: var(--text-main);
    color: var(--text-main);
}

.nav-links a:not(.btn-outline):hover {
    opacity: 0.7;
}

/* Fix mobile menu mixed blend mode issue */
.navbar.menu-open {
    background: var(--bg-alt) !important;
}

/* -------------------------------------
   HERO SECTION
---------------------------------------- */
.hero {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5%;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-image: linear-gradient(to bottom, rgba(10, 10, 10, 0.4), rgba(10, 10, 10, 0.8)),
        url('../images/large-1560654c6aa571.jpg');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: -1;
    will-change: transform;
}

.hero-content {
    color: #ffffff;
    z-index: 10;
    width: 100%;
}

.hero .tagline {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 2.5rem;
    line-height: 1.4;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.5;
    animation: bounce 2s infinite;
}

.mouse {
    width: 24px;
    height: 36px;
    border: 2px solid #fff;
    border-radius: 12px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translate(-50%, 0);
    }

    40% {
        transform: translate(-50%, -10px);
    }

    60% {
        transform: translate(-50%, -5px);
    }
}

/* -------------------------------------
   SCROLL SEQUENCE ELEMENTS
---------------------------------------- */
.sticky-container {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
}

.seq-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#seq-hero-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0 5%;
    box-sizing: border-box;
}

#seq-hero-text .title {
    text-align: center;
    width: 100%;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

#seq-about-bg {
    z-index: 11;
    opacity: 0;
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.7) 100%), 
                      url('../images/portrait-headshot.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: contain;
    transform: scale(1.05);
    will-change: opacity, transform;
}

#seq-about-text {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    max-width: 1200px;
    z-index: 12;
    opacity: 0;
    text-align: center;
    transform: translate(-50%, -40%);
    will-change: opacity, transform;
}

#seq-about-text .about-text {
    width: 100%;
}

@media (max-width: 768px) {
    #seq-about-bg {
        background-size: cover;
        background-position: center 15%; /* Position head better on mobile */
    }

    #seq-about-text {
        padding: 0 1rem;
    }

    #bio-lead {
        font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
    }

    .title {
        font-size: clamp(3rem, 12vw, 5rem);
        line-height: 0.9;
    }
}

/* -------------------------------------
   ABOUT
---------------------------------------- */
.about-quote blockquote {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin: 0;
    padding: 0;
    color: var(--text-main);
    letter-spacing: -0.02em;
    position: relative;
}

@media (min-width: 768px) {
    .about-quote {
        display: flex;
        align-items: center;
        padding-left: var(--space-lg);
        border-left: 4px solid var(--accent);
    }
}

.about-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.about-portrait {
    width: 100%;
    max-width: 500px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
}

.about-content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* -------------------------------------
   RESULTS & ON SNOW
---------------------------------------- */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    padding: 2rem 0;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

@media (min-width: 768px) {
    .timeline-item {
        grid-template-columns: 120px 1fr;
        gap: 3rem;
    }

    .timeline-item.align-right {
        grid-template-columns: 1fr 120px;
        text-align: right;
    }

    .timeline-item.align-right .timeline-date {
        order: 2;
        text-align: left;
    }

    .timeline-item.align-right .timeline-content {
        order: 1;
    }
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1;
}

.t-title {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.t-desc {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* -------------------------------------
   STATS & RANKINGS
---------------------------------------- */
.ranking-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.rank-card {
    background: var(--bg-alt);
    padding: 2rem 3rem;
    text-align: center;
    border: 1px solid var(--border);
    transition: transform 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
    flex: 1 1 200px;
    max-width: 300px;
    text-decoration: none;
    color: var(--text-main);
    display: block;
    /* So it behaves like a block element, not inline */
}

.rank-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.rank-card .disc {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.rank-card .pos {
    display: block;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 3rem;
    color: var(--accent);
    line-height: 1;
}

/* -------------------------------------
   STATS
---------------------------------------- */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md) 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-val {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 600;
}

/* -------------------------------------
   MEDIA – Horizontal Scroll (Apple-like)
---------------------------------------- */
.media-scroll-section {
    position: relative;
    height: 400vh;
    background-color: var(--bg-color);
}

.media-sticky {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.media-header {
    padding: 0 5%;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.media-header .section-title {
    margin-bottom: 0;
}

.media-track {
    display: flex;
    gap: 2rem;
    padding: 0 5%;
    will-change: transform;
    align-items: center;
    flex-shrink: 0;
}

.media-slide {
    flex: 0 0 auto;
    width: 50vw;
    height: 65vh;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: var(--bg-alt);
}

.media-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--ease-out);
}

.media-slide:hover img {
    transform: scale(1.04);
}

/* Progress bar */
.media-progress {
    position: absolute;
    bottom: 2rem;
    left: 5%;
    right: 5%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.media-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.05s linear;
}

/* Mobile */
@media (max-width: 767px) {
    .media-scroll-section {
        height: 300vh;
    }

    .media-track {
        gap: 1rem;
    }

    .media-slide {
        width: 85vw;
        height: 55vh;
    }

    .media-header {
        margin-bottom: 1rem;
    }
}

/* -------------------------------------
   PARTNERS
---------------------------------------- */
.partner-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
}

@media (min-width: 768px) {
    .partner-logos {
        gap: 6rem;
    }
}

.logo-placeholder {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-muted);
    opacity: 0.5;
    letter-spacing: 0.1em;
    transition: opacity 0.3s ease;
}

.logo-placeholder:hover {
    opacity: 1;
}

/* -------------------------------------
   FOOTER / CONTACT
---------------------------------------- */
.footer {
    background-color: var(--bg-alt);
    color: var(--text-main);
}

.email-link {
    display: inline-block;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-top: 1rem;
    position: relative;
}

.email-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease-out);
}

.email-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .social-links {
        align-items: flex-end;
    }
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

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

.fis-logo-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    /* If the image has a black background and white text, this will make the black transparent */
    mix-blend-mode: screen;
    transition: opacity 0.3s ease;
}

.social-btn:hover .fis-logo-icon {
    opacity: 0.8;
}

.sporthilfe-logo-icon {
    height: 20px;
    width: auto;
    object-fit: contain;
    filter: invert(1);
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.social-btn:hover .sporthilfe-logo-icon {
    opacity: 0.8;
}

.footer-bottom {
    margin-top: var(--space-xl);
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

.credit {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* -------------------------------------
   SPONSORING
---------------------------------------- */
.sponsoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.sponsor-card {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 3rem 2rem;
    transition: transform 0.3s var(--ease-out);
}

.sponsor-card.featured {
    border: 2px solid var(--accent);
    transform: scale(1.02);
}

.sponsor-card .level {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.sponsor-card .price {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.sponsor-card .benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem 0;
    text-align: left;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sponsor-card .benefits li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sponsor-card .benefits li::before {
    content: '✓';
    color: var(--accent);
    font-weight: bold;
}

.sponsor-card .btn-primary,
.sponsor-card .btn-outline {
    margin-top: auto;
}

/* -------------------------------------
   RACE MAP — Embedded Section
---------------------------------------- */
.racemap-section {
    background-color: var(--bg-color);
}

.racemap-lead {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    letter-spacing: 0.02em;
}

.racemap-wrapper {
    position: relative;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    gap: 0;
}

.racemap-container {
    position: relative;
    width: 100%;
    height: 75vh;
    min-height: 500px;
    max-height: 800px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #0a0a0a;
}

#racemap-map {
    width: 100%;
    height: 100%;
}

/* Override Mapbox controls inside embedded map */
#racemap-map .mapboxgl-ctrl-top-right {
    top: 60px;
    right: 8px;
}

#racemap-map .mapboxgl-ctrl-logo {
    opacity: 0.3;
}

#racemap-map .mapboxgl-ctrl-attrib {
    opacity: 0.3;
    font-size: 10px !important;
}

/* ─── Map Controls ──────────────────── */
.racemap-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
}

.racemap-lang-switcher {
    display: flex;
    gap: 2px;
    background: rgba(14, 14, 14, 0.85);
    border: 1px solid rgba(30, 30, 30, 0.8);
    border-radius: 6px;
    padding: 2px;
}

.racemap-lang-btn {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    padding: 4px 7px;
    border-radius: 4px;
    color: #555;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.racemap-lang-btn:hover {
    color: #8a8a8a;
}

.racemap-lang-btn.active {
    color: #edebe7;
    background: rgba(255, 255, 255, 0.08);
}

.racemap-btn-nav {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(14, 14, 14, 0.85);
    border: 1px solid rgba(30, 30, 30, 0.8);
    color: #8a8a8a;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.racemap-btn-nav:hover {
    border-color: #2a2a2a;
    color: #edebe7;
}

/* ─── Detail Panel ──────────────────── */
.racemap-detail-panel {
    position: absolute;
    bottom: 16px;
    left: 16px;
    width: 320px;
    z-index: 10;
    background: rgba(14, 14, 14, 0.95);
    border: 1px solid #1e1e1e;
    border-radius: 10px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: none;
}

.racemap-detail-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.racemap-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 14px 0;
}

.racemap-panel-badge {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: #2a2a2a;
    color: #8a8a8a;
}

.racemap-panel-badge[data-country="ITA"] {
    background: #1a2e22;
    color: #6aaa7a;
}

.racemap-panel-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #555;
    font-size: 0.875rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.racemap-panel-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #edebe7;
}

.racemap-panel-body {
    padding: 8px 14px 14px;
}

.racemap-panel-name {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.375rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 2px;
    color: #edebe7;
}

.racemap-panel-region {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: #555;
    letter-spacing: 0.02em;
    margin-bottom: 12px;
}

.racemap-panel-stats-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.racemap-panel-stat {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #1e1e1e;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.racemap-panel-stat-value {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.125rem;
    color: #edebe7;
    line-height: 1;
    margin-bottom: 3px;
}

.racemap-panel-stat-label {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.racemap-panel-best {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(214, 48, 49, 0.1);
    border: 1px solid rgba(214, 48, 49, 0.2);
    border-radius: 6px;
    margin-bottom: 10px;
}

.racemap-panel-best-label {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    color: #ff4136;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.racemap-panel-best-value {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.875rem;
    color: #ff4136;
}

.racemap-panel-best.no-result {
    background: rgba(255, 255, 255, 0.02);
    border-color: #1e1e1e;
}

.racemap-panel-best.no-result .racemap-panel-best-label,
.racemap-panel-best.no-result .racemap-panel-best-value {
    color: #555;
}

.racemap-panel-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #1e1e1e;
}

.racemap-panel-nav-btn {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    padding: 4px 8px;
    border-radius: 4px;
    color: #8a8a8a;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.racemap-panel-nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #edebe7;
}

.racemap-panel-nav-counter {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: #555;
}

/* ─── Stats Bar ─────────────────────── */
.racemap-stats-bar {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 20px;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: #555;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 6px 16px;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid #1e1e1e;
    border-radius: 6px;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.racemap-stats-bar.hidden {
    opacity: 0;
}

.racemap-stats-val {
    color: #edebe7;
    font-weight: 600;
}

/* ─── List Toggle ───────────────────── */
.racemap-list-toggle {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 10;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(14, 14, 14, 0.85);
    border: 1px solid #1e1e1e;
    color: #8a8a8a;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.racemap-list-toggle:hover {
    border-color: #2a2a2a;
    color: #edebe7;
}

/* ─── List Sidebar ──────────────────── */
.racemap-list-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    z-index: 20;
    background: rgba(14, 14, 14, 0.97);
    border-left: 1px solid #1e1e1e;
    border-radius: 0 12px 12px 0;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.racemap-list-sidebar.visible {
    transform: translateX(0);
}

.racemap-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #1e1e1e;
    flex-shrink: 0;
}

.racemap-list-title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #edebe7;
    margin: 0;
}

.racemap-list-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #555;
    font-size: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.racemap-list-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #edebe7;
}

.racemap-list-content {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.racemap-list-content::-webkit-scrollbar {
    width: 3px;
}

.racemap-list-content::-webkit-scrollbar-track {
    background: transparent;
}

.racemap-list-content::-webkit-scrollbar-thumb {
    background: #1e1e1e;
    border-radius: 2px;
}

.racemap-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: inherit;
    font-family: inherit;
}

.racemap-list-item:hover {
    background: #161616;
}

.racemap-list-item.active {
    background: rgba(214, 48, 49, 0.1);
}

.racemap-list-item-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d63031;
    flex-shrink: 0;
    opacity: 0.6;
}

.racemap-list-item.active .racemap-list-item-dot {
    opacity: 1;
    box-shadow: 0 0 6px #d63031;
}

.racemap-list-item-info {
    flex: 1;
    min-width: 0;
}

.racemap-list-item-name {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.75rem;
    color: #edebe7;
    line-height: 1.2;
    display: block;
}

.racemap-list-item-meta {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    color: #555;
    letter-spacing: 0.02em;
    margin-top: 1px;
    display: block;
}

.racemap-list-item-count {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    color: #555;
    flex-shrink: 0;
}

/* ─── Mobile Race Map ───────────────── */
@media (max-width: 767px) {
    .racemap-container {
        height: 65vh;
        min-height: 400px;
        border-radius: 10px;
    }

    .racemap-detail-panel {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 10px 10px 0 0;
        transform: translateY(100%);
        max-height: 50%;
        overflow-y: auto;
    }

    .racemap-detail-panel.visible {
        transform: translateY(0);
    }

    .racemap-panel-body::before {
        content: '';
        display: block;
        width: 32px;
        height: 3px;
        background: #2a2a2a;
        border-radius: 2px;
        margin: 0 auto 8px;
    }

    .racemap-list-sidebar {
        width: 100%;
        border-radius: 0;
    }

    .racemap-stats-bar {
        gap: 14px;
        font-size: 0.5625rem;
        padding: 5px 12px;
    }

    .racemap-controls {
        top: 8px;
        right: 8px;
    }
}

/* ─── Focus states ──────────────────── */
.racemap-btn-nav:focus-visible,
.racemap-lang-btn:focus-visible,
.racemap-list-toggle:focus-visible,
.racemap-list-item:focus-visible,
.racemap-panel-nav-btn:focus-visible,
.racemap-panel-close:focus-visible,
.racemap-list-close:focus-visible {
    outline: 2px solid #d63031;
    outline-offset: 2px;
}

/* -------------------------------------
   ANIMATIONS & UTILS
---------------------------------------- */
.hidden-onload {
    opacity: 0;
    visibility: hidden;
}

.fade-up {
    transform: translateY(30px);
    transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}

.fade-up.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Scroll reveal classes */
.fade-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.fade-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* -------------------------------------
   LEGAL PAGES (Impressum / Datenschutz)
---------------------------------------- */
.legal-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1.2rem 2rem;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.legal-back-btn {
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.legal-back-btn:hover {
    opacity: 0.6;
}

.legal-page {
    min-height: 100vh;
    padding: 8rem 2rem 4rem;
    max-width: 800px;
    margin: 0 auto;
}

.legal-title {
    font-family: var(--font-head);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    line-height: 0.9;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.legal-intro {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.legal-intro strong {
    color: var(--text-main);
}

.legal-section {
    margin-bottom: 2.5rem;
}

.legal-section h2 {
    font-family: var(--font-head);
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.legal-section h3 {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.legal-section p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.legal-section a {
    color: var(--text-main);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.3s ease;
}

.legal-section a:hover {
    opacity: 0.6;
}

.legal-section ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.legal-section ul li {
    font-size: 0.95rem;
    color: var(--text-muted);
    padding: 0.4rem 0 0.4rem 1.5rem;
    position: relative;
    line-height: 1.6;
}

.legal-section ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--border);
}

.legal-updated {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--border);
    margin-top: 3rem;
    letter-spacing: 0.05em;
}

.legal-links {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.legal-links a {
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.legal-links a:hover {
    opacity: 0.6;
}

.legal-bottom-nav {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* Footer legal links (main page) */
.footer-legal {
    margin-top: 0.75rem;
}

.footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.footer-legal a:hover {
    opacity: 0.6;
}

.footer-legal span {
    color: var(--border);
    margin: 0 0.5rem;
}