:root {
  color-scheme: dark;
  --bg: #050506;
  --panel: rgba(20, 22, 25, .88);
  --panel-strong: #16181c;
  --line: rgba(255,255,255,.12);
  --muted: #aeb2ba;
  --text: #fff4f1;
  --red: #e10600;
  --red-bright: #ff3b30;
  --cyan: #00e3fd;
  --amber: #ffbd38;
  --green: #4cff9a;
  --shadow: 0 24px 80px rgba(0,0,0,.45);
  --hard-shadow: 0 18px 0 rgba(225,6,0,.16), 0 34px 90px rgba(0,0,0,.68);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(225,6,0,.2), transparent 32%),
    radial-gradient(circle at 80% 10%, rgba(0,227,253,.14), transparent 26%),
    #050506;
  color: var(--text);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  overflow-x: hidden;
  animation: pageFadeIn .55s ease both;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.025) 50%, rgba(255,255,255,.025) 75%, transparent 75%, transparent);
  background-size: 7px 7px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, transparent, black 16%, black 82%, transparent);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  line-height: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px clamp(16px, 3vw, 40px);
  background: rgba(5,5,6,.82);
  border-bottom: 3px solid var(--red);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 44px rgba(0,0,0,.36);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--red-bright);
  font-family: Anton, sans-serif;
  font-size: 30px;
  font-style: italic;
}

.brand .material-symbols-outlined {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--red);
  color: white;
  transform: skewX(-10deg);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(225,6,0,.48);
  background: rgba(255,255,255,.04);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.desktop-nav a {
  padding: 10px 13px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  transition: background .22s ease, color .22s ease, transform .22s ease;
}

.desktop-nav a:hover,
.desktop-nav .active {
  background: var(--red);
  color: white;
  transform: skewX(-7deg);
}

.status-chip,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid rgba(0,227,253,.34);
  background: rgba(0,227,253,.1);
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.status-chip span,
.pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 16px currentColor;
}

main {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 10px 96px;
}

.hero {
  position: relative;
  min-height: clamp(620px, 82vh, 820px);
  display: grid;
  align-items: center;
  overflow: hidden;
  margin: 18px 0 28px;
  border: 2px solid rgba(225,6,0,.58);
  background: #09090a;
  box-shadow: var(--hard-shadow);
  clip-path: polygon(0 0, calc(100% - 46px) 0, 100% 46px, 100% 100%, 34px 100%, 0 calc(100% - 34px));
  animation: riseFade .72s ease .05s both;
}

.hero-bg,
.hero-car {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-bg { opacity: .48; filter: saturate(1.15) contrast(1.08); }
.hero-car {
  left: auto;
  right: -2%;
  top: auto;
  bottom: -7%;
  width: min(960px, 74vw);
  height: auto;
  object-fit: contain;
  z-index: 3;
  filter: drop-shadow(0 38px 46px rgba(0,0,0,.72));
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(5,5,6,.95) 0%, rgba(5,5,6,.7) 42%, transparent 72%),
    linear-gradient(0deg, rgba(5,5,6,.8), transparent 42%);
}

.hero-content {
  position: relative;
  z-index: 4;
  width: min(660px, 100%);
  padding: clamp(24px, 6vw, 70px);
  animation: slideFadeLeft .75s ease .18s both;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  font-family: Anton, sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(74px, 13vw, 178px);
  line-height: .82;
  font-style: italic;
  color: white;
  text-shadow: 5px 0 0 rgba(225,6,0,.74), -3px 0 0 rgba(0,227,253,.44), 0 24px 32px rgba(0,0,0,.62);
}

h2 { font-size: clamp(28px, 4vw, 48px); line-height: 1; }
h3 { font-size: 24px; }

h2, h3, p, a {
  overflow-wrap: anywhere;
}

.hero-copy {
  max-width: 520px;
  margin: 22px 0;
  color: #d8d8df;
  font-size: clamp(17px, 2vw, 21px);
}

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 17px;
  border: 2px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.btn:hover { transform: translateY(-2px) skewX(-5deg); }
.btn.primary { background: var(--red); border-color: var(--red); color: white; }
.btn.ghost { background: rgba(255,255,255,.06); color: white; }
.btn.cyan { background: var(--cyan); border-color: var(--cyan); color: #001015; }

.glass,
.panel {
  background: linear-gradient(145deg, rgba(28,31,36,.94), rgba(10,10,12,.9));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--hard-shadow);
}

.race-tile {
  position: absolute;
  right: clamp(18px, 3vw, 44px);
  bottom: clamp(18px, 4vw, 48px);
  z-index: 6;
  width: min(420px, calc(100% - 36px));
  padding: 22px;
  backdrop-filter: blur(14px);
  border-left: 5px solid var(--cyan);
  transform: skewX(-3deg);
  animation: slideFadeUp .7s ease .34s both;
}

.race-tile > * { transform: skewX(3deg); }

.hud-stack {
  position: absolute;
  right: 34px;
  top: 120px;
  z-index: 5;
  display: grid;
  gap: 8px;
  color: rgba(255,255,255,.78);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.hud-stack span {
  padding: 9px 13px;
  background: rgba(0,0,0,.44);
  border-right: 4px solid var(--red);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  transform: skewX(-12deg);
}

.race-tile h2 { color: white; }
.race-tile p:not(.eyebrow) { margin: 9px 0 0; color: var(--muted); }

.countdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.countdown div,
.metric,
.stat-card {
  background: rgba(0,0,0,.35);
  border: 1px solid var(--line);
  padding: 12px;
}

.countdown strong,
.metric strong {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 25px;
}

.countdown span,
.metric span {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.dashboard-grid,
.page-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.panel {
  grid-column: span 4;
  padding: clamp(18px, 2vw, 26px);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  border-left: 4px solid rgba(225,6,0,.78);
  position: relative;
  overflow: hidden;
  animation: slideFadeUp .62s ease both;
}

.dashboard-grid .panel:nth-child(1),
.page-grid .panel:nth-child(1) { animation-delay: .08s; }
.dashboard-grid .panel:nth-child(2),
.page-grid .panel:nth-child(2) { animation-delay: .16s; }
.dashboard-grid .panel:nth-child(3),
.page-grid .panel:nth-child(3) { animation-delay: .24s; }

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 62%, rgba(225,6,0,.13) 63%, transparent 68%);
}

.panel > * { position: relative; z-index: 1; }

.panel.wide { grid-column: span 8; }
.panel.full { grid-column: 1 / -1; }

.panel-head,
.row-head,
.split-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.text-link {
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.driver-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.driver-card,
.team-card {
  padding: 15px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.16);
  border-bottom: 3px solid rgba(225,6,0,.7);
  transform: skewX(-3deg);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
  animation: popFade .5s ease both;
}

.driver-card:nth-child(1), .team-card:nth-child(1) { animation-delay: .08s; }
.driver-card:nth-child(2), .team-card:nth-child(2) { animation-delay: .14s; }
.driver-card:nth-child(3), .team-card:nth-child(3) { animation-delay: .2s; }
.driver-card:nth-child(4), .team-card:nth-child(4) { animation-delay: .26s; }
.driver-card:nth-child(5), .team-card:nth-child(5) { animation-delay: .32s; }

.driver-card:hover,
.team-card:hover {
  transform: translateY(-4px) skewX(-7deg);
  border-color: var(--cyan);
  background: rgba(225,6,0,.18);
}

.driver-card > *,
.team-card > * { transform: skewX(3deg); }

.driver-card .pos,
.table-row .pos {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 34px;
  margin-bottom: 10px;
  background: var(--red);
  color: white;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  transform: skewX(-9deg);
}

.driver-card h3,
.team-card h3 { font-size: 21px; }
.driver-card p,
.team-card p,
.muted { color: var(--muted); }

.winner-card { background: linear-gradient(160deg, rgba(225,6,0,.42), rgba(20,22,25,.92)); }
.winner-number {
  color: var(--red-bright);
  font-family: Anton, sans-serif;
  font-size: 86px;
  line-height: .9;
  font-style: italic;
}

.module-list {
  display: grid;
  gap: 9px;
}

.module-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  background: rgba(255,255,255,.045);
  border-left: 3px solid var(--red);
  color: #f3f3f4;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.module-list a:hover {
  transform: translateX(6px);
  border-left-color: var(--cyan);
  background: rgba(0,227,253,.1);
}

.page-hero {
  position: relative;
  min-height: 270px;
  display: flex;
  align-items: end;
  margin: 18px 0;
  padding: clamp(22px, 4vw, 46px);
  overflow: hidden;
  border: 2px solid rgba(225,6,0,.58);
  background: #070708;
  box-shadow: var(--hard-shadow);
  clip-path: polygon(0 0, calc(100% - 42px) 0, 100% 42px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
  animation: riseFade .68s ease .04s both;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5,5,6,.96), rgba(5,5,6,.5)),
    linear-gradient(135deg, rgba(225,6,0,.45), transparent 42%),
    url("../IMAGES/bg.webp") center / cover;
  opacity: .9;
}

.page-hero > * { position: relative; z-index: 3; }
.page-hero h1 { font-size: clamp(58px, 9vw, 116px); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}

.segmented button,
.select,
.search {
  border: 0;
  color: var(--text);
  background: transparent;
  padding: 10px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.segmented button.active { background: var(--red); }
.select,
.search {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
}

.data-table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 70px minmax(150px, 1fr) minmax(120px, .8fr) 100px 80px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.14);
  border-left: 4px solid rgba(225,6,0,.62);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
  animation: slideFadeUp .45s ease both;
}

.table-row:nth-child(2) { animation-delay: .04s; }
.table-row:nth-child(3) { animation-delay: .08s; }
.table-row:nth-child(4) { animation-delay: .12s; }
.table-row:nth-child(5) { animation-delay: .16s; }
.table-row:nth-child(6) { animation-delay: .2s; }
.table-row:nth-child(7) { animation-delay: .24s; }
.table-row:nth-child(8) { animation-delay: .28s; }

.table-row:not(.header):hover {
  transform: translateX(5px);
  background: rgba(225,6,0,.15);
  border-left-color: var(--cyan);
}

.table-row.header {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  background: rgba(225,6,0,.16);
}

.table-row strong { font-size: 18px; }
.points { color: var(--cyan); font-family: "JetBrains Mono", monospace; font-weight: 800; }

.calendar-list,
.qualifying-list,
.gallery-grid {
  display: grid;
  gap: 12px;
}

.race-row {
  display: grid;
  grid-template-columns: 72px minmax(150px, 1fr) 170px;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.14);
  border-left: 5px solid var(--red);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  transition: transform .16s ease, border-color .16s ease;
  animation: slideFadeUp .48s ease both;
}

.race-row:nth-child(1) { animation-delay: .04s; }
.race-row:nth-child(2) { animation-delay: .08s; }
.race-row:nth-child(3) { animation-delay: .12s; }
.race-row:nth-child(4) { animation-delay: .16s; }
.race-row:nth-child(5) { animation-delay: .2s; }
.race-row:nth-child(6) { animation-delay: .24s; }

.race-row:hover {
  transform: translateX(5px);
  border-left-color: var(--cyan);
}

.round {
  color: var(--red-bright);
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}

.driver-focus {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 18px;
}

.monogram {
  display: grid;
  place-items: center;
  min-height: 310px;
  background:
    linear-gradient(145deg, rgba(225,6,0,.85), rgba(0,227,253,.3)),
    url("../IMAGES/fg.webp") center bottom / contain no-repeat;
  border: 2px solid rgba(225,6,0,.58);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%);
  animation: slideFadeLeft .64s ease .08s both;
}

.monogram span {
  font-family: Anton, sans-serif;
  font-size: clamp(86px, 16vw, 180px);
  font-style: italic;
  opacity: .92;
  text-shadow: 0 18px 34px rgba(0,0,0,.48);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.gallery-grid {
  grid-template-columns: repeat(4, 1fr);
}

.gallery-grid img,
.device-strip img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #111;
}

.device-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.repo-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(225,6,0,.28), rgba(0,227,253,.12));
  border: 2px solid rgba(0,227,253,.45);
  border-left: 7px solid var(--red);
  box-shadow: var(--hard-shadow);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: none;
  justify-content: space-around;
  border-top: 1px solid var(--line);
  background: rgba(5,5,6,.92);
  backdrop-filter: blur(14px);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 64px;
  padding: 9px 8px 7px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  transition: color .2s ease, transform .2s ease, background .2s ease;
}

.bottom-nav a.active {
  color: var(--red-bright);
  transform: translateY(-3px);
  background: rgba(225,6,0,.08);
}

.speed-lines {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(105deg, transparent 0 62px, rgba(255,255,255,.035) 63px 64px);
  animation: speed 16s linear infinite;
  opacity: .35;
}

@keyframes speed {
  from { transform: translateX(0); }
  to { transform: translateX(-180px); }
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes riseFade {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideFadeLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes popFade {
  from { opacity: 0; transform: translateY(14px) skewX(-3deg) scale(.96); }
  to { opacity: 1; transform: translateY(0) skewX(-3deg) scale(1); }
}

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

@media (max-width: 980px) {
  .desktop-nav { display: none; }
  .bottom-nav { display: flex; }
  .hero { min-height: 720px; align-items: start; }
  .hero-car { width: 105vw; right: -24vw; bottom: 100px; }
  .hero-shade { background: linear-gradient(180deg, rgba(5,5,6,.93), rgba(5,5,6,.5) 58%, rgba(5,5,6,.86)); }
  .race-tile { left: 18px; right: 18px; }
  .hud-stack { display: none; }
  .panel, .panel.wide { grid-column: 1 / -1; }
  .driver-strip, .gallery-grid, .device-strip { grid-template-columns: repeat(2, 1fr); }
  .driver-focus { grid-template-columns: 1fr; }
  .table-row { grid-template-columns: 56px minmax(130px, 1fr) 90px; }
  .table-row > :nth-child(3),
  .table-row > :nth-child(5) { display: none; }
}

@media (max-width: 620px) {
  main { width: min(100% - 20px, 1380px); }
  .brand { font-size: 24px; }
  .status-chip { display: none; }
  .hero { min-height: 700px; margin-top: 10px; }
  .hero-content { padding: 24px 18px; }
  .hero-car { width: 128vw; right: -42vw; bottom: 130px; }
  .driver-strip, .gallery-grid, .device-strip, .metrics-grid { grid-template-columns: 1fr; }
  .race-row { grid-template-columns: 1fr; }
  .repo-card { grid-template-columns: 1fr; }
}
