:root {
  --bg: #071014;
  --bg-deep: #03080b;
  --panel: #0b1519;
  --text: #e9e5dc;
  --muted: #a6b0b1;
  --faint: #68777a;
  --accent: #78d5d1;
  --warm: #d1b78c;
  --line: rgba(220, 236, 234, 0.13);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, "Segoe UI", Arial, sans-serif;
  --max: 1320px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 75% 10%, rgba(70, 130, 136, 0.10), transparent 30%),
    linear-gradient(180deg, var(--bg-deep), var(--bg));
  color: var(--text);
  font-family: var(--serif);
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3000;
  width: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(120, 213, 209, 0.6);
}

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 4vw;
  transition: background 0.4s ease, padding 0.4s ease, border-color 0.4s ease;
}

.nav.scrolled {
  padding-top: 14px;
  padding-bottom: 14px;
  background: rgba(3, 9, 12, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  z-index: 4;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(120, 213, 209, 0.35);
  border-radius: 50%;
  color: var(--accent);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  text-transform: uppercase;
}

.brand-copy strong {
  font-size: 12px;
  letter-spacing: 0.28em;
  font-weight: 600;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.menu-button {
  position: relative;
  z-index: 4;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(5, 12, 15, 0.55);
  cursor: pointer;
}

.menu-button span {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 1px;
  background: var(--text);
  transition: transform 0.35s ease, top 0.35s ease;
}

.menu-button span:first-child {
  top: 18px;
}

.menu-button span:last-child {
  top: 26px;
}

.menu-button.open span:first-child {
  top: 22px;
  transform: rotate(45deg);
}

.menu-button.open span:last-child {
  top: 22px;
  transform: rotate(-45deg);
}

.menu {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: rgba(3, 9, 12, 0.96);
  backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.menu.open {
  opacity: 1;
  visibility: visible;
}

.menu a {
  color: rgba(233, 229, 220, 0.72);
  font-family: var(--sans);
  font-size: clamp(1.1rem, 2vw, 1.8rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 0.25s ease, transform 0.25s ease;
}

.menu a:hover {
  color: var(--accent);
  transform: translateX(8px);
}

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.hero-image {
  position: absolute;
  inset: -3%;
  z-index: -5;
  background-image:
    linear-gradient(90deg, rgba(2, 7, 9, 0.04) 0%, rgba(2, 7, 9, 0.06) 45%, rgba(2, 7, 9, 0.58) 74%, rgba(2, 7, 9, 0.88) 100%),
    linear-gradient(180deg, rgba(2, 7, 9, 0.10), rgba(2, 7, 9, 0.12) 55%, rgba(2, 7, 9, 0.86) 100%),
    url("../img/hero.jpg");
  background-size: cover;
  background-position: 36% center;
  filter: saturate(0.82) contrast(1.03) brightness(0.88);
  transform: scale(1.04);
  will-change: transform;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: -4;
  background:
    radial-gradient(circle at 34% 48%, transparent 0%, transparent 25%, rgba(2, 7, 9, 0.10) 55%, rgba(2, 7, 9, 0.52) 100%);
}

.mist {
  position: absolute;
  z-index: -2;
  left: -20%;
  right: -20%;
  bottom: -12%;
  height: 48%;
  filter: blur(38px);
  background:
    radial-gradient(ellipse at 30% 50%, rgba(170, 210, 212, 0.18), transparent 44%),
    radial-gradient(ellipse at 72% 60%, rgba(170, 210, 212, 0.12), transparent 48%);
  animation: mistMove 20s ease-in-out infinite alternate;
}

.mist-b {
  bottom: 12%;
  opacity: 0.45;
  animation-duration: 30s;
  animation-direction: alternate-reverse;
}

@keyframes mistMove {
  from { transform: translateX(-3%) translateY(2%); }
  to { transform: translateX(6%) translateY(-3%); }
}

.hero-layout {
  width: min(92%, var(--max));
  min-height: 100svh;
  margin: 0 auto;
  padding: 150px 0 10vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(430px, 0.8fr);
  align-items: end;
  gap: 70px;
}

/* Esta columna se deja vacía para que el personaje quede visible. */
.hero-safe-space {
  min-height: 1px;
}

.hero-copy {
  justify-self: end;
  max-width: 620px;
  text-align: left;
}

.eyebrow,
.section-label {
  margin: 0 0 22px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  line-height: 1;
}

.title-main {
  display: block;
  font-size: clamp(5.5rem, 10vw, 10rem);
  font-weight: 400;
  line-height: 0.78;
  letter-spacing: -0.075em;
}

.title-sub {
  display: block;
  margin-top: 0.42em;
  color: var(--warm);
  font-size: clamp(1.6rem, 3.3vw, 3.6rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.title-es {
  display: block;
  margin-top: 12px;
  color: rgba(233, 229, 220, 0.58);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero-text {
  margin: 32px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.75;
}

.enter-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 38px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.enter-line {
  width: 58px;
  height: 1px;
  background: rgba(233, 229, 220, 0.28);
  overflow: hidden;
}

.enter-line::after {
  content: "";
  display: block;
  width: 30px;
  height: 1px;
  background: var(--accent);
  animation: enterPulse 2.4s ease-in-out infinite;
}

@keyframes enterPulse {
  from { transform: translateX(-32px); }
  to { transform: translateX(70px); }
}

.hero-note {
  position: absolute;
  left: 4vw;
  bottom: 5vh;
  max-width: 310px;
  color: rgba(233, 229, 220, 0.48);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.quote-section {
  min-height: 100svh;
  padding: 140px 24px;
  display: grid;
  place-items: center;
  text-align: center;
}

.quote-section blockquote {
  max-width: 1100px;
  margin: 0;
  font-size: clamp(2.5rem, 5.3vw, 5.8rem);
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.quote-section blockquote span {
  display: block;
  margin-top: 0.18em;
  color: var(--warm);
}

.chapter {
  position: relative;
  width: min(90%, 1080px);
  margin: 0 auto;
  padding: 150px 0 190px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 55px;
}

.chapter-dark {
  width: 100%;
  max-width: none;
  padding-left: max(5vw, calc((100vw - 1080px) / 2));
  padding-right: max(5vw, calc((100vw - 1080px) / 2));
  background: #050c0f;
}

.chapter-index {
  color: rgba(120, 213, 209, 0.14);
  font-size: clamp(4rem, 8vw, 8rem);
  line-height: 1;
}

.chapter-content h2 {
  max-width: 780px;
  margin: 0 0 65px;
  font-size: clamp(3rem, 6vw, 6rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.prose {
  max-width: 760px;
  font-size: clamp(1.15rem, 1.7vw, 1.38rem);
  line-height: 1.85;
}

.prose p {
  margin: 0 0 1.45em;
}

.pull-quote {
  margin-top: 3.2em !important;
  padding-left: 26px;
  border-left: 1px solid var(--accent);
  color: var(--accent);
  font-size: 1.45em;
  line-height: 1.5;
}

.image-break {
  position: relative;
  min-height: 82svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-image: url("../img/hero.jpg");
  background-size: cover;
  background-position: 36% center;
  background-attachment: fixed;
}

.image-break-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 7, 9, 0.78), rgba(2, 7, 9, 0.10) 58%, rgba(2, 7, 9, 0.44)),
    linear-gradient(180deg, rgba(2, 7, 9, 0.12), rgba(2, 7, 9, 0.88));
}

.image-break p {
  position: relative;
  z-index: 2;
  width: min(90%, var(--max));
  margin: 0 auto;
  padding: 90px 0;
  font-size: clamp(2.2rem, 4.5vw, 4.8rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.image-break p span {
  display: block;
  color: var(--warm);
}

.final-section {
  min-height: 88svh;
  padding: 140px 24px;
  display: grid;
  place-items: center;
  text-align: center;
}

.final-inner {
  max-width: 1000px;
}

.final-inner h2 {
  margin: 0;
  font-size: clamp(3rem, 5.5vw, 6rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.final-inner h2 span {
  display: block;
  color: var(--warm);
}

.final-inner > p:last-child {
  max-width: 660px;
  margin: 34px auto 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.7;
}

.sound-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1800;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(5, 12, 15, 0.72);
  color: var(--muted);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.sound-button:hover {
  transform: translateY(-2px);
  color: var(--accent);
  border-color: rgba(120, 213, 209, 0.38);
}

.sound-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  height: 18px;
}

.sound-bars i {
  display: block;
  width: 2px;
  border-radius: 3px;
  background: currentColor;
}

.sound-bars i:nth-child(1) { height: 6px; }
.sound-bars i:nth-child(2) { height: 11px; }
.sound-bars i:nth-child(3) { height: 16px; }
.sound-bars i:nth-child(4) { height: 9px; }

.sound-button.active {
  color: var(--accent);
}

.sound-button.active .sound-bars i {
  animation: bars 1s ease-in-out infinite;
}

.sound-button.active .sound-bars i:nth-child(2) { animation-delay: .12s; }
.sound-button.active .sound-bars i:nth-child(3) { animation-delay: .24s; }
.sound-button.active .sound-bars i:nth-child(4) { animation-delay: .36s; }

@keyframes bars {
  0%, 100% { transform: scaleY(.45); opacity: .5; }
  50% { transform: scaleY(1); opacity: 1; }
}

.audio-hint {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1700;
  transform: translate(-50%, 20px);
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(5, 12, 15, 0.82);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  transition: 0.35s ease;
}

.audio-hint.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

footer {
  padding: 46px 5vw 70px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1s ease, transform 1s ease;
}

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

@media (max-width: 980px) {
  .hero-layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(370px, 1.05fr);
    gap: 30px;
  }

  .hero-image {
    background-position: 31% center;
  }

  .title-main {
    font-size: clamp(5rem, 12vw, 8rem);
  }
}

@media (max-width: 760px) {
  .brand-copy small {
    display: none;
  }

  .hero {
    min-height: 100svh;
  }

  .hero-image {
    background-image:
      linear-gradient(180deg, rgba(2, 7, 9, 0.06) 0%, rgba(2, 7, 9, 0.12) 48%, rgba(2, 7, 9, 0.90) 100%),
      url("../img/hero.jpg");
    background-position: 36% center;
  }

  .hero-layout {
    width: min(88%, var(--max));
    padding-top: 130px;
    padding-bottom: 9vh;
    grid-template-columns: 1fr;
    align-items: end;
  }

  .hero-safe-space {
    min-height: 42svh;
  }

  .hero-copy {
    justify-self: start;
    max-width: 100%;
  }

  .title-main {
    font-size: clamp(4.8rem, 24vw, 7.5rem);
  }

  .title-sub {
    font-size: clamp(1.55rem, 8vw, 2.8rem);
  }

  .hero-note {
    display: none;
  }

  .chapter {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 110px;
    padding-bottom: 130px;
  }

  .chapter-index {
    font-size: 4.5rem;
  }

  .image-break {
    background-attachment: scroll;
    background-position: 36% center;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .nav {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-layout {
    width: 88%;
  }

  .hero-safe-space {
    min-height: 45svh;
  }

  .hero-text {
    font-size: 1rem;
  }

  .quote-section {
    min-height: 82svh;
  }

  .audio-hint {
    max-width: calc(100% - 100px);
    text-align: center;
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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