/* ============================================================
   TROY FOULGER RACING — Design System
   Dirt-track / night-race visual language.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Color — extracted directly from the No. 49 car's livery photos via k-means */
  --ink: #131215;
  --panel: #1f1e21;
  --panel-2: #28272b;
  --line: rgba(240, 240, 236, 0.16);
  --line-strong: rgba(240, 240, 236, 0.34);
  --orange: #d84523;
  --orange-light: #ff633f;
  --orange-dim: #a8371c;
  --red: #7a231c;
  --tan: #d9d9d9;
  --paper: #f0f0ec;
  --muted: #b0b0b0;
  --muted-2: #8a8a8a;

  /* Type */
  --display: 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --container: 1140px;
  --edge: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0;
  letter-spacing: 0.2px;
}

p { margin: 0; color: var(--muted); max-width: 62ch; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--edge);
}

section { position: relative; }

.eyebrow-num {
  font-family: var(--display);
  color: var(--orange-light);
  font-size: 0.95rem;
  font-weight: 600;
}

/* ---------- Focus ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 14px 26px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  background: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--red); color: var(--paper); }
.btn-primary:hover { background: #551912; }
.btn-outline { border-color: var(--line-strong); color: var(--paper); }
.btn-outline:hover { border-color: var(--orange); color: var(--orange-light); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 9, 8, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--paper);
  white-space: nowrap;
}
.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  background: var(--orange);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 15% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--paper); border-color: var(--orange); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  width: 42px;
  height: 42px;
  color: var(--paper);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after { display: none; }
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.is-open { max-height: 480px; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; width: 100%; padding: 16px var(--edge); border-bottom: 1px solid var(--line); border-left: 2px solid transparent; }
  .nav-links a:hover, .nav-links a[aria-current="page"] { border-color: transparent; border-left-color: var(--orange); background: var(--panel); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 84px;
  background:
    radial-gradient(ellipse 900px 500px at 85% -10%, rgba(216, 69, 35, 0.20), transparent 60%),
    var(--ink);
  border-bottom: 1px solid var(--line);
}
.hero-track {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.hero-inner {
  max-width: 620px;
}
.hero-media {
  position: relative;
  border: 1px solid var(--line-strong);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 36px), calc(100% - 36px) 100%, 0 100%);
  overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.6);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-media-tag {
  position: absolute;
  left: 0;
  bottom: 0;
  background: var(--orange);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; max-height: 60vh; }
}
.hero .eyebrow-num { display: block; margin-bottom: 18px; }
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  color: var(--paper);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.hero h1 em {
  font-style: normal;
  color: var(--orange);
}
.hero .lede {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 36px;
  max-width: 54ch;
}
.hero-photo-note {
  position: relative;
  z-index: 1;
  margin-top: 56px;
  border: 1px dashed var(--line-strong);
  padding: 16px 20px;
  font-size: 0.85rem;
  color: var(--muted-2);
  max-width: 640px;
}

/* ---------- Stat strip ---------- */
.stat-strip {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 56px 0;
}
.stat-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 36px;
}
.stat-strip-head h2 { font-size: 1.9rem; color: var(--paper); text-transform: uppercase; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.stat-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 22px;
}
.stat-num {
  font-family: var(--display);
  font-size: clamp(2.2rem, 4vw, 3rem);
  color: var(--orange);
  font-weight: 600;
  line-height: 1;
}
.stat-label {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}
.stat-strip-foot { margin-top: 28px; color: var(--muted); max-width: 70ch; }
@media (max-width: 700px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Section shell ---------- */
.section { padding: 88px 0; border-bottom: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head .eyebrow-num { display: block; margin-bottom: 12px; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); color: var(--paper); text-transform: uppercase; margin-bottom: 14px; }
.section-head p { font-size: 1.05rem; }

/* ---------- About split ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 56px;
  align-items: start;
}
.about-copy p { color: var(--paper); font-size: 1.02rem; margin-bottom: 18px; opacity: 0.88; max-width: none; }
.about-copy .btn-row { margin-top: 28px; }
.spec-card {
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 24px 100%, 0 calc(100% - 24px));
  padding: 30px;
}
.spec-card h3 { color: var(--tan); font-size: 1rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 18px; }
.spec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.spec-list li { display: flex; justify-content: space-between; gap: 16px; font-size: 0.92rem; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.spec-list li:last-child { border-bottom: none; padding-bottom: 0; }
.spec-list .k { color: var(--muted); }
.spec-list .v { color: var(--paper); font-weight: 600; text-align: right; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* ---------- Achievement list ---------- */
.achieve-list { list-style: none; margin: 0; padding: 0; }
.achieve-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 22px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.achieve-row:first-child { border-top: 1px solid var(--line); }
.achieve-year { font-family: var(--display); color: var(--orange-light); font-size: 1rem; font-weight: 600; }
.achieve-title { color: var(--paper); font-size: 1.05rem; }
.section-foot { margin-top: 36px; }

/* ---------- Sponsors ---------- */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.sponsor-tile {
  background: var(--panel);
  padding: 30px 20px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--paper);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: background 0.15s ease, color 0.15s ease;
}
.sponsor-tile:hover { background: var(--panel-2); color: var(--orange-light); }
@media (max-width: 860px) { .sponsor-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .sponsor-grid { grid-template-columns: 1fr; } }

/* ---------- Generic content grid / cards (photos, store, crew, news) ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.tile {
  border: 1px solid var(--line);
  background: var(--panel);
}
.tile-media {
  aspect-ratio: 4 / 3;
  background:
    repeating-linear-gradient(135deg, rgba(216,69,35,0.10) 0 2px, transparent 2px 14px),
    var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  font-size: 0.8rem;
  text-align: center;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.tile-body { padding: 20px; }
.tile-body h3 { color: var(--paper); font-size: 1.05rem; margin-bottom: 6px; }
.tile-body p { font-size: 0.9rem; }
.tile-price { font-family: var(--display); color: var(--orange-light); font-size: 1.1rem; margin-top: 14px; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%);
  padding: 46px var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-banner h3 { color: var(--paper); font-size: 1.5rem; text-transform: uppercase; }
.cta-banner p { margin-top: 8px; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 56px 0 40px;
  background: var(--ink);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.footer-brand p { margin-top: 12px; max-width: 32ch; font-size: 0.9rem; }
.footer-links { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { color: var(--paper); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.footer-col a:hover { color: var(--orange-light); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 24px;
  font-size: 0.82rem;
  color: var(--muted-2);
}

/* ---------- Page header (subpages) ---------- */
.page-header {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse 700px 400px at 90% -20%, rgba(216,69,35,0.18), transparent 60%), var(--ink);
}
.page-header .eyebrow-num { display: block; margin-bottom: 14px; }
.page-header h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); text-transform: uppercase; color: var(--paper); max-width: 760px; }
.page-header p { margin-top: 16px; font-size: 1.05rem; max-width: 62ch; }

/* ---------- Contact form ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 0.85fr; gap: 56px; align-items: start; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--paper);
  padding: 13px 14px;
  font-family: var(--body);
  font-size: 0.95rem;
}
.field textarea { resize: vertical; min-height: 130px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.form-note { margin-top: 18px; font-size: 0.82rem; color: var(--muted-2); }
.contact-side .spec-card { margin-bottom: 20px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Schedule: manual fallback disclosure ---------- */
.schedule-manual { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 32px; }
.schedule-manual summary {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 600;
  color: var(--tan);
  font-size: 0.95rem;
  list-style: none;
}
.schedule-manual summary::-webkit-details-marker { display: none; }
.schedule-manual summary::before { content: "+ "; color: var(--orange-light); }
.schedule-manual[open] summary::before { content: "\2212 "; }
.schedule-manual summary:hover { color: var(--paper); }

/* ---------- Table (schedule) ---------- */
.race-table { width: 100%; border-collapse: collapse; }
.race-table th, .race-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.race-table th { color: var(--muted); font-weight: 500; text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.4px; }
.race-table td { color: var(--paper); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.table-wrap .race-table { border: none; }

/* ---------- Utility ---------- */
.mt-lg { margin-top: 40px; }
.center-text { text-align: center; margin: 0 auto; }
