/* ============================================================
   CLUB TESLA CHILE — sistema visual oscuro
   Identidad original del club. Negro profundo, rojo carrera,
   tipografía Archivo (variable width) + IBM Plex Mono para datos.
   ============================================================ */

:root {
  /* Color */
  --bg: #060607;
  --bg-raised: #0d0d0f;
  --bg-card: #121214;
  --bg-card-hover: #18181b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #f4f4f2;
  --ink-2: rgba(244, 244, 242, 0.64);
  --ink-3: rgba(244, 244, 242, 0.38);
  --accent: #e10600;
  --accent-hi: color-mix(in oklab, var(--accent), white 14%);
  --accent-soft: color-mix(in oklab, var(--accent), transparent 86%);
  --accent-glow: color-mix(in oklab, var(--accent), transparent 62%);

  /* Type */
  --sans: "Archivo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Layout */
  --max: 1280px;
  --pad: clamp(20px, 4vw, 48px);
  --nav-h: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

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

/* ---------- Type scale ---------- */

h1, h2, h3, h4 { margin: 0; text-wrap: balance; }

.display {
  font-weight: 800;
  font-stretch: 115%;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 0.94;
}

.h-xl { font-size: clamp(56px, 9vw, 132px); }
.h-lg { font-size: clamp(40px, 6vw, 84px); }
.h-md { font-size: clamp(28px, 3.6vw, 48px); }
.h-sm { font-size: clamp(20px, 2.2vw, 28px); font-weight: 700; font-stretch: 110%; text-transform: uppercase; letter-spacing: 0.01em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent-hi);
}

.eyebrow--dim { color: var(--ink-3); }

.lead {
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
  max-width: 56ch;
}

.body-2 { font-size: 15px; color: var(--ink-2); text-wrap: pretty; }

.mono-data {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 28px;
  height: 48px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  font-stretch: 110%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease),
    color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-hi);
  box-shadow: 0 0 32px var(--accent-glow);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  color: var(--ink);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255,255,255,0.3); }

.btn--lg { height: 56px; padding: 0 36px; font-size: 15px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 4px;
  transition: color 160ms var(--ease), border-color 160ms var(--ease), gap 160ms var(--ease);
}
.link-arrow:hover { color: var(--accent-hi); border-color: var(--accent); gap: 14px; }

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background 240ms var(--ease), border-color 240ms var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(6, 6, 7, 0.82);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}

.nav__inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.nav__logo { width: 54px; height: 54px; filter: invert(1); }
.nav__wordmark {
  font-weight: 800;
  font-stretch: 118%;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
}
.nav__wordmark small {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-stretch: 100%;
  font-size: 9px;
  letter-spacing: 0.34em;
  color: var(--ink-3);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav__link {
  padding: 9px 16px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  transition: color 140ms var(--ease), background 140ms var(--ease);
}
.nav__link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.nav__link.is-active { color: var(--ink); }
.nav__link.is-active::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 2px;
  margin-bottom: -4px;
  background: var(--accent);
  border-radius: 2px;
}

.nav__cta { height: 38px; padding: 0 20px; font-size: 12.5px; }

.nav__burger {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  width: 42px;
  height: 38px;
  cursor: pointer;
  color: var(--ink);
  align-items: center;
  justify-content: center;
}

@media (max-width: 880px) {
  .nav__links { display: none; }
  .nav__links.is-open {
    display: flex;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(6, 6, 7, 0.97);
    backdrop-filter: blur(20px);
    padding: 16px var(--pad) 28px;
    border-bottom: 1px solid var(--line);
    gap: 2px;
  }
  .nav__links.is-open .nav__link { padding: 14px 8px; font-size: 16px; }
  .nav__burger { display: inline-flex; }
  .nav__cta { display: none; }
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding: clamp(72px, 10vw, 140px) var(--pad);
}
.section__inner { max-width: var(--max); margin: 0 auto; }
.section--raised { background: var(--bg-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.section-head__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

/* ---------- Cards ---------- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), background 220ms var(--ease);
}
a.card:hover, .card--hover:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: var(--bg-card-hover);
}

/* ---------- Marquee ---------- */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  user-select: none;
}
.marquee__track {
  display: flex;
  gap: 56px;
  width: max-content;
  animation: marquee-scroll 36s linear infinite;
}
.marquee__item {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 56px;
}
.marquee__item::after { content: ""; width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); flex-shrink: 0; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
}
body.no-marquee .marquee { display: none; }

/* ---------- Reveal on scroll ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
  }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- image-slot dark skin ---------- */

image-slot {
  background: linear-gradient(160deg, #131316 0%, #0a0a0c 100%);
  border: 1px dashed rgba(255, 255, 255, 0.14);
}
image-slot[data-filled], image-slot.filled { border: none; }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
  padding: clamp(48px, 6vw, 80px) var(--pad) 36px;
}
.footer__inner { max-width: var(--max); margin: 0 auto; }
.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 880px) { .footer__top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer__top { grid-template-columns: 1fr; } }

.footer__brand { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.footer__logo { width: 84px; height: 84px; filter: invert(1); opacity: 0.92; }

.footer__col h4 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.footer__col a { font-size: 14.5px; color: var(--ink-2); transition: color 140ms var(--ease); }
.footer__col a:hover { color: var(--ink); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 28px;
}
.footer__legal {
  font-size: 12.5px;
  color: var(--ink-3);
  max-width: 64ch;
  text-wrap: pretty;
  line-height: 1.6;
}

/* ---------- CTA band ---------- */

.cta-band {
  position: relative;
  text-align: center;
  padding: clamp(90px, 12vw, 170px) var(--pad);
  overflow: hidden;
  border-top: 1px solid var(--line);
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 80%;
  background: radial-gradient(ellipse at 50% 100%, var(--accent-glow), transparent 65%);
  pointer-events: none;
}
.cta-band__inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 28px; }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field input, .field select, .field textarea {
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  padding: 13px 16px;
  outline: none;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.field .field__error {
  font-size: 12.5px;
  color: var(--accent-hi);
  display: none;
}
.field.has-error input, .field.has-error select { border-color: var(--accent); }
.field.has-error .field__error { display: block; }

/* ---------- Chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 140ms var(--ease);
}
.chip:hover { border-color: rgba(255,255,255,0.34); color: var(--ink); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Util ---------- */

.grid { display: grid; gap: 20px; }
.accent { color: var(--accent-hi); }
.tnum { font-variant-numeric: tabular-nums; }
