:root {
  --bg: #0b0c0f;
  --bg-elevated: #14161c;
  --bg-soft: #1b1e27;
  --ink: #f4f1ea;
  --ink-muted: #a8a59c;
  --line: rgba(244, 241, 234, 0.12);
  --accent: #e11d2e;
  --accent-hot: #ff3b2f;
  --accent-soft: rgba(225, 29, 46, 0.16);
  --gold: #f0b429;
  --font-display: "Bebas Neue", "Arial Narrow", sans-serif;
  --font-body: "Outfit", sans-serif;
  --nav-h: 4.5rem;
  --radius: 0.35rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 72rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(225, 29, 46, 0.18), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, rgba(240, 180, 41, 0.08), transparent 50%),
    linear-gradient(180deg, #101218 0%, var(--bg) 40%, #090a0d 100%);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* ——— Nav ——— */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(11, 12, 15, 0.92);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.site-header.is-scrolled,
.site-header.is-open {
  border-bottom-color: var(--line);
  background: rgba(11, 12, 15, 0.98);
}

.nav-inner {
  position: relative;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 1002;
}

.brand img {
  height: 2.75rem;
  width: auto;
  filter: brightness(1.15);
}

.brand-mark {
  display: none;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-size: 1.5rem;
  line-height: 1;
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  place-items: center;
  position: relative;
  z-index: 1002;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--ink);
  margin: 0.22rem 0;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: #fff !important;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.2s, transform 0.2s;
}

.nav-cta:hover {
  background: var(--accent-hot);
  transform: translateY(-1px);
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.04);
  animation: hero-drift 18s var(--ease) infinite alternate;
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 9, 12, 0.92) 0%, rgba(8, 9, 12, 0.55) 48%, rgba(8, 9, 12, 0.35) 100%),
    linear-gradient(180deg, rgba(8, 9, 12, 0.35) 0%, rgba(8, 9, 12, 0.15) 35%, rgba(8, 9, 12, 0.95) 100%);
}

.hero-content {
  width: min(100% - 2.5rem, var(--max));
  margin: 0 auto;
  padding: calc(var(--nav-h) + 4rem) 0 4.5rem;
}

.hero-brand {
  display: block;
  width: min(100%, 34rem);
  margin-bottom: 1.1rem;
  filter: brightness(1.35) drop-shadow(0 12px 30px rgba(0, 0, 0, 0.55));
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.1s forwards;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4.25rem);
  line-height: 0.95;
  letter-spacing: 0.12em;
  color: var(--ink);
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.25s forwards;
}

.hero p {
  margin: 0 0 1.75rem;
  max-width: 34ch;
  color: var(--ink-muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.4s forwards;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.55s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 3rem;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hot);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: rgba(244, 241, 234, 0.35);
  background: rgba(244, 241, 234, 0.05);
}

/* ——— Sections ——— */
.section {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
  position: relative;
}

.section-head {
  margin-bottom: 2.25rem;
  max-width: 40rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-hot);
}

.section-head h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 3.75rem);
  letter-spacing: 0.03em;
  line-height: 1;
}

.section-head p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

.section-alt {
  background:
    linear-gradient(180deg, transparent, rgba(20, 22, 28, 0.85)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 18px,
      rgba(244, 241, 234, 0.02) 18px,
      rgba(244, 241, 234, 0.02) 36px
    );
}

/* ——— Calendar table ——— */
.note {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--gold);
  background: rgba(240, 180, 41, 0.08);
  color: var(--ink);
  font-size: 0.98rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(20, 22, 28, 0.75);
}

.schedule {
  width: 100%;
  border-collapse: collapse;
  min-width: 36rem;
}

.schedule th,
.schedule td {
  padding: 1rem 1.15rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.schedule th {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}

.schedule tbody tr {
  transition: background 0.2s;
}

.schedule tbody tr:hover {
  background: var(--accent-soft);
}

.schedule tbody tr:last-child td {
  border-bottom: 0;
}

.schedule .race-num {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--accent-hot);
}

/* ——— People ——— */
.people-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}

.person {
  text-align: center;
}

.person-photo {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  margin-bottom: 0.85rem;
}

.person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.6s var(--ease);
}

.person:hover .person-photo img {
  transform: scale(1.06);
}

.person h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  font-weight: 400;
}

.person-solo {
  max-width: 16rem;
  margin-inline: auto;
}

/* ——— Sponsors ——— */
.sponsors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: center;
}

.sponsor {
  display: grid;
  place-items: center;
  min-height: 8rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  transition: border-color 0.25s, background 0.25s;
}

.sponsor:hover {
  border-color: rgba(244, 241, 234, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

.sponsor img {
  max-height: 4.5rem;
  width: auto;
  object-fit: contain;
  filter: grayscale(0.15) brightness(1.05);
}

/* ——— History ——— */
.page-hero {
  padding: calc(var(--nav-h) + 3.5rem) 0 2.5rem;
}

.page-hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  letter-spacing: 0.03em;
  line-height: 0.95;
}

.page-hero p {
  margin: 0;
  color: var(--ink-muted);
  max-width: 40ch;
  font-size: 1.1rem;
}

.champions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem 1.5rem;
}

.champ-card {
  padding: 1.25rem 1.35rem;
  border-top: 2px solid var(--accent);
  background: linear-gradient(180deg, rgba(225, 29, 46, 0.08), transparent 60%);
  border-inline: 1px solid transparent;
  transition: background 0.25s;
}

.champ-card:hover {
  background: linear-gradient(180deg, rgba(225, 29, 46, 0.14), transparent 70%);
}

.champ-card h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  font-weight: 400;
}

.champ-card p {
  margin: 0.2rem 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.champ-card strong {
  color: var(--ink);
  font-weight: 600;
}

/* ——— Pilots ——— */
.pilots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.pilot {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  isolation: isolate;
}

.pilot img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.7s var(--ease);
}

.pilot:hover img {
  transform: scale(1.05);
}

.pilot-meta {
  position: absolute;
  inset: auto 0 0;
  padding: 2.5rem 1rem 1rem;
  background: linear-gradient(transparent, rgba(8, 9, 12, 0.95));
}

.pilot-meta h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  font-weight: 400;
}

/* ——— Form ——— */
.form-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
}

.form-panel {
  padding: 1.75rem;
  background: rgba(20, 22, 28, 0.8);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 560;
  color: var(--ink-muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(225, 29, 46, 0.7);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field-hint {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.file-drop {
  position: relative;
  border: 1px dashed rgba(244, 241, 234, 0.28);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.35);
  min-height: 7rem;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.file-drop:hover,
.file-drop:focus-within {
  border-color: rgba(225, 29, 46, 0.7);
  background: rgba(225, 29, 46, 0.08);
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-drop-ui {
  display: grid;
  place-content: center;
  gap: 0.25rem;
  min-height: 7rem;
  padding: 1rem;
  text-align: center;
  pointer-events: none;
}

.file-drop-ui strong {
  font-weight: 600;
  color: var(--ink);
}

.file-drop-ui span {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.file-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.86rem;
}

.file-list .file-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list .file-size {
  color: var(--ink-muted);
  flex-shrink: 0;
  font-size: 0.78rem;
}

.form-status {
  display: none;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: rgba(46, 160, 90, 0.15);
  border: 1px solid rgba(46, 160, 90, 0.35);
}

.form-status.is-visible {
  display: block;
}

.form-status.is-error {
  background: rgba(225, 29, 46, 0.12);
  border-color: rgba(225, 29, 46, 0.4);
}

.btn[disabled] {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.form-side {
  padding-top: 0.25rem;
}

.form-side h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 2.6rem;
  letter-spacing: 0.03em;
  line-height: 1;
}

.form-side p {
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.contact-list a {
  color: var(--ink);
  border-bottom: 1px solid rgba(244, 241, 234, 0.25);
  padding-bottom: 0.15rem;
  transition: color 0.2s, border-color 0.2s;
}

.contact-list a:hover {
  color: var(--accent-hot);
  border-color: var(--accent-hot);
}

/* ——— Footer ——— */
.site-footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.site-footer a {
  color: var(--ink);
  border-bottom: 1px solid transparent;
}

.site-footer a:hover {
  border-bottom-color: var(--ink);
}

/* ——— Motion helpers ——— */
.reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.4rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hero-drift {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.1) translate3d(-1.5%, -1%, 0);
  }
}

/* ——— Responsive ——— */
@media (max-width: 1100px) {
  .nav-toggle {
    display: grid;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    margin: 0;
    padding: calc(var(--nav-h) + 1.5rem) 1.5rem 2rem;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.35rem;
    background: #0b0c0f;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1001;
    transition: opacity 0.25s var(--ease), visibility 0.25s;
  }

  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--line);
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.95rem 0.15rem;
    font-size: 1.25rem;
    color: var(--ink);
  }

  .nav-links .nav-cta {
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
    padding: 0.95rem 1.25rem;
    font-size: 1rem;
    border-bottom: 0;
  }

  .nav-links li:has(.nav-cta) {
    border-bottom: 0;
  }

  .champions,
  .form-layout,
  .sponsors {
    grid-template-columns: 1fr;
  }

  .people-grid,
  .pilots-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-content {
    padding-bottom: 3.25rem;
  }
}

@media (max-width: 560px) {
  .people-grid,
  .pilots-grid {
    grid-template-columns: 1fr 1fr;
  }

  .person-solo {
    max-width: none;
  }

  .brand img {
    height: 2.35rem;
  }
}

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

  .hero-media img {
    transform: none;
  }

  .reveal,
  .hero-brand,
  .hero h1,
  .hero p,
  .hero-actions {
    opacity: 1;
    transform: none;
  }
}
