:root {
  color-scheme: dark;
  --ink: #f7f2ea;
  --muted: #b6afa7;
  --subtle: #7f7b76;
  --asphalt: #080909;
  --panel: #151515;
  --panel-2: #1d1b19;
  --line: #34302d;
  --brand-red: #ef2b24;
  --brand-orange: #ff8f1f;
  --cream: #fff3d6;
  --green: #65d46e;
  --yellow: #ffd84a;
  --blue: #78b7ff;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--asphalt);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 14%, rgba(239, 43, 36, 0.18), transparent 26rem),
    linear-gradient(180deg, #090909 0%, #11100f 44%, #0b0b0b 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(8, 9, 9, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
}

.brand__badge {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 38px;
  color: #080909;
  background: var(--cream);
  border-radius: 5px;
  font-size: 17px;
  font-weight: 1000;
  transform: skew(-10deg);
  overflow: hidden;
}

.brand__badge::before,
.brand__badge::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 7px;
}

.brand__badge::before {
  left: 0;
  background: var(--brand-red);
}

.brand__badge::after {
  right: 0;
  background: var(--brand-orange);
}

.brand__text {
  display: grid;
  line-height: 1;
}

.brand__small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand__big {
  font-size: 20px;
  font-weight: 950;
}

.topbar__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.signal,
.sync-cadence,
.nav-pill,
.source-chip,
.race-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.signal::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--subtle);
}

.signal--ok::before {
  background: var(--green);
  box-shadow: 0 0 18px rgba(101, 212, 110, 0.9);
}

.signal--error::before {
  background: var(--brand-red);
}

.signal--loading::before {
  background: var(--yellow);
}

.sync-cadence {
  color: var(--ink);
  background: rgba(255, 143, 31, 0.12);
}

.nav-pill {
  color: var(--cream);
  text-decoration: none;
}

.nav-pill:hover {
  border-color: var(--brand-orange);
}

.nav-pill--home {
  color: #11100f;
  background: var(--cream);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  background: #24211f;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(255, 143, 31, 0.74);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: clamp(420px, 76vh, 760px);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
}

.hero__image {
  z-index: -3;
  background: var(--hero-image, linear-gradient(135deg, #181818, #3a1711));
  background-size: cover;
  background-position: center 18%;
  transform: scale(1.02);
}

.hero__shade {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(8, 9, 9, 0), rgba(8, 9, 9, 0.5)),
    linear-gradient(90deg, rgba(8, 9, 9, 0.76) 0%, rgba(8, 9, 9, 0.44) 32%, rgba(8, 9, 9, 0) 66%, rgba(8, 9, 9, 0.1));
}

.hero__content {
  max-width: 960px;
  padding: clamp(28px, 6vw, 82px);
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--brand-orange);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 10ch;
  margin-bottom: 22px;
  font-size: clamp(56px, 11vw, 142px);
  line-height: 0.88;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 6px 32px rgba(0, 0, 0, 0.75);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--ink);
  font-weight: 850;
}

.hero__meta span:not(.race-pill) {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(8, 9, 9, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.number-mark {
  position: absolute;
  right: clamp(16px, 6vw, 84px);
  bottom: clamp(-30px, -2vw, -8px);
  z-index: -1;
  color: rgba(255, 255, 255, 0.08);
  font-size: clamp(150px, 32vw, 420px);
  font-weight: 1000;
  line-height: 0.72;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.22);
}

.race-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(16px, 4vw, 48px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(90deg, rgba(239, 43, 36, 0.16), rgba(255, 143, 31, 0.07), rgba(255, 255, 255, 0.03));
}

.race-band h2,
.panel h2 {
  margin-bottom: 4px;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1.02;
}

.race-band__right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: min(100%, 280px);
}

.race-band__right span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.flag-light {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--subtle);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.2), 0 0 26px rgba(255, 255, 255, 0.14);
}

.flag-light[data-flag="green"] { background: var(--green); }
.flag-light[data-flag="yellow"] { background: var(--yellow); }
.flag-light[data-flag="red"] { background: var(--brand-red); }
.flag-light[data-flag="checkered"] {
  background:
    conic-gradient(#f7f2ea 25%, #080909 0 50%, #f7f2ea 0 75%, #080909 0);
  background-size: 16px 16px;
}

.muted {
  color: var(--muted);
}

.stat-grid,
.content-grid,
.highlights-panel,
.season-panel,
.sources {
  margin: clamp(18px, 4vw, 44px) clamp(16px, 4vw, 48px);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.stat-card,
.panel,
.sources {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    var(--panel);
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 150px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
}

.stat-card--hero {
  background:
    linear-gradient(140deg, rgba(239, 43, 36, 0.72), rgba(255, 143, 31, 0.28)),
    #1b0f0b;
}

.stat-card__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 0.9;
}

.stat-card span:last-child {
  color: var(--cream);
  font-weight: 750;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.4fr);
  gap: 18px;
}

.panel {
  padding: 22px;
  min-width: 0;
}

.panel--focus {
  background:
    linear-gradient(145deg, rgba(239, 43, 36, 0.2), transparent 45%),
    var(--panel-2);
}

.panel__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.driver-strip {
  display: grid;
  grid-template-columns: 104px 1fr;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: #0d0d0d;
}

.driver-strip__number {
  display: grid;
  place-items: center;
  aspect-ratio: 1.25 / 1;
  color: #050505;
  background: linear-gradient(135deg, var(--cream), #ffffff 42%, #dfd0c7);
  border-left: 8px solid var(--brand-red);
  border-right: 8px solid var(--brand-orange);
  border-radius: 6px;
  font-size: 46px;
  font-weight: 1000;
  transform: skew(-8deg);
}

.driver-strip h3 {
  margin-bottom: 6px;
  font-size: 28px;
}

.driver-strip p {
  margin-bottom: 0;
  color: var(--muted);
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.detail-list div {
  min-height: 78px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.detail-list dt {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 850;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

th {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

td {
  color: var(--ink);
  font-weight: 700;
}

tr.is-stenhouse td {
  color: var(--cream);
  background: rgba(239, 43, 36, 0.22);
}

.season-panel {
  padding: 22px;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.tab {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.tab.is-active {
  color: #11100f;
  background: var(--cream);
}

.tab-panel {
  margin-top: 18px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.mini-stat {
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.mini-stat span {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-stat strong {
  display: block;
  margin-top: 12px;
  font-size: 32px;
  line-height: 1;
}

.highlights-panel {
  padding: 22px;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.highlight-card {
  min-height: 220px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(239, 43, 36, 0.22), rgba(255, 143, 31, 0.08) 48%, rgba(255, 255, 255, 0.025)),
    #181716;
}

.highlight-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.highlight-card__top span,
.highlight-card__top time {
  color: var(--brand-orange);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.highlight-card strong {
  display: block;
  color: var(--cream);
  font-size: 24px;
  line-height: 1.05;
}

.highlight-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.sources {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  margin-bottom: 44px;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.source-links a {
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 9px 12px;
  text-decoration: none;
  font-weight: 850;
}

.source-links a:hover {
  border-color: var(--brand-orange);
}

.wreckhouse-page {
  background:
    radial-gradient(circle at 74% 10%, rgba(239, 43, 36, 0.22), transparent 28rem),
    radial-gradient(circle at 8% 35%, rgba(255, 143, 31, 0.12), transparent 22rem),
    linear-gradient(180deg, #090909 0%, #11100f 48%, #080909 100%);
}

.wreck-hero {
  position: relative;
  min-height: clamp(420px, 62vh, 680px);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(8, 9, 9, 0.88), rgba(8, 9, 9, 0.35)),
    url("https://res.cloudinary.com/nascarnextgen/image/upload/c_fill,g_auto,w_1536,h_800/q_auto/f_auto/v1/Hero_Heading_1_Photo_ickz3n");
  background-size: cover;
  background-position: center 18%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wreck-hero__content {
  max-width: 980px;
  padding: clamp(28px, 6vw, 82px);
}

.wreck-hero__copy {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.45;
}

.wreck-summary {
  margin: clamp(18px, 4vw, 44px) clamp(16px, 4vw, 48px);
  padding: 22px;
}

.wreck-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wreck-grid--notable {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wreck-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(239, 43, 36, 0.18), rgba(255, 143, 31, 0.06) 42%, rgba(255, 255, 255, 0.02)),
    #171615;
}

.wreck-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  overflow: hidden;
  color: var(--cream);
  background:
    linear-gradient(135deg, rgba(239, 43, 36, 0.54), rgba(255, 143, 31, 0.18)),
    #0d0d0d;
  text-decoration: none;
}

.wreck-media iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.wreck-media--link {
  padding: 24px;
  text-align: center;
}

.wreck-media--link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 9, 9, 0.18), rgba(8, 9, 9, 0.78));
  opacity: 0;
  transition: opacity 160ms ease;
}

.wreck-media--link:hover::before {
  opacity: 1;
}

.wreck-media--photo {
  background:
    linear-gradient(180deg, rgba(8, 9, 9, 0.05), rgba(8, 9, 9, 0.72)),
    var(--wreck-thumb),
    #0d0d0d;
  background-position: center;
  background-size: cover;
}

.wreck-media--link strong,
.wreck-media--link small {
  position: relative;
  z-index: 1;
  display: block;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.78);
}

.wreck-media--link strong {
  margin-top: 12px;
  font-size: 24px;
}

.wreck-media--link small {
  max-width: 34ch;
  color: var(--muted);
  line-height: 1.35;
}

.play-mark {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 74px;
  height: 74px;
  color: #11100f;
  background: var(--cream);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 1000;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

.wreck-card__body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.wreck-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-orange);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.wreck-card h3 {
  margin-bottom: 0;
  color: var(--cream);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.04;
}

.wreck-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.wreck-facts,
.wreck-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wreck-facts span,
.wreck-card__links a,
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.text-link {
  justify-self: start;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1120px) {
  .stat-grid,
  .highlights-grid,
  .mini-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .wreck-grid,
  .wreck-grid--notable {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 64px;
    gap: 12px;
  }

  .brand__logo {
    width: 48px;
  }

  .brand__small {
    display: none;
  }

  .sync-cadence {
    display: none;
  }

  .nav-pill {
    min-height: 40px;
  }

  .hero {
    min-height: 560px;
  }

  .hero__image {
    background-position: 52% 0;
  }

  .hero__shade {
    background:
      linear-gradient(180deg, rgba(8, 9, 9, 0.08), rgba(8, 9, 9, 0.7)),
      linear-gradient(90deg, rgba(8, 9, 9, 0.62), rgba(8, 9, 9, 0.18));
  }

  .hero__content {
    padding: 24px 16px 48px;
  }

  h1 {
    font-size: 58px;
  }

  .wreck-hero {
    min-height: 520px;
    background-position: 54% 0;
  }

  .wreck-hero__content {
    padding: 24px 16px 48px;
  }

  .wreck-media {
    min-height: 190px;
  }

  .race-band,
  .sources,
  .panel__header {
    align-items: stretch;
    flex-direction: column;
  }

  .stat-grid,
  .highlights-grid,
  .mini-grid,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .driver-strip {
    grid-template-columns: 84px 1fr;
    padding: 14px;
  }

  .driver-strip__number {
    font-size: 38px;
  }

  .source-links {
    justify-content: flex-start;
  }

  .tabs {
    width: 100%;
    justify-content: space-between;
  }

  .tab {
    flex: 1;
  }
}
