:root {
  --paper: #fafaf8;
  --ink: #242522;
  --muted: #72736d;
  --line: #deded7;
  --accent: #3dd6c6;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Archivo", ui-sans-serif, system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 20;
}
.skip-link:focus { left: 1rem; top: 1rem; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }

.page { min-height: 100svh; }

header {
  position: fixed;
  top: 20px;
  left: clamp(22px, 4.2vw, 68px);
  right: clamp(22px, 4.2vw, 68px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  isolation: isolate;
}
header::before {
  content: "";
  position: absolute;
  inset: -20px -70px -12px;
  background: var(--paper);
  z-index: -1;
  pointer-events: none;
}

.logo {
  color: var(--ink);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.065em;
  white-space: nowrap;
}
.logo span {
  font-weight: 800;
  color: var(--accent);
}

.tag {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.journey {
  position: relative;
  height: 320vh;
}

.journey-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

.scene {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.scene canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.scene-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.95rem;
}
.scene.is-fallback .scene-fallback { display: grid; }
.scene.is-live .scene-fallback { display: none; }

.journey-intro,
.interior-title,
.door-title {
  position: absolute;
  z-index: 3;
  top: clamp(80px, 12%, 150px);
  left: 20px;
  right: 20px;
  text-align: center;
  max-width: none;
  margin: 0 auto;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.interior-title,
.door-title {
  opacity: 0;
  visibility: hidden;
}

/* Sobre la puerta en el tramo lateral de la cámara */
.door-title {
  top: clamp(34%, 38vh, 46%);
  left: clamp(1.2rem, 6vw, 3.5rem);
  right: auto;
  max-width: min(26rem, 58vw);
  text-align: left;
}
.door-title h2 {
  font-size: clamp(1.35rem, 3.2vw, 2.15rem);
  line-height: 1.15;
  font-weight: 400;
}
.door-title .emph {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-family: var(--font);
  font-weight: 350;
  letter-spacing: -0.06em;
  line-height: 1.07;
  font-size: clamp(38px, 4.6vw, 70px);
}

h1 .soft { color: #989b8f; }
.interior-title .explore-link {
  color: #fafaf8;
  background: rgba(250, 250, 248, 0.12);
  border: 1px solid rgba(250, 250, 248, 0.35);
}

.lede,
.hero-purpose {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.cabin-metric {
  position: absolute;
  right: clamp(22px, 4.2vw, 68px);
  bottom: clamp(6rem, 16vh, 10rem);
  z-index: 3;
  display: grid;
  gap: 0.35rem;
  text-align: right;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.cabin-metric strong {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.055em;
  line-height: 1;
}
.cabin-metric span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
}

.journey-bottom {
  position: absolute;
  bottom: 28px;
  left: clamp(22px, 4.2vw, 68px);
  right: clamp(22px, 4.2vw, 68px);
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}
.journey-bottom .location { justify-self: end; font-size: 9px; }
.chapter { letter-spacing: 0.025em; }

.scroll-cue {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  border: 0;
  background: none;
  padding: 0;
  border-radius: 0;
  backdrop-filter: none;
}
.cue-arrow {
  display: inline-block;
  font-size: 28px;
  animation: cue 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes cue {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(3px); }
}

.journey-progress {
  position: absolute;
  right: 24px;
  top: calc(50% - 35px);
  width: 1px;
  height: 70px;
  background: var(--line);
  z-index: 4;
}
.journey-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ink);
  transform-origin: top;
  transform: scaleY(0);
}

.after {
  position: relative;
  z-index: 2;
  padding: 32px clamp(22px, 4.2vw, 68px) max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.after h2 {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 400;
  letter-spacing: -0.035em;
  margin-bottom: 0.8rem;
}
.after p {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.after a {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}
.after code {
  font-size: 0.92em;
  color: var(--ink);
}

@media (max-width: 760px) {
  header { top: 18px; left: 22px; right: 22px; }
  .logo { font-size: 20px; }
  .cabin-metric { display: none; }
  .journey-intro,
  .interior-title { top: max(106px, 13%); }
  .door-title {
    top: 36%;
    left: 22px;
    right: 22px;
    max-width: none;
  }
  .door-title h2 { font-size: clamp(1.2rem, 5.5vw, 1.6rem); }
  h1, h2 { font-size: clamp(35px, 8.5vw, 55px); }
  .eyebrow { font-size: 9px; letter-spacing: 0.13em; }
  .journey-bottom {
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 22px;
    right: 22px;
    grid-template-columns: 1fr;
    text-align: center;
    font-size: 8px;
  }
  .journey-bottom .location,
  .journey-bottom .chapter { display: none; }
  .scroll-cue { font-size: 16px; gap: 10px; justify-self: center; }
  .journey-progress { right: 12px; height: 50px; top: 47%; }
}

@media (prefers-reduced-motion: reduce) {
  .cue-arrow { animation: none; }
  html { scroll-behavior: auto; }
}
