/* ==========================================================================
   THE RACE MATES — Design System
   Edit tokens here to re-theme the whole site.
   ========================================================================== */

:root {
  /* Brand colour tokens */
  --red: #FF1E00;
  --red-hot: #FF4524;
  --yellow: #E6FF00;
  --bg-0: #101011;        /* page background */
  --bg-1: #1A1A1A;        /* card background */
  --bg-2: #232427;        /* raised card background */
  --graphite: #2F3136;    /* borders, dividers, tertiary */
  --ink: #F4F3EF;         /* primary text */
  --muted: #A2A4AA;       /* secondary text */
  --faint: #6B6D73;       /* labels, meta */

  /* Type */
  --font-display: "Space Grotesk", "Arial Narrow", sans-serif;
  --font-body: "Manrope", "Helvetica Neue", sans-serif;

  /* Layout */
  --container: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-pad: clamp(4rem, 10vw, 7.5rem);
  --radius: 0.25rem;      /* sharp, paddock-style corners */

  --nav-h: 4.25rem;
}

/* ---------- Reset / base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; }

::selection { background: var(--red); color: #fff; }

/* Subtle track-grid texture on the page background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 72px 72px;
}

main { position: relative; z-index: 1; }

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  font-style: italic;
  margin: 0 0 1rem;
}

h1 { font-size: clamp(2.75rem, 8.5vw, 5.5rem); }
h2 { font-size: clamp(2rem, 5.5vw, 3.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.6rem); }

p { margin: 0 0 1.25rem; }

.lede {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 44rem;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bg-0);
  background: var(--yellow);
  padding: 0.35rem 0.7rem;
  margin-bottom: 1.5rem;
  transform: skewX(-8deg);
}
.kicker > span { display: inline-block; transform: skewX(8deg); }

.kicker--red { background: var(--red); color: #fff; }
.kicker--ghost {
  background: transparent;
  color: var(--faint);
  border: 1px solid var(--graphite);
}

/* ---------- Layout helpers ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-pad); position: relative; }

.section--tint { background: var(--bg-1); }

.section-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head .lede { margin-bottom: 0; }

.grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
}
@media (min-width: 46rem) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* Speed-line divider motif */
.speedlines {
  display: grid;
  gap: 0.3rem;
  width: min(9rem, 25vw);
}
.speedlines i {
  height: 0.3rem;
  transform: skewX(-30deg);
}
.speedlines i:nth-child(1) { background: var(--yellow); width: 100%; }
.speedlines i:nth-child(2) { background: var(--graphite); width: 78%; }
.speedlines i:nth-child(3) { background: var(--red); width: 56%; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.95rem 1.6rem;
  min-height: 3rem;               /* large tap target */
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transform: skewX(-8deg);
  transition: background-color 160ms ease, color 160ms ease,
              border-color 160ms ease, translate 160ms ease;
}
.btn > * { transform: skewX(8deg); }
.btn:hover { translate: 0 -2px; }
.btn:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

.btn--spotify { background: var(--red); color: #fff; }
.btn--spotify:hover { background: var(--red-hot); }

.btn--apple {
  background: transparent;
  color: var(--ink);
  border-color: rgba(244, 243, 239, 0.35);
}
.btn--apple:hover { border-color: var(--ink); background: rgba(244, 243, 239, 0.06); }

.btn--yellow { background: var(--yellow); color: var(--bg-0); }
.btn--yellow:hover { background: #F0FF4D; }

.btn--sm { padding: 0.6rem 1.05rem; min-height: 2.6rem; font-size: 0.8rem; }

.btn .icon { width: 1.05em; height: 1.05em; flex: none; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

/* ---------- Navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(16, 16, 17, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--graphite);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--nav-h);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.nav-brand img {
  height: 2.9rem;
  width: auto;
}
.footer-brand .nav-brand img {
  height: auto;
  width: min(13rem, 64vw);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 1.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: color 160ms ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--red);
}

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 3rem;
  height: 3rem;
  padding: 0.75rem;
  background: none;
  border: 1px solid var(--graphite);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  transition: transform 200ms ease, opacity 200ms ease;
}
.nav-toggle span:nth-child(2) { width: 70%; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none;
  border-top: 1px solid var(--graphite);
  background: var(--bg-0);
}
.mobile-menu.is-open { display: block; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0.75rem 0 1.25rem; }
.mobile-menu a:not(.btn) {
  display: block;
  padding: 0.9rem var(--gutter);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid rgba(47, 49, 54, 0.5);
}
.mobile-menu a[aria-current="page"] { color: var(--red); }
.mobile-menu .menu-cta { padding: 1.25rem var(--gutter) 0.25rem; }
.mobile-menu .menu-cta .btn { width: 100%; }

@media (min-width: 56rem) {
  .nav-links { display: flex; }
  .nav-toggle, .mobile-menu { display: none !important; }
}
@media (max-width: 30rem) {
  .nav-actions .btn { display: none; } /* keep header clean on tiny screens; CTA lives in menu */
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4.5rem, 12vw, 8.5rem) clamp(4rem, 10vw, 7rem);
  border-bottom: 1px solid var(--graphite);
}

.hero-ghost {
  position: absolute;
  right: -0.05em;
  top: 50%;
  translate: 0 -50%;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(14rem, 42vw, 34rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 30, 0, 0.14);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.hero .lede { margin-bottom: 2rem; }

.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.75rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}
.hero-note::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  background: var(--yellow);
  transform: skewX(-20deg);
}

/* ---------- Ticker ---------- */

.ticker {
  overflow: hidden;
  border-bottom: 1px solid var(--graphite);
  background: var(--bg-1);
  padding-block: 0.8rem;
}
.ticker-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: ticker 32s linear infinite;
}
.ticker span {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.ticker span::after {
  content: "//";
  margin-left: 2.5rem;
  color: var(--red);
}
@keyframes ticker {
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ---------- Cards ---------- */

.card {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--graphite);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color 180ms ease, translate 180ms ease;
}
.card:hover { border-color: rgba(244, 243, 239, 0.28); translate: 0 -3px; }

/* red accent bar top-left */
.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 2.75rem;
  height: 3px;
  background: var(--red);
}
.card--yellow::before { background: var(--yellow); }

.card .meta {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.6rem;
}
.card h3 { margin-bottom: 0.35rem; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .btn-row { margin-top: auto; padding-top: 1rem; }

/* ---------- Featured / latest episode ---------- */

.featured {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--bg-1);
  border: 1px solid var(--graphite);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 3rem);
}
@media (min-width: 56rem) {
  .featured { grid-template-columns: 1.05fr 0.95fr; align-items: center; }
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 1rem;
}
.badge-live::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--yellow);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  50% { opacity: 0.25; }
}
@media (prefers-reduced-motion: reduce) {
  .badge-live::before { animation: none; }
}

/* Spotify embed slot */
.player-slot { width: 100%; }
.player-slot iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
}

/* ---------- Host cards ---------- */

.host-card {
  background: var(--bg-1);
  border: 1px solid var(--graphite);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 180ms ease, translate 180ms ease;
}
.host-card:hover { border-color: rgba(244, 243, 239, 0.28); translate: 0 -3px; }

.host-visual {
  position: relative;
  aspect-ratio: 16 / 8;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 0 14px, transparent 14px 28px),
    var(--bg-2);
  border-bottom: 1px solid var(--graphite);
}
.host-visual .initial {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(4rem, 9vw, 6rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px var(--red);
}
.host-card--yellow .host-visual .initial { -webkit-text-stroke-color: var(--yellow); }

.host-body { padding: clamp(1.5rem, 3vw, 2rem); }
.host-tag {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--yellow);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.host-card--yellow .host-tag { color: var(--red-hot); }
.host-body p:last-child { margin-bottom: 0; color: var(--muted); }

/* ---------- Social clip embeds (TikTok / Instagram) ---------- */

.social-group + .social-group { margin-top: clamp(2rem, 5vw, 3rem); }

.social-group-head {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.social-group-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--graphite);
}

.social-grid { align-items: start; }
.social-grid blockquote {
  margin: 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  width: 100% !important;
  border-radius: var(--radius);
  overflow: hidden;
}

/* ---------- Final CTA band ---------- */

.cta-band {
  position: relative;
  overflow: hidden;
  background: var(--red);
  color: #fff;
  text-align: center;
  padding-block: clamp(4rem, 9vw, 6.5rem);
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(-55deg, rgba(0, 0, 0, 0.10) 0 26px, transparent 26px 52px);
  pointer-events: none;
}
.cta-band .container { position: relative; }
.cta-band h2 { font-size: clamp(2.5rem, 7vw, 4.5rem); }
.cta-band p { color: rgba(255, 255, 255, 0.85); max-width: 36rem; margin-inline: auto; }
.cta-band .btn-row { justify-content: center; margin-top: 2rem; }
.cta-band .btn--dark { background: var(--bg-0); color: #fff; }
.cta-band .btn--dark:hover { background: #000; }
.cta-band .btn--light {
  background: transparent; color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}
.cta-band .btn--light:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 9vw, 6rem);
  border-bottom: 1px solid var(--graphite);
}
.page-hero .lede { margin-bottom: 0; }

/* ---------- Episode list (Episodes page) ---------- */

.episode-row {
  display: grid;
  gap: 1.5rem;
  background: var(--bg-1);
  border: 1px solid var(--graphite);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  transition: border-color 180ms ease;
}
.episode-row:hover { border-color: rgba(244, 243, 239, 0.28); }
.episode-row + .episode-row { margin-top: 1.25rem; }
@media (min-width: 56rem) {
  .episode-row { grid-template-columns: 1.1fr 0.9fr; align-items: center; }
}
.episode-row.is-latest { border-left: 4px solid var(--red); }
.episode-row .meta {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.75rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.episode-row .meta .ep-num { color: var(--red-hot); }
.episode-row p { color: var(--muted); }

/* ---------- About page ---------- */

.prose { max-width: 46rem; }
.prose p { color: var(--muted); font-size: 1.05rem; }
.prose h2 { margin-top: 3rem; }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
}
@media (min-width: 56rem) {
  .contact-grid { grid-template-columns: 1.15fr 0.85fr; }
}

.form-field { margin-bottom: 1.4rem; }
.form-field label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.form-field input,
.form-field textarea {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--graphite);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.95rem 1.1rem;
  transition: border-color 160ms ease;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--yellow);
}
.form-field textarea { min-height: 10rem; resize: vertical; }

.form-note { font-size: 0.85rem; color: var(--faint); margin-top: 1rem; }

.contact-panel {
  background: var(--bg-1);
  border: 1px solid var(--graphite);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
}
.contact-panel + .contact-panel { margin-top: 1.25rem; }
.contact-panel h3 { font-size: 1.05rem; margin-bottom: 0.75rem; }
.contact-panel a.email {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--yellow);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.contact-panel a.email:hover { border-bottom-color: var(--yellow); }

.social-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.social-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--bg-2);
  border: 1px solid var(--graphite);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  min-height: 3rem;
  transition: border-color 160ms ease, color 160ms ease;
}
.social-list a:hover { border-color: var(--ink); }
.social-list a .arrow { color: var(--red); transition: translate 160ms ease; }
.social-list a:hover .arrow { translate: 4px 0; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--graphite);
  background: var(--bg-1);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  position: relative;
  z-index: 1;
}
.footer-grid {
  display: grid;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
@media (min-width: 46rem) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.footer-brand p { color: var(--muted); font-size: 0.92rem; max-width: 22rem; margin: 1rem 0 0; }

.footer-head {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1rem;
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 150ms ease;
}
.footer-links a:hover { color: var(--ink); }

.footer-bottom {
  border-top: 1px solid var(--graphite);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--faint);
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  translate: 0 22px;
  transition: opacity 550ms ease, translate 550ms ease;
}
.reveal.is-visible { opacity: 1; translate: 0 0; }
.reveal-stagger > * { transition-delay: calc(var(--i, 0) * 70ms); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; translate: none; transition: none; }
  html { scroll-behavior: auto; }
}
