/* ---------------------------------------------------------------------------
   Tokens first. Compose these; do not reintroduce loose pixel values or
   one-off colours further down.

   One theme on purpose: this is an event poster, black tarmac and Valencian
   orange, in light and dark system modes alike (color-scheme: dark keeps form
   controls and scrollbars consistent with it).
   --------------------------------------------------------------------------- */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #0b0b0c;
  --bg-raised: #141416;
  --asphalt: #1d1d20;
  --line: rgb(244 237 226 / 0.09);
  --line-strong: rgb(244 237 226 / 0.22);
  --ink: #f4ede2;
  --ink-soft: #b3ada3;
  --ink-faint: #75706a;
  --orange: #ff5a1f;
  --orange-deep: #e3440c;
  --orange-wash: rgb(255 90 31 / 0.12);
  --go: #c8f53c;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --step-3: clamp(2.25rem, 1.4rem + 4vw, 4.5rem);
  --step-4: clamp(3rem, 1.2rem + 8vw, 8rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --gap: clamp(1rem, 2vw, 1.5rem);
  --section: clamp(4.5rem, 10vw, 9rem);
  --radius: 14px;
  --radius-small: 8px;
  --max: 76rem;

  --font: "Archivo", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: var(--step-0)/1.55 var(--font);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}

/* The tilted marquee is wider than the screen. clip, not hidden: hidden makes
   a scroll container, which breaks the sticky nav, and on phones still lets
   the layout viewport grow, pushing fixed elements off-centre. */
html, body { overflow-x: clip; }

.defs { position: absolute; }

a { color: inherit; }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }

.display {
  margin: 0;
  font-weight: 900;
  font-stretch: 112%;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.015em;
}
.display em { font-style: normal; color: var(--orange); }

.eyebrow {
  margin: 0 0 1rem;
  color: var(--orange);
  font-size: var(--step--1);
  font-weight: 700;
  text-transform: uppercase;
}

.lede { margin: 1.25rem 0 0; max-width: 38rem; color: var(--ink-soft); font-size: var(--step-1); }
.note { margin: 0; color: var(--ink-faint); font-size: 0.9375rem; }

/* --- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #160700;
  font: 800 var(--step-0)/1 var(--font);
  font-stretch: 108%;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s;
}
.btn:hover { background: var(--orange-deep); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: progress; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { background: rgb(244 237 226 / 0.06); }
.btn-small { padding: 0.65rem 1rem; font-size: var(--step--1); }
.btn-wide { width: 100%; }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* --- nav ----------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 0.75rem var(--gutter);
  background: rgb(11 11 12 / 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav nav { display: flex; gap: 1.5rem; margin-left: auto; font-size: 0.9375rem; color: var(--ink-soft); }
.nav nav a { text-decoration: none; }
.nav nav a:hover { color: var(--ink); }
@media (max-width: 720px) { .nav nav { display: none; } .nav .btn { margin-left: auto; } }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 900;
  font-stretch: 118%;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.brand-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-wash);
}

/* --- hero ---------------------------------------------------------------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 6rem) var(--gutter) var(--section);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
}
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; }
  .specs { grid-column: 1 / -1; }
}
/* Sized to its own column and to the screen height, never to rem: with a
   larger browser font, rem grew the headline until "EL ÚLTIMO" wrapped and
   the hero ran off the screen. "EN CRUZAR" is the widest of the four lines. */
.hero-copy { container-type: inline-size; min-width: 0; }
.hero h1 { font-size: 13vw; font-size: min(14cqi, 12vh); }

.kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: 0 0 1.5rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.kicker span:first-child { color: var(--orange); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.hero-track, .demo-stage {
  position: relative;
  margin: 0;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: radial-gradient(120% 90% at 50% 40%, rgb(255 90 31 / 0.08), transparent 60%), var(--bg-raised);
}
.telemetry {
  display: flex;
  gap: 1.25rem;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.telemetry span:first-child { color: var(--orange); font-weight: 700; }
.telemetry b { color: var(--ink); font-weight: 700; }

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  margin: 0;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}
.specs div { padding: 1rem 1.1rem; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.specs dt { font-size: 0.6875rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.specs dd { margin: 0.35rem 0 0; font-size: var(--step-2); font-weight: 700; }
.specs small { font-size: 0.55em; color: var(--ink-soft); margin-left: 0.15em; }

.badge {
  display: inline-block;
  margin: 0 0 1.1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--orange-wash);
  box-shadow: inset 0 0 0 1px var(--orange);
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.price-hint { margin: 1rem 0 0; color: var(--ink-soft); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; }
.price-hint:empty { display: none; }
.preview-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0;
  padding: 0.4rem var(--gutter);
  background: var(--go);
  color: #111;
  font-size: 0.75rem;
  text-align: center;
}

/* --- the circuit --------------------------------------------------------- */
.track { display: block; width: 100%; height: auto; overflow: visible; }
.track .kerb { fill: none; stroke: var(--ink); stroke-width: 27; stroke-linejoin: round; opacity: 0.18; }
.track .asphalt { fill: none; stroke: var(--asphalt); stroke-width: 25; stroke-linejoin: round; }
.track .track-line { fill: none; stroke: var(--ink); stroke-width: 1.2; opacity: 0.55; }
.track-label { fill: var(--ink-faint); font-size: 9px; letter-spacing: 0.15em; }
.runner circle { fill: var(--ink); filter: drop-shadow(0 0 4px rgb(244 237 226 / 0.55)); transition: opacity 0.6s; }
.runner.is-you circle { fill: var(--orange); filter: drop-shadow(0 0 7px var(--orange)); }
.runner-tag { fill: var(--orange); font: 700 9px var(--mono); }
/* Eliminated: orange, a pulsing ring and a tag, then off the track. */
.runner.is-out circle:first-child { fill: var(--orange); filter: drop-shadow(0 0 8px var(--orange)); }
.runner.is-gone { opacity: 0; transition: opacity 0.6s; }
.runner .out-ring { fill: none; filter: none; stroke: var(--orange); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ring 0.9s var(--ease) 2; }
@keyframes ring { from { transform: scale(1); opacity: 1; } to { transform: scale(4); opacity: 0; } }
.out-tag { animation: tag-in 0.35s var(--ease) both; }
.out-tag rect { fill: var(--orange); }
.out-tag line { stroke: var(--orange); stroke-width: 2; }
.out-tag text { fill: #160700; font: 900 16px var(--font); font-stretch: 110%; letter-spacing: 0.06em; }
@keyframes tag-in { from { opacity: 0; transform: translate(0, -28px) scale(0.6); } to { opacity: 1; transform: translate(0, -40px) scale(1); } }

/* --- marquee ------------------------------------------------------------- */
.marquee {
  overflow: hidden;
  background: var(--orange);
  color: #160700;
  transform: rotate(-1.5deg);
  margin: 0 -2rem;
}
.marquee-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  padding: 0.85rem 0;
  font-weight: 900;
  font-stretch: 115%;
  font-size: var(--step-2);
  white-space: nowrap;
  animation: marquee 28s linear infinite;
}
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* --- sections ------------------------------------------------------------ */
.section { max-width: var(--max); margin: 0 auto; padding: var(--section) var(--gutter) 0; }
.section-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head h2 { font-size: var(--step-3); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
}
@media (min-width: 1100px) { .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.step {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.step-n { color: var(--orange); font-weight: 700; font-size: var(--step-2); }
.step h3 { margin: 0; font-size: clamp(1.25rem, 1rem + 0.7vw, 1.5rem); font-weight: 900; font-stretch: 100%; text-transform: uppercase; line-height: 1; }
.step p { margin: 0; color: var(--ink-soft); }
.step .rule { margin-top: auto; padding-top: 0.75rem; color: var(--ink); font-size: 0.6875rem; letter-spacing: 0.06em; }
.step-final { background: linear-gradient(160deg, var(--orange-wash), transparent 70%), var(--bg-raised); }

.heat-dots { display: flex; gap: 0.4rem; }
.heat-dots i {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--go);
  transition: background 0.4s, opacity 0.4s;
}
.heat-dots i.gone { background: var(--ink-faint); opacity: 0.35; }
.step-final .heat-dots i:not(.gone) { background: var(--orange); }

/* bracket */
.bracket { position: relative; }
.bracket-track { position: relative; display: grid; gap: 0.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .bracket-track {
    grid-template-columns: repeat(5, minmax(0, 1fr) 1rem) minmax(8.5rem, 1fr);
    align-items: center;
    row-gap: 2.5rem;
  }
  /* Second row, under octavos and cuartos, with the dashed detour drawn in. */
  .bracket-track .col-repesca { grid-row: 2; grid-column: 3 / 6; justify-self: center; width: min(100%, 17rem); }
}
.bracket-col {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-raised);
  opacity: 0.12;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), border-color 0.5s;
}
.bracket-col.on { opacity: 1; transform: none; }
.bracket-col.is-second { border-style: dashed; border-color: var(--orange); }
.bracket-col.is-second:not(.on) { transform: translateY(30px); }
.bracket-head { margin-bottom: 0.7rem; }
.bracket-n { color: var(--orange); font-size: 0.75rem; font-weight: 700; }
.bracket-head h3 { margin: 0.1rem 0 0.15rem; font-size: 1.05rem; font-weight: 900; font-stretch: 108%; text-transform: uppercase; }
.bracket-head p { margin: 0; color: var(--ink-faint); font-size: 0.6875rem; line-height: 1.35; }

.quali-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.quali-grid i {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0;
  transition: opacity 0.3s, background 0.6s;
  transition-delay: calc(var(--seed) * 8ms);
}
.on .quali-grid i { opacity: 0.85; }
/* Sorted: fastest first, coloured from orange (fast) to grey (slow). */
.quali-grid.sorted i {
  order: var(--seed);
  background: color-mix(in srgb, var(--orange) calc(100% - var(--seed) * 2%), var(--ink-faint));
}

.bracket-groups { display: grid; gap: 5px; }
@media (max-width: 999px) { .bracket-groups { grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); } }
.grp { display: flex; gap: 4px; padding: 5px 6px; border-radius: 6px; background: var(--bg); }
.grp i { flex: 1; aspect-ratio: 1; max-width: 0.75rem; border-radius: 50%; background: var(--ink); transition: background 0.4s, opacity 0.4s; }
.settled .grp i.win { background: var(--go); }
.settled .grp i.lose { background: var(--ink-faint); opacity: 0.3; }
.col-final.settled .grp i.win { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.second-tag { margin: 0.6rem 0 0; color: var(--orange); font-size: 0.6875rem; line-height: 1.5; }

.bracket-flow { position: relative; height: 1.1rem; justify-self: center; width: 2px; background: var(--line-strong); overflow: hidden; }
@media (min-width: 1000px) { .bracket-flow { width: 100%; height: 2px; } }
.bracket-flow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--orange);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease);
}
@media (min-width: 1000px) { .bracket-flow::after { transform: scaleX(0); transform-origin: left; } }
.bracket-flow.on::after { transform: none; }

.bracket-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.bracket-links .link {
  fill: none;
  stroke: var(--orange);
  stroke-width: 2;
  stroke-dasharray: 6 6;
  opacity: 0;
  transition: opacity 0.5s;
}
.bracket-links.in .link-in, .bracket-links.out .link-out { opacity: 0.9; animation: march 1s linear infinite; }
@keyframes march { to { stroke-dashoffset: -12; } }
@media (prefers-reduced-motion: reduce) { .bracket-links .link { animation: none !important; } }

.col-champion { text-align: center; }
.col-champion.on { border-color: var(--orange); background: linear-gradient(160deg, var(--orange-wash), transparent 70%), var(--bg-raised); }
.trophy svg { width: 3.2rem; height: 3.2rem; fill: var(--orange); stroke: var(--orange); stroke-width: 3; stroke-linejoin: round; }
.col-champion.on .trophy { animation: crown 0.8s var(--ease) both; }
@keyframes crown { 0% { transform: scale(0.4) rotate(-12deg); } 60% { transform: scale(1.15) rotate(4deg); } 100% { transform: none; } }
.champ-title { margin: 0.3rem 0 0; font-weight: 900; text-transform: uppercase; font-size: 1rem; }
.champ-sub { margin: 0.15rem 0 0; color: var(--ink-faint); font-size: 0.6875rem; }


/* demo */
.demo-grid { display: grid; gap: var(--gap); }
@media (min-width: 960px) { .demo-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.demo-panel { display: grid; gap: 1.1rem; }
.demo-status { margin: 0; min-height: 3em; font-weight: 700; font-size: var(--step-1); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; border: 0; }
.chips legend { width: 100%; margin-bottom: 0.5rem; padding: 0; color: var(--ink-soft); font-size: 0.875rem; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span {
  display: inline-block;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--ink-soft);
  font-size: 0.9375rem;
  transition: background 0.2s, color 0.2s;
}
.chips input:checked + span { background: var(--ink); color: var(--bg); box-shadow: none; font-weight: 700; }
.chips input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }

.board { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); font-size: 0.875rem; }
.board li {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}
.board .pos { color: var(--ink-faint); }
.board .you .name { color: var(--orange); font-weight: 700; }
.board .out { color: var(--ink-faint); }
.board .out .name { text-decoration: line-through; text-decoration-color: var(--orange); }
.board .tag { color: var(--orange); font-size: 0.75rem; }

/* story */
.story-grid {
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: var(--radius);
  background: var(--orange);
  color: #160700;
}
.story-grid .eyebrow { color: #160700; }
.story-big { font-size: clamp(1.75rem, 1rem + 3vw, 3.5rem); max-width: 24ch; }
.story-grid .lede { color: rgb(22 7 0 / 0.78); }

/* cards */
.cards { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { padding: 1.5rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg-raised); }
.card h3 { margin: 0 0 0.5rem; font-size: var(--step-1); font-weight: 800; font-stretch: 108%; text-transform: uppercase; }
.card p { margin: 0; color: var(--ink-soft); }
.card-photo { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 10 / 7;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
  transition: transform 0.6s var(--ease), filter 0.6s;
}
.card-photo:hover img { transform: scale(1.04); filter: none; }
.card-body { padding: 1.25rem 1.4rem 1.5rem; border-top: 3px solid var(--orange); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.timeline li {
  display: grid;
  grid-template-columns: 6rem 1fr;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-strong);
  font-size: var(--step-1);
}
.timeline time { color: var(--ink-faint); }
.timeline .hot span { color: var(--orange); font-weight: 700; }

/* paella */
.paella-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 900px) { .paella-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.paella-art { margin: 0; max-width: 34rem; justify-self: center; width: 100%; }
.paella-svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 30px 40px rgb(0 0 0 / 0.55)); }
.paella-copy h2 { font-size: var(--step-3); }
.paella-copy .btn { margin-top: 0.5rem; }
.paella .handle { fill: #3b3b40; stroke: #1b1b1e; stroke-width: 2; }
.paella .pan { fill: #46464c; }
.paella .pan-inner { fill: #2b2b2f; }
.paella .sofrito { fill: #c9541c; opacity: 0.16; }
.paella .g1 { fill: #f8d27a; }
.paella .g2 { fill: #f1bd4f; }
.paella .g3 { fill: #e9a83a; }
.paella .g4 { fill: #fbe2a2; opacity: 0.9; }
.paella .meat { fill: #c17a3c; stroke: #874c1f; stroke-width: 1.6; }
.paella .meat-hi { fill: #e0a35f; opacity: 0.7; }
.paella .bone { fill: #f1e6cf; stroke: #c9b994; stroke-width: 1; }
.paella .bean { fill: #6fa846; stroke: #3f7a24; stroke-width: 1.4; }
.paella .bean-line { stroke: #9cc96e; stroke-width: 1.4; stroke-linecap: round; }
.paella .garrofo { fill: #f0e8d2; stroke: #c8bb98; stroke-width: 1.2; }
.paella .garrofo-line { fill: none; stroke: #c8bb98; stroke-width: 1; }
.paella .snail { fill: #7a5636; stroke: #4c331e; stroke-width: 1.2; }
.paella .snail-line { fill: none; stroke: #c9a27a; stroke-width: 1.1; }
.paella .sprig { fill: none; stroke: #3f5a2c; stroke-width: 3.2; stroke-linecap: round; }
.paella .needles { fill: none; stroke: #5f8442; stroke-width: 2.6; stroke-linecap: round; }
.paella .logs { fill: #4a2c17; }
.paella .flame { transform-box: fill-box; transform-origin: bottom; }
.paella .f1 { fill: #ff5a1f; animation: flicker 1.1s ease-in-out infinite alternate; }
.paella .f2 { fill: #ffb12e; animation: flicker 0.8s ease-in-out infinite alternate-reverse; }
@keyframes flicker { from { transform: scaleY(0.85) skewX(-2deg); } to { transform: scaleY(1.08) skewX(2deg); } }
@media (prefers-reduced-motion: reduce) { .paella .flame { animation: none; } }
.steam path { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; opacity: 0; animation: steam 3.2s ease-in-out infinite; }
.steam path:nth-child(2) { animation-delay: 1.1s; }
.steam path:nth-child(3) { animation-delay: 2.2s; }
@keyframes steam {
  0% { opacity: 0; transform: translateY(18px); }
  40% { opacity: 0.35; }
  100% { opacity: 0; transform: translateY(-14px); }
}
@media (prefers-reduced-motion: reduce) { .steam path { animation: none; opacity: 0.2; } }

/* signup */
.signup-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 900px) { .signup-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; } }
.price-big { font-size: var(--step-4); }
.price-big small { font-size: 0.45em; margin-left: 0.1em; color: var(--orange); }
.includes { margin: 1.5rem 0 1rem; padding: 0; list-style: none; display: grid; gap: 0.5rem; font-size: var(--step-1); }
.includes li::before { content: "✓"; color: var(--go); margin-right: 0.6rem; font-weight: 700; }
.guarantee {
  margin: 1.5rem 0 0;
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--orange);
  background: var(--orange-wash);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  color: var(--ink-soft);
}
.guarantee strong { color: var(--ink); }

.form {
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.form > label:not(.check) { display: grid; gap: 0.4rem; color: var(--ink-soft); font-size: 0.9375rem; }
.optional { color: var(--ink-faint); }
input, select {
  width: 100%;
  font: inherit;
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  padding: 0.75rem 0.85rem;
}
input:focus, select:focus { border-color: var(--orange); outline: none; }
.chips input { width: auto; }

.stepper { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--ink-soft); font-size: 0.9375rem; }
.stepper-ctrl { display: flex; align-items: center; gap: 0.75rem; }
.stepper-ctrl button {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font: 700 1.25rem/1 var(--font);
  cursor: pointer;
}
.stepper-ctrl button:hover { border-color: var(--orange); }
.stepper output { min-width: 1.5rem; text-align: center; font: 700 var(--step-1) var(--mono); color: var(--ink); }

.check { display: flex; gap: 0.75rem; align-items: flex-start; color: var(--ink-soft); font-size: 0.9375rem; }
.check input { width: 1.2rem; height: 1.2rem; margin: 0.15rem 0 0; accent-color: var(--orange); flex: none; }

/* price tiers */
.tier-chip {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--orange);
  color: #160700;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.price-next { margin: 0.25rem 0 0; color: var(--ink-faint); text-decoration: line-through; text-decoration-color: transparent; }
.countdown { margin: 1rem 0 0; color: var(--ink-soft); font-size: 0.875rem; }
.countdown b { color: var(--orange); font-size: 1.05rem; }
.scarce {
  margin: 0.75rem 0 0;
  color: var(--orange);
  font-weight: 800;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .scarce { animation: none; } }
.ladder { list-style: none; margin: 1.5rem 0 0; padding: 0; border-top: 1px solid var(--line-strong); font-size: 0.875rem; }
.ladder li { display: grid; grid-template-columns: 1fr auto auto; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); color: var(--ink-faint); }
.ladder li.past span:not(.tag) { text-decoration: line-through; }
.ladder li.now { color: var(--ink); font-weight: 700; }
.ladder .tag { color: var(--orange); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; align-self: center; }

.buybar {
  position: fixed;
  left: 50%;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 15;
  width: min(34rem, calc(100% - 1.5rem));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.55rem 0.55rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgb(20 20 22 / 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.5);
  animation: rise 0.35s var(--ease);
}
.buybar[hidden] { display: none; }
@keyframes rise { from { transform: translate(-50%, 120%); } }
.buybar-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.6rem; min-width: 0; }
.buybar-text .mono { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--orange); }
.buybar-text b { font-size: 1.05rem; }
.buybar .buybar-count { color: var(--ink-soft); }

/* sign-up form */
.form { gap: 1.5rem; }
.form-group { display: grid; gap: 1rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.form-group legend { margin-bottom: 0.9rem; padding: 0; color: var(--orange); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.field-row { display: grid; gap: 1rem; }
@media (min-width: 560px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: grid; gap: 0.4rem; min-width: 0; color: var(--ink-soft); font-size: 0.875rem; font-weight: 600; }
.field-label { color: var(--ink-soft); font-size: 0.875rem; font-weight: 600; }
.field .optional { font-weight: 400; color: var(--ink-faint); }
.hint { color: var(--ink-faint); font-size: 0.8125rem; font-weight: 400; }
.form .chips { gap: 0.5rem; }
.form .chips label { flex: 1; }
.form .chips span { display: block; text-align: center; }
.stepper { padding: 0.9rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--bg); }
.stepper > div:first-child { display: grid; gap: 0.2rem; }
.summary { margin: 0; padding: 1rem 1.1rem; border-radius: var(--radius-small); background: var(--bg); font-size: 0.875rem; display: grid; gap: 0.4rem; }
.summary div[hidden] { display: none; }
.summary div { display: flex; justify-content: space-between; gap: 1rem; color: var(--ink-soft); }
.summary dt, .summary dd { margin: 0; }
.summary .total { margin-top: 0.3rem; padding-top: 0.6rem; border-top: 1px solid var(--line-strong); color: var(--ink); font-weight: 700; font-size: 1rem; }

/* sponsors */
.sponsor-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (min-width: 900px) { .sponsor-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.sponsor h2 { font-size: var(--step-3); }
.offer { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.offer li { padding: 1rem 1.1rem; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--bg-raised); color: var(--ink-soft); }
.offer b { display: block; margin-bottom: 0.2rem; color: var(--ink); font-weight: 800; text-transform: uppercase; font-stretch: 108%; }
.sponsor-cta { margin-top: 2rem; }

/* contact */
.contact-form { max-width: 46rem; }
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  padding: 0.75rem 0.85rem;
  resize: vertical;
}
textarea:focus { border-color: var(--orange); outline: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* paella nudge */
.nudge {
  width: min(26rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--ink);
  overflow: hidden;
}
.nudge[open] { animation: pop 0.35s var(--ease); }
@keyframes pop { from { transform: translateY(16px) scale(0.96); opacity: 0; } }
.nudge::backdrop { background: rgb(0 0 0 / 0.6); backdrop-filter: blur(4px); }
.nudge img { display: block; width: 100%; height: 11rem; object-fit: cover; }
.nudge-body { display: grid; gap: 0.6rem; padding: 1.25rem 1.4rem 1.4rem; }
.nudge-body .eyebrow { margin: 0; }
.nudge-body h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.25rem); }
.nudge-body p { margin: 0; color: var(--ink-soft); }
.nudge-actions { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
@media (prefers-reduced-motion: reduce) { .nudge[open] { animation: none; } }

.footer-link { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.footer-link:hover { color: var(--orange); border-color: var(--orange); }
.nav-back { margin-left: auto; }

/* legal */
.legal h2 { font-size: var(--step--1); color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.legal ul { margin: 0; padding-left: 1.1rem; max-width: 50rem; color: var(--ink-faint); font-size: 0.875rem; display: grid; gap: 0.4rem; }

/* footer */
.footer {
  max-width: var(--max);
  margin: var(--section) auto 0;
  padding: 2rem var(--gutter) 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  border-top: 1px solid var(--line-strong);
  color: var(--ink-faint);
  font-size: 0.875rem;
}
.footer .brand { color: var(--ink); }
.stamp { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0 0 0 auto; font-size: 0.6875rem; }
.stamp div { display: flex; gap: 0.4rem; }
.stamp dd { margin: 0; }
.stamp code { font-family: var(--mono); }

/* thank-you page */
.result { max-width: 46rem; margin: 0 auto; padding: clamp(4rem, 12vw, 9rem) var(--gutter); }
.result h1 { font-size: var(--step-3); }
.result .actions { margin-top: 2.5rem; }
