:root {
    --white: #ffffff;
    --off-white: #fbf7f0;
    --light-grey: #f3ece0;
    --border: #e7dccb;
    --border-hover: #d8c6ae;
    --text-primary: #2d241b;
    --text-secondary: #5e4d3f;
    --text-muted: #9a8674;
    --accent: #a15b34;
    --accent-light: #f8ebdf;
    --accent-dark: #804424;
    --accent-gradient: linear-gradient(135deg, #a15b34 0%, #7f3f25 100%);
    --warm-accent: #c18433;
    --success: #10b981;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --card-shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    --white: #1a1a1a;
    --off-white: #222222;
    --light-grey: #2a2a2a;
    --border: #3a3a3a;
    --border-hover: #4a4a4a;
    --text-primary: #e8e0d8;
    --text-secondary: #b8a898;
    --text-muted: #8a7a6a;
    --accent: #d4834a;
    --accent-light: #2e2218;
    --accent-dark: #e89860;
    --accent-gradient: linear-gradient(135deg, #d4834a 0%, #a15b34 100%);
    --card-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
    --card-shadow-hover: 0 12px 24px rgba(0,0,0,0.25), 0 4px 8px rgba(0,0,0,0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: radial-gradient(circle at 15% 0%, #fff8ef 0%, #ffffff 45%);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}
[data-theme="dark"] body {
    background: radial-gradient(circle at 15% 0%, #1f1a14 0%, #141414 45%);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

/* ---- SCROLL PROGRESS ---- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--accent-gradient);
    z-index: 1001;
    width: 0%;
    transition: width 0.05s linear;
}

/* ---- NAV ---- */
.header {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    transition: background 0.3s;
}
[data-theme="dark"] .header {
    background: rgba(20,20,20,0.92);
}
.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}
.logo {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
}
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}
.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color 0.2s;
    padding: 0.25rem 0;
}
.nav-link:hover { color: var(--accent); }
.nav-link.active { color: var(--accent); }
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
}
.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}
.nav-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}

/* ---- HERO ---- */
.hero {
    padding: 160px 0 100px;
    text-align: center;
    background: linear-gradient(135deg, #2f251d 0%, #4a3424 50%, #3a2a1e 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(161,91,52,0.18) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 80% 30%, rgba(193,132,51,0.12) 0%, transparent 70%);
    animation: heroShift 20s ease-in-out infinite alternate;
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    pointer-events: none;
    opacity: 0.5;
}
@keyframes heroShift {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.05) translate(-2%, 1%); }
}
.hero-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}
.hero h1 {
    font-size: 3.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
    animation: heroFadeUp 0.8s ease-out both;
}
.hero-tagline {
    font-size: 1.0625rem;
    color: #e7d9cb;
    font-weight: 400;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
    line-height: 1.7;
    animation: heroFadeUp 0.8s ease-out 0.15s both;
}
.hero-location {
    font-size: 0.875rem;
    color: #bda792;
    margin-bottom: 2.5rem;
    animation: heroFadeUp 0.8s ease-out 0.3s both;
}
.hero-links {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: heroFadeUp 0.8s ease-out 0.45s both;
}
.hero-link {
    color: #dcc8b2;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(231,217,203,0.25);
    border-radius: 6px;
}
.hero-link:hover {
    color: var(--white);
    border-color: rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.05);
}
#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- SECTIONS ---- */
.section {
    padding: 100px 0;
    border-bottom: none;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1rem;
}
.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.15em;
    bottom: 0.15em;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
}
.section-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
}

/* ---- ABOUT / SUMMARY ---- */
.summary-text {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.75;
    max-width: 750px;
}

/* ---- EDUCATION ---- */
.timeline { display: flex; flex-direction: column; gap: 2rem; }
.timeline-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: start;
}
.timeline-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    padding-top: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.timeline-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}
.timeline-content .institution {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.timeline-content .detail {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ---- EXPERIENCE ---- */
.experience-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: start;
}
.experience-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}
.experience-content .company {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.experience-content ul {
    list-style: none;
    padding: 0;
}
.experience-content li {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding-left: 1rem;
    position: relative;
    margin-bottom: 0.25rem;
    line-height: 1.6;
}
.experience-content li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
}

/* ---- PROJECTS ---- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}
.project-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.75rem;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.15s ease-out;
    position: relative;
    overflow: hidden;
    will-change: transform;
}
.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}
.project-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--card-shadow-hover);
}
.project-card:hover::before {
    transform: scaleX(1);
}
.project-card h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.project-card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1.25rem;
}
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--light-grey);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    text-transform: none;
    letter-spacing: normal;
}
.project-card .project-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--accent-gradient);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ---- SKILLS ---- */
.skills-columns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2.5rem;
}
.skill-group h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
    border-image: var(--accent-gradient) 1;
    display: inline-block;
}
.skill-group ul {
    list-style: none;
    padding: 0;
}
.skill-group li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
}

/* ---- F1 PREDICTIONS ---- */
.predictions-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
.predictions-card {
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    height: 100%;
}
.predictions-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.predictions-card .card-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.prediction-item {
    display: grid;
    grid-template-columns: 32px 1fr 50px;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
}
.prediction-item:last-child { border-bottom: none; }
.prediction-rank {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}
.prediction-rank.top-1 { color: #d97706; }
.prediction-rank.top-2 { color: #6b7280; }
.prediction-rank.top-3 { color: #92400e; }
.prediction-info .driver-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}
.prediction-info .team-name {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.prediction-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.probability-bar-bg {
    width: 100%;
    background: var(--border);
    border-radius: 3px;
    height: 6px;
    overflow: hidden;
}
.probability-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.25,0.46,0.45,0.94);
    width: 0;
}
.probability-value {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent);
    text-align: right;
}
.methodology-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
}
.methodology-box h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.methodology-box p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}
.methodology-box p:last-child { margin-bottom: 0; }
.factor-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}
.factor-list li {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: 0.375rem 0 0.375rem 1.25rem;
    position: relative;
}
.factor-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.factor-list li strong {
    color: var(--text-primary);
    font-weight: 600;
}
.last-updated {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* F1 team color bars */
.team-color-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.375rem;
    vertical-align: middle;
}

/* Race status badge */
.race-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--accent-light);
    color: var(--accent);
    margin-bottom: 1.25rem;
}
.race-status .pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Points badge on prediction items */
.points-badge {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--light-grey);
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
}
.points-badge.has-points {
    color: var(--accent-dark);
    background: var(--accent-light);
}

.telemetry-callout {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
    border-left: 2px solid var(--warm-accent);
    padding-left: 0.75rem;
}
.telemetry-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.telemetry-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--border);
}
.telemetry-item:last-child { border-bottom: none; }
.telemetry-item .driver {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
}
.telemetry-item .meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.telemetry-item .value {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--accent-dark);
    text-align: right;
}
.telemetry-mini {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.9rem;
    line-height: 1.6;
}

/* ---- CONTACT ---- */
.contact-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.contact-item i {
    color: var(--text-muted);
    font-size: 0.875rem;
    width: 20px;
    text-align: center;
}
.contact-item a, .contact-item span {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}
.contact-item a:hover { color: var(--accent); }

/* ---- FOOTER ---- */
.footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 3rem 0;
    text-align: center;
}
.footer p {
    font-size: 0.8125rem;
    color: #64748b;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.footer-link {
    color: #64748b;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(100,116,139,0.2);
}
.footer-link:hover {
    color: var(--white);
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
}

/* ---- ANIMATIONS ---- */
.animate-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- 3D CARD TILT ---- */
.project-card {
    transform-style: preserve-3d;
    perspective: 800px;
}
.project-card .project-icon,
.project-card h3,
.project-card p,
.project-card .project-tags {
    transform: translateZ(20px);
}

/* ---- DARK MODE: mobile menu ---- */
[data-theme="dark"] .nav-menu.active {
    background: var(--white);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .nav-menu { display: none; }
    .nav-menu.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px; left: 0; right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        padding: 1rem 2rem;
        gap: 1rem;
    }
    .mobile-menu-toggle { display: block; }
    .logo-text { display: none; }
    .hero h1 { font-size: 2.25rem; }
    .hero { padding: 130px 0 70px; }
    .section { padding: 60px 0; }
    .timeline-item, .experience-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    .timeline-date { padding-top: 0; }
    .projects-grid { grid-template-columns: 1fr; }
    .predictions-container { grid-template-columns: 1fr; }
    .skills-columns { grid-template-columns: 1fr 1fr; }
    .hero-links { flex-direction: column; align-items: center; }
    .contact-row { flex-direction: column; gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .animate-in,
    .race-status .pulse,
    .hero::before,
    .hero h1,
    .hero-tagline,
    .hero-location,
    .hero-links,
    .probability-bar-fill {
        animation: none !important;
        transition: none !important;
    }
    .hero h1, .hero-tagline, .hero-location, .hero-links { opacity: 1; }
}

/* ---- Easter Eggs (Hassium) ---- */
.hs-hold-ring {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    width: 48px;
    height: 48px;
    opacity: 0;
    transition: opacity 0.3s;
}
.hs-hold-ring.active { opacity: 1; }
.hs-hold-ring circle {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linecap: round;
}
.hs-synthesis-flash {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(232,168,109,0.5) 0%, transparent 60%);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}
.hs-decay-card {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: rgba(20, 16, 12, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(212, 131, 74, 0.3);
    border-radius: 14px;
    padding: 28px 40px;
    z-index: 10000;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s, transform 0.5s;
    font-family: 'Space Grotesk', sans-serif;
}
.hs-decay-card.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.hs-decay-card .hs-number {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    letter-spacing: 0.15em;
}
.hs-decay-card .hs-symbol {
    font-size: 3.5rem;
    font-weight: 700;
    color: #e8a86d;
    line-height: 1.15;
}
.hs-decay-card .hs-name {
    font-size: 1rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 10px;
}
.hs-decay-card .hs-detail {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.35);
    line-height: 1.7;
}

/* ---- F1 PAGE: race-card grid + chart ---- */
.f1-hero-mini {
    padding: 130px 0 50px;
    background: linear-gradient(135deg, #2f251d 0%, #4a3424 50%, #3a2a1e 100%);
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.f1-hero-mini::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(161,91,52,0.18) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 80% 30%, rgba(193,132,51,0.12) 0%, transparent 70%);
    pointer-events: none;
}
.f1-eyebrow {
    position: relative;
    z-index: 2;
    margin: 0 0 0.75rem;
    min-height: 0.85rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #e89860;
}
.f1-eyebrow:empty {
    margin: 0;
}
.f1-hero-mini h1 {
    font-size: 2.25rem;
    color: #ffffff;
    position: relative;
    z-index: 2;
    margin-bottom: 0.5rem;
}
.f1-hero-mini .subtitle {
    font-size: 0.9375rem;
    color: #dcc8b2;
    position: relative;
    z-index: 2;
}

/* Circuit map — outline of the current race's track, swaps per race.
   The baked SVGs stroke with currentColor, so this color drives the line. */
.circuit-map {
    position: relative;
    z-index: 2;
    margin: 2rem auto 0;
    max-width: 240px;
    color: #dcc8b2;
    line-height: 0;
}
.circuit-map svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
    filter: drop-shadow(0 6px 18px rgba(212, 131, 74, 0.3));
    animation: circuit-draw 0.8s ease both;
}
@keyframes circuit-draw {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.circuit-map-caption {
    position: relative;
    z-index: 2;
    margin: 0.85rem auto 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #dcc8b2;
}
@media (prefers-reduced-motion: reduce) {
    .circuit-map svg { animation: none; }
}

.race-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 768px) {
    .race-grid-2 { grid-template-columns: 1fr; }
}
.race-card {
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
}
.race-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.race-card .sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}
.win-row {
    display: grid;
    grid-template-columns: 28px 1fr 60px;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
}
.win-row:last-child { border-bottom: none; }
.win-row .pos {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}
.win-row .who .name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}
.win-row .who .team {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.win-row .barwrap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.win-row .barwrap .bg {
    width: 100%;
    background: var(--border);
    border-radius: 3px;
    height: 6px;
    overflow: hidden;
}
.win-row .barwrap .fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.25,0.46,0.45,0.94);
    width: 0;
}
.win-row .pct {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent);
    text-align: right;
}
.signal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.signal-tile {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem 0.875rem;
}
.signal-tile .label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.signal-tile .value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}
.archive-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.archive-row:last-child { border-bottom: none; }
.archive-row .race-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}
.archive-row .meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.archive-row .verdict {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
}
.archive-row .verdict.hit { background: rgba(16,185,129,0.15); color: #059669; }
.archive-row .verdict.miss { background: rgba(220,38,38,0.12); color: #b91c1c; }
.archive-row .verdict.pending { background: var(--accent-light); color: var(--accent); }

/* ---- Championship: car on a track ---- */
.champ-row {
    display: grid;
    grid-template-columns: 28px minmax(120px, 1fr) minmax(200px, 2.4fr) 56px;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}
.champ-row:last-child { border-bottom: none; }
.champ-rank {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}
.champ-info .champ-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
.champ-info .champ-team {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.champ-track {
    position: relative;
    height: 22px;
    background: linear-gradient(to right, var(--border) 0%, var(--border) 100%);
    background-size: 100% 1px;
    background-position: center;
    background-repeat: no-repeat;
}
.champ-track::before {
    content: '';
    position: absolute;
    inset: 0;
    border-top: 1px dashed var(--border);
    top: 50%;
}
.champ-track-finish {
    position: absolute;
    right: 0;
    top: -2px;
    bottom: -2px;
    width: 6px;
    background-image: repeating-linear-gradient(
        45deg,
        var(--text-muted) 0 3px,
        transparent 3px 6px
    );
    opacity: 0.55;
}
.champ-car {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 16px;
    transition: left 1.4s cubic-bezier(0.34, 1.2, 0.5, 1);
    will-change: left;
}
.champ-car .f1-car-svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}
.champ-pct {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
    .champ-row {
        grid-template-columns: 22px 1fr 52px;
        grid-template-areas:
            "rank info pct"
            ".    track track";
        row-gap: 0.4rem;
    }
    .champ-rank { grid-area: rank; }
    .champ-info { grid-area: info; }
    .champ-track { grid-area: track; }
    .champ-pct  { grid-area: pct; }
}
