/* ==========================================================================
   ALEX OCAMPO — hoja de estilos
   Diseño: monocromo (#050505 / #e8e8e8), atmósfera de warehouse, mobile-first.
   ========================================================================== */

/* ---------- Tokens de diseño (variables CSS) ---------- */
:root {
  --bg:        #000000;  /* negro REAL — look noir */
  --ink:       #ffffff;  /* texto principal: blanco puro */
  --ink-dim:   #888;     /* texto secundario */
  --ink-faint: #555;     /* labels, detalles */
  --line:      #1c1c1c;  /* bordes finos */

  --ease-slow: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-slow:  1.2s;

  /* Grano de película: textura SVG generada inline (sin descargar imagen) */
  --grain-img: 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'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Mientras el overlay ENTER está activo, no se puede hacer scroll */
body.is-locked { overflow: hidden; height: 100vh; height: 100svh; }

::selection { background: var(--ink); color: var(--bg); }

/* ==========================================================================
   CAPAS DE FONDO
   ========================================================================== */

/* La niebla WebGL: fija, detrás de todo */
#fog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Respaldo sin WebGL: oculto por defecto */
#fog-fallback { display: none; }

body.no-webgl #fog { display: none; }
body.no-webgl #fog-fallback {
  display: block;
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 50% 38%, rgba(190,190,190,0.16), transparent 70%),
    radial-gradient(ellipse 60% 45% at 30% 60%, rgba(160,160,160,0.08), transparent 70%),
    var(--bg);
  background-size: 200% 200%, 220% 220%, 100% 100%;
  animation: fog-drift 40s ease-in-out infinite alternate;
}

@keyframes fog-drift {
  from { background-position: 0% 0%, 100% 100%, 0 0; }
  to   { background-position: 100% 30%, 0% 60%, 0 0; }
}

/* Grano de película sobre todo el sitio (muy sutil) */
#grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;          /* deja pasar los clics */
  background-image: var(--grain-img);
  opacity: 0.05;
}

/* ==========================================================================
   PANTALLA DE ENTRADA
   ========================================================================== */
#enter {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  text-align: center;
  transition: opacity 1.6s var(--ease-slow);
}

#enter.is-hidden { opacity: 0; pointer-events: none; }

.enter-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: clamp(1rem, 4vw, 1.4rem);
  letter-spacing: 0.55em;
  text-indent: 0.55em;            /* compensa el tracking al centrar */
  text-transform: uppercase;
  color: var(--ink-dim);
  animation: enter-breathe 5s ease-in-out infinite;
}

@keyframes enter-breathe {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

#enter-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid #3a3a3a;
  padding: 1.1rem 3.2rem;
  cursor: pointer;
  transition: border-color 0.8s ease, letter-spacing 0.8s ease,
              box-shadow 0.8s ease;
}

#enter-btn:hover,
#enter-btn:focus-visible {
  border-color: var(--ink);
  letter-spacing: 0.7em;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.08);
  outline: none;
}

.enter-hint {
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ==========================================================================
   CONTROL DE SONIDO
   ========================================================================== */
#sound-toggle {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 60;
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line);
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: color 0.5s ease, border-color 0.5s ease;
}

#sound-toggle:hover,
#sound-toggle:focus-visible { color: var(--ink); border-color: #3a3a3a; outline: none; }

/* ==========================================================================
   NOMBRE PERSISTENTE (barra superior)
   ========================================================================== */
/* Par visual del sound-toggle: nombre arriba a la izquierda, sonido a la
   derecha. Oculto sobre el hero (ahí ya está el AO gigante); main.js le
   pone .is-shown cuando el visitante pasa el hero. */
#topbar {
  position: fixed;
  top: 1.2rem;
  left: 1.2rem;
  z-index: 60;
  font-weight: 200;
  font-size: 0.7rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: #f2f2f2;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.55rem 0.45rem 0.55rem 0.9rem; /* derecha menor: el tracking ya deja aire */
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;                    /* invisible = no intercepta clics */
  transition: opacity 0.6s ease, transform 0.6s ease, color 0.5s ease;
}

#topbar.is-shown { opacity: 1; transform: none; pointer-events: auto; }

#topbar:hover,
#topbar:focus-visible { color: var(--ink); outline: none; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  min-height: 100vh;
  min-height: 100svh;             /* móvil: ignora la barra de URL */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 0 1rem;
}

/* Texto solo para buscadores y lectores de pantalla (invisible) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hero-name {
  position: relative;
  z-index: 0;
}

/* El monograma AO: Archivo ancha y negra (look "Monument Extended" de
   los sellos europeos). El texto es TRANSPARENTE: define la posición,
   pero lo visible es el canvas #veil que recorta su silueta en la niebla */
.hero-mark {
  display: block;
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-stretch: 125%;
  font-size: min(43vw, 40vh);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: transparent;
}

/* El "velo": oscurece el hero entero salvo la silueta de las letras.
   veil.js lo dibuja; aquí solo lo posicionamos cubriendo el hero. */
#veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* El tagline y la flecha viven POR ENCIMA del velo (no se oscurecen) */
.hero-tag { position: relative; z-index: 2; }
.hero-scroll { z-index: 2; }  /* ya es position:absolute más abajo */

/* El nombre completo: pequeño, fino, ultra-espaciado — el susurro bajo
   el símbolo. La jerarquía invertida es la declaración de estilo. */
.hero-sub {
  position: relative;
  z-index: 2;
  margin-top: 1.6rem;
  font-weight: 200;
  font-size: clamp(0.85rem, 3.4vw, 1.05rem);
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  text-transform: uppercase;
  color: #f2f2f2;
}

.hero-tag {
  margin-top: 1rem;
  font-size: clamp(0.55rem, 2.2vw, 0.68rem);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.hero-scroll {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-faint);
  text-decoration: none;
  font-size: 1.1rem;
  animation: scroll-bob 3s ease-in-out infinite;
  transition: color 0.5s ease;
}

.hero-scroll:hover { color: var(--ink); }

@keyframes scroll-bob {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.5; }
  50%      { transform: translate(-50%, 8px); opacity: 1; }
}

/* ==========================================================================
   SECCIONES
   ========================================================================== */
.section {
  max-width: 60rem;
  margin: 0 auto;
  padding: clamp(5rem, 14vh, 9rem) 1.5rem;
  /* Degradado para que el texto sea legible sobre la niebla,
     pero la niebla siga viva en los espacios entre secciones */
  background: linear-gradient(
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.82) 14%,
    rgba(0,0,0,0.82) 86%,
    rgba(0,0,0,0) 100%
  );
}

.section-label {
  font-size: 0.68rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

/* Línea fina antes del label */
.section-label::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 1px;
  background: var(--ink-faint);
}

/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

/* En pantallas anchas: foto a la izquierda, texto a la derecha */
@media (min-width: 720px) {
  .about-grid { grid-template-columns: 2fr 3fr; gap: 4rem; }
}

.photo-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  max-width: 24rem;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Tratamiento B/N noir — cualquier foto que pongas aquí lo hereda */
  filter: grayscale(1) contrast(1.3) brightness(0.95);
}

/* Grano + bordes que se funden con el negro de la página */
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain-img);
  opacity: 0.14;
  box-shadow: inset 0 0 70px 25px var(--bg);
  pointer-events: none;
}

/* Si la foto no carga: monograma fantasma en su lugar */
.photo-standin { display: none; }
.photo-missing img { display: none; }
.photo-missing .photo-standin {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 6rem;
  color: #161616;
  background: radial-gradient(ellipse at 50% 40%, #0d0d0d, var(--bg));
}

.about-text p { color: #b5b5b5; max-width: 38ch; }
.about-text p + p { margin-top: 1.2rem; color: var(--ink-dim); }

/* ---------- LISTEN ---------- */
.player-frame {
  border: 1px solid var(--line);
}

.player-frame iframe { display: block; border: 0; }

@media (max-width: 480px) {
  .player-frame iframe { height: 380px; }
}

/* ---------- CONNECT ---------- */
.links { list-style: none; }

.links li { border-bottom: 1px solid var(--line); }
.links li:first-child { border-top: 1px solid var(--line); }

.links a {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  padding: 1.1rem 0.2rem;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: clamp(1.5rem, 6.5vw, 2.3rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: #777;
  transition: color 0.6s ease, letter-spacing 0.9s var(--ease-slow),
              padding-left 0.9s var(--ease-slow);
}

/* Numeración pequeña al estilo tracklist */
.links a i {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
  min-width: 2rem;
}

.links a:hover,
.links a:focus-visible {
  color: var(--ink);
  letter-spacing: 0.13em;
  padding-left: 0.8rem;
  outline: none;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  max-width: 60rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem 3rem;
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.footer a {
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.5s ease;
}

.footer a:hover { color: var(--ink); }

.footer-copy {
  margin-top: 2rem;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: #3a3a3a;
  text-transform: uppercase;
}

/* ==========================================================================
   ANIMACIONES DE APARICIÓN (reveals al hacer scroll)
   main.js añade .is-visible cuando el elemento entra al viewport
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-slow),
              transform var(--dur-slow) var(--ease-slow);
}

.reveal.is-visible { opacity: 1; transform: none; }

/* Retardos escalonados para elementos hermanos */
.d1 { transition-delay: 0.12s; }
.d2 { transition-delay: 0.24s; }
.d3 { transition-delay: 0.36s; }
.d4 { transition-delay: 0.48s; }

/* ==========================================================================
   ACCESIBILIDAD: usuarios que prefieren menos movimiento
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal { opacity: 1; transform: none; transition: none; }

  .enter-name, .hero-scroll,
  body.no-webgl #fog-fallback { animation: none; }
}
