/* Self-hosted fonts (SIL Open Font License 1.1, licence files in assets/fonts/). Latin subset, same faces the site used from Google Fonts. */
@font-face {
  font-family: 'Archivo';
  font-style: italic;
  font-weight: 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('./assets/fonts/Archivo-Italic-Variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('./assets/fonts/Archivo-Variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url('./assets/fonts/IBMPlexSans-Variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('./assets/fonts/IBMPlexSans-Variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/fonts/JetBrainsMono-Variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./assets/fonts/JetBrainsMono-Variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./assets/fonts/JetBrainsMono-Variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./assets/fonts/JetBrainsMono-Variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --brand-red: #990000;
  --brand-red-rgb: 153, 0, 0;
  --secondary: #4A4A52;
  --background: #0B0B0D;
  --surface: #17171A;
  --surface-dark: #050506;
  --border: #2E2E33;
  --text: #F2F1EE;
  --text-secondary: #9B9BA1;

  --font-heading: 'Archivo', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --radius: 6px;
  --header-height: 76px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  --section-pad: 60px;
  --container: 1360px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-stretch: 88%;
  font-variation-settings: 'wdth' 88;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h1 { font-size: 39px; font-style: italic; }
h2, h3 { font-style: normal; letter-spacing: 0; word-spacing: .16em; }
h2 { font-size: 31px; }
h3 { font-size: 20px; }

@media (min-width: 768px) {
  h1 { font-size: 49px; }
  h2 { font-size: 39px; }
}

@media (min-width: 1200px) {
  h1 { font-size: 61px; }
}

p { color: var(--text-secondary); }

.eyebrow {
  display: block;
  width: fit-content;
  min-width: 220px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
  margin: 0 0 var(--space-md);
}
/* solid red bar instead of a text dash: visible on the dark background */
.dash {
  display: inline-block;
  width: 18px;
  height: 3px;
  background: var(--brand-red);
  vertical-align: .22em;
  margin: 0 .2em;
}

.placeholder-copy {
  outline: 1px dashed var(--brand-red);
  outline-offset: 4px;
  background: rgba(var(--brand-red-rgb), 0.08);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  transition: filter 0.15s, background 0.15s, border-color 0.15s;
}
.btn-primary {
  background: var(--brand-red);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.15); }
.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}
.btn-outline:hover { border-color: var(--brand-red); color: #fff; }
.btn-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}
.btn-outline-light:hover { border-color: var(--brand-red); color: #fff; }
.btn-large { padding: 16px 36px; font-family: var(--font-mono); font-size: 16px; }

/* ─── Split button: main button + attached copy-email square ─── */
.split { --h: 40px; display: inline-flex; align-items: stretch; vertical-align: middle; }
.split > a {
  height: var(--h);
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.copy-btn {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--h);
  height: var(--h);
  margin: 0;
  padding: 0;
  cursor: pointer;
  background: var(--brand-red);
  color: #fff;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: filter 0.15s, background-color 0.15s;
}
.copy-btn:hover { filter: brightness(1.15); }
.copy-btn svg { width: 16px; height: 16px; }
.copy-btn .icon-check,
.copy-btn.copied .icon-copy { display: none; }
.copy-btn.copied .icon-check { display: block; }
/* tooltip: "Copy email", "Copied", or the address itself when the clipboard is unavailable */
.copy-btn::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  padding: 5px 8px;
  background: #000;
  border: 1px solid #3a3a40;
  border-radius: 3px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-transform: none;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.nav-split .copy-btn::after { bottom: auto; top: calc(100% + 8px); }
@media (hover: hover) {
  .copy-btn:hover::after { opacity: 1; }
}
.copy-btn:focus-visible::after,
.copy-btn.show-tip::after { opacity: 1; }

.nav-split { flex-shrink: 0; }
.nav-split > .nav-cta { padding-left: 20px; padding-right: 20px; }

.split-hero { --h: 52px; }
.split-hero > .hero-btn { flex: 1; border-radius: 2px 0 0 2px; }
.split-hero .copy-btn {
  border: 1px solid var(--brand-red);
  border-left-color: rgba(255, 255, 255, 0.4);
  border-radius: 0 2px 2px 0;
}
@media (max-width: 480px) {
  .hero-actions .split-hero { flex: 1 1 100%; }
}

.split-contact { --h: 56px; display: flex; }
.split-contact > .btn { flex: 1; }

/* the "Get in touch" link in the Teams intro: small outline split button */
.split-inline { --h: 28px; font-size: 14px; }
.section-intro .split-inline > a {
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-right: 0;
  border-radius: 3px 0 0 3px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.section-intro .split-inline > a:hover { background: rgba(255, 255, 255, 0.1); }
.split-inline .copy-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0 3px 3px 0;
}
.split-inline .copy-btn:hover { filter: none; background: rgba(255, 255, 255, 0.1); }
.split-inline .copy-btn svg { width: 14px; height: 14px; }

:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

/* ─── Header ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  height: var(--header-height);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 15px;
  color: var(--text);
  flex-shrink: 0;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: var(--space-xl);
  flex: 1;
  justify-content: center;
}
.nav-links a {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 20px;
  background: var(--brand-red);
  color: #fff;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  transition: filter 0.15s;
}
.nav-cta:hover { filter: brightness(1.15); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
}

/* ─── Sections generic ─── */
section {
  scroll-margin-top: var(--header-height);
  padding: var(--section-pad) var(--space-lg);
}
.section-head { max-width: var(--container); margin: 0 auto var(--space-xl); }
h2 { max-width: var(--container); margin-left: auto; margin-right: auto; }
.section-intro { max-width: 680px; margin-top: 12px; }
.section-intro a { color: var(--text); text-decoration: underline; }

/* ─── Hero ─── */
.hero {
  position: relative;
  padding: 0;
  background: var(--background);
}

/* Container: cqw/cqh units below resolve against this box. */
.hero-visual {
  container-type: size;
  position: relative;
  height: clamp(560px, 74svh, 760px);
  overflow: hidden;
}
@media (min-width: 900px) {
  .hero-visual { height: clamp(640px, calc(100svh - var(--header-height)), 1100px); }
}

/*
  Photo stage. Everything is expressed in source-photo pixels (6000x4000)
  times one scale --k, so the photo, the cut-out and the headline share
  a single transform and cannot drift apart. The web images are crops of that
  photo; --ox/--oy/--ow/--oh give each crop's place in the original frame.

  The right edge of the window is pinned at photo x = 2320, just left of the
  ROLEX lettering (x ~ 2370), so ROLEX and the crown never appear.
*/
.hero-stage {
  --f: .64;   /* subject height / hero height, lower bound */
  --t: .36;   /* head top, fraction of hero height */
  --fsf: 350; /* headline font size, in source-photo px */
  --lh: .8;   /* headline line-height */
  --dy: 45;   /* photo + cut-out shift down, source-photo px (headline stays) */
  --cyp: 1400;/* headline centre y, in source-photo px */
  --cx-p: 1400;
  --k: max(calc(var(--f) * 100cqh / 2050), calc(min(100cqw, 1920px) / 2320));
  --sl: calc(100cqw - var(--k) * 2320);
  /* the head top stays at least 14px below the annotation block (block bottom = clamp + 114px) */
  --st: calc(max(var(--t) * 100cqh, var(--k) * 440 + 40px, var(--k) * 405 + 128px + clamp(20px, 3.2cqw, 48px)) - var(--k) * 1560);
  /* headline font size: --fsf scale, capped so "THE BAR" keeps a 16px gutter on both sides.
     Text spans about cx - 2.25em ... cx + 1.86em; the stamp reaches cx + 2em. */
  --fs: min(
    calc(var(--k) * var(--fsf)),
    calc((var(--cx) - 16px) / 2.3),
    calc((100cqw - var(--cx) - 16px) / 2)
  );
  --cx: calc(var(--sl) + var(--k) * var(--cx-p));
  --cy: calc(var(--st) + var(--k) * var(--cyp));
  position: absolute;
  inset: 0;
}
/* Desktop: fit vertically, from the top of "RAISE" to the lid logo. Any width
   the photo no longer covers on the left fades into the page background. */
@media (min-width: 900px) {
  .hero-stage {
    --fsf: 450;
    --lh: .78;
    --dy: 50;
    --cyp: 1400;
    --cx-p: 1370;
    --top: 28px; /* top of "RAISE" */
    --k: calc((100cqh - var(--top)) / 1611);
    --st: calc(var(--top) - var(--k) * 1049);
  }
  .hero-bg {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 calc(var(--k) * 520));
            mask-image: linear-gradient(90deg, transparent, #000 calc(var(--k) * 520));
  }
}

.hero-photo {
  --ox: 0; --oy: 0; --ow: 6000; --oh: 4000;
  position: absolute;
  left: calc(var(--sl) + var(--k) * var(--ox));
  top: calc(var(--st) + var(--k) * (var(--dy) + var(--oy)));
  width: calc(var(--k) * var(--ow));
  height: calc(var(--k) * var(--oh));
  max-width: none;
  /* same filter on photo and cut-out so they match exactly */
  filter: grayscale(100%) contrast(1.2);
  user-select: none;
  -webkit-user-drag: none;
}
.hero-bg { --oy: 250; --ow: 2400; --oh: 3600; z-index: 0; }
.hero-cutout { --ox: 900; --oy: 1500; --ow: 1500; --oh: 2200; z-index: 3; pointer-events: none; }

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(11, 11, 13, .78) 0%, rgba(11, 11, 13, .45) 38%, rgba(11, 11, 13, 0) 62%),
    linear-gradient(180deg, rgba(11, 11, 13, .5) 0%, rgba(11, 11, 13, .25) 45%, rgba(11, 11, 13, .7) 100%);
}

/* Headline, behind the cut-out */
.hero-headline {
  position: absolute;
  z-index: 2;
  font-size: var(--fs);
  width: 4.3em;
  left: calc(var(--cx) - 2.15em);
  top: calc(var(--cy) - var(--lh) * 1em);
  line-height: var(--lh);
  letter-spacing: -0.045em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}
.hero-headline span { display: block; }
.hero-headline .l1 { margin-left: -.1em; }
.hero-headline .l2 { margin-left: -.08em; word-spacing: .14em; }

/* "EVERY RACE" stamp: exclusive to the hero */
.hero-stamp {
  position: absolute;
  z-index: 4;
  right: calc(100cqw - var(--cx) - 2.0 * var(--fs));
  top: calc(var(--cy) + var(--lh) * var(--fs) + .03 * var(--fs));
  transform: rotate(-3deg);
  transform-origin: right center;
  background: var(--brand-red);
  color: #fff;
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 900;
  font-variation-settings: 'wdth' 88;
  font-size: max(20px, calc(var(--fs) * .12));
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1;
  padding: .5em .85em .55em;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset;
}
@media (max-width: 899px) {
  /* mobile: stamp goes left, under "THE", clear of the head and headset */
  .hero-stamp {
    right: auto;
    left: calc(var(--cx) - 2.15 * var(--fs) - .08 * var(--fs));
    top: calc(var(--cy) + var(--lh) * var(--fs) + .1 * var(--fs));
    font-size: 17px;
    transform-origin: left center;
  }
}

/* Mono annotation block */
.hero-note {
  position: absolute;
  z-index: 4;
  top: clamp(20px, 3.2cqw, 48px);
  left: 5cqw;
  width: min(270px, 86cqw);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  line-height: 1.5;
  color: var(--text);
  text-transform: uppercase;
}
.hero-note .rule { display: block; height: 1px; background: rgba(255, 255, 255, .45); }
.hero-note .row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.hero-note .label { color: #B4B4BA; font-weight: 400; }
.hero-note .value { font-weight: 700; }
.hero-note .dash { flex: none; margin: 0; vertical-align: baseline; }
.hero-note .label { min-width: 6.5ch; }

/*
  Mid widths (split screen): the headline's left edge reaches under the top-left annotation block.
  Whenever the hero is not wide enough for its height, the annotations become a single strip
  above the headline and the artwork gives up 44px at the top to make room for it.
  Thresholds are the aspect ratios at which the block would start to touch the headline.
*/
@media (min-width: 900px) {
  @container ((height < 700px) and (aspect-ratio < 1.72)) or ((height >= 700px) and (height < 900px) and (aspect-ratio < 1.67)) or ((height >= 900px) and (aspect-ratio < 1.6)) {
    .hero-stage { --top: 72px; }
    .hero-note {
      top: 16px;
      width: auto;
      display: flex;
      align-items: center;
      gap: 28px;
      border-top: 1px solid rgba(255, 255, 255, .45);
      border-bottom: 1px solid rgba(255, 255, 255, .45);
    }
    .hero-note .rule { display: none; }
    .hero-note .row { padding: 8px 0; }
  }
}

/* Subtitle and buttons */
.hero-copy {
  position: relative;
  z-index: 5;
  padding: 28px var(--space-lg) 56px;
  max-width: 640px;
}
@media (min-width: 900px) {
  .hero-copy {
    position: absolute;
    left: max(5vw, calc(50vw - 960px + 5vw));
    bottom: clamp(32px, 7vh, 72px);
    padding: 0;
    max-width: 440px;
  }
}
.hero-sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .02em;
  color: #fff;
  background: var(--brand-red);
  border: 1px solid var(--brand-red);
  padding: 14px 28px;
  border-radius: 2px;
  transition: filter .15s, background-color .15s;
}
.hero-btn:hover { filter: brightness(1.2); }
.hero-btn-outline { background: transparent; border-color: #fff; }
.hero-btn-outline:hover { filter: none; background: rgba(255, 255, 255, .1); }
@media (max-width: 480px) {
  .hero-actions .hero-btn { flex: 1 1 100%; text-align: center; }
}

/* ─── Services ─── */
.card-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}
@media (min-width: 768px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--secondary); transform: translateY(-2px); }
.card-icon { width: 28px; height: 28px; color: var(--brand-red); margin-bottom: var(--space-md); }
.card h3 { margin-bottom: var(--space-sm); }
.card p { font-size: 14px; }

/* ─── About ─── */
.about { --section-bg: var(--surface); }
.about-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-width: var(--container);
  margin: 0 auto;
}
@media (min-width: 900px) {
  .about-inner { flex-direction: row; align-items: center; }
}
.about-photo {
  flex: 1;
  border-radius: var(--radius);
  overflow: hidden;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; min-height: 320px; }
.about-text { flex: 1; }
.about-text p { margin-bottom: var(--space-md); }
.about-text h2 { margin-bottom: var(--space-lg); }
/* About steps: compact data list, same mono labels as the section labels */
.about-steps { list-style: none; margin: var(--space-lg) 0 0; padding: 0; }
.about-step { padding: 14px 0; }
.about-step + .about-step { border-top: 1px solid rgba(255, 255, 255, 0.25); }
.about-step:first-child { padding-top: 0; }
.about-text .about-step-head {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.about-text .about-step-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-secondary); }
.stats { display: flex; gap: var(--space-xl); margin-top: var(--space-lg); }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-family: var(--font-mono); font-size: 28px; font-weight: 600; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* ─── References ─── */
.ref-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}
/* 3 across only when the 5:4 cards are wide enough to hold the position and three text lines */
@media (min-width: 1100px) {
  .ref-grid { grid-template-columns: repeat(3, 1fr); }
}
/* References: posters. Photo = full-card background (black & white, like the hero), dark gradient from the bottom. */
.references { --section-bg: var(--surface); }
.ref-card {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 5 / 4;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.ref-card img {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* same function list in both states so the filter can transition */
  filter: grayscale(100%) contrast(1.2) saturate(1) brightness(1);
  transition: filter 0.3s ease;
}
/* "Fade" look: matte blacks, lower contrast, slightly muted colour */
.ref-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: rgb(40, 40, 45);
  mix-blend-mode: lighten;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.ref-card.is-color img { filter: grayscale(0) contrast(0.9) saturate(1.05) brightness(1); }
.ref-card.is-color::before { opacity: 1; }
.ref-card.is-color .ref-result { color: var(--brand-red); }
@media (hover: hover) {
  .ref-card:hover img { filter: grayscale(0) contrast(0.9) saturate(1.05) brightness(1); }
  .ref-card:hover::before { opacity: 1; }
  .ref-card:hover .ref-result { color: var(--brand-red); }
}
.ref-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(11, 11, 13, 0.92) 0%, rgba(11, 11, 13, 0.7) 30%, rgba(11, 11, 13, 0) 68%);
}
.ref-caption { width: 100%; padding: 20px; }
.ref-result {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-style: normal;
  font-weight: 900;
  font-stretch: 88%;
  font-variation-settings: 'wdth' 88;
  font-size: clamp(56px, 24cqw, 120px);
  line-height: 0.8;
  letter-spacing: -0.02em;
  color: #fff;
  transition: color 0.3s ease;
}
/* three distinct levels: white mono bold / grey mono regular / dimmer grey sans */
.ref-line1,
.ref-line2 {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ref-line1 {
  margin: 0 0 4px;
  min-height: 3em; /* room for two lines on every card, so the giant position never moves */
  display: flex;
  align-items: flex-end; /* spare room goes above the event line, the three lines stay together */
  font-weight: 700;
  color: #fff;
}
.ref-line2 { margin: 0 0 6px; font-weight: 400; color: #b6b6bc; }
.ref-team { margin: 0; font-family: var(--font-body); font-size: 14px; font-weight: 400; color: #85858d; }
@container (max-width: 300px) {
  .ref-line1 { min-height: 4.5em; } /* narrow cards can wrap the event line onto three lines */
}

/* ─── Process ─── */
.process { --section-bg: var(--background); }
.process .section-head h2,
.process .section-intro { color: #fff; }
.process .section-intro { color: var(--text-secondary); }
.process-stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
.process-stat-value { font-family: var(--font-mono); font-size: 32px; font-weight: 700; color: #fff; }
.process-stat-label { font-size: 14px; color: var(--text-secondary); max-width: 640px; }
.process-card h3 { color: #fff; margin-bottom: var(--space-sm); }
.process-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--space-md);
  margin-bottom: 4px;
}
.process-label::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 2px;
  background: var(--brand-red);
  flex-shrink: 0;
}
.process-label:first-child { margin-top: 0; }
.process-text { font-size: 14px; margin-bottom: 0; }

/* ─── Contact ─── */
.contact {
  --section-bg: var(--surface);
  text-align: left;
}
.contact > p { max-width: 640px; }
.contact h2 { max-width: none; margin-left: 0; margin-right: 0; margin-bottom: var(--space-lg); }
.contact p { margin-bottom: var(--space-xl); }
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-md);
}

/* ─── Two-column sections (desktop): label + title on the left, content on the right ─── */
@media (min-width: 900px) {
  .services,
  .process,
  .contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: var(--space-3xl);
    align-items: start;
    max-width: none;
    margin: 0;
    text-align: left;
    padding-inline: max(var(--space-lg), calc((100% - var(--container)) / 2));
  }
  /* head stays in view while the (taller) right column scrolls */
  .services .section-head,
  .process .section-head {
    position: sticky;
    top: calc(var(--header-height) + var(--space-lg));
    max-width: none;
    margin: 0;
  }
  .services h2,
  .process h2 { max-width: none; margin-left: 0; margin-right: 0; }
  .services .card-grid,
  .process .card-grid { max-width: none; margin: 0; gap: var(--space-md); }
  .services .card,
  .process .card { padding: var(--space-lg); }

  /* text takes the wide left column; the links sit right-aligned, centred on the text block */
  .contact { grid-template-columns: minmax(0, 1fr) auto; }
  .contact .eyebrow,
  .contact h2,
  .contact p { grid-column: 1; margin-left: 0; margin-right: 0; }
  .contact .eyebrow { margin-bottom: var(--space-md); }
  .contact h2 { margin-bottom: var(--space-md); }
  .contact p { margin-bottom: 0; }
  .contact-actions {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    justify-self: end;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
  }
}

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--border);
  --section-bg: var(--background);
  padding: var(--space-xl) max(var(--space-lg), calc((100% - var(--container)) / 2));
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: var(--space-sm); font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.footer-credit { font-size: 12px; color: var(--text-secondary); opacity: 0.75; text-align: center; text-wrap: balance; }
.footer-links { display: flex; align-items: center; gap: var(--space-sm); white-space: nowrap; }
.footer-links a + a::before { content: "·"; margin-right: var(--space-sm); color: var(--text-secondary); display: inline-block; }
.site-footer a { font-size: 13px; color: var(--text-secondary); }
.site-footer a:hover { color: var(--text); }
.footer-credit a { font-size: inherit; }
@media (max-width: 767px) {
  .site-footer { flex-direction: column; justify-content: center; text-align: center; gap: var(--space-md); }
  .footer-links { flex-wrap: wrap; justify-content: center; }
}

/* ─── Legal page ─── */
.legal { min-height: 70vh; }
.legal-inner { max-width: var(--container); margin: 0 auto; }
.legal-inner > * { max-width: 720px; }
.legal h1 {
  margin: 0 0 var(--space-xl);
  font-size: 31px;
  font-style: normal;
  letter-spacing: 0;
  word-spacing: .16em;
}
@media (min-width: 768px) {
  .legal h1 { font-size: 39px; }
}
.legal h2 { margin: var(--space-xl) 0 var(--space-sm); font-size: 20px; }
.legal p { margin-bottom: var(--space-md); }
.legal a { color: var(--text); text-decoration: underline; }
.nowrap { white-space: nowrap; }

/* ─── Gallery / Bento grids ─── */
.gallery { --section-bg: var(--background); }
.gallery-alt { --section-bg: var(--surface); }

/*
  Six photos: one tall tile (the portrait), two wide-ish and small tiles.
  .bento-left / .bento-right set which side the tall tile sits on.
  4 columns: tall + three small on row 1, tall + wide + small on row 2
  (mirrored for .bento-right).
*/
.bento {
  --bento-row: 190px;
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: var(--bento-row);
  grid-auto-flow: dense;
  gap: var(--space-md);
}
.bento-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-dark);
}
.bento-item picture, .ref-card picture, .about-photo picture { display: contents; } /* the <picture> wrapper must not change the img layout */
.bento-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bento-tall { grid-row: span 2; }

/* Background: same black & white treatment as the hero photo, applied in CSS only */
.bento-mono .bento-item img { filter: grayscale(100%) contrast(1.2); }

/* 2 columns */
@media (min-width: 480px) {
  .bento { grid-template-columns: repeat(2, 1fr); --bento-row: 200px; }
  .bento-w { grid-column: 1 / -1; }
  .bento-left .bento-tall { grid-column: 1; }
  .bento-right .bento-tall { grid-column: 2; }
}
/* 4 columns, mixed tile sizes */
@media (min-width: 900px) {
  .bento { grid-template-columns: repeat(4, 1fr); --bento-row: 250px; }
  .bento-w { grid-column: span 2; }
  .bento-left .bento-tall { grid-column: 1; }
  .bento-right .bento-tall { grid-column: 4; }
}

/*
  Teams: placed tile by tile. DOM order is the 1-column reading order:
  Sebring (large), Sepang (wide), Daytona, Le Mans (tall portrait), CTMP, Barcelona (wide).
  Rows are sized from the column width so group photos keep their heads.
*/
.bento-teams { --bento-row: 240px; }
.bento-teams .tm-lem { grid-row: span 2; }

/* Daytona: whole photo at full tile width (nobody cut), team centred top-bottom, bottom edge faded into the tile */
.bento-teams .tm-day { background: rgb(70, 64, 64); }
.bento-teams .tm-day img {
  position: absolute;
  left: 0;
  top: calc(50% - 44.3cqw);
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
}

/* 2 columns: Sebring full width first, wide tiles full width, 2 rows each */
@media (min-width: 480px) {
  .bento-teams { --bento-row: calc((100vw - 2 * var(--space-lg) - var(--space-md)) / 3); }
  .bento-teams .tm-seb { grid-column: 1 / -1; grid-row: span 2; }
  .bento-teams .tm-lem { grid-column: 2; }
  .bento-teams .tm-sep,
  .bento-teams .tm-dre { grid-column: 1 / -1; grid-row: span 2; }
}
/* 4 columns (4fr 3fr 3fr 3fr), 2 rows:  SEB SEP DAY LEM / SEB CTMP DRE LEM
   Framing below is desktop only: the inline object-position stays for the 1- and 2-column layouts. */
@media (min-width: 900px) {
  .bento-teams {
    --bento-fr: calc((min(100vw - 2 * var(--space-lg), var(--container)) - 3 * var(--space-md)) / 13);
    --bento-row: calc(var(--bento-fr) * 2.2);
    grid-template-columns: 4fr 3fr 3fr 3fr;
  }
  .bento-teams .tm-seb { grid-column: 1; grid-row: 1 / span 2; }
  .bento-teams .tm-sep { grid-column: 2; grid-row: 1; }
  .bento-teams .tm-day { grid-column: 3; grid-row: 1; }
  .bento-teams .tm-lem { grid-column: 4; grid-row: 1 / span 2; }
  .bento-teams .tm-ctmp { grid-column: 2; grid-row: 2; }
  .bento-teams .tm-dre { grid-column: 3; grid-row: 2; }

  /* Sebring: image box 10% shorter, anchored to the bottom, so more of the width is shown (top strip = night sky) */
  .bento-teams .tm-seb { background: rgb(14, 15, 22); }
  .bento-teams .tm-seb img {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 90%;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 14%);
  }
  .bento-teams .tm-lem img { object-position: 50% 100% !important; transform: none !important; }
  .bento-teams .tm-ctmp img { object-position: 45% 70% !important; }
}

.photo-credit {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(11, 11, 13, 0.6);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 1;
}

/*
  Photo captions: small data readout, built from data-caption by script.js.
  .bento-ui stacks the credit above the caption band, so they never overlap.
  Line 1 = place + year (before the dash) + frame counter, line 2 = description.
*/
.bento-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.bento-ui .photo-credit {
  position: static;
  align-self: flex-end;
  margin: 0 6px 6px 0;
}
.bento-cap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.18s ease, opacity 0.18s ease;
}
.bento-cap-box { min-height: 0; overflow: hidden; }
.bento-cap-body {
  padding: 6px 9px 7px;
  background: rgba(11, 11, 13, 0.85);
  border-top: 1px solid #5a5a60;
  text-align: left;
}
.cap-line1 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}
.cap-place .dash { width: 14px; margin: 0 7px 0 0; vertical-align: .28em; }
.cap-count { flex: none; color: #8a8a92; letter-spacing: 0.06em; }
.cap-line2 {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.35;
  color: #dcdce0;
}
.cap-line1 + .cap-line2 { margin-top: 1px; }

/* narrow tiles (4-column grid near 900px, 1-column-wide Teams tiles): tighter line 1 so it does not wrap */
.bento-item { container-type: inline-size; }
@container (max-width: 260px) {
  .cap-line1 { font-size: 9.5px; letter-spacing: 0.06em; gap: 6px; }
  .cap-place .dash { width: 11px; margin-right: 5px; }
  .bento-cap-body { padding: 5px 7px 6px; }
}
@container (max-width: 170px) {
  .cap-count { display: none; }
}

@media (hover: hover) {
  .bento-item:hover .bento-cap { grid-template-rows: 1fr; opacity: 1; }
}
/* touch: always visible, compact (line 1 + line 2 only) */
@media (hover: none) {
  .bento-cap { grid-template-rows: 1fr; opacity: 1; }
  .bento-cap-body { padding: 4px 7px 5px; }
  .cap-line1 { font-size: 9px; letter-spacing: 0.08em; }
  .cap-count { display: none; }
  .cap-place .dash { width: 11px; margin-right: 5px; }
  .cap-line2 { font-size: 10.5px; line-height: 1.3; }
}

/* ─── Mobile nav ─── */
@media (max-width: 899px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    padding: var(--space-lg);
    gap: var(--space-lg);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-split { display: none; }
}

/* ─── Track progress: Monza minimap (desktop), 8-segment bar (below) ─── */
:root { --sector-a: #ffffff; --sector-b: #8a8a92; }

/*
  Layers: section/footer backgrounds are painted on ::before at z-index -1; the minimap (desktop) sits at
  z-index 80, above all content (cards, photos, text) and below the header (100) and the splash.
  Nothing here changes a box size or position (::before is absolutely positioned and fills its section).
*/
main > section:not(.hero),
.site-footer { position: relative; }
main > section:not(.hero)::before,
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--section-bg, transparent);
  pointer-events: none;
}

.track-rail,
.track-bar {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
body.track-on .track-rail,
body.track-on .track-bar { opacity: 1; }
body.track-end .track-rail { opacity: 0; } /* Contact on screen: the minimap fades out (same transition as the top fade) */

.track-map { display: block; width: 100%; height: auto; overflow: visible; }
.track-map .sector { fill: none; stroke-width: 14; stroke-linejoin: round; transition: stroke 0.25s ease; }
.track-map .s-a { stroke: var(--sector-a); }
.track-map .s-b { stroke: var(--sector-b); }
.track-map .sector.is-active { stroke: var(--brand-red); }
.track-map .lap { fill: none; stroke: none; }
.track-map .dot { fill: #fff; }

/* below 1024px: thin progress bar, one segment per sector (width = its share of the lap) */
.track-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  gap: 2px;
  height: 4px;
}
.track-bar span { flex: 1 1 0; background: var(--sector-a); transition: background-color 0.25s ease; }
.track-bar span.s-b { background: var(--sector-b); }
.track-bar span.is-active { background: var(--brand-red); }
.track-rail { display: none; }

@media (min-width: 1024px) {
  .track-bar { display: none; }
  .track-rail {
    display: block;
    position: fixed;
    z-index: 80; /* above all page content (header is 100); never catches clicks: .track-rail has pointer-events: none */
    right: 24px;
    bottom: 24px;
    width: 200px;
  }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ─── Line breaks: avoid single-word last lines ─── */
p, li, blockquote, figcaption, dd { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }
.card p, .process-text { text-wrap: balance; } /* narrow card columns: pretty gives up on long last words */

/* ─── Splash (intro heartbeat) ─── */
:root{--splash-bg:#0a0a0a;--splash-accent:#e10600;--splash-beat:.9s;--splash-beats:1;--splash-fade-in:.35s;--splash-exit:.4s;--splash-logo:180px}
#splash{position:fixed;inset:0;z-index:9999;touch-action:none;display:grid;place-items:center;background:var(--splash-bg);transition:transform var(--splash-exit) ease-out;animation:splash-out var(--splash-exit) ease-out 1.8s forwards}
#splash.is-done{transform:translateY(-100%)}
@keyframes splash-out{to{transform:translateY(-100%);visibility:hidden}}
#splash .logo{width:min(40vw,var(--splash-logo));height:auto;opacity:0;will-change:transform,filter;animation:splash-fadein var(--splash-fade-in) ease-out forwards,splash-heartbeat var(--splash-beat) ease-in-out var(--splash-fade-in) var(--splash-beats)}
@keyframes splash-heartbeat{0%{transform:scale(1);filter:drop-shadow(0 0 0 transparent)}14%{transform:scale(1.12);filter:drop-shadow(0 0 22px var(--splash-accent))}28%{transform:scale(1);filter:drop-shadow(0 0 6px var(--splash-accent))}42%{transform:scale(1.07);filter:drop-shadow(0 0 16px var(--splash-accent))}70%,100%{transform:scale(1);filter:drop-shadow(0 0 0 transparent)}}
@keyframes splash-fadein{to{opacity:1}}
@media (prefers-reduced-motion:reduce){#splash{display:none}}
