:root {
  --bg: #0A0A0A;
  --text: #F5F2EC;
  --muted: rgba(245, 242, 236, 0.68);
  --faint: rgba(245, 242, 236, 0.4);
  --accent: #E8A33D;
  /* ease-out largo con aterrizaje de pluma: las apariciones se sienten caras */
  --suave: cubic-bezier(0.22, 1, 0.36, 1);
}

@font-face {
  font-family: 'Domine';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/domine-v25-latin-500.woff2') format('woff2');
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* ---------- fondo: video en loop con poster a juego ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }

.bg-poster,
.bg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(5px) brightness(0.8);
  transform: scale(1.06);
}

.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

/* ---------- accesibilidad ---------- */
.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;
}

.skip-link {
  position: absolute;
  left: -9999px; top: 0;
  background: var(--bg);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  z-index: 10;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

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

/* ---------- toggle de idioma ---------- */
.lang-toggle {
  position: fixed;
  top: 1rem; right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  z-index: 5;
}

.lang-toggle button {
  background: none;
  border: 0;
  color: var(--faint);
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}

.lang-toggle button[aria-pressed="true"] { color: var(--text); font-weight: 600; }
.lang-toggle .sep { color: var(--faint); }

/* ---------- hero ---------- */
main {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 2rem 1.5rem 4rem;
  text-align: center;
}

#title-canvas {
  display: block;
  width: 96vw;
  height: clamp(300px, 56vh, 600px);
}

.subtitle {
  max-width: 34rem;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: 1.6;
  color: var(--muted);
  /* pegado al wordmark, como la línea siguiente (lo publica el JS) */
  margin-top: var(--subtitle-raise, 0px);
}

/* iconos de contacto en fila, centrados, en el flujo bajo el subtítulo */
.actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

/* coreografía del intro (una sola vez):
   subtítulo → aparece al abrirse el nombre, se va antes del repliegue.
   acciones + cromo → se levantan tras la desintegración y se quedan. */
/* --subtitle-shift lo publica el JS: centra el texto bajo el wordmark.
   visibility:hidden además de opacity: lo invisible NO debe ser tabulable */
.subtitle {
  opacity: 0;
  visibility: hidden;
  transform: translate(var(--subtitle-shift, 0px), 18px);
  pointer-events: none;
  transition: opacity 1.4s var(--suave), transform 1.4s var(--suave);
}

.actions {
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 1.4s var(--suave), transform 1.4s var(--suave);
}

.lang-toggle,
footer {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1.4s var(--suave);
}

body.show-subtitle .subtitle {
  opacity: 1;
  visibility: visible;
  transform: translate(var(--subtitle-shift, 0px), 0);
  pointer-events: auto;
}

body.show-actions .actions {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
body.show-actions .lang-toggle,
body.show-actions footer { opacity: 1; visibility: visible; pointer-events: auto; }

/* ---------- iconos de contacto: sin círculo, solo el trazo, flotando ---------- */
@keyframes flotar {
  from { transform: translateY(0); }
  to   { transform: translateY(-5px); }
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px; /* 30px de icono + 16 = 46px: target táctil AA */
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s ease;
  animation: flotar 3.4s ease-in-out infinite alternate;
}

.btn-icon + .btn-icon {
  animation-delay: -1.7s; /* desincronizados: viento, no metrónomo */
}

.btn-icon:hover {
  color: var(--accent);
}

/* ---------- footer ---------- */
footer {
  position: fixed;
  bottom: 1rem;
  left: 0; right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--faint);
}

/* ---------- móvil: solo ajuste de escala (el lockup ya es vertical) ---------- */
@media (max-width: 700px) {
  .subtitle {
    font-size: 0.95rem;
    max-width: 86vw;
  }
}

/* ---------- reduced motion: todo visible y quieto desde el frame 1 ---------- */
@media (prefers-reduced-motion: reduce) {
  .lang-toggle, footer {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: none;
  }
  .subtitle {
    opacity: 1;
    visibility: visible;
    transform: translate(var(--subtitle-shift, 0px), 0);
    pointer-events: auto;
    transition: none;
  }
  .actions {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: none;
  }
  .btn-icon {
    animation: none;
    transition: none;
  }
}
