/* =====================================================================
   Gran Premio de la Personería · New Cambridge School
   Mobile first. Paleta: rojo y azul del escudo oficial + dorado/violeta
   del juego para conectar sitio y pista.
   ===================================================================== */

:root {
  /* Identidad del colegio (muestreada del escudo oficial) */
  --red: #D0001C;
  --red-deep: #9E0015;
  --blue: #08487F;
  --blue-deep: #063761;
  --blue-ink: #0B1E33;

  /* Pista y juego */
  --gold: #FFC53D;
  --gold-deep: #E0A100;
  --violet: #5B3DF5;
  --violet-deep: #2A1B8A;
  --asphalt: #1B1E26;

  /* Neutros con sesgo azul */
  --paper: #F4F6FA;
  --paper-2: #E8ECF3;
  --card: #FFFFFF;
  --ink: #141A24;
  --muted: #5B6675;
  --line: #D7DEE8;

  --font-display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', Arial, sans-serif;
  --font-body: 'Barlow', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1120px;
  --gutter: 20px;
  --radius: 6px;
  --shadow-hard: 6px 6px 0 var(--asphalt);
  --shadow-soft: 0 12px 32px rgba(11, 30, 51, 0.12);
  --sticky-h: 76px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  padding-bottom: var(--sticky-h); /* espacio para la barra fija en móvil */
}

img, video { max-width: 100%; height: auto; display: block; }
/* Los hijos de una rejilla no deben heredar el ancho intrínseco de imágenes o videos */
.hero-inner > *, .game-grid > *, .video-grid > *, .drivers > * { min-width: 0; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--asphalt); color: #fff; padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--wrap), calc(100% - var(--gutter) * 2)); margin: 0 auto; }
#inicio, #juego, #video, #propuestas, #candidatos, #comparte { scroll-margin-top: 72px; }

/* ---------- Tipografía ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1.display { font-size: clamp(46px, 13vw, 96px); }
h2.display { font-size: clamp(34px, 9vw, 60px); }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.eyebrow-light { color: var(--gold); }

.lead { font-size: 18px; line-height: 1.5; max-width: 34em; }
.lead strong { color: var(--red); font-weight: 700; }
.fine { font-size: 14px; color: var(--muted); }
.num { font-family: var(--font-display); font-weight: 900; font-style: italic; font-variant-numeric: tabular-nums; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 12px 26px;
  font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase;
  font-size: 21px; letter-spacing: 0.03em; line-height: 1;
  text-decoration: none; border: 0; cursor: pointer;
  transform: skewX(-10deg);
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
  touch-action: manipulation;
}
.btn > span { display: inline-block; transform: skewX(10deg); }
.btn-lg { min-height: 60px; font-size: 24px; padding: 14px 34px; }
.btn-gold { background: var(--gold); color: var(--asphalt); box-shadow: var(--shadow-hard); }
.btn-gold:hover { background: #FFD262; }
.btn-gold:active { transform: skewX(-10deg) translate(3px, 3px); box-shadow: 3px 3px 0 var(--asphalt); }
.btn-blue { background: var(--blue); color: #fff; box-shadow: 6px 6px 0 var(--blue-ink); }
.btn-blue:hover { background: var(--blue-deep); }
.btn-blue:active { transform: skewX(-10deg) translate(3px, 3px); box-shadow: 3px 3px 0 var(--blue-ink); }
.btn-ghost { background: transparent; color: currentColor; box-shadow: inset 0 0 0 3px currentColor; }
.btn-ghost:hover { box-shadow: inset 0 0 0 3px var(--gold); color: var(--gold); }

/* ---------- Franjas de pianito / meta ---------- */
.kerb { position: relative; }
.kerb::before, .kerb::after {
  content: ""; position: absolute; left: 0; right: 0; height: 12px; z-index: 2;
  background: repeating-linear-gradient(90deg, var(--red) 0 24px, #fff 24px 48px);
}
.kerb::before { top: 0; }
.kerb::after { bottom: 0; }

.kerb-check::before, .kerb-check::after {
  content: ""; position: absolute; left: 0; right: 0; height: 18px; z-index: 2;
  background:
    repeating-conic-gradient(#111 0 25%, #f4f4f4 0 50%) 0 0 / 18px 18px;
}
.kerb-check { position: relative; }
.kerb-check::before { top: 0; }
.kerb-check::after { bottom: 0; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 62px; padding: 8px var(--gutter);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; text-decoration: none; flex: none; }
.brand-logo { flex: none; width: auto; height: 40px; }
.nav { display: flex; gap: 0; flex-wrap: nowrap; min-width: 0; }
.nav a {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 14px; color: var(--blue); text-decoration: none; padding: 8px 6px; border-bottom: 3px solid transparent; white-space: nowrap;
}
.nav a:hover { border-bottom-color: var(--red); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(8, 72, 127, 0.55), transparent 60%),
    linear-gradient(180deg, var(--blue-ink) 0%, var(--asphalt) 100%);
  color: #fff;
  padding: 44px 0 52px;
  overflow: hidden;
}
.hero-inner { width: min(var(--wrap), calc(100% - var(--gutter) * 2)); margin: 0 auto; display: grid; gap: 32px; }
.hero-copy .eyebrow { color: var(--gold); }
.hero h1 { color: #fff; text-shadow: 5px 5px 0 var(--red); margin: 4px 0 18px; }
.hero .lead { color: rgba(255, 255, 255, 0.86); }
.hero .lead strong { color: var(--gold); }
.hero .lead .num { color: var(--gold); font-size: 1.15em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px 16px; margin: 26px 0 0; }
.hero-actions .btn-ghost { color: #fff; }

.hero-facts {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 26px;
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: 16px;
  color: rgba(255, 255, 255, 0.75);
}
.hero-facts .num { color: var(--gold); font-size: 24px; margin-right: 4px; }

.hero-photo { position: relative; max-width: 420px; }
.hero-photo img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 30%;
  border: 4px solid #fff; box-shadow: 10px 10px 0 var(--red);
}
.hero-photo figcaption {
  position: absolute; left: 12px; right: 12px; bottom: 14px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.pill {
  font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase;
  font-size: 15px; letter-spacing: 0.02em; padding: 6px 12px; color: #fff; transform: skewX(-8deg);
}
.pill-red { background: var(--red); }
.pill-blue { background: var(--blue); }

/* ---------- Ticker ---------- */
.ticker {
  overflow: hidden; background: var(--gold); color: var(--asphalt);
  font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase;
  font-size: 18px; letter-spacing: 0.06em; padding: 9px 0; white-space: nowrap;
}
.ticker-track { display: inline-flex; gap: 22px; animation: ticker 28s linear infinite; }
.ticker-track span { flex: none; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */
.section { padding: 56px 0; }
.section-head { margin-bottom: 28px; }
.section-head .lead { margin-top: 12px; color: var(--muted); }

/* ---------- El juego ---------- */
.game { background: var(--violet); color: #fff; position: relative; overflow: hidden; }
.game .wrap { position: relative; }
.game-grid { display: grid; gap: 36px; }
.game h2 { color: var(--gold); text-shadow: 4px 4px 0 var(--violet-deep); margin-bottom: 26px; }
.game .fine { color: rgba(255, 255, 255, 0.75); margin-top: 14px; }

.steps { display: grid; gap: 18px; margin-bottom: 30px; }
.steps li {
  display: grid; grid-template-columns: 74px 1fr; column-gap: 14px; row-gap: 6px; align-items: start;
  padding: 16px 16px 16px 0; border-top: 2px solid rgba(255, 255, 255, 0.2);
}
.steps li:first-child { border-top: 0; }
.steps h3, .steps p { grid-column: 2; }
.step-k {
  grid-column: 1; grid-row: 1 / span 2;
  font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase;
  font-size: 22px; line-height: 1; color: var(--gold); padding-top: 2px;
}
.steps h3 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 22px; line-height: 1.05; }
.steps p { color: rgba(255, 255, 255, 0.86); font-size: 16px; }

/* Teléfono ilustrado con la portada del juego */
.phone {
  width: min(300px, 82vw); margin: 0 auto; padding: 12px;
  background: var(--asphalt); border-radius: 34px; box-shadow: var(--shadow-soft), 0 0 0 2px #3a3f4a;
}
.phone-screen {
  position: relative; aspect-ratio: 9 / 17.5; border-radius: 24px; overflow: hidden;
  background: var(--violet); display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 26px 16px 22px; gap: 8px;
}
.ps-kerb { position: absolute; left: 0; right: 0; height: 10px; background: repeating-linear-gradient(90deg, #E0332E 0 18px, #FAFAF7 18px 36px); }
.ps-kerb:first-child { top: 0; }
.ps-kerb:last-child { bottom: 0; }
.ps-meta { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: rgba(255, 255, 255, 0.9); margin-top: 8px; }
.ps-title { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 30px; line-height: 0.88; color: var(--gold); text-shadow: 3px 3px 0 var(--violet-deep); }
.ps-track {
  position: relative; width: 120px; flex: 1; min-height: 120px; margin: 6px 0;
  background: #464B56; box-shadow: 5px 5px 0 var(--violet-deep);
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-image: repeating-linear-gradient(180deg, #E0332E 0 12px, #FAFAF7 12px 24px) 8;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px;
}
.ps-car { width: 56px; height: auto; }
.ps-star { position: absolute; color: var(--gold); font-size: 22px; text-shadow: 0 0 8px rgba(255, 197, 61, 0.9); animation: fall 3.6s linear infinite; }
.ps-star.s1 { left: 12px; animation-delay: 0s; }
.ps-star.s2 { left: 50%; margin-left: -10px; animation-delay: 1.2s; }
.ps-star.s3 { right: 12px; animation-delay: 2.4s; }
@keyframes fall { from { top: -24px; opacity: 0; } 10% { opacity: 1; } 85% { opacity: 1; } to { top: 100%; opacity: 0; } }
.ps-names { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 15px; color: #fff; }
.ps-btn {
  font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 15px;
  background: var(--gold); color: var(--violet-deep); padding: 9px 18px; transform: skewX(-10deg); box-shadow: 3px 3px 0 var(--violet-deep);
}

/* ---------- Video ---------- */
.video { background: var(--paper-2); }
.video-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; }
.video-copy .lead { color: var(--muted); margin: 12px 0 18px; }
.video-facts {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 24px;
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: 16px; color: var(--muted);
}
.video-facts .num { color: var(--red); font-size: 24px; margin-right: 4px; }
.video-frame { width: 100%; max-width: 340px; margin: 0 auto; display: block; }
.video-frame video {
  width: 100%; max-width: 100%; height: auto; aspect-ratio: 9 / 16; display: block; background: var(--asphalt); object-fit: contain;
  border: 4px solid #fff; box-shadow: 10px 10px 0 var(--blue);
}
.video-frame figcaption { text-align: center; margin-top: 14px; }

/* ---------- Propuestas ---------- */
.proposals { background: var(--paper); }
.plist { display: grid; gap: 14px; }

.prop {
  background: var(--card); border-left: 10px solid var(--gold);
  box-shadow: var(--shadow-hard);
  transition: transform 120ms ease;
}
.prop[open] { border-left-color: var(--red); }
.prop summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 40px 1fr 28px; gap: 12px; align-items: start;
  padding: 18px 16px 18px 14px;
}
.prop summary::-webkit-details-marker { display: none; }
.prop-star { font-size: 30px; line-height: 1; color: var(--gold); -webkit-text-stroke: 1.5px var(--gold-deep); padding-top: 2px; }
.prop[open] .prop-star { color: var(--red); -webkit-text-stroke: 1.5px var(--red-deep); }
.prop-text { display: grid; gap: 4px; min-width: 0; }
.prop-k { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 13px; color: var(--blue); }
.prop-title { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 26px; line-height: 0.95; color: var(--ink); text-wrap: balance; }
.prop-sum { font-size: 16px; color: var(--muted); line-height: 1.4; }
.prop-chev {
  width: 14px; height: 14px; margin: 10px 6px 0 0; justify-self: end;
  border-right: 3px solid var(--blue); border-bottom: 3px solid var(--blue); transform: rotate(45deg);
  transition: transform 160ms ease;
}
.prop[open] .prop-chev { transform: rotate(-135deg); margin-top: 16px; }
.prop-body { padding: 0 16px 22px 66px; display: grid; gap: 12px; max-width: 70ch; }
.prop-body p { font-size: 16.5px; line-height: 1.55; color: #2A3240; }
.prop-hl {
  font-family: var(--font-display); font-weight: 700; font-size: 20px !important; line-height: 1.15 !important;
  color: var(--blue) !important; border-left: 4px solid var(--red); padding-left: 12px;
}
.prop-img { width: 100%; box-shadow: 4px 4px 0 var(--blue); }

.proposals-cta {
  margin-top: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px;
  padding-top: 26px; border-top: 2px solid var(--line);
}
.proposals-cta p { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 20px; color: var(--blue); }

/* ---------- Candidatos ---------- */
.team { background: var(--paper-2); }
.drivers { display: grid; gap: 18px; }
.driver { background: var(--card); padding: 22px 20px 20px; border-top: 8px solid var(--red); box-shadow: var(--shadow-soft); }
.driver-blue { border-top-color: var(--blue); }
.driver-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.helmet {
  flex: none; width: 54px; height: 54px; border-radius: 50% 50% 40% 40%; background: var(--helm, #ccc);
  position: relative; box-shadow: inset -6px -4px 0 rgba(0, 0, 0, 0.18);
}
.helmet::after { content: ""; position: absolute; left: 10px; right: 6px; top: 22px; height: 14px; background: #1b1a2a; border-radius: 3px; }
.driver-role { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 13px; color: var(--muted); display: block; }
.driver h3 { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 30px; line-height: 0.95; }
.driver-red h3 { color: var(--red); }
.driver-blue h3 { color: var(--blue); }
.driver p { font-size: 16px; color: #2A3240; }
.driver-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.driver-tags li {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 14px;
  padding: 5px 10px; background: var(--paper-2); color: var(--blue-ink); border: 1px solid var(--line);
}

/* ---------- Cierre ---------- */
.finish { background: var(--asphalt); color: #fff; padding: 64px 0 68px; }
.finish-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.finish h2 { color: #fff; text-shadow: 4px 4px 0 var(--red); margin-bottom: 14px; }
.finish .lead { color: rgba(255, 255, 255, 0.82); }
.finish .hero-actions { justify-content: center; }
.finish .fine { color: var(--gold); margin-top: 14px; }

/* ---------- Footer ---------- */
.footer { background: #fff; border-top: 1px solid var(--line); padding: 30px 0 34px; color: var(--muted); font-size: 15px; }
.footer-inner { display: grid; gap: 10px; justify-items: start; }
.footer-logo { height: 52px; width: auto; }

/* ---------- Barra fija en móvil ---------- */
.stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(27, 30, 38, 0.96); border-top: 3px solid var(--gold);
  display: flex; justify-content: center;
  transform: translateY(0); transition: transform 220ms ease;
}
.stickybar .btn { width: 100%; max-width: 420px; box-shadow: none; }
.stickybar.is-hidden { transform: translateY(110%); }

/* =====================================================================
   Tablet y escritorio
   ===================================================================== */
@media (min-width: 640px) {
  :root { --gutter: 28px; }
  .brand-logo { height: 50px; }
  .nav { gap: 4px; }
  .nav a { font-size: 16px; padding: 8px 12px; letter-spacing: 0.06em; }
  .hero-photo figcaption { flex-direction: row; flex-wrap: wrap; }
  .drivers { grid-template-columns: 1fr 1fr; }
  .section { padding: 72px 0; }
}

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .stickybar { display: none; }
  .hero { padding: 72px 0 84px; }
  .hero-inner { grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 48px; }
  .hero-photo { justify-self: end; width: 100%; max-width: 440px; transform: rotate(-2deg); }
  .game-grid { grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 56px; }
  .video-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; gap: 56px; }
  .video-frame { max-width: 360px; transform: rotate(-2deg); }
  .phone { margin: 0 auto; transform: rotate(3deg); }
  .plist { gap: 18px; }
  .prop summary { padding: 22px 22px 22px 18px; grid-template-columns: 46px 1fr 28px; }
  .prop-title { font-size: 30px; }
  .prop-body { padding-left: 82px; }
}
