@font-face {
    font-family: "Oswald";
    src: url("../../../assets/fonts/Oswald-SemiBold.ttf") format("truetype");
    font-display: swap;
}

:root {
    --ink: #14171b;
    --muted: #666e76;
    --paper: #f3f2ef;
    --white: #fffffe;
    --carbon-950: #08090b;
    --carbon-900: #101317;
    --carbon-800: #1a1e23;
    --carbon-700: #262b31;
    --red: #e10600;
    --red-dark: #a80400;
    --gold: #ffc23c;
    --silver: #c8ccd2;
    --bronze: #cd7f32;
    --line: rgba(20, 23, 27, .12);
    --shadow: 0 20px 55px rgba(0, 0, 0, .14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--paper);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.page-shell {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

.hero {
    position: relative;
    min-height: 650px;
    overflow: hidden;
    color: var(--white);
    background:
        radial-gradient(circle at 78% 40%, rgba(225, 6, 0, .18), transparent 26%),
        linear-gradient(120deg, var(--carbon-950), var(--carbon-800));
}

.hero::before {
    position: absolute;
    inset: 0;
    content: "";
    opacity: .1;
    background-image:
        linear-gradient(30deg, transparent 47%, rgba(255, 255, 255, .14) 48%, transparent 49%),
        linear-gradient(150deg, transparent 47%, rgba(255, 255, 255, .09) 48%, transparent 49%);
    background-size: 70px 120px;
}

.nav-shell {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 92px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    font-family: Oswald, Impact, sans-serif;
    font-size: 13px;
    line-height: 1.05;
    letter-spacing: .12em;
    text-decoration: none;
    text-transform: uppercase;
}

.brand-mark {
    display: block;
    width: auto;
    height: 26px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px 26px;
}

.nav-links a {
    color: rgba(255, 255, 255, .75);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-decoration: none;
    text-transform: uppercase;
}

.nav-links a:hover {
    color: var(--red);
}

.icon-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: var(--white);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 99px;
}

.icon-button:hover {
    border-color: var(--red);
}

.icon-button.is-loading .refresh-icon {
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    align-items: center;
    min-height: 510px;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--red);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.eyebrow.dark {
    color: var(--red-dark);
}

h1,
h2 {
    margin: 0;
    font-family: Oswald, Impact, sans-serif;
    font-weight: 700;
    line-height: .98;
    text-transform: uppercase;
}

h1 {
    max-width: 700px;
    font-size: clamp(58px, 8.2vw, 110px);
    letter-spacing: -.035em;
}

h1 span {
    color: var(--red);
}

h2 {
    font-size: clamp(34px, 4vw, 52px);
    letter-spacing: -.02em;
}

.hero-intro {
    max-width: 570px;
    margin: 24px 0;
    color: rgba(255, 255, 255, .72);
    font-size: 17px;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: rgba(255, 255, 255, .78);
    background: rgba(0, 0, 0, .22);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 99px;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 194, 60, .16);
}

.sync-ok .status-dot {
    background: #35d07f;
    box-shadow: 0 0 0 4px rgba(53, 208, 127, .16);
}

.sync-err .status-dot {
    background: var(--red);
}

.hero-art {
    position: relative;
    width: min(420px, 38vw);
    aspect-ratio: 1;
    justify-self: end;
}

.flag-check {
    position: absolute;
    inset: 6%;
    border-radius: 50%;
    background-image:
        linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%),
        linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%);
    background-size: 34px 34px;
    background-position: 0 0, 17px 17px;
    background-color: #f4f4f2;
    opacity: .16;
    -webkit-mask-image: radial-gradient(circle, #000 60%, transparent 72%);
    mask-image: radial-gradient(circle, #000 60%, transparent 72%);
}

.hero-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(300px, 68%);
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .45));
    transform: translate(-50%, -50%);
}

.hero-chip {
    position: absolute;
    padding: 5px 10px;
    color: var(--carbon-950);
    background: var(--gold);
    border-radius: 99px;
    font-family: Oswald, Impact, sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
}

.chip-one { top: 6%; left: 44%; }
.chip-two { right: 2%; bottom: 34%; background: var(--silver); }
.chip-three { bottom: 4%; left: 12%; background: var(--bronze); color: var(--white); }

.hero-stripes {
    position: absolute;
    right: -5%;
    bottom: -38px;
    left: -5%;
    height: 75px;
    background: linear-gradient(90deg, var(--red) 0 32%, var(--carbon-800) 32% 62%, var(--gold) 62%);
    clip-path: polygon(0 46%, 100% 0, 100% 55%, 0 100%);
}

.overview {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: -36px;
    background: var(--white);
    border-radius: 5px;
    box-shadow: var(--shadow);
}

.stat-card {
    min-width: 0;
    min-height: 138px;
    padding: 28px 30px;
    border-right: 1px solid var(--line);
}

.stat-card:last-child {
    border-right: 0;
}

.stat-label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    overflow: hidden;
    margin-bottom: 4px;
    font-family: Oswald, Impact, sans-serif;
    font-size: 26px;
    line-height: 1.15;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.stat-card strong small {
    color: #9aa0a6;
    font-size: 15px;
}

.next-kickoff strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.stat-card > span:last-child {
    color: var(--muted);
    font-size: 12px;
}

.progress-track {
    height: 4px;
    margin-top: 13px;
    overflow: hidden;
    background: #e4e3de;
    border-radius: 99px;
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--red);
    transition: width .4s ease;
}

.is-hidden {
    display: none !important;
}

.section {
    padding-top: 92px;
    padding-bottom: 92px;
}

.section-tinted {
    background: #eae8e3;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 34px;
}

.section-note {
    max-width: 370px;
    margin: 0 0 3px;
    color: var(--muted);
    font-size: 13px;
    text-align: right;
}

.next-race-section {
    padding-top: 60px;
    padding-bottom: 60px;
    color: var(--ink);
    background: #eae8e3;
    border-top: 3px solid var(--red);
}

.next-race-section .section-note,
.calendar-section .section-note {
    color: var(--muted);
}

.live-now-section {
    padding-top: 54px;
    padding-bottom: 54px;
    color: var(--white);
    background:
        radial-gradient(circle at 50% 0%, rgba(225, 6, 0, .2), transparent 45%),
        var(--carbon-950);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.live-now-section .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.live-now-section .eyebrow::before {
    width: 8px;
    height: 8px;
    content: "";
    background: var(--red);
    border-radius: 50%;
    animation: live-pulse 1.2s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .3; transform: scale(.6); }
}

@media (prefers-reduced-motion: reduce) {
    .live-now-section .eyebrow::before { animation: none; }
}

.track-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    margin-top: 12px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.track-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.live-row {
    display: grid;
    grid-template-columns: 20px 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 4px;
}

.tyre-badge {
    display: grid;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--carbon-950);
    border-radius: 50%;
    font-family: Oswald, Impact, sans-serif;
    font-size: 10px;
    font-weight: 800;
}

.live-row.is-leader {
    background: rgba(255, 194, 60, .12);
    border-color: rgba(255, 194, 60, .4);
}

.live-pos {
    color: rgba(255, 255, 255, .5);
    font-family: Oswald, Impact, sans-serif;
    font-size: 15px;
}

.live-row.is-leader .live-pos {
    color: var(--gold);
}

.live-driver {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-team-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.live-gap {
    flex: 0 0 auto;
    color: var(--white);
    font-family: Oswald, Impact, sans-serif;
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
}

.live-gap small {
    display: block;
    margin-top: 1px;
    color: rgba(255, 255, 255, .45);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.bracket-note {
    color: rgba(255, 255, 255, .58);
}

.live-delay-note {
    margin-top: 4px;
    color: rgba(255, 255, 255, .35);
    font-size: 11px;
}

.session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.session-card {
    padding: 18px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 5px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .05);
}

.session-card.is-race {
    background: rgba(225, 6, 0, .06);
    border-color: rgba(225, 6, 0, .35);
}

.session-card span {
    display: block;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.session-card strong {
    display: block;
    margin-top: 8px;
    color: var(--ink);
    font-family: Oswald, Impact, sans-serif;
    font-size: 17px;
}

.session-card.is-race strong {
    color: var(--red-dark);
}

.session-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.empty-state {
    padding: 30px;
    color: var(--muted);
    background: var(--white);
    border: 1px dashed var(--line);
    text-align: center;
}

.table-card {
    overflow: hidden;
    background: var(--white);
    border-radius: 5px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .07);
}

.table-row {
    display: grid;
    align-items: center;
    min-height: 66px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
}

.driver-row {
    grid-template-columns: 60px 1.6fr 1fr .6fr .7fr;
}

.constructor-row {
    grid-template-columns: 60px 1.8fr .7fr .8fr;
}

.table-head {
    min-height: 46px;
    color: var(--muted);
    background: #e6e5e0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.table-entry:last-child {
    border-bottom: 0;
}

.rank {
    color: var(--muted);
    font-family: Oswald, Impact, sans-serif;
    font-size: 19px;
}

.rank.top-rank {
    color: var(--red);
    font-size: 25px;
}

.driver-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    font-weight: 800;
}

.driver-cell img {
    width: 28px;
    height: 19px;
    flex: 0 0 auto;
    object-fit: cover;
    background: #e4e3de;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 2px;
}

.driver-cell .avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--white);
    background: var(--carbon-800);
    border-radius: 50%;
    font-family: Oswald, Impact, sans-serif;
    font-size: 12px;
}

.driver-cell small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-swatch {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.points-cell {
    font-family: Oswald, Impact, sans-serif;
    font-size: 20px;
}

.wins-cell {
    color: var(--muted);
    font-weight: 700;
}

.calendar-grid {
    display: grid;
    align-items: start;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.race-card {
    display: block;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 5px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .05);
}

.race-card summary {
    display: block;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
}

.race-card summary::-webkit-details-marker {
    display: none;
}

.race-card.is-complete summary {
    cursor: pointer;
}

.race-card:not(.has-details) summary {
    cursor: default;
}

.race-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.race-status {
    padding: 4px 8px;
    color: var(--muted);
    background: #ece9e3;
    border-radius: 99px;
}

.race-status.status-complete {
    color: #1c7a44;
    background: #dcf1e3;
}

.race-status.status-live {
    color: var(--white);
    background: var(--red);
}

.race-title {
    display: flex;
    align-items: center;
    gap: 11px;
}

.race-title img {
    width: 30px;
    height: 20px;
    flex: 0 0 auto;
    object-fit: cover;
    background: #e4e3de;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 2px;
}

.race-title strong {
    display: block;
    font-family: Oswald, Impact, sans-serif;
    font-size: 17px;
    line-height: 1.2;
    text-transform: uppercase;
}

.race-title small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.race-podium {
    padding: 4px 14px 8px;
    max-height: 360px;
    overflow-y: auto;
    border-top: 1px solid var(--line);
    background: #f7f6f2;
}

.podium-row {
    display: grid;
    grid-template-columns: 18px 1fr 68px 28px;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(20, 23, 27, .06);
    font-size: 11.5px;
}

.podium-row:last-child {
    border-bottom: 0;
}

.podium-row.results-head {
    position: sticky;
    top: 0;
    padding: 8px 0;
    background: #f7f6f2;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.podium-row .pos-num {
    font-family: Oswald, Impact, sans-serif;
    font-size: 14px;
    color: var(--muted);
}

.podium-row.pos-1 .pos-num { color: var(--gold); }
.podium-row.pos-2 .pos-num { color: #9aa0a6; }
.podium-row.pos-3 .pos-num { color: var(--bronze); }

.results-driver {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.results-driver small {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.results-time {
    overflow: hidden;
    font-family: Oswald, Impact, sans-serif;
    font-size: 10.5px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.results-points {
    color: var(--red);
    font-family: Oswald, Impact, sans-serif;
    text-align: right;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.team-card {
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 5px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .05);
    border-top: 4px solid var(--carbon-800);
}

.team-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 20px;
    color: var(--white);
    background: var(--carbon-900);
}

.team-card-name {
    font-family: Oswald, Impact, sans-serif;
    font-size: 20px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.team-card-points {
    color: var(--gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.driver-entry-row {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 57px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
}

.driver-entry-row:last-child {
    border-bottom: 0;
}

.driver-entry-row img {
    width: 32px;
    height: 21px;
    object-fit: cover;
    background: #e4e3de;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 2px;
}

.driver-entry-name {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.driver-entry-points {
    min-width: 48px;
    padding: 5px 9px;
    color: var(--red-dark);
    background: transparent;
    border: 1px solid #d9c0bb;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-align: center;
    text-transform: uppercase;
}

footer {
    color: rgba(255, 255, 255, .58);
    background: var(--carbon-950);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 130px;
    gap: 25px;
    font-size: 11px;
}

.footer-brand {
    color: var(--white);
}

@media (max-width: 900px) {
    .hero {
        min-height: 590px;
    }

    .hero-content {
        grid-template-columns: 1fr;
    }

    .hero-art {
        position: absolute;
        right: -60px;
        bottom: 10px;
        width: 300px;
        opacity: .45;
    }

    .hero-copy {
        position: relative;
        z-index: 2;
    }

    .overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card:nth-child(2) {
        border-right: 0;
    }

    .teams-grid {
        grid-template-columns: 1fr;
    }

    .driver-row,
    .constructor-row {
        grid-template-columns: 44px 1fr .6fr;
    }

    .driver-row span:nth-child(3),
    .driver-row span:nth-child(4) {
        display: none;
    }

    .constructor-row span:nth-child(3) {
        display: none;
    }

    .driver-row .points-cell {
        align-self: start;
        margin-top: 2px;
    }

    .table-row {
        padding: 0 16px;
    }

    .section {
        padding-top: 60px;
        padding-bottom: 60px;
    }

    .section-heading {
        flex-direction: column;
        align-items: start;
        gap: 10px;
    }

    .section-note {
        text-align: left;
    }
}

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

    .stat-card {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .footer-inner {
        flex-direction: column;
        justify-content: center;
        padding: 24px 0;
        text-align: center;
    }
}
