/* ============================================
   UNKNOW — Hoja de estilos
   Paleta: #e6e3dc (fondo), #ff2a2a (acento), #0d0c0c (texto), #ffffff (cards)
   Tipografías: Playfair Display (títulos), Google Sans (cuerpo)
   ============================================ */

/* === Reset y base === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #e6e3dc;
  --red: #ff2a2a;
  --dark: #0d0c0c;
  --light: #e6dede;
  --white: #ffffff;
  --card-shadow: 0 4px 24px rgba(13, 12, 12, .10);
  --radius: 16px;
  /* Espacio reservado bajo la isla del header (portada / bitácora) */
  --page-header-reserve: 5.75rem;
}

html {
  overflow-x: hidden;
}

/* === Transiciones entre páginas (solo raíz, cortas, sin escala fuerte) === */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.28s;
  animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
}

::view-transition-old(root) {
  animation-name: fade-out;
}

::view-transition-new(root) {
  animation-name: fade-in;
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

body {
  font-family: 'Google Sans', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Portada y bitácora: columna ~90vh útil y pie pegado abajo */
body.page-stack {
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

body.page-stack .page-column {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: min(90dvh, calc(100svh - var(--page-header-reserve)));
  box-sizing: border-box;
}

body.page-stack .page-column > footer {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
}

/* Hero portada: crece en la columna; sin min-height 100vh (pie al borde ~90vh útil) */
body.page-stack .page-column > .hero:not(.interior) {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

/* === Fila del encabezado fijo === */
.header-row {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 90%;
  max-width: 800px;
}

/* === Encabezado y navegación === */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 2.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  border-radius: 40px;
  flex: 1;
}


header span,
.header-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--dark);
  text-transform: uppercase;
  text-decoration: none;
}

.header-title:hover {
  color: var(--red);
  transition: color .2s;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

nav a {
  text-decoration: none;
  color: var(--dark);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .04em;
  transition: color .2s;
}

nav a:hover {
  color: var(--red);
}

/* === Botón efecto fuego === */
.fire-btn {
  background: var(--dark);
  color: var(--white);
  border: none;
  padding: .45rem 1.1rem;
  border-radius: 40px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .04em;
  transition: background .2s, transform .15s;
}

.fire-btn:hover {
  background: var(--red);
}

.fire-btn.active {
  background: var(--red);
}

/* === Cabecera principal / portada === */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 4rem 2rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Portada: alto mínimo útil (encabezado fijo + scroll natural) */
.hero:not(.interior) {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  padding-top: max(5.5rem, calc(env(safe-area-inset-top, 0px) + 4.75rem));
  padding-bottom: 1.5rem;
}

.hero.interior {
  height: auto;
  min-height: 0;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.08;
  margin-top: 0;
  margin-bottom: 1rem;
  padding: 0.35rem 0;
  color: var(--dark);
}

.hero h1 span {
  color: var(--red);
}

/* === Bento grid portada: 4 columnas en escritorio; 2×2 en tablet/móvil (≤900px) === */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.bento-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 28px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  padding: 0.55rem 0.6rem;
  text-decoration: none;
  color: var(--dark);
  transition: color .2s, box-shadow .2s, background .2s;
  min-height: 2.35rem;
  height: auto;
}

.bento-card:hover {
  color: var(--red);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 20px rgba(31, 38, 135, 0.35);
}

.bento-card .member-role {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
}

.bento-card .member-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.65rem, 1.15vw, 0.8rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--dark);
}

.bento-card .member-location {
  font-size: .82rem;
  color: #666;
}

.bento-card .member-arrow {
  order: -1; /* Flecha a la izquierda */
  font-size: 0.95rem;
  flex-shrink: 0;
  color: var(--red);
}

/* === Texto introductorio === */
.intro-text {
  max-width: 680px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #444;
  margin-bottom: 1.5rem;
}

/* Centrado de texto global */
body, .hero, .bitacora-content, .timeline-item {
  text-align: center;
}

/* Título sección integrantes */
.integrantes-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark);
  margin: 1rem 0 0.65rem;
  text-align: center;
}

/* ============================================
   Cabecera interior (bitácora y páginas similares)
   ============================================ */
section.hero.interior {
  padding: 2rem 2.5rem 1.5rem;
  padding-top: max(5.5rem, calc(env(safe-area-inset-top, 0px) + 4.25rem));
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

section.hero.interior h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
  margin-bottom: .6rem;
}

section.hero.interior p {
  font-size: 1rem;
  line-height: 1.65;
  color: #555;
}

section.hero.interior .scroll-arrow {
  margin-top: 1.5rem;
  color: var(--dark);
  opacity: 0.6;
  animation: bounceArrow 1.5s ease-in-out infinite;
}

/* Escritorio (≥901px): bajar el contenido principal +70px; más aire bajo la isla del header */
@media (min-width: 901px) {
  :root {
    --page-header-reserve: 7.75rem;
  }

  .hero:not(.interior) {
    padding-top: max(calc(5.5rem + 70px), calc(env(safe-area-inset-top, 0px) + 4.75rem + 70px));
    padding-bottom: 1.5rem;
  }

  section.hero.interior {
    padding-top: max(calc(5.5rem + 70px), calc(env(safe-area-inset-top, 0px) + 4.25rem + 70px));
    padding-bottom: 1.5rem;
  }

  section.hero.interior .scroll-arrow {
    margin-top: 1.5rem;
  }
}

@keyframes bounceArrow {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(8px);
    opacity: 1;
  }
}

/* ============================================
   Bitácora — línea de tiempo
   ============================================ */
.bitacora-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2.5rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  align-items: flex-start;
}

.timeline-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 2rem 2.2rem;
  position: relative;
  text-align: left;
}

.timeline-item h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.18rem;
  font-weight: 800;
  margin-bottom: .35rem;
  color: var(--dark);
}

.timeline-item .fecha {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: .75rem;
}

.timeline-item p {
  font-size: .95rem;
  line-height: 1.65;
  color: #444;
  margin-bottom: .75rem;
}

.timeline-item ul {
  padding-left: 1.2rem;
}

.timeline-item li {
  font-size: .92rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: .3rem;
}

.timeline-item li strong {
  color: var(--dark);
}

/* ============================================
   Integrante — tarjetas bento
   ============================================ */
.integrante-wrapper {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 2.5rem 5rem;
  overflow-x: hidden;
}

.grid-container {
  position: relative;
  overflow-x: hidden;
}

.integrante-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: auto;
  gap: 1.1rem;
  margin-top: 100px;
}

/* Tarjeta base */
.i-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  align-items: flex-start;
}

.i-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem;
  margin-bottom: .2rem;
}

/* === Tarjeta perfil (columnas 1–5) === */
.i-profile {
  grid-column: span 5;
  background: #1a1a1a;
  color: var(--white);
  align-items: flex-start;
  text-align: left;
  padding: 1.5rem;
}

.i-profile .avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #333;
  margin-bottom: 1rem;
  object-fit: cover;
  border: 3px solid var(--red);
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.i-profile .avatar-emoji {
  font-size: 3.2rem;
  line-height: 1;
}

/* Avatares SVG por tipo Pokémon */
.avatar svg {
  width: 60%;
  height: 60%;
}

.avatar-fire svg {
  filter: drop-shadow(0 0 8px rgba(255, 107, 53, 0.4));
}

.avatar-water svg {
  filter: drop-shadow(0 0 8px rgba(74, 144, 217, 0.4));
}

.avatar-electric svg {
  filter: drop-shadow(0 0 8px rgba(244, 208, 63, 0.4));
}

.avatar-grass svg {
  filter: drop-shadow(0 0 8px rgba(124, 179, 66, 0.4));
}

.i-profile .member-full-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.i-profile .member-role-tag {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  margin-top: .3rem;
}

.i-profile .meta-row {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-start;
  font-size: .78rem;
  color: var(--light);
}

.i-profile .meta-row span {
  display: flex;
  align-items: center;
  gap: .3rem;
}

/* Botón de modo noche dentro del perfil - minimalista */
.i-profile .blackout-toggle {
  margin-top: 0.6rem;
  background: transparent;
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  height: auto;
}

.i-profile .blackout-toggle:hover {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  transform: scale(1.05);
}

/* === Sobre mí === */
.i-bio {
  grid-column: span 7;
}

.i-bio p {
  font-size: .95rem;
  line-height: 1.7;
  color: #444;
  text-align: center;
}

/* Películas, música y habilidades: centrado (perfil sin tocar) */
.i-bio,
.i-skills,
.i-movies {
  align-items: center;
  text-align: center;
}

.i-bio > .card-tag,
.i-skills > .card-tag,
.i-movies > .card-tag {
  width: 100%;
}

.i-bio > .skills-bento,
.i-bio > .skills-list,
.i-skills > .movies-grid,
.i-movies > .movies-grid,
.i-skills > .music-tagline {
  width: 100%;
  align-self: stretch;
}

.i-bio .skills-list li {
  text-align: center;
}

/* === Habilidades (ancho completo en grid) === */
.i-skills {
  grid-column: span 6;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .4rem;
  font-family: 'Courier New', monospace;
  font-size: .9rem;
  line-height: 1.6;
}

.skill-pill {
  background: var(--bg);
  border: 1.5px solid #ddd;
  border-radius: 40px;
  padding: 0.8rem 1rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--dark);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-letter {
  display: inline-block;
  transition: all 0.2s ease;
}

.skill-letter:hover {
  transform: scale(1.2);
  font-weight: 700;
}

/* Variaciones de color en la sopa de letras */
.skill-letter.color-1 { color: #ff2a2a; }
.skill-letter.color-2 { color: #ff8c00; }
.skill-letter.color-3 { color: #ffd700; }
.skill-letter.color-4 { color: #8a2be2; }
.skill-letter.color-5 { color: #1e90ff; }
.skill-letter.color-6 { color: #ff1493; }
.skill-letter.color-7 { color: #00ced1; }
.skill-letter.color-8 { color: #32cd32; }

/* === Películas === */
.i-movies {
  grid-column: span 6;
}

.movie-list {
  list-style: none;
  margin-top: .3rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  width: 100%;
}

.movie-list li {
  background: var(--bg);
  border-radius: 10px;
  padding: .4rem 1.5rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--dark);
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  width: 100%;
}

.movie-list .music-content {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: 1;
  text-align: left;
  justify-content: flex-start;
  line-height: 1.2;
}

.movie-list .music-btn {
  background: var(--dark);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  flex-shrink: 0;
}

.movie-list .music-btn:hover {
  background: var(--red);
}

.movie-list .movie-icon {
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* === Rejilla de posters de películas === */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.8rem;
  /* Evita que cada fila iguale la altura al poster más alto: sin esto, flex:1 en la imagen recorta tapas/posters */
  align-items: start;
}

.movie-poster {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 0.4rem 0.1rem;
  min-width: 0;
  align-self: start;
  width: 100%;
}

.movie-poster:hover {
  outline: 2px solid #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.movie-poster:hover .movie-title {
  color: #000;
}

.movie-poster .movie-image {
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
  min-height: 0;
  aspect-ratio: 2 / 3;
  height: auto;
  object-fit: cover;
  object-position: center;
  display: block;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  padding: 0;
}

.movie-poster .movie-info {
  padding: 0.25rem 0;
  text-align: center;
}

.movie-poster .movie-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

/* Álbumes (música): tapas cuadradas en todos los breakpoints */
.i-skills .movie-poster.music-poster img.movie-image {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 0;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
  padding: 0;
  display: block;
}

.i-skills .movie-poster.music-poster .movie-image.music-cover {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 0;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
  padding: 0;
  border: none;
  background: linear-gradient(155deg,
    var(--music-accent, #555) 0%,
    #121212 55%,
    #0a0a0a 100%);
  display: grid;
  place-items: center;
  position: relative;
}

.i-skills .movie-poster.music-poster .movie-image.music-cover::after {
  content: '♪';
  font-size: 2.4rem;
  line-height: 1;
  opacity: 0.82;
  color: rgba(255, 255, 255, 0.94);
}

.i-skills .movie-poster .movie-info.music-poster-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.2rem 0.45rem;
  width: 100%;
}

.i-skills .movie-poster .movie-info.music-poster-foot .music-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  width: 100%;
  text-align: center;
}

.i-skills .movie-poster .movie-artist {
  font-size: 0.7rem;
  font-weight: 500;
  color: #555;
  line-height: 1.2;
}

.i-skills .movie-poster .music-btn {
  flex-shrink: 0;
  margin-top: 0;
  padding: 0;
  align-self: center;
  font-weight: 600;
  background: var(--dark);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.72rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.i-skills .movie-poster .music-btn:hover {
  background: var(--red);
}

.i-skills .movie-poster.music-poster.playing {
  outline: 2px solid var(--red);
  box-shadow: 0 4px 14px rgba(255, 42, 42, 0.2);
}

body.blackout-active .i-skills .movie-poster.music-poster .movie-artist {
  color: #aaa;
}

.i-skills .music-tagline {
  margin: 0.65rem 0 0;
  padding: 0 0.35rem;
  font-size: clamp(0.74rem, 2.4vw, 0.88rem);
  font-weight: 700;
  color: var(--dark);
  text-align: center;
  line-height: 1.35;
}

body.blackout-active .i-skills .music-tagline {
  color: #ccc;
}

/* Iconos SVG en línea */
.icon-svg {
  width: 1em;
  height: 1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-svg svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Icono de línea de tiempo en bitácora */
.timeline-icon {
  width: 1.2em;
  height: 1.2em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.3rem;
  vertical-align: middle;
}

.timeline-icon svg {
  width: 100%;
  height: 100%;
  stroke: var(--red);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === Discos musicales === */
.i-music {
  grid-column: span 12;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .8rem;
  margin-top: .5rem;
}

.music-item {
  background: var(--bg);
  border-radius: 12px;
  padding: 1.2rem 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  cursor: pointer;
  transition: box-shadow .2s;
  border: 1.5px solid transparent;
  min-height: 160px;
  justify-content: space-between;
}

.music-item:hover {
  box-shadow: 0 4px 16px rgba(255, 42, 42, .15);
  border-color: var(--red);
}

.music-item.playing {
  border-color: var(--red);
  background: #fff0f0;
}

.music-disc {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: .3rem;
}

.music-title {
  font-weight: 700;
  font-size: .88rem;
}

.music-artist {
  font-size: .78rem;
  color: #777;
}

.music-btn {
  margin-top: .5rem;
  background: var(--dark);
  color: var(--white);
  border: none;
  border-radius: 40px;
  padding: .3rem .75rem;
  font-size: .75rem;
  cursor: pointer;
  font-weight: 600;
  transition: background .2s;
  align-self: flex-start;
}

.music-btn:hover,
.music-item.playing .music-btn {
  background: var(--red);
}

/* === Tarjeta blackout === */
.i-blackout {
  grid-column: span 12;
}

.blackout-inner {
  background: var(--dark);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.blackout-inner p {
  color: var(--light);
  font-size: .9rem;
  flex: 1;
  min-width: 180px;
}

/* === Botón flotante “Volver” (cristal) === */
.back-island {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  color: var(--dark);
  font-size: .88rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 40px;
  padding: .4rem 1rem;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  transition: color .2s, box-shadow .2s, opacity .4s ease, transform .4s cubic-bezier(.22,1,.36,1);
  white-space: nowrap;
  animation: slideInIsland 1s cubic-bezier(.22,1,.36,1) both;
}

@keyframes slideInIsland {
  from {
    opacity: 0;
    transform: translateX(50px) scale(.85);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.back-island:hover {
  color: var(--red);
}

/* === Efecto fuego en títulos === */
.fire-active h1,
.fire-active h2,
.fire-active .member-full-name {
  background: linear-gradient(90deg, #ff2a2a, #ff8c00, #ffd700, #ff8c00, #ff2a2a);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fireGradient 1.8s linear infinite;
}

@keyframes fireGradient {
  0% {
    background-position: 0% center;
  }

  100% {
    background-position: 200% center;
  }
}

/* === SVG de fuego animado desde abajo === */
.fire-svg {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 200px;
  height: 200px;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}

.fire-active .fire-svg {
  transform: translateX(-50%) translateY(20%);
  opacity: 1;
}

.fire-svg svg {
  width: 100%;
  height: 100%;
  animation: fireFlicker 0.5s ease-in-out infinite alternate;
}

@keyframes fireFlicker {
  0% {
    transform: scale(1) rotate(-2deg);
    filter: drop-shadow(0 0 20px rgba(255, 42, 42, 0.8));
  }
  100% {
    transform: scale(1.05) rotate(2deg);
    filter: drop-shadow(0 0 30px rgba(255, 140, 0, 1));
  }
}

/* === Efecto blackout (“Se cortó la luz”) === */
body.blackout-active {
  background: #0a0a0a;
  color: #888;
  transition: all .8s ease;
}

/* Antorcha: gradiente radial desde el centro */
body.blackout-active::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle 300px at 50% 80%, 
    rgba(255, 140, 0, 0.15) 0%, 
    rgba(255, 100, 0, 0.08) 40%, 
    transparent 70%);
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.5s ease;
}

body.blackout-active.torch-lit::before {
  opacity: 1;
}

/* Luna visible en modo blackout */
.moon-svg {
  position: fixed;
  top: 10%;
  right: 10%;
  width: 80px;
  height: 80px;
  z-index: 45;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  pointer-events: none;
}

body.blackout-active .moon-svg {
  opacity: 1;
  transform: translateY(0);
}

/* Estrellas de fondo */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 35;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

body.blackout-active .stars {
  opacity: 1;
}

body.blackout-active header {
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid rgba(255, 140, 0, 0.3);
  box-shadow: 0 4px 20px rgba(255, 100, 0, 0.2);
}

body.blackout-active .header-title,
body.blackout-active nav a {
  color: #aaa;
}

body.blackout-active .i-card {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 140, 0, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  color: #999;
}

body.blackout-active .i-card:hover {
  border-color: rgba(255, 140, 0, 0.4);
  box-shadow: 0 8px 30px rgba(255, 100, 0, 0.15);
}

body.blackout-active .member-full-name {
  color: #fff;
}

body.blackout-active .skills-list li {
  color: #000;
}

/* Habilidades por tipo Pokémon en blackout */
body.blackout-active .skills-fire li {
  background: #ff6b35;
  color: #fff;
}

body.blackout-active .skills-water li {
  background: #4a90d9;
  color: #fff;
}

body.blackout-active .skills-electric li {
  background: #f4d03f;
  color: #000;
}

body.blackout-active .skills-grass li {
  background: #7cb342;
  color: #fff;
}

/* Bento de habilidades en blackout */
body.blackout-active .skills-bento .skill-box {
  background: rgba(30, 30, 30, 0.8);
  border-color: rgba(255, 140, 0, 0.3);
  color: #ccc;
}

body.blackout-active .skills-bento .skill-box:hover {
  border-color: rgba(255, 140, 0, 0.5);
  box-shadow: 0 4px 15px rgba(255, 100, 0, 0.2);
}

/* Cajas de habilidad por tipo en blackout */
body.blackout-active .skills-fire .skill-box {
  background: rgba(255, 107, 53, 0.3);
  border-color: rgba(255, 107, 53, 0.5);
  color: #fff;
}

body.blackout-active .skills-water .skill-box {
  background: rgba(74, 144, 217, 0.3);
  border-color: rgba(74, 144, 217, 0.5);
  color: #fff;
}

body.blackout-active .skills-electric .skill-box {
  background: rgba(244, 208, 63, 0.3);
  border-color: rgba(244, 208, 63, 0.5);
  color: #000;
}

body.blackout-active .skills-grass .skill-box {
  background: rgba(124, 179, 66, 0.3);
  border-color: rgba(124, 179, 66, 0.5);
  color: #fff;
}

body.blackout-active .card-tag {
  color: #fff;
}

body.blackout-active .skill-pill {
  background: rgba(30, 30, 30, 0.9);
  border: 1px solid rgba(255, 140, 0, 0.2);
  color: #888;
}

body.blackout-active .back-island {
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid rgba(255, 140, 0, 0.3);
  color: #aaa;
}

/* Animación de la antorcha (fuego) */
body.blackout-active .fire-svg svg {
  animation: torchFlicker 0.3s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 40px rgba(255, 140, 0, 0.8)) 
          drop-shadow(0 0 80px rgba(255, 80, 0, 0.4));
}

@keyframes torchFlicker {
  0% {
    transform: scale(1) rotate(-1deg);
    filter: drop-shadow(0 0 30px rgba(255, 140, 0, 0.7)) 
            drop-shadow(0 0 60px rgba(255, 80, 0, 0.3));
  }
  100% {
    transform: scale(1.02) rotate(1deg);
    filter: drop-shadow(0 0 50px rgba(255, 140, 0, 0.9)) 
            drop-shadow(0 0 100px rgba(255, 80, 0, 0.5));
  }
}

/* Estilos del botón blackout */
.blackout-btn {
  background: #1a1a1a;
  color: #aaa;
  border: 1px solid rgba(255, 140, 0, 0.4);
  border-radius: 30px;
  padding: .6rem 1.2rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: .5rem;
}

.blackout-btn:hover {
  background: #252525;
  border-color: rgba(255, 140, 0, 0.6);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 140, 0, 0.2);
}

body.blackout-active .blackout-inner {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 140, 0, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Mensaje en tarjeta blackout */
.blackout-message {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 0.5rem;
  border-top: 1px solid rgba(255, 140, 0, 0.2);
}

body.blackout-active .blackout-message {
  color: #aaa;
}

/* Listas película/música en blackout: texto oscuro para contraste */
body.blackout-active .movie-list li,
body.blackout-active .movie-list .music-content,
body.blackout-active .movie-list strong {
  color: #000 !important;
}

/* Portada: título principal en blanco; “UNKNOW” sigue en rojo */
body.blackout-active .hero h1 {
  color: #fff !important;
}

body.blackout-active .hero h1 span {
  color: var(--red) !important;
}

body.blackout-active .hero .intro-text {
  color: #ccc;
}

body.blackout-active .bento-card .member-name {
  color: #fff;
}

body.blackout-active .movie-list .movie-icon {
  color: #ff8c00;
}

/* Posters de películas en blackout */
body.blackout-active .movie-poster {
  background: rgba(30, 30, 30, 0.8);
  border-color: rgba(255, 140, 0, 0.3);
}

body.blackout-active .movie-poster .movie-title {
  color: #fff;
}

body.blackout-active .movie-poster:hover {
  border-color: rgba(255, 140, 0, 0.5);
  box-shadow: 0 4px 12px rgba(255, 100, 0, 0.15);
}

/* Botón luna fijo abajo a la derecha */
.moon-btn-fixed {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid rgba(255, 140, 0, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.moon-btn-fixed:hover {
  border-color: rgba(255, 140, 0, 0.8);
  box-shadow: 0 4px 20px rgba(255, 140, 0, 0.3);
  transform: scale(1.05);
}

.moon-btn-fixed svg {
  width: 28px;
  height: 28px;
}

/* Mensaje de ayuda junto a la luna */
.moon-hint {
  position: fixed;
  bottom: 2rem;
  right: 5rem;
  background: rgba(20, 20, 20, 0.95);
  color: #ff8c00;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 140, 0, 0.4);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 99;
  white-space: nowrap;
}

.moon-hint.show {
  opacity: 1;
  transform: translateX(0);
}

/* Estrellas: cruces pequeñas tipo destellos */
.stars svg {
  width: 100%;
  height: 100%;
}

.stars path {
  transform-origin: center;
}

/* Luna un poco más grande */
.moon-svg {
  width: 100px;
  height: 100px;
}

/* ============ Etiquetas de tarjeta ============ */
.i-card .card-tag {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark);
  padding: 0.3rem 0;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.i-card {
  position: relative;
}

/* Lista de habilidades estilo lista de películas */
.i-bio .skills-list {
  list-style: none;
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.i-bio .skills-list li {
  background: var(--bg);
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  min-height: 40px;
}

/* === Rejilla bento de habilidades === */
.skills-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.6rem;
  width: 100%;
}

.skills-bento .skill-box {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  color: var(--dark);
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  min-width: 0;
}

.skills-bento .skill-box:hover {
  outline: 2px solid #000;
  color: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============ ANIMACIONES POR INTEGRANTE ============ */

/* --- CARLOS: Avión --- */
.airplane-svg {
  position: fixed;
  top: 20%;
  left: -150px;
  width: 120px;
  height: 60px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

body.blackout-active .airplane-svg {
  opacity: 1;
  animation: flyPlane 8s linear infinite;
}

@keyframes flyPlane {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(calc(100vw + 200px)) translateY(-20px); }
}

/* --- HEBER: OVNI --- */
.ufo-svg {
  position: fixed;
  top: 15%;
  left: 50%;
  width: 100px;
  height: 60px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.5s;
}

body.blackout-active .ufo-svg {
  opacity: 1;
  animation: ufoHover 4s ease-in-out infinite, ufoGlow 2s ease-in-out infinite;
}

@keyframes ufoHover {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-30px); }
}

@keyframes ufoGlow {
  0%, 100% { filter: drop-shadow(0 0 5px #0f0) drop-shadow(0 0 10px #0f0); }
  50% { filter: drop-shadow(0 0 15px #0f0) drop-shadow(0 0 25px #0f0) drop-shadow(0 0 40px #0f0); }
}

/* --- JAVIER: Perro caminando --- */
.dog-svg {
  position: fixed;
  bottom: 0;
  left: -120px;
  width: 100px;
  height: 100px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
}

body.blackout-active .dog-svg {
  opacity: 1;
  animation: dogWalk 10s linear infinite;
}

@keyframes dogWalk {
  0% { transform: translateX(0); }
  15% { transform: translateX(calc(30vw + 120px)) translateY(-20px); }
  20% { transform: translateX(calc(30vw + 120px)) translateY(-20px) scaleX(-1); }
  25% { transform: translateX(calc(30vw + 120px)) translateY(-20px); }
  50% { transform: translateX(calc(100vw + 120px)) translateY(-20px); }
  51% { transform: translateX(calc(100vw + 120px)) scaleX(-1); }
  65% { transform: translateX(calc(30vw + 120px)) scaleX(-1); }
  70% { transform: translateX(calc(30vw + 120px)) scaleX(1); }
  100% { transform: translateX(0); }
}

/* --- LEANDRO: Gato caminando (espejo del perro) --- */
.cat-svg {
  position: fixed;
  bottom: 0;
  right: -100px;
  width: 90px;
  height: 90px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
}

body.blackout-active .cat-svg {
  opacity: 1;
  animation: catWalk 10s linear infinite;
}

@keyframes catWalk {
  0% { transform: translateX(0) scaleX(-1); }
  15% { transform: translateX(calc(-30vw - 100px)) translateY(-20px) scaleX(-1); }
  20% { transform: translateX(calc(-30vw - 100px)) translateY(-20px) scaleX(1); }
  25% { transform: translateX(calc(-30vw - 100px)) translateY(-20px) scaleX(-1); }
  50% { transform: translateX(calc(-100vw - 100px)) translateY(-20px) scaleX(-1); }
  51% { transform: translateX(calc(-100vw - 100px)) scaleX(1); }
  65% { transform: translateX(calc(-30vw - 100px)) scaleX(1); }
  70% { transform: translateX(calc(-30vw - 100px)) scaleX(-1); }
  100% { transform: translateX(0) scaleX(-1); }
}

@media (max-width: 600px) {
  .moon-svg {
    width: 70px;
    height: 70px;
  }
  
  .moon-btn-fixed {
    width: 45px;
    height: 45px;
    bottom: 1.5rem;
    right: 1.5rem;
  }
  
  .moon-btn-fixed svg {
    width: 24px;
    height: 24px;
  }
  
  .moon-hint {
    bottom: 4rem;
    right: 1.5rem;
    font-size: 0.8rem;
  }
}

/* ============================================
   Diseño responsive
   ============================================ */
@media (max-width: 1200px) {
  .integrante-bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .i-profile {
    grid-column: span 2;
  }

  .i-bio {
    grid-column: span 2;
  }

  .i-skills,
  .i-movies {
    grid-column: span 1;
  }
}

@media (max-width: 900px) {
  :root {
    --page-header-reserve: 5.35rem;
  }

  /* Portada: integrantes en 2 columnas (tablet y móvil) */
  .bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-row {
    width: 95%;
    top: 1rem;
    gap: .4rem;
    align-items: center;
  }

  header {
    padding: 0.5rem 1rem;
    border-radius: 30px;
  }

  .header-title {
    font-size: 1.1rem;
    letter-spacing: .08em;
  }

  nav {
    gap: 1rem;
  }

  nav a {
    font-size: .85rem;
  }

  .fire-btn {
    padding: .35rem .7rem;
    font-size: .8rem;
  }

  .back-island {
    padding: .35rem .8rem;
    font-size: .8rem;
    border-radius: 30px;
  }

  .hero:not(.interior) {
    padding-top: max(calc(4.75rem - 10px), calc(env(safe-area-inset-top, 0px) + 4rem - 10px));
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: calc(1.25rem - 10px);
    /* Sin altura mínima de viewport: el bloque mide solo su contenido y el footer entra en pantalla */
    min-height: 0;
  }

  .hero:not(.interior) h1 {
    font-size: clamp(1.35rem, 5.5vw, 2.35rem);
    margin-bottom: calc(0.65rem - 5px);
    padding: 0.2rem 0;
  }

  .hero:not(.interior) .intro-text {
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: calc(0.75rem - 5px);
  }

  .hero:not(.interior) .integrantes-title {
    font-size: 1.2rem;
    margin: calc(0.6rem - 5px) 0 calc(0.45rem - 5px);
  }

  .hero:not(.interior) .bento-grid {
    gap: 0.55rem;
    margin-top: 0.35rem;
  }

  .hero:not(.interior) .bento-card {
    padding: 0.6rem 0.75rem;
    border-radius: 28px;
  }

  .hero:not(.interior) .bento-card .member-name {
    font-size: 0.9rem;
  }

  section.hero.interior {
    padding: calc(1.25rem - 10px) 1rem calc(1rem - 10px);
    padding-top: max(calc(4.75rem - 10px), calc(env(safe-area-inset-top, 0px) + 3.5rem - 10px));
  }

  section.hero.interior h1 {
    font-size: clamp(1.35rem, 5vw, 2rem);
    margin-bottom: calc(0.6rem - 5px);
  }

  section.hero.interior p {
    font-size: 0.92rem;
    margin-bottom: calc(0.5rem - 5px);
  }

  section.hero.interior .scroll-arrow {
    margin-top: calc(1.5rem - 15px);
  }

  /* Index y bitácora: bajar 100px el bloque de título (aprovecha aire bajo el header; no cambia el alto del viewport) */
  body.page-stack .page-column > .hero:not(.interior) {
    padding-top: max(calc(4.75rem - 10px + 100px), calc(env(safe-area-inset-top, 0px) + 4rem - 10px + 100px));
  }

  body.page-stack .page-column > section.hero.interior {
    padding-top: max(calc(4.75rem - 10px + 100px), calc(env(safe-area-inset-top, 0px) + 3.5rem - 10px + 100px));
  }

  .bitacora-content {
    padding: 0 1.2rem calc(3rem - 10px);
    gap: 1rem;
  }

  .timeline-item {
    padding: 1.2rem 1rem;
  }

  .timeline-item h2 {
    font-size: 1.02rem;
  }

  .timeline-item p,
  .timeline-item li {
    font-size: 0.88rem;
  }

  .integrante-wrapper {
    padding: 1.2rem 1.2rem 4rem;
  }

  .integrante-bento {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 72px;
  }

  .i-profile,
  .i-bio,
  .i-skills,
  .i-movies {
    grid-column: span 1 !important;
    min-width: 0;
  }

  .header-title {
    font-size: 1rem;
    letter-spacing: .06em;
  }

  .back-island {
    order: -1;
    margin-bottom: 0.3rem;
    margin-top: 0.2rem;
  }
  
  /* Integrante en pantallas pequeñas */
  .i-profile {
    padding: 1.5rem 1rem;
  }
  
  .i-profile .avatar {
    width: 90px;
    height: 90px;
  }

  /* Películas y álbumes en una columna; habilidades en 3 columnas compactas */
  .i-skills .movies-grid.music-posters,
  .i-movies .movies-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .i-bio .skills-bento {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 0.35rem;
  }

  .i-bio .skills-bento .skill-box {
    padding: 0.42rem 0.3rem;
    font-size: 0.7rem;
    min-height: 2.4rem;
  }
}

@media (max-width: 400px) {
  header span {
    font-size: 1rem;
  }

  nav {
    gap: .6rem;
  }

  nav a {
    font-size: .75rem;
  }

  .fire-btn {
    padding: .3rem .6rem;
    font-size: .7rem;
  }

  .back-island {
    padding: .3rem .6rem;
    font-size: .75rem;
  }

  .fire-svg {
    width: 120px;
    height: 120px;
  }

  .hero:not(.interior) .bento-card {
    padding: 0.45rem 0.45rem;
    border-radius: 22px;
    min-height: 2.1rem;
  }

  .hero:not(.interior) .bento-card .member-name {
    font-size: clamp(0.68rem, 2.8vw, 0.8rem);
  }

  .hero:not(.interior) h1 {
    font-size: clamp(1.2rem, 6vw, 1.85rem);
  }

  .hero:not(.interior) .intro-text {
    font-size: 0.86rem;
  }

  .i-bio .skills-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .i-bio .skills-bento .skill-box {
    font-size: 0.66rem;
    min-height: 2.25rem;
    padding: 0.35rem 0.25rem;
  }

  .music-grid {
    grid-template-columns: 1fr;
  }

  .integrante-bento {
    grid-template-columns: 1fr;
    margin-top: 68px;
  }

  .i-profile,
  .i-bio,
  .i-skills,
  .i-movies,
  .i-music,
  .i-blackout {
    grid-column: span 1 !important;
  }

  .bitacora-content {
    padding-bottom: calc(2.5rem - 10px);
  }

  .timeline-item {
    padding: 0.95rem 0.8rem;
  }
}

/* === Pie de página === */
footer {
  text-align: center;
  padding: 0.5rem 1rem; /* Padding reducido a la mitad */
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
  letter-spacing: 0.05em;
}

body.blackout-active footer {
  color: #888;
}

/* === Ajustes de la portada === */
.intro-text {
  margin-bottom: 0.85rem;
}

/* === Barras de desplazamiento (evitar saltos de maquetación) === */
html {
  overflow-y: scroll; /* Fuerza barra vertical para estabilizar el ancho */
}

body {
  overflow-x: hidden;
}

/* Ocultar barra visual; el scroll sigue activo */
::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

body {
  scrollbar-width: none; /* Firefox: sin barra fina */
}