:root {
  --race-black: #090909;
  --race-panel: #111111;
  --race-panel-2: #171717;
  --race-ink: #f2f0eb;
  --race-muted: #aaa7a0;
  --race-line: rgba(255, 255, 255, .14);
  --race-red: #d62936;
  --race-red-dark: #8f111a;
  --race-max: 1180px;
}

.racing-page {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 14%, rgba(165, 24, 35, .13), transparent 30rem),
    repeating-linear-gradient(118deg, rgba(255,255,255,.012) 0, rgba(255,255,255,.012) 1px, transparent 1px, transparent 8px),
    var(--race-black);
  color: var(--race-ink);
}
.racing-page .wrap { max-width: var(--race-max); }
.racing-page a { transition: color .2s ease, border-color .2s ease, background .2s ease; }
.racing-page img { color: var(--race-muted); }
.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: var(--race-red);
  font-weight: 800;
}
.skip-link:focus { top: 12px; }

.racing-header {
  background: rgba(8, 8, 8, .92);
  border-color: var(--race-line);
  backdrop-filter: blur(14px);
}
.racing-header .brand-mark { color: #fff; }
.racing-header .brand-sub { color: var(--race-red); }
.racing-header .nav a { color: var(--race-muted); }
.racing-header .nav a:hover,
.racing-header .nav a[aria-current="page"] { color: #fff; }
.racing-header .nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--race-red); }

.race-hero {
  position: relative;
  min-height: min(860px, calc(100svh - 68px));
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  overflow: hidden;
  background: #050505;
}
.hero-photo {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 46% 52%;
  filter: saturate(.82) contrast(1.12) brightness(.72);
  transform: scale(1.015);
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1), filter .5s ease;
}
.hero-photo:hover img { transform: scale(1.035); filter: saturate(.94) contrast(1.1) brightness(.76); }
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.57) 45%, rgba(0,0,0,.12) 72%),
    linear-gradient(0deg, #090909 0%, transparent 50%),
    linear-gradient(180deg, rgba(0,0,0,.25), transparent 28%);
  pointer-events: none;
}
.hero-copy { padding-top: 120px; padding-bottom: clamp(70px, 10vw, 120px); }
.eyebrow,
.kicker {
  margin: 0 0 14px;
  color: var(--race-red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.race-hero h1 {
  max-width: 820px;
  margin: 0;
  font-family: Impact, "Arial Narrow", "Segoe UI", sans-serif;
  font-size: clamp(64px, 12vw, 148px);
  font-weight: 900;
  line-height: .86;
  letter-spacing: -.035em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero-deck {
  max-width: 680px;
  margin: 26px 0 0;
  color: #ddd9d1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 3vw, 30px);
  font-style: italic;
  line-height: 1.35;
}
.story-cue {
  display: inline-flex;
  gap: 12px;
  margin-top: 34px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,.4);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.story-cue:hover { color: var(--race-red); border-color: var(--race-red); }

.section { padding: clamp(76px, 10vw, 132px) 0; }
.narrow { width: min(800px, calc(100% - 48px)); margin: 0 auto; }
.section h2 {
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.section .lead {
  margin-top: 30px;
  color: #e4e1db;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 3vw, 29px);
  line-height: 1.55;
}
.section p { color: var(--race-muted); }
.opening { background: linear-gradient(180deg, #090909, #0e0e0e 72%, #090909); }
.opening .narrow > p:not(.kicker):not(.lead) { font-size: 18px; line-height: 1.8; }

.race-stats {
  margin-top: 72px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--race-line);
  border-bottom: 1px solid var(--race-line);
}
.race-stats div { padding: 30px 24px; border-left: 1px solid var(--race-line); }
.race-stats div:first-child { border-left: 0; }
.race-stats strong {
  display: block;
  color: #fff;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -.06em;
}
.race-stats span {
  display: block;
  margin-top: 8px;
  color: var(--race-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.photo-grid { margin-top: 68px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; }
.photo-card { margin: 0; overflow: hidden; background: var(--race-panel); border: 1px solid var(--race-line); }
.origins-grid .portrait-card { grid-column: span 4; }
.origins-grid .wide-card { grid-column: span 6; }
.photo-button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  color: inherit;
  background: #050505;
  border: 0;
  cursor: zoom-in;
}
.photo-card .photo-button { aspect-ratio: 4 / 3; }
.portrait-card .photo-button { aspect-ratio: 3 / 4; }
.photo-card img,
.covie-card img,
.closing-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.78) contrast(1.08);
  transition: transform .55s cubic-bezier(.2,.7,.2,1), filter .3s ease;
}
.photo-button:hover img { transform: scale(1.025); filter: saturate(1) contrast(1.05); }
.photo-card figcaption,
.covie-card figcaption {
  min-height: 84px;
  padding: 17px 18px 19px;
  color: #ddd9d1;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.4;
}
.photo-card figcaption span,
.covie-card figcaption span {
  display: block;
  margin-bottom: 5px;
  color: var(--race-red);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.solo-section { position: relative; background: #070707; border-top: 1px solid var(--race-line); border-bottom: 1px solid var(--race-line); }
.solo-section::before {
  content: "ONE MAN";
  position: absolute;
  right: -1vw;
  top: 7%;
  color: rgba(255,255,255,.025);
  font-family: Impact, sans-serif;
  font-size: clamp(100px, 19vw, 280px);
  letter-spacing: -.05em;
  line-height: .8;
  pointer-events: none;
}
.solo-layout { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(44px, 8vw, 110px); align-items: center; }
.solo-copy > p:not(.kicker) { font-size: 18px; line-height: 1.75; }
.solo-copy blockquote { margin: 36px 0 0; padding: 4px 0 4px 25px; border-left: 3px solid var(--race-red); }
.solo-copy blockquote p { margin: 0; color: #f2f0eb; font-family: Georgia, serif; font-size: 21px; font-style: italic; }
.solo-copy cite { display: block; margin-top: 12px; color: var(--race-muted); font-size: 13px; font-style: normal; }
.covie-card { margin: 0; overflow: hidden; border: 1px solid var(--race-line); background: var(--race-panel); }
.covie-card .photo-button { aspect-ratio: 4 / 3; }
.builder-pair { margin-top: 72px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.stable-section { background: linear-gradient(180deg, #0d0d0d, #141414); }
.section-heading { margin-bottom: 48px; }
.section-heading h2 { max-width: 920px; }
.section-intro { max-width: 720px; margin: 22px 0 0; font-family: Georgia, serif; font-size: 20px; font-style: italic; }
.stable-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--race-line); border: 1px solid var(--race-line); }
.machine-card { position: relative; min-height: 330px; padding: 38px; overflow: hidden; background: var(--race-panel); }
.machine-no { position: absolute; right: 20px; top: 10px; color: rgba(255,255,255,.055); font-family: Impact, sans-serif; font-size: 106px; line-height: 1; }
.machine-type { position: relative; margin: 0 0 32px; color: var(--race-red) !important; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.machine-card h3 { position: relative; margin: 0 0 18px; font-size: 36px; letter-spacing: -.035em; }
.machine-card p:not(.machine-type) { position: relative; max-width: 520px; line-height: 1.7; }
.machine-card strong { position: absolute; left: 38px; bottom: 34px; color: #fff; font-size: 18px; }
.featured-machine { background: linear-gradient(145deg, #241013, #121212 70%); }
.stable-showcase {
  margin-top: 48px;
  display: grid;
  grid-template-columns: .9fr 1fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.stable-showcase .stable-lineup { grid-row: 1 / 3; }
.stable-showcase .stable-wide { grid-column: 2 / 4; }
.stable-showcase .photo-card { display: flex; min-height: 0; flex-direction: column; }
.stable-showcase .photo-button { flex: 1; min-height: 0; aspect-ratio: auto; }
.stable-showcase .stable-lineup .photo-button { aspect-ratio: 4 / 5; }
.stable-showcase > .photo-card:not(.stable-lineup):not(.stable-wide) .photo-button { aspect-ratio: 4 / 3; }
.stable-showcase .stable-wide .photo-button { aspect-ratio: 16 / 7; }
.stable-showcase figcaption { min-height: 80px; }

.peak-section { background: #090909; }
.season-block { padding: 72px 0; display: grid; grid-template-columns: .75fr 1.25fr; gap: clamp(40px, 7vw, 90px); align-items: start; border-top: 1px solid var(--race-line); }
.season-block.reverse { grid-template-columns: 1.25fr .75fr; }
.season-block.reverse .season-copy { order: 2; }
.season-copy { position: sticky; top: 105px; }
.season-year { margin: 0 0 8px !important; color: var(--race-red) !important; font-family: Impact, sans-serif; font-size: 82px; line-height: .9; letter-spacing: -.03em; }
.season-copy h3 { margin: 0 0 22px; font-size: clamp(28px, 4vw, 44px); line-height: 1.05; letter-spacing: -.035em; }
.season-copy p:not(.season-year) { font-size: 17px; line-height: 1.72; }
.season-photos { display: grid; gap: 22px; }
.two-up { grid-template-columns: 1fr 1fr; }
.single-photo .photo-button { aspect-ratio: 4 / 3; }
.photo-wall { grid-template-columns: 1fr 1fr; }
.photo-wall .wall-wide { grid-column: 1 / -1; }
.photo-wall .wall-wide .photo-button { aspect-ratio: 16 / 9; }

.record-section { background: #111; border-top: 1px solid var(--race-line); }
.record-layout { display: grid; grid-template-columns: .72fr 1.28fr; gap: clamp(46px, 8vw, 110px); }
.record-intro { position: sticky; top: 105px; align-self: start; }
.record-intro p:not(.kicker) { font-size: 17px; line-height: 1.7; }
.timeline { border-top: 1px solid var(--race-line); }
.timeline-year { display: grid; grid-template-columns: 100px 1fr; gap: 28px; padding: 34px 0; border-bottom: 1px solid var(--race-line); }
.timeline-marker { color: var(--race-red); font-family: Impact, sans-serif; font-size: 38px; line-height: .85; letter-spacing: -.02em; }
.timeline-marker span { font-size: 26px; }
.timeline-year h3 { margin: 0 0 16px; font-size: 26px; letter-spacing: -.025em; }
.timeline-year p,
.timeline-year li { color: var(--race-muted); line-height: 1.65; }
.timeline-year ul { margin: 0; padding-left: 20px; }
.timeline-year li + li { margin-top: 9px; }

.titles-section { background: linear-gradient(180deg, #090909, #0f0f0f); }
.table-scroll { overflow-x: auto; border: 1px solid var(--race-line); }
.titles-section table { min-width: 720px; margin: 0; color: var(--race-ink); font-size: 15px; }
.titles-section th,
.titles-section td { padding: 17px 19px; border-color: var(--race-line); }
.titles-section th { color: var(--race-red); background: #090909; }
.titles-section td:nth-child(2) { color: #fff; font-weight: 750; }
.titles-section tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }

.closing-section { padding-bottom: 0; background: #070707; }
.closing-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(48px, 9vw, 126px); align-items: center; }
.closing-photo { margin: 0; align-self: end; }
.closing-photo .photo-button { aspect-ratio: 4 / 5; }
.closing-photo img { object-position: center 20%; }
.last-line { margin: 24px 0 0; font-size: 18px; line-height: 1.7; }
.last-line a { color: #fff; border-bottom: 1px solid var(--race-red); }
.last-line a:hover { color: var(--race-red); }
.back-shop { display: inline-flex; gap: 10px; margin-top: 28px; padding-bottom: 5px; border-bottom: 1px solid rgba(255,255,255,.35); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.back-shop:hover { color: var(--race-red); border-color: var(--race-red); }

.racing-footer { margin-top: 100px; background: #050505; border-color: var(--race-line); }
.racing-footer .brand-mark { color: #fff; }
.racing-footer .footer-inner,
.racing-footer .footer-legal { border-color: var(--race-line); }
.racing-footer .footer-links a,
.racing-footer .footer-legal p { color: var(--race-muted); }
.racing-footer .footer-links a:hover { color: #fff; }

.photo-dialog {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #fff;
  background: rgba(0,0,0,.96);
  border: 0;
}
.photo-dialog:not([open]) { display: none; }
.photo-dialog::backdrop { background: rgba(0,0,0,.96); }
.dialog-stage { position: relative; width: 100%; height: 100%; display: grid; place-items: center; padding: 64px 82px 72px; }
.photo-dialog figure { width: 100%; height: 100%; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.photo-dialog img { min-height: 0; max-width: 100%; max-height: calc(100vh - 145px); object-fit: contain; }
.photo-dialog figcaption { max-width: 900px; margin-top: 17px; color: #d8d4cc; font-family: Georgia, serif; text-align: center; }
.dialog-close,
.dialog-nav { position: absolute; z-index: 2; color: #fff; background: rgba(20,20,20,.75); border: 1px solid rgba(255,255,255,.25); cursor: pointer; }
.dialog-close { right: 20px; top: 18px; width: 44px; height: 44px; border-radius: 50%; font-size: 30px; line-height: 1; }
.dialog-nav { top: 50%; width: 48px; height: 64px; margin-top: -32px; font-size: 38px; line-height: 1; }
.dialog-prev { left: 18px; }
.dialog-next { right: 18px; }
.dialog-close:hover,
.dialog-nav:hover { color: var(--race-red); border-color: var(--race-red); }

.reveal.will-reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.racing-page :focus-visible { outline: 3px solid rgba(214,41,54,.75); outline-offset: 4px; }

@media (max-width: 900px) {
  .race-stats { grid-template-columns: repeat(2, 1fr); }
  .race-stats div:nth-child(3) { border-left: 0; border-top: 1px solid var(--race-line); }
  .race-stats div:nth-child(4) { border-top: 1px solid var(--race-line); }
  .solo-layout,
  .record-layout,
  .closing-layout { grid-template-columns: 1fr; }
  .covie-card { max-width: 760px; }
  .stable-grid { grid-template-columns: 1fr; }
  .stable-showcase { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .stable-showcase .stable-lineup { grid-row: auto; }
  .stable-showcase .stable-wide { grid-column: 1 / -1; }
  .stable-showcase .stable-wide .photo-button { aspect-ratio: 16 / 8; }
  .season-block,
  .season-block.reverse { grid-template-columns: 1fr; }
  .season-block.reverse .season-copy { order: 0; }
  .season-copy,
  .record-intro { position: static; }
  .closing-photo { width: min(560px, 100%); }
}

@media (max-width: 720px) {
  .racing-header .header-inner { gap: 12px; }
  .racing-header .nav { gap: 13px; }
  .racing-header .nav a { font-size: 12px; }
  .race-hero { min-height: 730px; }
  .hero-photo img { object-position: 55% center; }
  .hero-shade { background: linear-gradient(0deg, #090909 0%, rgba(0,0,0,.56) 58%, rgba(0,0,0,.2) 100%); }
  .hero-copy { padding-bottom: 72px; }
  .origins-grid .portrait-card,
  .origins-grid .wide-card { grid-column: span 12; }
  .origins-grid .photo-card .photo-button { aspect-ratio: 4 / 3; }
  .origins-grid .portrait-card:first-child .photo-button { aspect-ratio: 4 / 5; }
  .builder-pair,
  .two-up,
  .photo-wall,
  .stable-showcase { grid-template-columns: 1fr; }
  .photo-wall .wall-wide { grid-column: auto; }
  .photo-wall .wall-wide .photo-button { aspect-ratio: 4 / 3; }
  .stable-showcase .stable-wide { grid-column: auto; }
  .stable-showcase .photo-button,
  .stable-showcase .stable-lineup .photo-button,
  .stable-showcase .stable-wide .photo-button { aspect-ratio: 4 / 3; }
  .stable-showcase .stable-lineup .photo-button { aspect-ratio: 4 / 5; }
  .machine-card { min-height: 350px; padding: 30px 26px; }
  .machine-card strong { left: 26px; }
  .timeline-year { grid-template-columns: 72px 1fr; gap: 18px; }
  .timeline-marker { font-size: 30px; }
  .dialog-stage { padding: 64px 12px 70px; }
  .dialog-nav { top: auto; bottom: 14px; width: 52px; height: 46px; margin: 0; }
  .dialog-prev { left: calc(50% - 62px); }
  .dialog-next { right: calc(50% - 62px); }
  .photo-dialog img { max-height: calc(100vh - 175px); }
}

@media (max-width: 480px) {
  .racing-header .brand-sub { display: none; }
  .race-hero h1 { font-size: clamp(58px, 20vw, 86px); }
  .hero-deck { font-size: 20px; }
  .narrow { width: calc(100% - 36px); }
  .section { padding: 76px 0; }
  .race-stats { padding: 0; margin-left: 18px; margin-right: 18px; width: auto; }
  .race-stats div { padding: 24px 16px; }
  .race-stats strong { font-size: 44px; }
  .photo-grid { gap: 16px; }
  .builder-pair { gap: 16px; }
  .timeline-year { grid-template-columns: 1fr; }
  .timeline-marker { font-size: 42px; }
  .closing-copy { padding-bottom: 16px; }
}

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