/* ============================================================
   NATIONAL FORMULA SERIES — Sistema de diseño retro racing
   Vintage motorsport poster · cream paper + racing red / gold / petrol
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Archivo:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* Paper / ink */
  --paper:      #e9dec9;
  --paper-hi:   #f4ecda;
  --paper-lo:   #ddcfb2;
  --ink:        #1d1813;
  --ink-soft:   #3b322a;
  --ink-faint:  #6a5d4c;

  /* Racing accents */
  --red:        #c63a2b;
  --red-deep:   #9c2a20;
  --gold:       #d99a2b;
  --gold-deep:  #b27c19;
  --teal:       #2f6f68;
  --teal-deep:  #235650;

  --line:       rgba(29, 24, 19, .16);
  --line-strong:rgba(29, 24, 19, .34);

  --shadow:     0 2px 0 rgba(29,24,19,.18);
  --shadow-lg:  10px 12px 0 rgba(29,24,19,.14);

  --maxw: 1200px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --font-display: 'Anton', sans-serif;
  --font-body:    'Archivo', sans-serif;
  --font-mono:    'Space Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 28px; }
.section { padding-block: 92px; position: relative; }
.section--tight { padding-block: 64px; }
.bleed { position: relative; }

.ink-bg   { background: var(--ink); color: var(--paper-hi); }
.ink-bg a { color: var(--paper-hi); }
.red-bg   { background: var(--red); color: var(--paper-hi); }

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px; background: var(--red); display: inline-block;
}
.ink-bg .eyebrow { color: var(--gold); }
.ink-bg .eyebrow::before { background: var(--gold); }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: .9;
  letter-spacing: .005em;
  text-transform: uppercase;
}

h1.display { font-size: clamp(52px, 9vw, 132px); }
h2.display { font-size: clamp(38px, 5.4vw, 78px); }
h3.display { font-size: clamp(26px, 3vw, 40px); }

.lead { font-size: clamp(17px, 1.5vw, 21px); color: var(--ink-soft); max-width: 56ch; }
.ink-bg .lead { color: rgba(244,236,218,.78); }

.mono-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(233,222,201,.86);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--ink);
}
.nav__row {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__logo { height: 30px; width: auto; display: block; flex: none; }
.brand__mark {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--ink); color: var(--paper-hi);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 17px; letter-spacing: .04em;
  border: 2px solid var(--ink);
  position: relative; overflow: hidden; flex: none;
}
.brand__mark::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-conic-gradient(var(--paper-hi) 0 25%, transparent 0 50%);
  background-size: 10px 10px; opacity: .12;
}
.brand__name { font-family: var(--font-display); font-size: 19px; letter-spacing: .03em; line-height: 1; }
.brand__sub  { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .26em; color: var(--ink-faint); text-transform: uppercase; }

.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  position: relative; padding-block: 4px;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--red); transition: width .25s var(--ease);
}
.nav__links a:hover::after, .nav__links a.is-active::after { width: 100%; }
.nav__burger { display: none; background: none; border: 0; font-family: var(--font-mono); font-weight: 700; font-size: 22px; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper-hi); --bd: var(--ink);
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  letter-spacing: .12em; text-transform: uppercase;
  background: var(--bg); color: var(--fg);
  border: 2px solid var(--bd);
  padding: 14px 24px; border-radius: 2px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), background .2s;
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn--red   { --bg: var(--red);  --fg: var(--paper-hi); --bd: var(--ink); }
.btn--gold  { --bg: var(--gold); --fg: var(--ink);      --bd: var(--ink); }
.btn--ghost { --bg: transparent; --fg: var(--ink);      --bd: var(--ink); box-shadow: 4px 4px 0 transparent; }
.btn--ghost:hover { box-shadow: 6px 6px 0 var(--ink); }
.ink-bg .btn--ghost { --fg: var(--paper-hi); --bd: var(--paper-hi); box-shadow: 4px 4px 0 transparent; }
.ink-bg .btn--ghost:hover { box-shadow: 6px 6px 0 var(--gold); }
.btn--lg { padding: 17px 30px; font-size: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn__arrow { transition: transform .2s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---------- Roundel (race number) ---------- */
.roundel {
  display: grid; place-items: center; border-radius: 50%;
  background: var(--paper-hi); color: var(--ink);
  border: 3px solid var(--ink);
  font-family: var(--font-display); line-height: 1;
  aspect-ratio: 1; position: relative;
}
.roundel--red  { background: var(--red);  color: var(--paper-hi); border-color: var(--ink); }
.roundel--gold { background: var(--gold); color: var(--ink); }
.roundel--dark { background: var(--ink);  color: var(--paper-hi); }

/* ---------- Decorative stripes / checker ---------- */
.stripes-v {
  background: repeating-linear-gradient(90deg,
    var(--red) 0 14px, var(--paper-hi) 14px 28px, var(--gold) 28px 42px, var(--paper-hi) 42px 56px, var(--teal) 56px 70px, var(--paper-hi) 70px 84px);
}
.checker {
  background-image:
    repeating-conic-gradient(var(--ink) 0% 25%, transparent 0% 50%);
  background-size: 22px 22px;
}
.rule-line { height: 2px; background: var(--ink); width: 100%; }

/* ---------- Generic card / stub ---------- */
.card {
  background: var(--paper-hi);
  border: 2px solid var(--ink);
  border-radius: 3px;
  box-shadow: var(--shadow-lg);
}
.card--flat { box-shadow: none; }

/* perforated ticket edge */
.stub { position: relative; }
.stub::before, .stub::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink); top: 50%; transform: translateY(-50%);
}

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--paper-hi); padding-block: 64px 30px; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer__brand .brand__mark { border-color: var(--paper-hi); }
.footer h4 { font-family: var(--font-mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
.footer ul { list-style: none; display: grid; gap: 10px; }
.footer a { font-size: 14px; color: rgba(244,236,218,.8); transition: color .2s; }
.footer a:hover { color: var(--gold); }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.socials a {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  border: 1.5px solid rgba(244,236,218,.3); padding: 8px 12px; border-radius: 2px;
}
.socials a:hover { border-color: var(--gold); color: var(--gold); }
.footer__base {
  margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(244,236,218,.18);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: rgba(244,236,218,.55);
}

/* ---------- Forms ---------- */
.field { display: grid; gap: 8px; }
.field > label, .label {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
  display: flex; align-items: center; gap: 8px;
}
.field .req { color: var(--red); }
.field .hint { font-family: var(--font-body); font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--ink-faint); font-weight: 500; }
.input, .select, textarea.input {
  width: 100%;
  font-family: var(--font-body); font-size: 16px; color: var(--ink);
  background: var(--paper-hi);
  border: 2px solid var(--ink);
  border-radius: 2px; padding: 13px 14px;
  transition: box-shadow .15s, border-color .15s;
}
.input::placeholder { color: var(--ink-faint); }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--red); box-shadow: 4px 4px 0 var(--red);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231d1813' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.field--error .input, .field--error .select { border-color: var(--red); box-shadow: 4px 4px 0 var(--red-deep); }
.field__err { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--red-deep); display: none; }
.field--error .field__err { display: block; }

.check {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start;
  padding: 16px; border: 2px solid var(--ink); border-radius: 2px; background: var(--paper-hi);
}
.check input { appearance: none; width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 2px; background: var(--paper-hi); display: grid; place-items: center; flex: none; cursor: pointer; }
.check input:checked { background: var(--red); }
.check input:checked::after { content: "✓"; color: var(--paper-hi); font-weight: 800; font-size: 15px; }
.check label { font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.check a { color: var(--red); text-decoration: underline; font-weight: 600; }

/* ---------- Image placeholder ---------- */
.ph {
  position: relative; display: grid; place-items: center; overflow: hidden;
  background-color: var(--paper-lo);
  background-image: repeating-linear-gradient(45deg, transparent 0 14px, rgba(29,24,19,.06) 14px 15px);
  border: 2px solid var(--ink); color: var(--ink-faint);
}
.ph span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; background: var(--paper-hi); padding: 5px 10px; border: 1.5px solid var(--ink); }

/* ---------- Badges / chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 11px; border: 1.5px solid var(--ink); border-radius: 100px; background: var(--paper-hi);
}
.chip--red  { background: var(--red);  color: var(--paper-hi); border-color: var(--ink); }
.chip--gold { background: var(--gold); color: var(--ink); }
.chip--teal { background: var(--teal); color: var(--paper-hi); }
.chip--ghost{ background: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot--live { background: #4ad06a; box-shadow: 0 0 0 0 rgba(74,208,106,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(74,208,106,0); } 100% { box-shadow: 0 0 0 0 rgba(74,208,106,0); } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast {
  background: var(--ink); color: var(--paper-hi); border: 2px solid var(--gold);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
  padding: 12px 18px; border-radius: 2px; box-shadow: var(--shadow-lg);
  animation: toastIn .3s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .nav__links {
    position: fixed; inset: 70px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--paper-hi); border-bottom: 2px solid var(--ink);
    padding: 8px 28px 20px; display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 14px 0; border-bottom: 1px solid var(--line); width: 100%; }
  .nav__burger { display: block; }
  .footer__grid { grid-template-columns: 1fr; gap: 30px; }
  .section { padding-block: 64px; }
  /* En la barra de navegación, deja solo el logo (sin wordmark) para que no se apriete */
  .nav .brand__name, .nav .brand__sub { display: none; }
  .nav .brand__logo { height: 26px; }
}
