/* Ready Set Drift — site styles. Dark motorsport theme, brand red #BF4545. */

:root {
  --red: #bf4545;
  --red-hot: #d95555;
  --bg: #0a0a0c;
  --bg-2: #101013;
  --panel: #141418;
  --line: #26262c;
  --text: #ececee;
  --muted: #a2a2ab;
  --display: "Archivo", "Arial Black", sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--red-hot); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ── Type ───────────────────────────────────────────────────────── */
.display {
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.02;
}
h1.display { font-size: clamp(2.6rem, 7vw, 5.2rem); }
h2.display { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 0.5rem; }
h3.display { font-size: 1.25rem; font-style: italic; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-style: italic;
  text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 0.8rem; color: var(--red-hot);
}
.eyebrow::before { content: ""; width: 34px; height: 3px; background: var(--red); transform: skewX(-20deg); }

.lead { color: var(--muted); font-size: 1.1rem; max-width: 62ch; }
.muted { color: var(--muted); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 13px 28px;
  font-family: var(--display); font-weight: 800; font-style: italic;
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.95rem;
  transform: skewX(-8deg); border: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
}
.btn > span { display: inline-block; transform: skewX(8deg); }
.btn:hover { text-decoration: none; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-hot); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.07); }

/* ── Caution stripe accent ──────────────────────────────────────── */
.stripe {
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--red) 0 16px, transparent 16px 32px);
  opacity: 0.85;
}

/* ── Header ─────────────────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 28px; height: 72px; }
.logo img { height: 22px; width: auto; }
.nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav a {
  color: var(--text); font-family: var(--display); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.82rem;
}
.nav a:hover, .nav a.active { color: var(--red-hot); text-decoration: none; }
.nav .btn { padding: 9px 20px; font-size: 0.82rem; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  position: relative; display: grid; align-items: end;
  min-height: 82vh; padding: 90px 0 70px;
  background-size: cover; background-position: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 12, 0.96) 0%, rgba(10, 10, 12, 0.45) 45%, rgba(10, 10, 12, 0.35) 100%);
}
.hero .wrap { position: relative; }
.hero p { margin: 18px 0 30px; }
.hero .cta-row { display: flex; gap: 16px; flex-wrap: wrap; }

.page-hero { min-height: 46vh; }

/* ── Sections ───────────────────────────────────────────────────── */
.section { padding: 84px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 40px; }

/* value props */
.props { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.prop {
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--red);
  padding: 28px 26px;
}
.prop h3 { margin-bottom: 8px; }
.prop p { color: var(--muted); font-size: 0.97rem; }

/* split feature (image + copy) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split.flip > .split-img { order: 2; }
.split-img { position: relative; }
.split-img img { border: 1px solid var(--line); }
.split-img::after {
  content: ""; position: absolute; left: -14px; bottom: -14px;
  width: 42%; height: 40%; border: 3px solid var(--red);
  transform: skewX(-8deg); z-index: -1;
}
.split ul { list-style: none; margin: 20px 0 28px; }
.split li { padding: 9px 0 9px 30px; position: relative; border-bottom: 1px solid var(--line); }
.split li::before {
  content: ""; position: absolute; left: 4px; top: 17px;
  width: 12px; height: 4px; background: var(--red); transform: skewX(-20deg);
}

/* ── Cards (events / galleries) ─────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
a.card { color: var(--text); }
a.card:hover { text-decoration: none; transform: translateY(-4px); border-color: var(--red); }
.card-cover { aspect-ratio: 16 / 10; overflow: hidden; background: #1a1a1f; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
a.card:hover .card-cover img { transform: scale(1.05); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body .go { margin-top: auto; padding-top: 10px; color: var(--red-hot); font-weight: 600; font-size: 0.9rem; }

.badge {
  display: inline-block; padding: 3px 10px; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  background: rgba(191, 69, 69, 0.16); color: var(--red-hot); border: 1px solid rgba(191, 69, 69, 0.4);
}
.badge.gray { background: rgba(255, 255, 255, 0.06); color: var(--muted); border-color: var(--line); }

/* event schedule cards */
.event-card {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--red);
  padding: 26px 28px; display: grid; grid-template-columns: 150px 1fr; gap: 26px;
}
.event-card + .event-card { margin-top: 16px; }
.event-date { font-family: var(--display); font-weight: 800; font-style: italic; font-size: 1.25rem; line-height: 1.2; text-transform: uppercase; }
.event-date small { display: block; color: var(--muted); font-family: var(--body); font-weight: 500; font-style: normal; font-size: 0.8rem; letter-spacing: 0.08em; margin-top: 6px; }
.event-card h3 { margin-bottom: 6px; }
.event-meta { color: var(--muted); font-size: 0.95rem; }
.event-days { margin-top: 12px; display: grid; gap: 6px; }
.event-days div { font-size: 0.93rem; color: var(--muted); }
.event-days strong { color: var(--text); font-weight: 600; }
.event-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.notice {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--red);
  padding: 18px 22px; margin-bottom: 36px; color: var(--muted);
}
.notice strong { color: var(--text); }

/* ── Gallery index ──────────────────────────────────────────────── */
.year-head {
  font-family: var(--display); font-weight: 900; font-style: italic;
  font-size: 2rem; text-transform: uppercase; margin: 48px 0 20px;
  display: flex; align-items: center; gap: 16px;
}
.year-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* ── Rulebook ───────────────────────────────────────────────────── */
.rules-layout { display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: start; }
.rules-toc { position: sticky; top: 96px; display: grid; gap: 2px; }
.rules-toc a {
  color: var(--muted); font-size: 0.9rem; padding: 8px 14px;
  border-left: 2px solid var(--line);
}
.rules-toc a:hover { color: var(--text); border-left-color: var(--red); text-decoration: none; }
.rules h2 {
  font-family: var(--display); font-weight: 800; font-style: italic; text-transform: uppercase;
  font-size: 1.5rem; margin: 46px 0 16px; padding-top: 10px;
}
.rules h2:first-child { margin-top: 0; }
.rules h3 { font-size: 1.05rem; margin: 26px 0 10px; color: var(--red-hot); text-transform: uppercase; letter-spacing: 0.08em; }
.rules ol { margin: 0 0 10px 22px; display: grid; gap: 8px; }
.rules ul { margin: 0 0 10px 22px; display: grid; gap: 8px; }
.rules li { color: #cfcfd6; }
.props.two { grid-template-columns: 1fr 1fr; }
.prop.gear .btn { margin-top: 18px; }
.prop.rules ul { margin-bottom: 0; }
.split ol li { padding: 0; border: 0; }
.split ol li::before { content: none; }
.layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.layouts img { border: 1px solid var(--line); width: 100%; }
.layouts figcaption { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 8px; }
@media (max-width: 720px) { .layouts { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .props.two { grid-template-columns: 1fr; } }
.rules li strong { color: var(--text); }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 18px; max-width: 640px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); display: block; margin-bottom: 7px; }
input, textarea, select {
  width: 100%; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); padding: 13px 15px; font-family: var(--body); font-size: 1rem;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); }
textarea { min-height: 160px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
input[type=checkbox] { width: 20px; height: 20px; padding: 0; flex: none; accent-color: var(--red); margin-top: 2px; }
label.check { display: flex; gap: 12px; align-items: flex-start; text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 400; color: var(--text); cursor: pointer; margin: 0; }
label .opt { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: 0.7; }
.form-row.three { grid-template-columns: repeat(3, 1fr); align-items: end; }
fieldset.days { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.days legend { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 9px; padding: 0; }
.days-list { display: flex; flex-wrap: wrap; gap: 10px; }
.days-list label.check { background: var(--panel); border: 1px solid var(--line); padding: 11px 16px 11px 13px; align-items: center; }
.days-list label.check:has(input:checked) { border-color: var(--red); }
.days-list input[type=checkbox] { margin-top: 0; }
select:disabled { opacity: 0.6; cursor: default; }
.rules-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 56px; }
.rules-cols h3:first-child { margin-top: 0; }
.rules p { color: #cfcfd6; margin-bottom: 10px; }
.form-status { font-size: 0.95rem; min-height: 1.4em; }
.form-status.ok { color: #6fbf73; }
.form-status.err { color: var(--red-hot); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ── CTA band ───────────────────────────────────────────────────── */
.cta-band { position: relative; padding: 110px 0; background-size: cover; background-position: center; text-align: center; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: rgba(10, 10, 12, 0.78); }
.cta-band .wrap { position: relative; }
.cta-band p { margin: 14px auto 30px; }
.cta-band .cta-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Footer ─────────────────────────────────────────────────────── */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-2); padding: 54px 0 34px; }
.foot-grid { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.foot-grid img { height: 18px; }
.foot-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-nav a { color: var(--muted); font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.1em; }
.foot-nav a:hover { color: var(--text); text-decoration: none; }
.socials { display: flex; gap: 14px; }
.socials a { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); color: var(--muted); }
.socials a:hover { color: #fff; border-color: var(--red); background: rgba(191, 69, 69, 0.15); }
.socials svg { width: 17px; height: 17px; fill: currentColor; }
.foot-bottom { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ── Gallery viewer (/g/:token) ─────────────────────────────────── */
.g-filters { display: flex; gap: 12px; flex-wrap: wrap; margin: 30px 0 6px; }
.g-filters select {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 9px 12px; font-family: var(--body); font-size: 0.9rem; max-width: 260px;
}
.g-filters select:focus { outline: none; border-color: var(--red); }

.g-grid { columns: 4 260px; column-gap: 14px; margin-top: 24px; }
.g-item {
  position: relative; margin: 0 0 14px; break-inside: avoid;
  border: 1px solid var(--line); background: #1a1a1f; cursor: pointer; overflow: hidden;
}
.g-item img { width: 100%; transition: transform 0.25s ease, opacity 0.25s ease; }
.g-item:hover img { transform: scale(1.03); opacity: 0.85; }
.g-item:hover { border-color: var(--red); }
.g-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 2rem; background: rgba(10, 10, 12, 0.35); pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(5, 5, 7, 0.96);
  display: flex; flex-direction: column;
}
.lightbox[hidden] { display: none; }
.lb-stage { flex: 1; display: grid; place-items: center; min-height: 0; padding: 18px; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; }
.lb-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 12px 22px 18px; flex-wrap: wrap;
}
.lb-info { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: 0.92rem; }
.lb-actions { display: flex; gap: 12px; align-items: center; }
.lb-like {
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 7px 14px; cursor: pointer; font-size: 0.95rem; font-family: var(--body);
}
.lb-like.liked { color: var(--red-hot); border-color: var(--red); }
.lb-dl {
  border: 1px solid var(--red); color: #fff; background: var(--red);
  padding: 7px 16px; font-size: 0.9rem; font-weight: 600;
}
.lb-dl:hover { background: var(--red-hot); text-decoration: none; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; z-index: 101; background: rgba(20, 20, 24, 0.7);
  border: 1px solid var(--line); color: #fff; cursor: pointer;
  width: 46px; height: 46px; font-size: 1.5rem; line-height: 1;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { border-color: var(--red); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .props, .cards { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .split.flip > .split-img { order: 0; }
  .rules-layout { grid-template-columns: 1fr; }
  .rules-toc { position: static; grid-template-columns: 1fr 1fr; margin-bottom: 10px; }
}
@media (max-width: 680px) {
  .props, .cards, .form-row { grid-template-columns: 1fr; }
  .form-row.three, .rules-cols { grid-template-columns: 1fr; }
  .event-card { grid-template-columns: 1fr; gap: 10px; }
  .nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(10, 10, 12, 0.97); border-bottom: 1px solid var(--line); padding: 10px 24px 20px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 13px 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 14px; text-align: center; }
  .nav-toggle { display: block; }
  .hero { min-height: 70vh; }
  .section { padding: 60px 0; }
}

/* Event detail pages + the links on schedule cards */
.event-links { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 16px; font-weight: 600; font-size: 0.92rem; }
.event-links a::after { content: " \2192"; }
.event-card h3 a { color: var(--text); }
.event-card h3 a:hover { color: var(--red-hot); text-decoration: none; }
.event-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
.event-facts { position: sticky; top: 96px; }
.event-facts dl { margin: 14px 0 22px; display: grid; gap: 12px; }
.event-facts dt { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.event-facts dd { margin: 2px 0 0; color: var(--text); font-size: 0.97rem; }
.rules ul { list-style: disc; }
.ticket-list { display: grid; gap: 10px; margin: 0 0 10px; }
.ticket { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 18px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); padding: 14px 18px; }
.ticket-name { font-weight: 600; color: var(--text); }
.ticket-desc { flex-basis: 100%; color: var(--muted); font-size: 0.92rem; }
.ticket-price { font-family: var(--display); font-weight: 800; font-style: italic; font-size: 1.1rem; }
.ticket .badge { margin-left: 10px; }
.day-list { display: grid; gap: 8px; margin: 0 0 10px; }
.day-list div { color: #cfcfd6; }
.day-list strong { color: var(--text); }
.event-card .price { color: var(--text); font-weight: 600; margin-top: 8px; }
@media (max-width: 960px) {
  .event-layout { grid-template-columns: 1fr; gap: 30px; }
  .event-facts { position: static; order: -1; }
}

/* Long-form text pages (waiver, privacy) */
.legal { max-width: 800px; }
.legal p { color: #cfcfd6; margin-bottom: 16px; }
.legal h2 { font-family: var(--display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 1.3rem; margin: 34px 0 12px; }
.legal ul { margin: 0 0 16px 22px; display: grid; gap: 8px; color: #cfcfd6; }
.legal strong { color: var(--text); }

/* Tracking notice */
.track-note {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; margin: 0 auto; max-width: 760px;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--red);
  padding: 14px 18px; display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); font-size: 0.92rem; color: var(--muted);
}
.track-note p { flex: 1 1 280px; margin: 0; }
.track-note button { background: none; border: 1px solid var(--line); color: var(--text); padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.track-note button.ok { background: var(--red); border-color: var(--red); color: #fff; }
.track-note button:hover { border-color: #fff; }
.foot-bottom .foot-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* The hidden attribute must win over layout rules like .form-grid { display: grid }. */
[hidden] { display: none !important; }

/* Long event titles must fit a phone: one long word (MOTORSPORTS) was wider than the screen. */
@media (max-width: 480px) { .page-hero h1 { font-size: 2rem; overflow-wrap: break-word; } }
