/* ==========================================================================
   MULXON · Página de presencia
   Colores tomados de los logos oficiales (priman sobre el manual).
   ========================================================================== */

@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-var.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --carbon: #14161c;
  --marfil: #f6f2ea;
  --azul: #31b9f6;
  --celeste: #59c7fa;
  --ambar: #fcab13;
  --amarillo: #fdc017;

  --text: var(--marfil);
  --text-muted: rgba(246, 242, 234, 0.66);
  --text-faint: rgba(246, 242, 234, 0.42);
  --line: rgba(246, 242, 234, 0.1);
  --line-strong: rgba(246, 242, 234, 0.22);
  --ok: #9cb7ab;
  --error: #ff8a7a;

  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  --gutter: clamp(16px, 4.5vw, 56px);
  --section-y: clamp(64px, 8vw, 112px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Movimiento: los actualiza main.js (mouse de -1 a 1, scroll en px) */
  --mx: 0;
  --my: 0;
  --sy: 0;

  color-scheme: dark;
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--carbon);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--celeste); outline-offset: 4px; }
::selection { background: var(--azul); color: var(--carbon); }

.container {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ambar);
  color: var(--carbon);
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

/* ---------- Botón ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), transform 0.35s var(--ease);
}

.btn-primary { background: var(--ambar); color: var(--carbon); }
.btn-primary:hover { background: var(--amarillo); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--celeste); color: var(--celeste); }
.btn-arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.btn-ghost:hover .btn-arrow { transform: translateY(3px); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn[disabled] { opacity: 0.7; cursor: progress; }

.btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(20, 22, 28, 0.3);
  border-top-color: var(--carbon);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header ---------- */

.site-header { position: relative; z-index: 10; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
}

.brand img { width: 140px; height: auto; }

.header-nav { display: flex; align-items: center; gap: 28px; }
.header-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.header-link:hover { color: var(--text); }

.header-cta {
  position: relative;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  padding-block: 6px;
}
.header-cta::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--ambar);
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.header-cta:hover::after { transform: scaleX(1); }

/* ---------- Portada ---------- */

.hero {
  position: relative;
  margin-top: -80px;          /* la trama de puntos pasa por detrás del header */
  padding-top: 80px;
  overflow: hidden;
}

.dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 62% 45%, #000 25%, transparent 80%);
          mask-image: radial-gradient(ellipse 75% 85% at 62% 45%, #000 25%, transparent 80%);
}

.hero-inner {
  z-index: 1;
  min-height: min(calc(100svh - 80px), 680px);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding-block: clamp(24px, 4vw, 48px) clamp(48px, 6vw, 80px);
}

.hero-title {
  font-size: clamp(1.75rem, 2.9vw, 2.45rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

/* Cada línea del título sube desde una máscara */
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero-title .line > span { display: inline-block; }
@media (min-width: 901px) { .hero-title .line > span { white-space: nowrap; } }
.js .hero-title .line > span {
  transform: translateY(105%);
  animation: sube 0.9s var(--ease) forwards;
}
.js .hero-title .line:nth-child(2) > span { animation-delay: 0.08s; }
.js .hero-title .line:nth-child(3) > span { animation-delay: 0.16s; }
@keyframes sube { to { transform: none; } }

.hero-lead {
  margin: 20px 0 32px;
  max-width: 40ch;
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  color: var(--text-muted);
}

.js .hero-lead,
.js .hero-copy .btn {
  opacity: 0;
  animation: aparece-suave 0.8s var(--ease) 0.45s forwards;
}
.js .hero-copy .btn { animation-delay: 0.55s; }
@keyframes aparece-suave { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }

/* Símbolo: se desplaza un poco con el mouse y más lento que la página al bajar.
   (No se rota ni se inclina, como pide el manual.) */
.hero-symbol {
  justify-self: center;
  width: min(100%, 460px);
  transform: translate3d(calc(var(--mx) * 10px), calc(var(--my) * 8px + var(--sy) * 0.18px), 0);
  transition: transform 0.6s var(--ease), opacity 0.2s;
}

.lazo { width: 100%; height: auto; overflow: visible; }

/* Entrada del símbolo: el azul (la idea) desde la izquierda, el ámbar
   (la ejecución) desde la derecha; los trazos se cruzan y aparece el centro. */
.lz { transform-box: fill-box; transform-origin: center; }

.js .hero-symbol .lz-idea,
.js .hero-symbol .lz-cruce-idea {
  clip-path: inset(-12% 112% -12% -12%);
  animation: entra 1s var(--ease) forwards;
}
.js .hero-symbol .lz-ejecucion,
.js .hero-symbol .lz-cruce-ejecucion {
  clip-path: inset(-12% -12% -12% 112%);
  animation: entra 1s var(--ease) forwards;
}
.js .hero-symbol .lz-idea            { animation-delay: 0.15s; }
.js .hero-symbol .lz-ejecucion       { animation-delay: 0.3s; }
.js .hero-symbol .lz-cruce-idea      { animation-delay: 0.75s; }
.js .hero-symbol .lz-cruce-ejecucion { animation-delay: 0.85s; }

.js .hero-symbol .lz-centro,
.js .hero-symbol .lz-centro-fondo {
  opacity: 0;
  transform: scale(0.4);
  animation: aparece 0.6s var(--ease) 1.35s forwards;
}

@keyframes entra   { to { clip-path: inset(-12% -12% -12% -12%); } }
@keyframes aparece { to { opacity: 1; transform: none; } }

/* ---------- Fragmentos decorativos ---------- */

.frags { position: absolute; inset: 0; pointer-events: none; }

.frag {
  position: absolute;
  pointer-events: none;
  transform: translate3d(calc(var(--mx) * var(--d) * 1px), calc(var(--my) * var(--d) * 1px + var(--sy) * var(--s) * 1px), 0);
  transition: transform 0.8s var(--ease);
}

.frag-1 { width: 30px; top: 22%; left: 47%; }
.frag-2 { width: 18px; bottom: 16%; left: 40%; }
.frag-3 { width: 84px; top: 14%; right: 5%; opacity: 0.16; }
.frag-4 { width: 110px; bottom: 10%; right: 36%; opacity: 0.14; }
.frag-5 { width: 90px; top: 20px; right: 3%; opacity: 0.3; }

.js .frags .frag { opacity: 0; animation: frag-in 1s var(--ease) 1.2s forwards; }
.js .frags .frag-3 { --o: 0.16; }
.js .frags .frag-4 { --o: 0.14; }
@keyframes frag-in { to { opacity: var(--o, 1); } }

/* ---------- Cinta ---------- */

.ribbon {
  position: relative;
  overflow: hidden;
  padding-block: 18px;
  border-block: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

/* El movimiento lo controla main.js: se repite según el ancho de pantalla
   y acelera un poco al hacer scroll, sin dejar huecos. */
.ribbon-track {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
}

.ribbon-track > * { margin-right: 32px; flex: none; }

.ribbon-track span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  letter-spacing: -0.02em;
  color: rgba(246, 242, 234, 0.42);
  transition: color 0.3s;
}
.ribbon-track span:hover { color: var(--marfil); }

.ribbon-track i {
  width: 14px; height: 9px;
  clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%);
}
.r-azul  { background: var(--azul); }
.r-ambar { background: var(--ambar); }

/* ---------- Qué construimos ---------- */

.build { position: relative; padding-block: var(--section-y); }

.build-head { margin-bottom: clamp(32px, 4.5vw, 52px); }

/* El título queda como antesala; la frase de la servilleta es la protagonista */
.build-head h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(0.98rem, 1.3vw, 1.1rem);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.build-head h2::before {
  content: "";
  width: 28px; height: 2px;
  background: linear-gradient(90deg, var(--azul), var(--ambar));
}

.build-statement {
  max-width: 24ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.build-statement .t-azul,
.build-statement .t-ambar { font-weight: inherit; }

.build-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
}

.build-item {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1.15fr) minmax(0, 1fr) 96px;
  align-items: baseline;
  gap: 6px 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-strong);
  transition: background-color 0.4s var(--ease);
}
.build-item:hover { background: rgba(246, 242, 234, 0.025); }

/* Línea de la idea (azul) a la ejecución (ámbar) */
.build-item::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--azul), var(--ambar));
  transform: scaleX(0);
  opacity: 0;
  transform-origin: left;
  transition: transform 0.6s var(--ease), opacity 0.2s;
}
.build-item:hover::after { transform: scaleX(1); opacity: 1; }

.build-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-faint);
  transition: color 0.3s;
}
.build-item:hover .build-num { color: var(--ambar); }

.build-item h3 {
  font-size: clamp(1.1rem, 1.65vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  transition: transform 0.5s var(--ease);
}
.build-item:hover h3 { transform: translateX(8px); }

.build-item p { color: var(--text-muted); font-size: 0.97rem; }

.build-arrow {
  justify-self: end;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  color: var(--ambar);
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease);
}
.build-item:hover .build-arrow,
.build-item:focus-within .build-arrow { opacity: 1; transform: none; }

/* Toda la fila es clicable: lleva al formulario con el mensaje empezado */
.build-item { cursor: pointer; }
.build-link { color: inherit; }
.build-link::after { content: ""; position: absolute; inset: 0; }
.build-link:focus-visible { outline: none; }
.build-item:focus-within { outline: 2px solid var(--celeste); outline-offset: 4px; border-radius: 4px; }

.js .build-item.reveal { transform: translateX(-24px); }
.js .build-item.reveal.is-visible { transform: none; }

/* ---------- Juego: Cruce ---------- */

.play { padding-block: var(--section-y) 0; }
.play-head h2 span { color: var(--ambar); }

.play-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 40px;
  margin-bottom: clamp(20px, 3vw, 32px);
}
.play-head h2 { font-size: clamp(1.6rem, 2.8vw, 2.4rem); }
.play-head p { max-width: 46ch; color: var(--text-muted); }
.t-azul { color: var(--celeste); font-weight: 700; }
.t-ambar { color: var(--ambar); font-weight: 700; }

.game {
  position: relative;
  aspect-ratio: 16 / 8;
  max-height: 72vh;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  overflow: hidden;
  background: #101217;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
          user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.game:focus { outline: none; }
.game:focus-visible { outline: 2px solid var(--celeste); outline-offset: 4px; }

.game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.game-hud {
  position: absolute;
  top: 16px; left: 20px; right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.3s;
}
.game[data-state="idle"] .game-hud { opacity: 0; }

.hud-stage {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--celeste);
}
.hud-right { display: flex; align-items: baseline; gap: 10px; }
.hud-score { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-combo { font-size: 1rem; color: var(--ambar); }

.game-screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: rgba(16, 18, 23, 0.62);
  cursor: default;
}
.game-screen[hidden] { display: none; }

.game-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  letter-spacing: -0.05em;
  line-height: 1;
  background: linear-gradient(90deg, var(--celeste) 0 48%, var(--ambar) 52% 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.game-help { color: var(--text-muted); max-width: 34ch; margin-bottom: 8px; }
.game-help kbd {
  font-family: var(--font-display);
  font-size: 0.8em;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.game-sound {
  position: absolute;
  right: 14px; bottom: 14px;
  z-index: 2;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(16, 18, 23, 0.7);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.game-sound:hover { color: var(--text); border-color: var(--celeste); }
.game-sound svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.game-sound .ico-off,
.game-sound.is-muted .ico-on { display: none; }
.game-sound.is-muted .ico-off { display: block; }

.go-title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.go-score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 6.5vw, 4.2rem);
  line-height: 1;
  color: var(--ambar);
  font-variant-numeric: tabular-nums;
}
.go-best { color: var(--text-faint); font-size: 0.88rem; margin-bottom: 14px; }
.go-actions { display: grid; justify-items: center; gap: 12px; grid-auto-flow: column; }

/* Franja inferior: el mensaje comercial, separado del resultado */
.game-over { padding-bottom: 96px; background: rgba(16, 18, 23, 0.88); }
.game-over .go-score { color: var(--marfil); }

/* El ámbar queda solo en la franja: es lo primero que ve el ojo */
.go-tip {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 24px;
  padding: 18px 28px;
  background:
    linear-gradient(90deg, rgba(49, 185, 246, 0.16), rgba(252, 171, 19, 0.16)),
    #14171d;
  text-align: center;
  animation: franja-sube 0.6s var(--ease) 0.35s both;
}
.go-tip::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--azul), var(--ambar));
  transform-origin: left;
  animation: linea-crece 0.8s var(--ease) 0.6s both;
}
.go-tip-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--marfil);
}
.go-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ambar);
  color: var(--carbon);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: 0 0 0 0 rgba(252, 171, 19, 0.55);
  animation: llama 1.6s ease-out 1s 2;
  transition: background-color 0.2s;
}
.go-cta:hover { background: var(--amarillo); }
.go-cta-arrow { display: inline-block; animation: empuja 1.2s ease-in-out 1.2s infinite; }

@keyframes franja-sube { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes linea-crece { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes llama {
  0%   { box-shadow: 0 0 0 0 rgba(252, 171, 19, 0.55); }
  100% { box-shadow: 0 0 0 16px rgba(252, 171, 19, 0); }
}
@keyframes empuja { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

/* ---- Victoria: completó los 5 niveles ---- */
.game-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }

.game-screen { isolation: isolate; }
.game-over.is-win { background: rgba(16, 18, 23, 0.72); }
.game-over.is-win::before {                      /* destello cálido detrás del título */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 38%, rgba(253, 192, 23, 0.28), rgba(49, 185, 246, 0.08) 40%, transparent 65%);
  animation: destello 1.4s ease-out both;
  pointer-events: none;
}
.game-over.is-win .go-title {
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 1;
  padding-bottom: 0.08em;
  background: linear-gradient(90deg, var(--celeste), var(--amarillo) 60%, var(--ambar));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: victoria 0.9s var(--ease) both;
}
.game-over.is-win .go-score { font-size: clamp(2rem, 4.5vw, 3rem); animation: aparece-suave 0.6s var(--ease) 0.35s both; }
.game-over.is-win .go-best { color: var(--text-muted); animation: aparece-suave 0.6s var(--ease) 0.5s both; }
.game-over.is-win .go-actions { animation: aparece-suave 0.6s var(--ease) 0.65s both; }

@keyframes victoria {
  0%   { transform: scale(0.55); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes destello {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  100% { opacity: 0.45; }
}

/* En el resumen y el panel de marca, sin marcador ni botón de sonido de fondo */
.game[data-state="over"] .game-hud { opacity: 0; }
.game[data-state="over"] .game-sound { display: none; }
.brand-form .go-actions { grid-auto-flow: row; }
.game-screen .btn { min-height: 44px; padding: 0 22px; }

/* Ponle tu marca */
.brand-form {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(100%, 380px);
}
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.brand-field { display: grid; gap: 6px; width: 100%; text-align: left; }
.brand-field span,
.brand-color span { font-family: var(--font-display); font-weight: 600; font-size: 0.8rem; color: var(--text-muted); }
.brand-field input {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  color: var(--text);
  background: var(--carbon);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}
.brand-field input:focus { outline: none; border-color: var(--celeste); }
.brand-colors { display: flex; gap: 24px; }
.brand-color { display: grid; justify-items: center; gap: 6px; cursor: pointer; }
.brand-color input {
  width: 56px; height: 56px;
  padding: 0;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  background: none;
  cursor: pointer;
}
.brand-color input::-webkit-color-swatch-wrapper { padding: 4px; }
.brand-color input::-webkit-color-swatch { border: 0; border-radius: 9px; }
.brand-color input::-moz-color-swatch { border: 0; border-radius: 9px; }
.brand-reset {
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.brand-reset:hover { color: var(--text); }

@media (max-width: 520px) {
  .go-actions { grid-auto-flow: row; }
  .go-tip { padding: 14px 16px; flex-direction: column; gap: 10px; }
  .game-over { padding-bottom: 128px; }
  .go-tip-text { font-size: 0.9rem; }
  .go-cta { font-size: 0.88rem; min-height: 40px; }
  .go-score { font-size: 2.6rem; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Contacto ---------- */

.contact {
  position: relative;
  overflow: hidden;
  padding-block: var(--section-y);
  border-top: 1px solid var(--line);
}

/* Trazos cruzados a 33° que se dibujan */
.cross {
  position: absolute;
  left: -4%;
  bottom: -14%;
  width: min(620px, 70vw);
  opacity: 0.3;
  pointer-events: none;
}
.cross line {
  fill: none;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.8s var(--ease);
}
.cross-a { stroke: var(--azul); }
.cross-b { stroke: var(--ambar); transition-delay: 0.25s !important; }
.contact.is-drawn .cross line,
html:not(.js) .cross line { stroke-dashoffset: 0; }

.contact-inner {
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.contact-copy h2 { font-size: clamp(1.8rem, 3.2vw, 2.7rem); letter-spacing: -0.03em; }
.contact-copy h2 span { color: var(--ambar); }
.contact-copy .contact-highlight { color: var(--celeste); font-weight: 700; }
.contact-copy p {
  margin-top: 18px;
  max-width: 40ch;
  color: var(--text-muted);
}

/* ---- Cierre: los 3 pasos que reaccionan al formulario ---- */
.close-title {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
}
.contact-copy .close-title { color: var(--text); }

.close-steps {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 26px;
  max-width: 42ch;
}

.cs-step {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 16px;
  --f: 0;                                   /* avance hacia el siguiente paso (0 a 1) */
}

/* Línea guía hacia el siguiente paso */
.cs-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 11px; top: 22px; bottom: -24px;
  width: 3px;
  border-radius: 2px;
  background: var(--line);
}
/* Relleno de idea (azul) a ejecución (ámbar) */
.cs-fill {
  position: absolute;
  left: 11px; top: 22px; bottom: -24px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--azul), var(--ambar));
  transform: scaleY(var(--f));
  transform-origin: top;
  transition: transform 0.6s var(--ease);
}

.cs-node {
  position: relative;
  z-index: 1;
  width: 25px; height: 16px;
  margin-top: 4px;
  clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%);
  background: var(--line-strong);
  transition: background-color 0.4s;
}
.cs-node::after {                          /* hueco interior: rombo en contorno */
  content: "";
  position: absolute;
  inset: 3px 4px;
  clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%);
  background: var(--carbon);
  transition: opacity 0.4s;
}
.cs-step.is-active .cs-node { background: var(--celeste); animation: late 1.8s ease-in-out infinite; }
.cs-step.is-done .cs-node { background: var(--ambar); animation: none; }
.cs-step.is-done .cs-node::after { opacity: 0; }
@keyframes late { 50% { opacity: 0.45; } }

.cs-step h3 {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  transition: color 0.4s;
}
.cs-step.is-active h3,
.cs-step.is-done h3 { color: var(--text); }
.contact-copy .cs-step p {
  margin-top: 3px;
  font-size: 0.93rem;
  color: var(--text-faint);
}

/* Cuando el formulario está completo, el botón se destaca */
.contact-form.is-ready .btn-primary { box-shadow: 0 0 0 0 rgba(252, 171, 19, 0.5); animation: llama 1.6s ease-out 2; }

/* ---- Al enviar: el símbolo se arma donde estaba el formulario ---- */
/* La columna derecha ocupa todo el alto para centrar la confirmación */
.contact-side { align-self: stretch; display: grid; }
.contact-done {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 10px;
  height: 100%;
  padding: 24px 0;
}
.contact-done[hidden] { display: none; }
.contact-done:focus { outline: none; }
.done-art { width: clamp(200px, 22vw, 300px); margin-bottom: 18px; }
.done-art svg { width: 100%; height: auto; overflow: visible; display: block; }

/* Misma entrada que en la portada: azul por la izquierda, ámbar por la derecha */
.contact-done .lz-idea,
.contact-done .lz-cruce-idea {
  clip-path: inset(-12% 112% -12% -12%);
  animation: entra 1s var(--ease) forwards;
}
.contact-done .lz-ejecucion,
.contact-done .lz-cruce-ejecucion {
  clip-path: inset(-12% -12% -12% 112%);
  animation: entra 1s var(--ease) forwards;
}
.contact-done .lz-idea            { animation-delay: 0.1s; }
.contact-done .lz-ejecucion       { animation-delay: 0.25s; }
.contact-done .lz-cruce-idea      { animation-delay: 0.7s; }
.contact-done .lz-cruce-ejecucion { animation-delay: 0.8s; }
.contact-done .lz-centro,
.contact-done .lz-centro-fondo {
  opacity: 0;
  transform: scale(0.4);
  animation: aparece 0.6s var(--ease) 1.3s forwards;
}

.done-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 3.6vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ambar);
  animation: aparece-suave 0.7s var(--ease) 1.4s both;
}
.done-text {
  max-width: 34ch;
  font-size: 1.05rem;
  color: var(--text-muted);
  animation: aparece-suave 0.7s var(--ease) 1.55s both;
}
.done-text .t-azul, .done-text .t-ambar { font-weight: 700; }
.done-text strong { color: var(--text); font-weight: 600; word-break: break-all; }
.done-again {
  margin-top: 10px;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  animation: aparece-suave 0.7s var(--ease) 1.7s both;
}
.done-again:hover { color: var(--text); }

.contact-form { display: grid; gap: 22px; align-content: start; }
.contact-form[hidden] { display: none; }

.field { display: grid; gap: 4px; }

.field label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 8px 0 10px;
  font: inherit;
  font-size: 1.02rem;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field textarea { resize: vertical; min-height: 92px; }
.field textarea::placeholder { color: var(--text-faint); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--celeste);
  box-shadow: 0 1px 0 0 var(--celeste);
}

.field.has-error input,
.field.has-error textarea { border-bottom-color: var(--error); }
.field-error { font-size: 0.85rem; color: var(--error); }

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  cursor: pointer;
}
.check input {
  flex: none;
  width: 18px; height: 18px;
  margin: 1px 0 0;
  accent-color: var(--ambar);
}
.check a { color: var(--celeste); text-decoration: underline; text-underline-offset: 2px; }
.check.has-error span { color: var(--error); }

.contact-form .btn { justify-self: start; min-width: 160px; }

.hp {
  position: absolute !important;
  left: -10000px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.form-status { min-height: 1.6em; font-size: 0.95rem; font-weight: 600; margin-top: -6px; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-error { color: var(--error); }

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

.site-footer { border-top: 1px solid var(--line); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 28px;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.footer-inner img { width: 120px; height: auto; }
.footer-inner a { text-decoration: underline; text-underline-offset: 2px; }
.footer-inner a:hover { color: var(--text); }

/* ---------- Aparición al hacer scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), background-color 0.4s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Página legal ---------- */

.legal { padding-block: clamp(40px, 6vw, 80px) var(--section-y); }
.legal .container { max-width: 780px; }
.legal h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 8px; }
.legal .legal-date { color: var(--text-faint); font-size: 0.9rem; margin-bottom: 36px; }
.legal h2 { font-size: 1.1rem; margin: 32px 0 10px; letter-spacing: -0.01em; }
.legal p, .legal li { color: var(--text-muted); }
.legal p + p { margin-top: 10px; }
.legal ul { padding-left: 20px; margin: 8px 0 0; }
.legal li + li { margin-top: 4px; }
.legal a { color: var(--celeste); text-decoration: underline; text-underline-offset: 2px; }
.legal .pendiente { color: var(--ambar); font-weight: 600; }

.legal .legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, gap 0.2s;
}
.legal .legal-back:hover { color: var(--text); gap: 12px; }
.legal .legal-back-btn { margin-top: 44px; color: var(--carbon); text-decoration: none; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 8px;
  }
  .hero-symbol { order: -1; justify-self: start; width: min(64%, 320px); }
  .frag-1 { top: 12%; left: auto; right: 12%; }
  .frag-2, .frag-4 { display: none; }
  .frag-5 { width: 56px; top: 20px; right: var(--gutter); opacity: 0.25; }
  .build-item { grid-template-columns: 40px minmax(0, 1fr); }
  .build-item p { grid-column: 2; }
  .build-arrow { position: absolute; right: 0; top: 22px; opacity: 1; transform: none; font-size: 0.85rem; }
  .build-item h3 { padding-right: 96px; }
  .contact-inner { grid-template-columns: 1fr; }
  .game { aspect-ratio: 4 / 5; max-height: 78vh; }
}

@media (max-width: 520px) {
  .header-inner { min-height: 68px; }
  .hero { margin-top: -68px; padding-top: 68px; }
  .brand img { width: 120px; }
  .hero-title .line { display: inline; overflow: visible; }
  .js .hero-title .line > span { display: inline; transform: none; animation: none; }
  .hero-copy .btn,
  .contact-form .btn { width: 100%; justify-self: stretch; }
  .build-item { grid-template-columns: 1fr; gap: 4px; }
  .build-item p { grid-column: 1; }
  .build-item:hover h3 { transform: none; }
  .frag-3 { width: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
  .ribbon-track { animation: none; translate: none; }
  .js .reveal { opacity: 1; transform: none; }
}
