/* Corner3 Motorsports — dark shop, one red.
   The palette is the logo's: near-black, bone, and the mark's own red
   (#FD0300, sampled from the artwork). Type is a condensed display face
   over a humanist grotesk, with a mono for labels and data. All three are
   self-hosted latin subsets — no font CDN, and `swap` so text paints
   immediately on the fallback. */

@font-face {
  font-family: "Anton"; src: url("assets/fonts/anton-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow"; src: url("assets/fonts/barlow-400-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow"; src: url("assets/fonts/barlow-600-latin.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono"; src: url("assets/fonts/plex-mono-500-latin.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --ink:        #08080A;
  --panel:      #101014;
  --raised:     #16161C;
  --line:       #26262E;
  --line-soft:  #1B1B22;
  --bone:       #EDEBE8;
  --ash:        #8A8792;
  --dim:        #5E5B66;
  --red:        #FD0300;
  --red-dim:    #C40200;

  --display: "Anton", "Haettenschweiler", "Arial Narrow Bold", Impact, sans-serif;
  --body: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --wrap: 1180px;
  --pad: 28px;
}

@media (max-width: 640px) { :root { --pad: 20px; } }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: .94;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--red); color: #fff; padding: 10px 16px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
}
.skip:focus { left: 8px; top: 8px; }

.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase; color: var(--red);
  margin-bottom: 14px;
}

/* ---------------------------------------------------------------- nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px var(--pad);
  background: linear-gradient(180deg, rgba(8,8,10,.92), rgba(8,8,10,0));
  transition: background .3s ease, backdrop-filter .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.stuck {
  background: rgba(8,8,10,.86);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}
.brand img { height: 26px; width: auto; }
.nav nav { display: flex; align-items: center; gap: 26px; }
.nav nav a {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ash);
  text-decoration: none; transition: color .2s ease;
}
.nav nav a:hover { color: var(--bone); }
.nav nav .cta {
  color: var(--bone); border: 1px solid var(--line);
  padding: 9px 16px; transition: border-color .2s ease, background .2s ease;
}
.nav nav .cta:hover { border-color: var(--red); background: rgba(253,3,0,.08); }

@media (max-width: 860px) {
  .nav nav a:not(.cta) { display: none; }
  .brand img { height: 22px; }
}

/* --------------------------------------------------------------- film */
.film { position: relative; }              /* height set by film.js */
.film-viewport {
  position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--ink);
}
#film-canvas, .film-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.film-poster { z-index: 0; }
#film-canvas { z-index: 1; }
/* the poster is swapped out the moment the canvas has drawn a frame; the
   attribute needs the override because the rule above sets display */
.film-poster[hidden] { display: none !important; }

.film-scrim {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8,8,10,.72) 0%, rgba(8,8,10,.10) 24%,
                    rgba(8,8,10,.06) 46%, rgba(8,8,10,.90) 86%, var(--ink) 100%),
    linear-gradient(90deg, rgba(8,8,10,.78) 0%, rgba(8,8,10,.12) 58%, rgba(8,8,10,0) 100%);
}

/* callouts: positioned onto the drawn artwork by film.js */
.callouts {
  position: absolute; z-index: 4; opacity: 0; pointer-events: none;
  transition: opacity .45s ease;
}
.callouts {
  --callout-size: 19px; --callout-stroke: 2px; --callout-halo: 5px;
}
.callouts .leaders path {
  stroke: var(--red); stroke-width: var(--callout-stroke); fill: none; opacity: .85;
}
.callouts .dots circle { fill: var(--red); }
.callouts text {
  font-family: var(--mono); font-weight: 500;
  font-size: var(--callout-size); letter-spacing: .13em;
  fill: #F2F0ED; paint-order: stroke fill;
  stroke: rgba(8,8,10,.9); stroke-width: var(--callout-halo); stroke-linejoin: round;
}

.cards { position: absolute; inset: 0; z-index: 5; }
.card {
  position: absolute; left: 0; bottom: 0; width: 100%;
  padding: 0 var(--pad) 12vh;
  opacity: 0; transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
  pointer-events: none;
}
.card-in { max-width: var(--wrap); margin: 0 auto; }
.card.on { opacity: 1; transform: none; }
.card.on .actions a { pointer-events: auto; }
.card .kicker {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase; color: var(--red); margin-bottom: 16px;
}
.card h1 { font-size: clamp(52px, 10vw, 150px); }
.card h2 { font-size: clamp(34px, 5.4vw, 74px); }
.card .lede {
  margin-top: 22px; max-width: 46ch; font-size: clamp(16px, 1.45vw, 20px); color: #C6C2CB;
}
.card .actions { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }

.scroll-hint {
  position: absolute; right: var(--pad); bottom: 26px; z-index: 6;
  font-family: var(--mono); font-size: 10px; letter-spacing: .28em;
  text-transform: uppercase; color: rgba(255,255,255,.42);
}

/* Reduced motion / no canvas: nothing is pinned and nothing overlaps. The
   film becomes what it always was underneath — a stack of stills with the
   same copy beside them. Everything goes back into normal flow, because a
   positioned poster would otherwise paint over static text. */
.static-still { display: none; }

body.film-static .film { height: auto !important; }
body.film-static .film-viewport { position: static; height: auto; overflow: visible; }
body.film-static #film-canvas,
body.film-static .film-scrim,
body.film-static .scroll-hint,
body.film-static .callouts { display: none; }
body.film-static .film-poster {
  position: static; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
}
body.film-static .cards { position: static; }
body.film-static .card {
  position: static; opacity: 1; transform: none; pointer-events: auto;
  padding: 44px var(--pad) 0;
}
body.film-static .card:last-child { padding-bottom: 72px; }
body.film-static .static-still {
  display: block; width: 100%; height: auto; margin-bottom: 30px; border: 1px solid var(--line);
}
body.film-static .card h1 { font-size: clamp(46px, 8vw, 104px); }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-block; text-decoration: none;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  padding: 14px 22px; border: 1px solid var(--red); background: var(--red); color: #fff;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { background: var(--red-dim); border-color: var(--red-dim); }
.btn.ghost { background: transparent; color: var(--bone); border-color: var(--line); }
/* a button-shaped statement, not a control — nothing to click yet */
.btn-static {
  background: transparent; border-color: var(--line); color: var(--dim); cursor: default;
}
.btn.ghost:hover { border-color: var(--red); color: #fff; background: rgba(253,3,0,.10); }

/* ----------------------------------------------------------- sections */
.section {
  padding: clamp(72px, 11vh, 128px) 0; border-top: 1px solid var(--line-soft);
  /* the nav is fixed, so an anchor jump must stop short of it */
  scroll-margin-top: 84px;
}
.section-h { font-size: clamp(30px, 4.6vw, 60px); max-width: 20ch; }
.body { color: var(--ash); font-size: 18px; margin-top: 20px; max-width: 62ch; }
.body.wide { max-width: 74ch; }
.note { color: var(--dim); font-size: 15px; margin-top: 26px; max-width: 58ch; }
.muted { color: var(--dim); }

/* services */
.services {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line-soft); margin-top: 52px;
  border: 1px solid var(--line-soft);
}
.service { background: var(--ink); padding: 38px 30px 40px; position: relative; }
.service h3 { font-size: clamp(26px, 2.6vw, 34px); }
.service p { color: var(--ash); margin-top: 14px; font-size: 16px; }
.service ul { margin: 22px 0 0; padding: 0; list-style: none; }
.service li {
  color: var(--bone); font-size: 15px; padding: 10px 0 10px 20px;
  border-top: 1px solid var(--line-soft); position: relative;
}
.service li::before {
  content: ""; position: absolute; left: 0; top: 19px;
  width: 6px; height: 1px; background: var(--red);
}
@media (max-width: 900px) { .services { grid-template-columns: 1fr; } }

/* split sections */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.split.reverse > :first-child { order: 2; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 34px; }
  .split.reverse > :first-child { order: 0; }
}

.marques { margin-top: 40px; display: flex; flex-direction: column; }
.marque { padding: 18px 0; border-top: 1px solid var(--line-soft); }
.marque:last-child { border-bottom: 1px solid var(--line-soft); }
.marque h3 { font-size: 22px; }
.marque p { color: var(--ash); font-size: 15px; margin-top: 6px; }

.platform-figure, .contact-figure { margin: 0; }
.platform-figure img, .contact-figure img {
  width: 100%; height: auto; border: 1px solid var(--line);
}
figcaption {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dim); margin-top: 10px;
}

.racing { background: var(--panel); }
.racing .actions { margin-top: 30px; display: flex; gap: 10px; flex-wrap: wrap; }

/* brands */
.brands {
  list-style: none; margin: 44px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft);
}
.brands li {
  background: var(--ink); padding: 26px 12px; text-align: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ash);
}
.shop .actions { margin-top: 36px; }
@media (max-width: 900px) { .brands { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .brands { grid-template-columns: repeat(2, 1fr); } }

/* contact */
.contact { background: var(--panel); }
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 34px; } }

.details { margin: 40px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft); }
.details > div { background: var(--panel); padding: 22px 20px; }
.details dt {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 8px;
}
.details dd { margin: 0; font-size: 17px; }
.details dd a { color: var(--bone); text-decoration-color: var(--red); text-underline-offset: 4px; }
@media (max-width: 520px) { .details { grid-template-columns: 1fr; } }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 44px 0 64px; }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 26px; flex-wrap: wrap; }
.foot-mark { height: 20px; width: auto; }
.foot-lines { display: flex; flex-direction: column; gap: 4px; font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.foot-lines.right { text-align: right; }
.foot-lines a { color: var(--ash); text-decoration: none; }
.foot-lines a:hover { color: var(--bone); }
@media (max-width: 700px) { .foot-lines.right { text-align: left; } }

/* studio credit — quiet, under the hairline, never competing with the shop */
.colophon {
  margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim);
}
.colophon a {
  color: var(--ash); text-decoration: none;
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
  transition: color .2s ease, border-color .2s ease;
}
.colophon a:hover { color: var(--bone); border-bottom-color: var(--red); }

/* racing links */
.links { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-direction: column; }
.links li { border-top: 1px solid var(--line); }
.links li:last-child { border-bottom: 1px solid var(--line); }
.links a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 0; text-decoration: none; color: var(--bone);
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  transition: color .2s ease, padding .2s ease;
}
.links a::after { content: "→"; color: var(--red); }
.links a:hover { color: #fff; padding-left: 8px; }

/* contact fields still to be supplied by the shop */
.details dd a[data-fill], .details [data-fill].muted {
  color: var(--dim); text-decoration: underline dashed var(--line); text-underline-offset: 5px;
}
.details dd a[data-fill]:hover { color: var(--ash); }

/* ============================================================ inner pages */
.page-head { position: relative; min-height: 62svh; display: flex; align-items: flex-end; overflow: hidden; }
.page-head-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.page-head-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(8,8,10,.88) 0%, rgba(8,8,10,.30) 40%, rgba(8,8,10,.86) 80%, var(--ink) 100%),
    linear-gradient(90deg, rgba(8,8,10,.80) 0%, rgba(8,8,10,.10) 70%);
}
.page-head-in { position: relative; z-index: 2; width: 100%; padding-top: 132px; padding-bottom: 56px; }
.page-head h1 { font-size: clamp(44px, 8vw, 116px); }
.page-head .lede { margin-top: 22px; max-width: 52ch; color: #C6C2CB; font-size: clamp(16px, 1.4vw, 19px); }
.page .section:first-of-type { border-top: 0; }

/* data tables — standings, records, schedule */
.table-scroll { overflow-x: auto; margin-top: 34px; }
.data { width: 100%; border-collapse: collapse; margin-top: 34px; font-size: 15px; }
.table-scroll .data { margin-top: 0; min-width: 720px; }
.data th, .data td { text-align: left; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.data thead th {
  font-family: var(--mono); font-weight: 500; font-size: 10.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--dim); border-bottom-color: var(--line);
}
.data tbody th { font-weight: 600; color: var(--bone); font-size: 15px; }
.data .pos, .data .pts, .data .rnd {
  font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.data .rnd, .data .pos { color: var(--red); }
.data .pts { color: var(--bone); }
.data .car { color: var(--ash); font-family: var(--mono); font-size: 13px; }
.data .who { color: var(--bone); display: block; }
.data .lap {
  display: block; margin-top: 3px; color: var(--ash);
  font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.data tbody tr:hover td, .data tbody tr:hover th { background: rgba(255,255,255,.02); }
.schedule { max-width: 720px; }

.standings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px 48px; margin-top: 34px; }
.standing-block h3 { font-size: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--red); }
.standing-block .data { margin-top: 0; }
@media (max-width: 900px) { .standings { grid-template-columns: 1fr; } }

.stamp { color: var(--dim); font-family: var(--mono); font-size: 12px; letter-spacing: .1em; }
.note a { color: var(--ash); text-decoration-color: var(--line); text-underline-offset: 4px; }
.note a:hover { color: var(--bone); }
