/* El juego que construimos entre todos · Kairis Comunidad
   v0.0 — Génesis. Estética de marca Kairis (conceptualismo humanista).
   Tokens heredados de estilo-kairis.md. */

:root {
  /* Fondos */
  --bg-canvas: #EEF1EA;
  --bg-paper: #F7F5EF;
  --bg-ink: #171714;

  /* Texto */
  --text-primary: #171714;
  --text-secondary: #56554F;
  --text-on-ink: #F7F5EF;
  --text-on-ink-dim: #A8A69E;

  /* Líneas */
  --line-soft: #D7D2C9;
  --line-hair: rgba(247, 245, 239, 0.10);

  /* Acentos (los 4 pilares = los 4 futuros equipos) */
  --accent-tech: #6F8FA6;
  --accent-sage: #9FB4A3;
  --accent-human: #D08A6C; /* terracota · kairós */
  --accent-lime: #C8D39B;

  /* Paleta de la escena v0.1 · "El Primer Latido" (votada por la comunidad) */
  --color-arena: #D8B77A;
  --color-arena-deep: #C2A063;
  --color-noche: #151515;
  --color-verde-vida: #6FCF5F;
  --color-lima-vida: #C7FF4A;
  --color-terracotta: #B76545;

  /* Tipografía */
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* ---------- Fondo de partículas (reutilizable) ---------- */
#bg-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}
/* El contenido va por encima del fondo. OJO: solo elementos en flujo normal;
   .modal y .consent son position:fixed y NO deben volverse relative. */
body > .topbar,
body > .intro-banner,
body > main,
body > section,
body > footer { position: relative; z-index: 1; }
/* .modal y .consent ya son fixed: solo elevamos su capa, sin tocar position */
body > .modal { z-index: 100; }
body > .consent { z-index: 200; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-ink);
  color: var(--text-on-ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   FONDO ATMOSFÉRICO DE LA ESCENA (no partículas)
   Capas: degradado arena→noche + halo de luz superior + halo
   verde del "latido" + grano sutil. Fijo, cubre el viewport.
   ============================================================ */
/* Fondo PLANO color arena (sin degradado típico). La "noche" entra solo como
   viñeta muy sutil en los bordes, y un grano fino para dar textura. */
body.page-scene { background: var(--color-arena); color: #2a2114; }

.scene-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--color-arena);
}
/* Grano fino para romper el plano vectorial (textura ligera, sin imágenes) */
.scene-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
/* Viñeta muy sutil para asentar (presencia "noche" mínima, no degradado central) */
.scene-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(135% 115% at 50% 42%, rgba(0,0,0,0) 62%, rgba(21,21,21,0.22) 100%);
}
/* Velo de OSCURIDAD según el enigma (--mood-dark: 0 claro → 1 muy oscuro).
   En enigmas difíciles, el mundo se cierra en penumbra fría (misterio). */
:root { --mood-dark: 0; }
body.page-scene::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--mood-dark, 0);
  background:
    radial-gradient(120% 100% at 50% 44%, rgba(8,6,16,0) 28%, rgba(8,6,16,0.86) 100%),
    linear-gradient(180deg, rgba(14,11,26,0.4), rgba(6,5,12,0.65));
  transition: opacity 0.55s var(--ease);
}

/* ---------- Banner explicativo (una vez por semana) ---------- */
.intro-banner[hidden] { display: none !important; }
.intro-banner {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 46px 12px 20px;
  background: var(--accent-human);
  color: var(--bg-ink);
}

.intro-banner__text {
  margin: 0 auto;
  max-width: 760px;
  font-size: 13.5px;
  line-height: 1.5;
  text-align: center;
}
.intro-banner__text strong { font-weight: 700; }
.intro-banner__text em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
}

.intro-banner__close {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: rgba(23, 23, 20, 0.12);
  color: var(--bg-ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.intro-banner__close:hover { background: rgba(23, 23, 20, 0.22); }

/* Cuando hay banner, la versión flotante no se solapa con él. */
body.has-banner .topbar { position: absolute; }

/* ---------- Barra superior: la versión, siempre presente ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-end;
  padding: 18px 22px;
  z-index: 10;
  pointer-events: none;
}

.version {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-on-ink-dim);
  border: 1px solid var(--line-hair);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(247, 245, 239, 0.03);
  pointer-events: auto;
}

/* ---------- Génesis ---------- */
.genesis {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 64px;
  max-width: 620px;
  margin: 0 auto;
}

.kmark {
  width: 96px;
  height: 96px;
  margin-bottom: 36px;
  animation: latido 3.4s var(--ease) infinite;
  transform-origin: center;
}

.kmark .k { width: 100%; height: 100%; display: block; }

@keyframes latido {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50%      { transform: scale(1.06); opacity: 1; }
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-human);
  margin: 0 0 18px;
}

.manifesto {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 8vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  max-width: 14ch;
}

.manifesto em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-human);
}

.lead {
  font-size: clamp(16px, 2.4vw, 19px);
  line-height: 1.6;
  color: var(--text-on-ink);
  max-width: 48ch;
  margin: 0 0 18px;
}

.ritual {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-on-ink-dim);
  max-width: 46ch;
  margin: 0 0 28px;
}

/* Botón principal: ir a votar (texto claro sobre terracota profundo = buen contraste) */
.vote-cta {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  color: #FFF6F0;
  background: var(--color-terracotta);
  text-decoration: none;
  padding: 15px 26px;
  border-radius: var(--radius-pill, 999px);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
  box-shadow: 0 8px 24px rgba(133, 60, 32, 0.28);
}

.vote-cta:hover {
  transform: translateY(-2px);
  background: #a3542f;
}

.cta-note {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: var(--text-on-ink-dim);
  margin: 16px 0 0;
  max-width: 40ch;
}

/* ============================================================
   v0.1 · LAYOUT JUEGO / EXPLICACIÓN
   Arriba el JUEGO (pantalla casi completa). Abajo la EXPLICACIÓN.
   ============================================================ */
/* Pantalla dividida: el JUEGO arriba, el FOOTER abajo, ambos visibles sin scroll.
   Reparto: juego ~78% de la altura, footer ~22%. */
body.page-scene {
  height: 100svh;
  overflow: hidden;             /* nada de scroll en la home: todo cabe */
}

.game {
  position: relative;
  flex: 0 0 90%;                 /* el juego ocupa el 90% de la pantalla */
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px 10px;
  overflow: hidden;
}

/* Palabras inspiradoras flotando muy tenues en el fondo del juego */
.scene-words {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.scene-word {
  position: absolute;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(14px, 3.5vw, 26px);
  color: rgba(58, 45, 20, 0.16);
  white-space: nowrap;
  animation: wordDrift 16s ease-in-out infinite alternate;
}
@keyframes wordDrift {
  from { transform: translateY(-6px); opacity: 0.5; }
  to   { transform: translateY(6px); opacity: 1; }
}

.stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 560px;
}

.stage__phase {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: #4a3413;
  margin: 0 0 30px;
}

/* ============================================================
   v0.2 · "El guardián del mapa" — reto sobre tablero hexagonal
   ============================================================ */
.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;
}
.board {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* Tablero ambiental de fondo (canvas) detrás del reto */
.hexworld {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 60%, transparent 100%);
          mask-image: radial-gradient(circle at 50% 50%, #000 60%, transparent 100%);
}

/* El reto (por encima del tablero) */
.riddle {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 18px 6px 8px;
  transition: opacity 0.5s var(--ease);
}
.riddle--done { opacity: 0; pointer-events: none; }

.riddle__progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 18px;
}
.rdot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(30, 22, 8, 0.18);
  border: 1px solid rgba(30, 22, 8, 0.3);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.rdot--on {
  background: var(--color-verde-vida);
  border-color: var(--color-verde-vida);
  box-shadow: 0 0 10px rgba(111, 207, 95, 0.8);
}
/* Los enigmas difíciles se marcan con un punto de otro color (aviso de reto) */
.rdot--hard { border-color: rgba(150, 90, 200, 0.6); }
.rdot--hard.rdot--on {
  background: #b06adb;
  border-color: #b06adb;
  box-shadow: 0 0 12px rgba(176, 106, 219, 0.9);
}

.riddle__q {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(17px, 4.2vw, 22px);
  line-height: 1.4;
  color: #221a0c;
  margin: 0 auto 26px;
  max-width: 26ch;
  min-height: 2.6em;
  transition: color 0.5s var(--ease), text-shadow 0.5s var(--ease);
}
/* Enigmas difíciles: el texto se aclara y brilla frío sobre la penumbra */
.stage__phase { transition: color 0.5s var(--ease); }
#riddle[data-mood="2"] .riddle__q { color: #e8e2d0; text-shadow: 0 0 14px rgba(120,150,220,0.4); }
#riddle[data-mood="3"] .riddle__q { color: #f0eef8; text-shadow: 0 0 18px rgba(150,170,255,0.55); }
#riddle[data-mood="2"] ~ .stage__hint,
#riddle[data-mood="3"] ~ .stage__hint { color: #b9c2e0; }
/* el rótulo de fase también se aclara en penumbra */
.stage:has(#riddle[data-mood="2"]) .stage__phase,
.stage:has(#riddle[data-mood="3"]) .stage__phase { color: #c7c2dc; }

/* Casillas hexagonales (2x2) */
.cells {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 280px;
  margin: 0 auto;
}
.cells--in .rcell { animation: cellIn 0.45s var(--ease) backwards; }
.cells--in .rcell { animation-delay: calc(var(--i) * 0.07s); }
@keyframes cellIn {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

.rcell {
  position: relative;
  aspect-ratio: 1 / 1;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  /* forma de hexágono */
  clip-path: polygon(50% 4%, 95% 27%, 95% 73%, 50% 96%, 5% 73%, 5% 27%);
  background: rgba(28, 22, 12, 0.14);
  box-shadow: inset 0 0 0 2px rgba(30, 22, 8, 0.45);
  transition: transform 0.2s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.rcell:hover {
  transform: translateY(-3px) scale(1.03);
  background: rgba(111, 207, 95, 0.16);
  box-shadow: inset 0 0 0 2px rgba(111, 207, 95, 0.7);
}
.rcell__sym {
  font-size: clamp(30px, 9vw, 44px);
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.rcell--correct {
  background: rgba(111, 207, 95, 0.4);
  box-shadow: inset 0 0 0 3px var(--color-verde-vida), 0 0 26px rgba(111,207,95,0.8);
  animation: cellPop 0.5s var(--ease);
}
@keyframes cellPop {
  0% { transform: scale(1); } 45% { transform: scale(1.18); } 100% { transform: scale(1.06); }
}
.rcell--wrong { animation: cellShake 0.5s var(--ease); }
@keyframes cellShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-7px); } 40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(5px); }
}

/* Mensaje de victoria */
.board__win[hidden] { display: none; }
.board__win {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 10px 8px;
}
.board__win--in { animation: oracleIn 0.7s var(--ease); }
.board__win-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 5.5vw, 30px);
  color: #1a1408;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.board__win-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(15px, 3.6vw, 18px);
  color: #5a4012;
  margin: 0 auto;
  max-width: 30ch;
}

/* --- Hexágono REGULAR + señal (legacy, no usado en v0.2) --- */
.hexwrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hexbtn {
  position: relative;
  width: clamp(230px, 70vw, 320px);
  aspect-ratio: 1 / 1;          /* hexágono regular: caja cuadrada */
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hexbtn[aria-disabled="true"] { cursor: default; }

.hexsvg { width: 100%; height: 100%; display: block; overflow: visible; }

/* Hexágono apagado: se ve que es "tocable" (contraste claro sobre arena) */
.hex {
  fill: rgba(21, 18, 10, 0.16);
  stroke: rgba(30, 22, 8, 0.6);
  stroke-width: 2.5;
  stroke-linejoin: round;
  transition: fill 0.6s var(--ease), stroke 0.6s var(--ease), filter 0.6s var(--ease);
}
.hex--lit-1 { stroke: rgba(111, 207, 95, 0.7); fill: rgba(21, 18, 10, 0.20); }
.hex--lit-2 { fill: rgba(111, 207, 95, 0.12); stroke: rgba(111, 207, 95, 0.9); }
.hex--awake {
  fill: rgba(111, 207, 95, 0.18);
  stroke: var(--color-verde-vida);
  stroke-width: 3;
  filter: drop-shadow(0 0 22px rgba(111, 207, 95, 0.7));
  animation: hexBreath 3.2s var(--ease) infinite;
}
@keyframes hexBreath {
  0%, 100% { filter: drop-shadow(0 0 16px rgba(111, 207, 95, 0.5)); }
  50%      { filter: drop-shadow(0 0 30px rgba(111, 207, 95, 0.85)); }
}

/* Aro indicador de "clicable" mientras está dormido (desaparece al despertar) */
.hexbtn::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 2px solid rgba(111, 207, 95, 0.0);
  pointer-events: none;
  animation: tapHint 2.6s var(--ease) infinite;
}
#scene[data-state="hablando"] .hexbtn::after,
#scene[data-state="completo"] .hexbtn::after { display: none; }
@keyframes tapHint {
  0%   { transform: scale(0.85); border-color: rgba(111, 207, 95, 0.0); }
  50%  { border-color: rgba(111, 207, 95, 0.22); }
  100% { transform: scale(1.15); border-color: rgba(111, 207, 95, 0.0); }
}

/* Relleno del hexágono que sube con cada frase leída */
.hexfill {
  opacity: 0.55;
  transition: y 0.7s var(--ease);
}
#scene[data-state="completo"] .hexfill { opacity: 0.78; }
/* Borde nítido por encima del relleno */
.hex-outline {
  fill: none;
  stroke: rgba(30, 22, 8, 0.6);
  stroke-width: 2.5;
  stroke-linejoin: round;
  transition: stroke 0.6s var(--ease);
}
#scene[data-state="completo"] .hex-outline { stroke: var(--color-verde-vida); stroke-width: 3; }

/* Señal de vida (verde/lima) */
.life {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.2);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
#scene[data-state="senal_aparece"] .life,
#scene[data-state="hablando"] .life,
#scene[data-state="completo"] .life {
  opacity: 1;
  transform: scale(1);
  animation: lifePulse 2.4s var(--ease) infinite;
}
@keyframes lifePulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50%      { transform: scale(1.22); opacity: 1; }
}
/* Empujón al tocar */
.life--bump { animation: lifeBump 0.4s var(--ease) !important; }
@keyframes lifeBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.7); }
  100% { transform: scale(1); }
}
#scene[data-state="completo"] .life {
  animation: lifePulse 1.6s var(--ease) infinite;
}

/* Vibración del hexágono al tocar */
.hexbtn--shake { animation: hexShake 0.4s var(--ease); }
@keyframes hexShake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-2px, 1px) rotate(-0.6deg); }
  50% { transform: translate(2px, -1px) rotate(0.6deg); }
  75% { transform: translate(-1px, 1px) rotate(-0.3deg); }
}

/* Ondas de pulso */
.pulses {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  border: 2px solid var(--color-lima-vida);
  opacity: 0.8;
  animation: pulseOut 1.1s var(--ease) forwards;
}
@keyframes pulseOut {
  0% { transform: scale(0.3); opacity: 0.8; }
  100% { transform: scale(3.4); opacity: 0; }
}

.stage__hint {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #45300f;
  margin: 28px 0 0;
  min-height: 1.2em;
  transition: opacity 0.4s var(--ease);
}
.stage__hint[hidden] { display: none; }

/* Frase del oráculo */
.oracle[hidden] { display: none; }
.oracle {
  margin: 26px auto 0;
  max-width: 30ch;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 4.4vw, 25px);
  line-height: 1.35;
  color: #221a0c;
  opacity: 0;
}
.oracle--in { animation: oracleIn 0.55s var(--ease) forwards; }
@keyframes oracleIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
/* Frase final, con más peso */
.oracle--final {
  font-style: normal;
  font-weight: 600;
  color: #1a1408;
}

/* Indicador de scroll hacia la explicación */
.scroll-cue {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #45300f;
  text-decoration: none;
  opacity: 0.9;
  animation: cueBob 2.2s var(--ease) infinite;
}
.scroll-cue:hover { opacity: 1; }
/* Al despertar, el mensaje ocupa ese espacio: ocultamos la pista de scroll */
#scene[data-state="despertar"] .scroll-cue,
#scene[data-state="final_v01"] .scroll-cue { display: none; }
@keyframes cueBob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 5px); }
}

/* ============================================================
   BARRA COMPACTA (.dock) · home. La explicación va en /proyecto.html
   ============================================================ */
/* Footer fijo del 10% de la pantalla en la home (juego = 90%) */
.dock {
  position: relative;
  z-index: 1;
  flex: 0 0 10%;
  min-height: 56px;             /* no menos de esto, aunque el 10% sea pequeño */
  display: flex;
  align-items: center;
  background: var(--bg-ink);
  color: var(--text-on-ink);
  border-top: 1px solid rgba(247, 245, 239, 0.12);
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px));
}
.dock__inner {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: row;          /* dos botones EN FILA, compactos */
  align-items: stretch;
  gap: 10px;
}

.dock-btn {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(13px, 3.6vw, 15px);
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-pill, 999px);
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.dock-btn:hover { transform: translateY(-2px); }
.dock-btn--ig {
  color: #FFF6F0;
  background: var(--color-terracotta);
  border: 1px solid var(--color-terracotta);
}
.dock-btn--ig:hover { background: #a3542f; }
.dock-btn--ghost {
  color: var(--text-on-ink);
  background: transparent;
  border: 1px solid rgba(247, 245, 239, 0.30);
}
.dock-btn--ghost:hover { border-color: var(--text-on-ink); }

.dock__next {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-on-ink-dim);
}
.dock__next strong { color: var(--accent-lime); font-weight: 600; }
.dock__approx { opacity: 0.7; }
.dock__time {
  color: var(--text-on-ink);
  font-variant-numeric: tabular-nums;
}

/* Chips de palabras (footer/proyecto) */
.info__cta-row { margin: 36px 0 0; }
.wordchips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.wordchip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent-lime);
  border: 1px solid rgba(200, 211, 155, 0.32);
  border-radius: var(--radius-pill, 999px);
  padding: 6px 14px;
  background: rgba(200, 211, 155, 0.06);
}

/* Countdown · etiqueta "(aprox.)" */
.countdown__approx {
  font-family: var(--font-mono);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-on-ink-dim);
}

/* En la página-escena (home), el badge de versión va sobre arena: ajuste de color */
body.page-scene .topbar { position: absolute; }
body.page-scene .version {
  color: #3a2810;
  border-color: rgba(30, 24, 12, 0.35);
  background: rgba(255, 252, 245, 0.55);
}

/* Temporizador hacia la próxima versión */
.countdown {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line-hair);
  width: 100%;
  max-width: 360px;
}

.countdown__label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-on-ink-dim);
  margin: 0 0 16px;
}
.countdown__label strong { color: var(--accent-lime); }

.countdown__clock {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 62px;
  padding: 12px 6px;
  background: rgba(247, 245, 239, 0.04);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-md, 18px);
}

.countdown__num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-on-ink);
  line-height: 1;
}

.countdown__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-ink-dim);
}

.countdown__clock--done .countdown__num { color: var(--accent-lime); }

.countdown__when {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-on-ink-dim);
  margin: 16px 0 0;
  text-transform: capitalize;
}

/* ---------- Página del diario ---------- */
.topbar--diary {
  justify-content: space-between;
}

.back-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-on-ink-dim);
  text-decoration: none;
  pointer-events: auto;
  transition: color 0.25s var(--ease);
}
.back-link:hover { color: var(--text-on-ink); }

.diary-page {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 110px 24px 56px;
}

.diary-page__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}
.diary-page__title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-human);
}

.diary-page .lead {
  text-align: left;
  margin-bottom: 28px;
}

.proyecto-toplink { margin: 0 0 30px; }

.diary-words { margin: 0 0 40px; }
.diary-words__title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-on-ink);
  margin: 0 0 14px;
}

/* Bloque introductorio del diario */
.diary-intro {
  background: rgba(247, 245, 239, 0.04);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-lg, 24px);
  padding: 22px;
  margin-bottom: 40px;
}

.diary-intro__text {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-on-ink);
}
.diary-intro__text strong { color: var(--accent-human); font-weight: 600; }

.diary-intro__cta {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--bg-ink);
  background: var(--accent-human);
  text-decoration: none;
  padding: 11px 20px;
  border-radius: var(--radius-pill, 999px);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.diary-intro__cta:hover { transform: translateY(-2px); background: #E0A083; }

.diary__empty {
  list-style: none;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-on-ink-dim);
}

.diary__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.diary__item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
}

.diary__v {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-human);
  padding-top: 2px;
}

.diary__head {
  margin: 0 0 4px;
  font-size: 15px;
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.diary__head time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-on-ink-dim);
}

.diary__change {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-on-ink-dim);
}

.diary__votes {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diary__vote {
  font-size: 13px;
  color: var(--text-on-ink-dim);
}

.diary__vote strong { color: var(--text-on-ink); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 22px 24px 30px;
}

.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.site-footer a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-on-ink-dim);
  text-decoration: none;
  opacity: 0.78;
  transition: opacity 0.25s var(--ease);
}

.site-footer a:hover { opacity: 1; }
.footer-link { text-decoration: underline; text-underline-offset: 3px; }

/* Enlace destacado al diario */
.footer-diary {
  font-family: var(--font-display) !important;
  font-weight: 700;
  font-size: 15px !important;
  letter-spacing: 0 !important;
  color: var(--accent-human) !important;
  text-decoration: none;
  padding: 10px 22px;
  border: 1px solid var(--accent-human);
  border-radius: var(--radius-pill, 999px);
  opacity: 1 !important;
  margin-bottom: 6px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.footer-diary:hover {
  transform: translateY(-2px);
  background: var(--accent-human);
  color: var(--bg-ink) !important;
}
.footer-sep { color: var(--text-on-ink-dim); opacity: 0.4; }
.powered-link strong { color: var(--accent-human); font-weight: 600; }

.site-footer__sign {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: var(--text-on-ink-dim);
  opacity: 0.7;
}

/* ---------- Popup de última actualización ---------- */
.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
body.modal-open { overflow: hidden; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 9, 0.72);
  backdrop-filter: blur(3px);
}

.modal__card {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(208, 138, 108, 0.18) 0%, rgba(208, 138, 108, 0) 60%),
    linear-gradient(180deg, #FBF9F4 0%, var(--bg-paper) 100%);
  color: var(--text-primary);
  border: 1px solid rgba(208, 138, 108, 0.18);
  border-radius: var(--radius-xl, 32px);
  padding: 34px 28px 28px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: modalIn 0.3s var(--ease);
}

/* Filo superior de acento, con los colores de la vida */
.modal__card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--accent-tech) 0%,
    var(--accent-sage) 33%,
    var(--accent-human) 66%,
    var(--accent-lime) 100%);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: rgba(23, 23, 20, 0.06);
  color: var(--text-primary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.modal__close:hover { background: rgba(23, 23, 20, 0.14); }

.modal__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-human-deep, #B5674A);
  margin: 0 0 12px;
}

.modal__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.modal__text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.modal__cta {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--bg-paper);
  background: var(--bg-ink);
  text-decoration: none;
  padding: 12px 22px;
  border-radius: var(--radius-pill, 999px);
  transition: transform 0.25s var(--ease);
}
.modal__cta:hover { transform: translateY(-2px); }

/* ---------- Banner de consentimiento de cookies ---------- */
.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  background: var(--bg-paper);
  color: var(--text-primary);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg, 24px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  padding: 18px 20px;
  max-width: 540px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.consent--show { opacity: 1; transform: none; }

.consent__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.consent__text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.consent__text strong { color: var(--text-primary); font-weight: 600; }
.consent__text a { color: var(--accent-human-deep, #B5674A); text-decoration: underline; text-underline-offset: 2px; }

.consent__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.consent__btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--radius-pill, 999px);
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.consent__btn:hover { transform: translateY(-1px); }
.consent__btn--ghost {
  background: transparent;
  border-color: var(--line-soft);
  color: var(--text-secondary);
}
.consent__btn--accept {
  background: var(--accent-human);
  color: var(--bg-ink);
}

@media (max-width: 460px) {
  .consent__actions { flex-direction: column-reverse; }
  .consent__btn { width: 100%; }
}

/* ---------- Páginas legales ---------- */
.legal-page {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 110px 24px 56px;
}
.legal-page h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.legal-page h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent-human); }
.legal-page .updated {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-on-ink-dim);
  margin: 0 0 36px;
}
.legal-page h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  margin: 34px 0 12px;
  color: var(--text-on-ink);
}
.legal-page p, .legal-page li {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-on-ink-dim);
}
.legal-page p { margin: 0 0 14px; }
.legal-page strong { color: var(--text-on-ink); font-weight: 600; }
.legal-page a { color: var(--accent-human); }
.legal-page ul { margin: 0 0 14px; padding-left: 20px; }
.legal-page li { margin-bottom: 6px; }
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 13.5px;
}
.legal-table th, .legal-table td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line-hair);
  color: var(--text-on-ink-dim);
  vertical-align: top;
}
.legal-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-on-ink);
  background: rgba(247, 245, 239, 0.03);
}

/* ---------- Accesibilidad ---------- */
@media (prefers-reduced-motion: reduce) {
  .kmark { animation: none; opacity: 1; }
  .modal__card { animation: none; }
  .consent { transition: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 560px) {
  .genesis { padding-top: 100px; }
}
