/* ============================================
   VARIABLES
   ============================================ */
:root {
  --color-bg: #2A2D32;
  --color-text: #F5F2EC;
  --color-accent: #6B1F2A;
  --color-muted: #A8A092;
  
  --font-display: 'Special Elite', cursive;
  --font-body: 'IBM Plex Mono', monospace;
  --font-hand: 'Syne Mono', monospace;
  --font-accent: 'IM Fell English', serif;
  
  --gutter: clamp(2rem, 5vw, 6rem);
}

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

html, body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  text-transform: uppercase;
}

h1 { font-size: clamp(4.5rem, 12vw, 10rem); }
h2 { font-size: clamp(3.5rem, 7vw, 7rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
h4 { font-size: 1rem; }

p {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  max-width: 60ch;
}
.panel-diary-intro h2 {
  font-size: clamp(1.8rem, 3.5vw, 3.2rem);
  line-height: 1.15;
  overflow-wrap: break-word;
}

em {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--color-accent);
}

.section-label {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.5rem var(--gutter);
  color: var(--color-text);
  mix-blend-mode: difference;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-hand);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ============================================
   HERO VERTICAL
   ============================================ */
.hero {
  height: 100vh;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background-color: #000;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.4));
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 0 2rem;
}

.hero-eyebrow {
  font-family: var(--font-hand);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.hero-title { margin-bottom: 1rem; }

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-text);
  margin-bottom: 3rem;
  font-style: italic;
  text-align: center;
  width: 100%;
}

.hero-scroll-hint {
  font-family: var(--font-hand);
  font-size: 1rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-text);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ============================================
   HORIZONTAL SCROLL CONTAINER
   ============================================ */
.horizontal-wrap {
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: #2A2D32;
}

.horizontal-track {
  display: flex;
  height: 100%;
  align-items: center;
  will-change: transform;
}

.panel {
  flex: 0 0 auto;
  height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--gutter);
}

.panel-inner {
  width: 100%;
}

/* ============================================
   INTRO VERTICAL
   ============================================ */
.intro-vertical {
  min-height: 100vh;
  padding: 10vh var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('imagen-prologo.jpg') no-repeat center center;
  background-size: cover;
}

.intro-inner {
  max-width: 800px;
  text-align: left;
}

.intro-inner h2 {
  margin-bottom: 2.5rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.intro-inner p {
  margin-bottom: 2rem;
  font-size: 1.2rem;
  line-height: 1.6;
}

/* ============================================
   PANEL INTRO
   ============================================ */
.panel-intro { width: 80vw; }

.panel-intro h2 { margin-bottom: 2.5rem; max-width: 18ch; }

.panel-intro p {
  margin-bottom: 1.5rem;
  font-size: 1.15rem;
  max-width: 55ch;
}

.panel-intro p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 4rem;
  float: left;
  line-height: 0.9;
  margin: 0.2rem 0.5rem 0 0;
  color: var(--color-accent);
}

/* ============================================
   PANEL TEAM
   ============================================ */
.panel-team { 
  width: 120vw; 
  background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("fondo-retratos.jpg") center/cover no-repeat;
}
.panel-team .panel-inner { max-width: 95%; }
.panel-team h2 {
  color: #fff;
  margin-bottom: 1.5rem;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}
.panel-team .section-label {
  color: #fff;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2rem;
  width: 100%;
}

.member { text-align: left; }

.member-portrait {
  width: 100%;
  aspect-ratio: 2 / 3;
  max-height: 60vh;
  border: 1px solid var(--color-muted);
  margin-bottom: 1rem;
  overflow: hidden;
}

.member h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.member-role {
  font-size: 0.85rem;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  font-style: italic;
  font-family: var(--font-accent);
}

.member-origin {
  font-family: var(--font-accent);
  font-size: 0.8rem;
  color: var(--color-text);
  letter-spacing: 0.05em;
}

/* ============================================
   PANEL RUTA
   ============================================ */
.panel-route { width: 110vw; background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url("panel-route.jpg") center/cover no-repeat; }

.panel-route h2 { margin-bottom: 2rem; }

.route-map {
  margin-bottom: 3rem;
  color: var(--color-text);
}

.map-svg { width: 100%; height: auto; max-height: 250px; }

#route-path { 
  stroke-dashoffset: 100; 
  animation: dash-crawl 3s linear infinite;
}

@keyframes dash-crawl {
  from { stroke-dasharray: 10 10; stroke-dashoffset: 20; }
  to { stroke-dasharray: 10 10; stroke-dashoffset: 0; }
}

.route-legs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}

.leg {
  text-align: left;
}

.leg h4 { margin-bottom: 0.5rem; }

.leg h4 {
  margin-bottom: 0.5rem;
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.leg p { font-size: 0.95rem; color: var(--color-text); font-style: italic; }

.route-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--color-muted);
  margin-bottom: 1rem;
  overflow: hidden;
}

.entry-image-placeholder {
  width: 100%;
  flex-grow: 1;
  background: var(--color-bg);
  border: 1px solid var(--color-muted);
  margin-bottom: 1.5rem;
  opacity: 0.6;
  order: 1;
}

.epilogue-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-bg);
  border: 1px solid var(--color-muted);
  margin-bottom: 2rem;
  opacity: 0.4;
}

/* ============================================
   PANEL DIARIO INTRO
   ============================================ */
.panel-diary-intro { width: 70vw; }

.panel-diary-intro h2 { margin-bottom: 2rem; max-width: 14ch; }

.diary-hint {
  font-family: var(--font-hand);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--color-accent);
  margin-top: 2rem;
}

/* ============================================
   PANEL ENTRADAS DIARIO
   ============================================ */
.panel-entry {
  width: 62vw;
  padding: var(--gutter) 0.5rem;
}

.entry-card {
  background: var(--color-text);
  color: var(--color-bg);
  padding: 2rem;
  height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  width: 100%;
  max-width: 850px;
}

.entry-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--color-accent);
}

.entry-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-muted);
  order: 2;
}

.entry-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--color-accent);
  font-style: italic;
}

.entry-date {
  font-family: var(--font-hand);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-bg);
  opacity: 0.7;
}

.entry-location {
  font-family: var(--font-hand);
  font-style: italic;
  font-size: 1.1rem;
  margin-left: auto;
  color: var(--color-accent);
}

.entry-title { 
  margin-bottom: 0.5rem;
  order: 3;
}

.entry-body {
  font-size: 0.95rem;
  order: 4;
}

/* ============================================
   PANEL EPÃLOGO
   ============================================ */
.panel-epilogue { width: 80vw; }

.panel-epilogue .panel-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.panel-epilogue h2 { margin-bottom: 2.5rem; }

.panel-epilogue p { margin: 0 auto 1.5rem; font-size: 1.15rem; }

.signature {
  font-family: var(--font-hand);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--color-text);
  margin-top: 3rem !important;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  padding: 2rem var(--gutter);
  background: var(--color-bg);
  color: var(--color-text);
  text-align: center;
  font-family: var(--font-hand);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  border-top: 1px solid var(--color-muted);
}

.site-footer a { color: var(--color-accent); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .panel-team { width: 280vw; }
  .team-grid { grid-template-columns: repeat(6, 60vw); }
  .panel-entry { width: 90vw; }
  .route-legs { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .horizontal-wrap { height: auto; overflow: visible; }
  .horizontal-track { flex-direction: column; height: auto; transform: none !important; }
  .panel { width: 100% !important; height: auto; min-height: 100vh; }
}

/* CORRESPONDENCIA OFICIAL */
.panel-letters-intro { width: 45vw; }
.panel-letters-intro h2 { margin-bottom: 2rem; max-width: 14ch; }
.letters-hint {
  font-family: var(--font-hand);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--color-accent);
  margin-top: 2rem;
}

.panel-letter-image {
  width: 38vw;
  padding: var(--gutter) 1rem;
}

.letter-image-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 500px;
  width: 100%;
}

.letter-image-wrap img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.letter-caption {
  font-family: var(--font-hand);
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text);
}

/* BOTÓN DE AUDIO GLOBAL */
.global-audio-control {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.global-audio-control:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.global-audio-control svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   ARCHIVO DE VIDEO (VERTICAL)
   ============================================ */
.video-archive {
  padding: 15vh var(--gutter);
  background: #1a1c1f;
  min-height: 100vh;
}

.video-archive .container {
  max-width: 1200px;
  margin: 0 auto;
}

.video-archive h2 {
  margin-bottom: 5rem;
  color: var(--color-accent);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4rem;
}

.video-item {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.video-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--color-muted);
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #2a2d32 0%, #000 100%);
  color: var(--color-muted);
  font-family: var(--font-hand);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.9rem;
}

.video-placeholder span {
  opacity: 0.5;
}

.video-caption {
  font-family: var(--font-hand);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-text);
  opacity: 0.8;
  border-left: 2px solid var(--color-accent);
  padding-left: 1rem;
}

@media (max-width: 900px) {
  .video-grid { grid-template-columns: 1fr; gap: 3rem; }
}

.panel-letter-image, .panel-letters-intro { background-color: black !important; }

.panel-letters-intro .section-label, .letters-hint { color: white !important; }

.panel-diary-intro { width: 40vw !important; }

.entry-card, .entry-card * { color: var(--color-accent) !important; }

.entry-card { background: var(--color-accent) !important; min-height: 60vh; }

.entry-card img { mix-blend-mode: normal !important; opacity: 1 !important; filter: none !important; background-color: transparent !important; }

.entry-image-placeholder { opacity: 1 !important; background: transparent !important; border: none !important; }

.panel-diary-intro, .panel-entry { background-color: black !important; }

.entry-card { background: #333 !important; }

/* ============================================
   MICROSCOPE — sección vertical con lupa
   Pegar al final de styles.css
   ============================================ */
.microscope-section {
  min-height: 100vh;
  width: 100%;
  background:
    linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.75)),
    url('fondo-microscope.jpg') center/cover no-repeat;
  padding: 10vh var(--gutter);
  display: flex;
  align-items: center;
  justify-content: center;
}

.microscope-inner {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.microscope-section .section-label {
  display: inline-block;
  background: var(--color-text);
  color: var(--color-bg);
  padding: 0.4rem 1rem;
  margin-bottom: 1.5rem;
}

.microscope-section h2 {
  color: var(--color-text);
  margin-bottom: 3rem;
}

/* Stage flexible: la imagen define el ratio.
   Ocupa hasta 70vh de alto y 90% del ancho disponible. */
.microscope-stage {
  position: relative;
  max-height: 70vh;
  max-width: 90%;
  overflow: hidden;
  cursor: none;
  background: #000;
  line-height: 0;
}

.microscope-base {
  display: block;
  max-height: 70vh;
  max-width: 100%;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.microscope-lens {
  position: absolute;
  top: 0;
  left: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 2px solid var(--color-text);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(0, 0, 0, 0.7);
  background-image: url('selenita-revelada.jpg');
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
  will-change: transform, background-position, opacity;
}

.microscope-lens.is-active {
  opacity: 1;
}

.microscope-hint {
  font-family: var(--font-hand);
  font-style: italic;
  font-size: 1rem;
  color: var(--color-muted);
  margin-top: 2rem;
  letter-spacing: 0.1em;
}

/* Mobile/tablet: sin interacción, dos imágenes apiladas */
@media (max-width: 900px), (pointer: coarse) {
  .microscope-stage {
    cursor: default;
    width: 100%;
    max-width: 500px;
    max-height: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow: visible;
  }
  .microscope-base {
    max-height: none;
    width: 100%;
  }
  .microscope-lens {
    display: none;
  }
  .microscope-stage::after {
    content: '';
    display: block;
    width: 100%;
    padding-top: 75%;
    background-image: url('selenita-revelada.jpg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  .microscope-hint {
    display: none;
  }
}


.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ENTRADAS DIARIO — estilos movidos desde inline */
.panel-entry .entry-image-placeholder { display: block !important; }

.panel-entry .entry-header {
  color: white !important;
  margin-top: 1.5rem;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 1.2rem;
}
