/* ============================================
   Troy Toney Racing — design tokens
   Concept: the start/finish straight — a kart livery's
   flat, high-contrast panels, timing-tower numerals,
   and the gap-time readouts that define club karting.
   ============================================ */

:root {
  --ink: #14171c;         /* base background, wet tarmac at dusk */
  --panel: #1c2129;       /* raised panel on dark */
  --panel-line: #2b323d;  /* hairline on dark panels */
  --paper: #f2f0ea;       /* light section background */
  --paper-line: #d9d5c9;  /* hairline on light panels */
  --titanium: #cfd3d9;    /* body text on dark */
  --titanium-dim: #8b919c;/* secondary text on dark */
  --graphite: #2a2d33;    /* body text on light */
  --graphite-dim: #6b6f77;/* secondary text on light */
  --red: #d5392a;         /* livery red — primary accent */
  --red-dim: #a62c20;
  --amber: #eea63c;       /* timing amber — secondary accent */

  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;

  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--titanium);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

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

p { max-width: 62ch; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20, 23, 28, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--panel-line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--titanium);
}

.brand .mark {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--paper);
  letter-spacing: 1px;
}

.brand .mark span { color: var(--red); }

.brand .full {
  font-size: 0.8rem;
  color: var(--titanium-dim);
  display: none;
}

@media (min-width: 640px) {
  .brand .full { display: inline; }
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
}

nav.main-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--titanium-dim);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

nav.main-nav a:hover,
nav.main-nav a[aria-current="page"] {
  color: var(--paper);
  border-color: var(--red);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--panel-line);
  color: var(--titanium);
  padding: 8px 12px;
  font-size: 1rem;
  border-radius: 3px;
}

@media (max-width: 780px) {
  nav.main-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--panel-line);
    display: none;
  }
  nav.main-nav.open { display: block; }
  nav.main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 10px 28px 20px;
  }
  nav.main-nav a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--panel-line);
  }
  .nav-toggle { display: inline-block; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: 2px;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-primary:hover { background: var(--red-dim); border-color: var(--red-dim); }

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--panel-line);
}
.btn-ghost:hover { border-color: var(--titanium); }

.btn-ghost-dark {
  background: transparent;
  color: var(--graphite);
  border-color: var(--paper-line);
}
.btn-ghost-dark:hover { border-color: var(--graphite-dim); }

/* ---------- hero ---------- */

.hero {
  padding: 76px 0 60px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--panel-line);
}

.hero .grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 50px;
  align-items: end;
}

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

.hero .class-tag {
  display: inline-flex;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--amber);
  border: 1px solid rgba(238,166,60,0.4);
  padding: 6px 12px;
  border-radius: 2px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  color: var(--paper);
  margin-bottom: 22px;
}

.hero h1 em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--paper);
}

.hero p.lede {
  color: var(--titanium-dim);
  font-size: 1.15rem;
  margin-bottom: 32px;
}

.hero .cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero .stat-panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  padding: 26px;
}

.hero .stat-panel .row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--panel-line);
}
.hero .stat-panel .row:last-child { border-bottom: none; }

.hero .stat-panel .num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--paper);
}
.hero .stat-panel .label {
  color: var(--titanium-dim);
  font-size: 0.92rem;
  align-self: center;
}

/* ---------- section basics ---------- */

section { padding: 80px 0; }

.section-dark { background: var(--ink); }
.section-panel { background: var(--panel); border-top: 1px solid var(--panel-line); border-bottom: 1px solid var(--panel-line); }
.section-light { background: var(--paper); color: var(--graphite); }
.section-light p { color: var(--graphite-dim); }
.section-light h2, .section-light h3 { color: var(--graphite); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  color: var(--paper);
}
.section-light .section-head h2 { color: var(--graphite); }

.section-head .gap-num {
  font-family: var(--font-display);
  color: var(--titanium-dim);
  font-size: 0.95rem;
  text-align: right;
}
.section-light .section-head .gap-num { color: var(--graphite-dim); }

hr.rule {
  border: none;
  border-top: 1px solid var(--panel-line);
  margin: 60px 0;
}
.section-light hr.rule { border-top: 1px solid var(--paper-line); }

/* ---------- cards / grids ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--panel-line);
  border: 1px solid var(--panel-line);
}

.card {
  background: var(--ink);
  padding: 30px;
}

.card h3 {
  font-size: 1.15rem;
  color: var(--paper);
  margin-bottom: 10px;
}

.card p { color: var(--titanium-dim); font-size: 0.96rem; }

/* ---------- driver profile ---------- */

.driver {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 34px;
  padding: 34px 0;
  border-bottom: 1px solid var(--panel-line);
}
.driver:last-child { border-bottom: none; }

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

.driver .photo-frame {
  aspect-ratio: 4/5;
  background: linear-gradient(160deg, var(--panel), var(--ink));
  border: 1px solid var(--panel-line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--titanium-dim);
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.driver .photo-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.driver .photo-frame .no {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: rgba(242,240,234,0.15);
}

.driver .class-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-family: var(--font-display);
  color: var(--amber);
  border: 1px solid rgba(238,166,60,0.35);
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 10px;
  margin-right: 6px;
}

.driver h3 { font-size: 1.5rem; color: var(--paper); margin-bottom: 4px; }
.driver .role { color: var(--titanium-dim); font-size: 0.92rem; margin-bottom: 14px; }

.driver .stat-line {
  display: flex;
  gap: 28px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.driver .stat-line div .n {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--paper);
}
.driver .stat-line div .l {
  font-size: 0.8rem;
  color: var(--titanium-dim);
}

/* ---------- results table ---------- */

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.results-table th {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--titanium-dim);
  padding: 12px 14px;
  border-bottom: 1px solid var(--panel-line);
}

.results-table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--panel-line);
  color: var(--titanium);
}

.results-table tr:hover td { background: var(--panel); }

.results-table .finish {
  font-family: var(--font-display);
  color: var(--paper);
}
.results-table .finish.podium { color: var(--amber); }

.section-light .results-table th { color: var(--graphite-dim); border-color: var(--paper-line); }
.section-light .results-table td { color: var(--graphite); border-color: var(--paper-line); }
.section-light .results-table tr:hover td { background: #eae7dd; }

/* ---------- sponsor tiers ---------- */

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .tier-grid { grid-template-columns: 1fr; } }

.tier {
  border: 1px solid var(--panel-line);
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
}

.tier.featured { border-color: var(--red); background: var(--panel); }

.tier .tier-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--paper);
  margin-bottom: 6px;
}
.tier .tier-price {
  color: var(--amber);
  font-family: var(--font-display);
  margin-bottom: 20px;
}
.tier ul {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  flex-grow: 1;
}
.tier li {
  padding: 9px 0;
  border-top: 1px solid var(--panel-line);
  color: var(--titanium-dim);
  font-size: 0.92rem;
}
.tier li:first-child { border-top: none; }

/* ---------- services pricing ---------- */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.price-card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
}

.price-head {
  margin-bottom: 12px;
}

.price-card h3 {
  font-size: 1.25rem;
  color: var(--paper);
  margin-bottom: 6px;
}

.price-card .price {
  font-family: var(--font-display);
  color: var(--amber);
  font-size: 0.95rem;
}

.price-card p {
  color: var(--titanium-dim);
  font-size: 0.94rem;
}

.price-card ul {
  list-style: none;
  padding: 0;
  margin: 14px 0 24px;
  flex-grow: 1;
}

.price-card li {
  padding: 8px 0;
  border-top: 1px solid var(--panel-line);
  color: var(--titanium-dim);
  font-size: 0.9rem;
}
.price-card li:first-child { border-top: none; }

.price-card .btn { align-self: flex-start; }

/* ---------- logo strip ---------- */

.logo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.logo-slot {
  flex: 1 1 160px;
  height: 90px;
  border: 1px dashed var(--paper-line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--graphite-dim);
  font-size: 0.85rem;
  text-align: center;
  padding: 10px;
}

/* ---------- gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px;
}
.gallery-item {
  aspect-ratio: 1;
  background: linear-gradient(150deg, var(--panel) 0%, var(--ink) 100%);
  border: 1px solid var(--panel-line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--titanium-dim);
  font-size: 0.82rem;
  text-align: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.gallery-item img,
.gallery-item video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- forms ---------- */

form.contact-form {
  display: grid;
  gap: 20px;
  max-width: 560px;
}
.field label {
  display: block;
  font-size: 0.88rem;
  color: var(--titanium-dim);
  margin-bottom: 7px;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  color: var(--titanium);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  border-radius: 2px;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}
.field textarea { resize: vertical; min-height: 130px; }

/* ---------- contact info blocks ---------- */

.info-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}
.info-strip .n { font-family: var(--font-display); color: var(--paper); font-size: 1.05rem; margin-bottom: 6px; }
.info-strip .l { color: var(--titanium-dim); font-size: 0.9rem; }

/* ---------- footer ---------- */

footer.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--panel-line);
  padding: 50px 0 30px;
}
footer .foot-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 30px;
}
footer h4 {
  font-size: 0.85rem;
  color: var(--titanium-dim);
  margin-bottom: 14px;
}
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 8px; font-size: 0.92rem; }
footer a { text-decoration: none; color: var(--titanium); }
footer a:hover { color: var(--red); }
footer .checker {
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--titanium-dim) 0 10px, transparent 10px 20px);
  opacity: 0.3;
  margin-bottom: 24px;
}
footer .fine {
  color: var(--titanium-dim);
  font-size: 0.82rem;
}

/* ---------- individual driver page ---------- */

.driver-page-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 44px;
  align-items: start;
}
@media (max-width: 760px) {
  .driver-page-hero { grid-template-columns: 1fr; }
}

.driver-page-hero .photo-frame {
  aspect-ratio: 4/5;
}

.driver-page-hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  color: var(--paper);
  margin-bottom: 8px;
}

.driver-back-link {
  display: inline-block;
  color: var(--titanium-dim);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 18px;
  border-bottom: 1px solid transparent;
}
.driver-back-link:hover { color: var(--paper); border-color: var(--red); }

.driver-page-hero .stat-line {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--panel-line);
}

.bio-large {
  color: var(--titanium-dim);
  font-size: 1.15rem;
  line-height: 1.7;
  max-width: 68ch;
}

/* ---------- utility ---------- */

.center { text-align: center; }
.mt-0 { margin-top: 0; }

/* ---------- lightbox ---------- */

img.zoomable {
  cursor: zoom-in;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 15, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 40px;
}

.lightbox-overlay.open {
  display: flex;
}

.lightbox-img-large {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid var(--panel-line);
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 28px;
  background: none;
  border: 1px solid var(--panel-line);
  color: var(--titanium);
  font-size: 1.8rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 2px;
  cursor: pointer;
}
.lightbox-close:hover {
  border-color: var(--titanium);
}
