@font-face {
  font-family: Geist;
  src: url("./assets/fonts/geist-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Geist;
  src: url("./assets/fonts/geist-sans-latin-900-normal.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #090f15;
  --deep: #0b131c;
  --white: #f0f2eb;
  --muted: #b3bec8;
  --accent: #d9ef78;
  --accent-hover: #e6f6a1;
  --line: #e0e9ed38;
  --gutter: clamp(1.3rem, 5.3vw, 6.25rem);
  font-family: Geist, sans-serif;
  color: var(--white);
  background: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
body { min-width: 0; }
p { line-height: 1.56; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
:where(a, button, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
[hidden] { display: none !important; }

.wrap { width: min(calc(100% - 2 * var(--gutter)), 86rem); margin-inline: auto; }
.skip { position: absolute; z-index: 4; top: 1rem; left: 1rem; padding: 1rem; background: var(--white); color: var(--ink); transform: translateY(-200%); }
.skip:focus { transform: none; }

/* All chapters share the same viewport and camera. */
.story {
  --viewport: 100vh;
  --viewport: 100svh;
  --cab: url("./assets/cabina-apertura.jpg");
  --desk: url("./assets/mesa-empalme-uhd.png");
  --turn: url("./assets/giro-ventanal.png");
  --roof: url("./assets/azotea-ciudad.jpg");
  isolation: isolate;
  background: var(--deep);
}
.story-stage {
  position: sticky;
  z-index: -1;
  top: 0;
  height: var(--viewport);
  overflow: hidden;
  pointer-events: none;
  background: var(--deep);
}
.story-content { position: relative; margin-top: calc(-1 * var(--viewport)); }
.stage-shot, .hero-media, .ascent-depth, .ascent-cabin, .stage-mullion, .stage-grade { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-shot { background-position: 61% center; background-repeat: no-repeat; background-size: cover; }
.stage-cab { background-image: var(--cab); }
.hero-media { object-fit: cover; object-position: 61% center; }
.stage-desk { opacity: 0; background-image: var(--desk); }
[data-film="desk"] .stage-desk { opacity: 1; }
[data-film="desk"] .hero-media { visibility: hidden; }
.stage-turn { overflow: hidden; opacity: 0; }
.turn-frame, .turn-art, .turn-art::before, .turn-detail { position: absolute; inset: 0; }
.turn-frame { overflow: hidden; }
.turn-art { --turn-crop: 61%; }
.turn-art::before {
  content: "";
  background: var(--turn) calc(var(--turn-crop) + var(--window-pan, 0%)) center / cover no-repeat;
  filter: saturate(.86);
}
.turn-detail {
  background: var(--desk) 61% center / cover no-repeat;
  mask-image:
    linear-gradient(90deg, transparent, #000 var(--detail-feather, 0%), #000 calc(100% - var(--detail-feather, 0%)), transparent),
    linear-gradient(transparent, #000 var(--detail-feather, 0%), #000 calc(100% - var(--detail-feather, 0%)), transparent),
    linear-gradient(90deg, #000 calc(var(--detail-reveal, 108%) - 8%), transparent var(--detail-reveal, 108%));
  mask-composite: intersect;
}
.stage-roof { opacity: 0; background-image: var(--roof); }
.ascent-depth, .ascent-cabin, .stage-mullion { opacity: 0; }
.ascent-cabin::before, .ascent-cabin::after {
  content: "";
  position: absolute;
}
.ascent-cabin::before {
  inset: 0 0 0 auto;
  width: clamp(1.15rem, 4.2vw, 4.5rem);
  background: linear-gradient(90deg, transparent, #a2a6a82b 14%, #141a21e8 26%, #080d13 75%);
}
.ascent-cabin::after {
  inset: auto 0 13% 0;
  height: clamp(.34rem, .7vw, .66rem);
  background: linear-gradient(0deg, #0b0f15, #303942 45%, #a6a09a65 64%, #0b1015);
  box-shadow: 0 .4rem .8rem #02050865;
}
.stage-mullion {
  width: 37%;
  background: linear-gradient(90deg, #0c131600, #0c1117 22%, #090d13 69%, #172026 92%, #151b1c00);
  inset: -10% auto auto 0;
  height: 120%;
}
.stage-grade {
  background: linear-gradient(90deg, #080e15cc, #080e1572 33%, #080e1507 74%),
    linear-gradient(0deg, #080e15a0, transparent 45%),
    linear-gradient(180deg, #080e156e, transparent 24%);
  transition: opacity .65s ease;
}
[data-intro="waiting"] .stage-grade { opacity: 0; }
.hero { display: flex; flex-direction: column; min-height: max(32rem, var(--viewport)); }
.hero .nav, .hero .hero-body { transition: opacity .66s cubic-bezier(.22,1,.36,1), transform .73s cubic-bezier(.22,1,.36,1); }
[data-intro="waiting"] .hero :is(.nav,.hero-body) { opacity: 0; transform: translateY(.6rem); }
[data-intro="waiting"] .hero:focus-within :is(.nav,.hero-body) { opacity: 1; transform: none; }

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: 5.35rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  position: relative;
  display: block;
  width: clamp(6rem, 10vw, 9.1rem);
  aspect-ratio: 4.9;
  overflow: hidden;
  mix-blend-mode: screen;
}
.brand img {
  position: absolute;
  width: 115%;
  max-width: none;
  height: auto;
  inset: 50% auto auto -7.3%;
  transform: translateY(-50%);
  filter: brightness(.73) contrast(12);
}

.nav-links, .nav-end, .language { display: flex; align-items: center; }
.nav-links { gap: clamp(1rem, 2.4vw, 2.5rem); font-size: .9rem; }
.nav-links a:hover, .hero-launch:hover { text-decoration: underline; text-underline-offset: .32rem; }
.nav-end { gap: clamp(.25rem, 1.4vw, 1.35rem); justify-self: end; }
.language button { background: transparent; border: 0; padding: 0 .38rem; min-width: 2rem; min-height: 2.75rem; color: var(--muted); font-size: .78rem; }
.language button[aria-pressed="true"] { color: var(--white); text-decoration: underline; text-underline-offset: .34rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: .72rem 1.05rem;
  border: 1px solid transparent;
  border-radius: .13rem;
  font-size: .91rem;
  font-weight: 900;
  line-height: 1.22;
  transition: color .2s, background-color .2s, border-color .2s;
}
.button-primary { background: var(--white); color: var(--ink); }
.button-primary:hover { background: #d1dde2; }
.button-accent { background: var(--accent); }
.button-accent:hover { background: var(--accent-hover); }
.accent-text { color: var(--accent); }
.button-ghost { background: #0a131f68; border-color: #edf3f16b; }
.button-ghost:hover { background: #26313a; }
.nav .button { font-weight: 400; min-height: 2.75rem; background: transparent; font-size: .82rem; }

.hero-body { flex: 1; display: flex; align-items: flex-end; padding-block: 4rem clamp(3rem, 10vh, 8.5rem); }
.hero-copy { width: min(100%, 56rem); }
h1, h2 { font-weight: 900; line-height: .91; letter-spacing: -.055em; text-wrap: balance; }
h1 { font-size: clamp(3.55rem, 8.8vw, 9.45rem); }
h1 span {
  display: block;
  transition: transform .65s cubic-bezier(.22, 1, .36, 1), clip-path .65s cubic-bezier(.22, 1, .36, 1);
  clip-path: inset(-.12em -.08em -.25em);
}
h1 span:last-child { letter-spacing: -.058em; }
[data-intro="waiting"] .hero:not(:focus-within) h1 span {
  clip-path: inset(0 -.08em 100%);
  transform: translateY(.3em);
}
[data-intro="ready"] h1 span:last-child { transition-delay: .13s; }
.hero-copy p { color: #dce4e8; font-size: clamp(1rem, 1.4vw, 1.14rem); max-width: 29rem; margin-top: 1.45rem; }
.hero-copy p + p { margin-top: .55rem; }
.hero-copy p {
  transition: opacity .65s cubic-bezier(.22, 1, .36, 1), transform .65s cubic-bezier(.22, 1, .36, 1);
}
[data-intro="waiting"] .hero:not(:focus-within) .hero-copy p { opacity: 0; transform: translateY(.45rem); }
[data-intro="ready"] .hero-copy p { transition-delay: .26s; }
[data-intro="ready"] .hero-copy p + p { transition-delay: .58s; }
.hero-stat {
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(var(--accent), var(--accent)) left 96% / 100% .14em no-repeat;
  transition: background-size .58s cubic-bezier(.22, 1, .36, 1);
}
[data-intro="waiting"] .hero:not(:focus-within) .hero-stat { background-size: 0% .14em; }
[data-intro="ready"] .hero-stat { transition-delay: .53s; }
[data-intro="ready"] .hero-stat:last-child { transition-delay: .78s; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1.6rem; }
.hero-actions .button { gap: 1.2rem; }
.hero-actions .button::after { content: "↓"; font-size: 1.08rem; font-weight: 400; }
.hero-launch { font-size: .92rem; padding-block: .75rem; }

/* The glass, text shading and information are separate from the scene behind them. */
.turn, .ascent, .lift-landing, .opening { position: relative; scroll-margin-top: 0; }
.turn, .lift-landing { display: grid; align-items: end; min-height: max(30rem, calc(var(--viewport) * .82)); }
.turn-layout { padding-block: clamp(6rem, 20vh, 13rem) clamp(3.2rem, 13vh, 10rem); }
.turn-layout h2 { max-width: 11ch; }
.turn-layout .program-title {
  max-width: 24ch;
  font-size: clamp(2rem, 4.6vw, 4.65rem);
  line-height: .99;
  text-wrap: pretty;
}
.program-line { display: block; overflow: clip; margin-block: -.12em; padding-block: .12em; }
.program-line > span { display: block; }
.turn-layout > p:last-child { margin-top: 1rem; max-width: 24rem; color: #e1e7e7; }
.lift-landing { min-height: max(29rem, calc(var(--viewport) * .76)); }
.lift-landing .turn-layout { padding-block: 4rem clamp(4rem, 16vh, 12rem); }
.lift-landing h2 { max-width: 12ch; }
.journey-benefits {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: .45rem 1.4rem;
  margin: 1.3rem 0 0;
  padding: 0;
  list-style: none;
}
.journey-benefits li::before {
  content: "";
  display: inline-block;
  width: .32rem;
  height: .32rem;
  margin: 0 .65rem .16rem .1rem;
  transform: rotate(45deg);
  background: var(--muted);
}
.turn-layout > .business-line { max-width: 34rem; }
.story:not([data-journey]) .turn { background: linear-gradient(90deg, #090f17f2, #090f1735), var(--turn) 64% center / cover; }
.story:not([data-journey]) :is(.ascent, .lift-landing) { background: linear-gradient(90deg, #090f17eb, #090f1735), var(--turn) 64% center / cover; }
.story:not([data-journey]) .ascent[data-activated="true"] { background-image: linear-gradient(90deg, #090f17eb, #090f1735), var(--desk); }
.story:not([data-journey]) .roof-content { background: linear-gradient(0deg, #090f17f0, #090f172d), var(--roof) 66% center / cover; }
.ascent-layout {
  min-height: max(39rem, var(--viewport));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  padding-block: clamp(4rem, 11vh, 8rem) clamp(3rem, 7vh, 6rem);
}
.ascent-copy { max-width: 36rem; }
.chapter { font-size: .89rem; margin-bottom: 1rem; color: var(--muted); }
h2 { font-size: clamp(3.15rem, 7vw, 7.1rem); }
.ascent-copy h2 { max-width: 9ch; }
.ascent-copy > p:last-of-type { margin-top: 1.2rem; max-width: 26rem; color: #d8dfe4; }
.ascent-controls { margin-top: clamp(1.7rem, 4vw, 3rem); padding-top: 1.15rem; border-top: 1px solid var(--line); }
.ascent-mode { color: var(--muted); font-size: .78rem; }
.ascent-controls h3 { margin-top: .33rem; font-size: clamp(1.35rem, 2.5vw, 2.02rem); font-weight: 900; letter-spacing: -.045em; }
.ascent-controls p { min-height: 3.1em; max-width: 28rem; margin-top: .18rem; color: #d6dfe4; font-size: .92rem; }
.sim-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem .8rem; margin-top: .75rem; }
.sim-reset { border: 0; padding: .72rem .25rem; min-height: 2.75rem; background: transparent; color: #d2dce3; font-size: .85rem; text-decoration: underline; text-underline-offset: .23rem; }
.ascent[data-activated="true"] .ascent-instrument { border-color: var(--accent); }
.ascent-instrument { width: clamp(10rem, 16vw, 15rem); align-self: end; color: #e4e8eb; background: #0a131dd6; backdrop-filter: blur(10px); border: 1px solid #e0e9ed48; padding: .8rem 1rem .55rem; }
.instrument-top { display: flex; justify-content: space-between; gap: .9rem; align-items: end; font-size: .78rem; margin-bottom: .6rem; color: #e5e9eb; }
#floor-count { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--white); }
.ascent:not([data-completed="0"]) #floor-count { color: var(--accent); }
.levels { padding: 0; margin: 0; list-style: none; display: flex; flex-direction: column-reverse; }
.level { display: flex; gap: .7rem; align-items: center; border-top: 1px solid #8293a048; min-height: 2.22rem; font-size: .82rem; color: #b2bec8; font-variant-numeric: tabular-nums; }
.level::before { content: ""; width: .38rem; height: .38rem; border: 1px solid #b2bec89e; transform: rotate(45deg); margin-inline: .22rem; }
.level[aria-current] { color: var(--white); }
.level[aria-current]::before { border-color: var(--white); }
.level[data-complete="true"] { color: var(--accent); }
.level[data-complete="true"]::before { background: var(--accent); border-color: var(--accent); }

.opening {
  min-height: max(31rem, calc(var(--viewport) * .82));
  display: grid;
  align-items: end;
}
.opening-content { padding-block: 4rem clamp(3rem, 8vw, 7rem); }
.opening h2 { max-width: 13ch; }
.opening p { max-width: 27rem; margin: 1.25rem 0 1.55rem; color: #d8e0e6; }
.opening-status { display: inline-flex; align-items: center; gap: .62rem; margin-bottom: .95rem; color: var(--muted); font-size: .87rem; }
.opening-status::before { content: ""; width: .42rem; height: .42rem; background: currentColor; transform: rotate(45deg); }

.roof-content { background: linear-gradient(0deg, #090f17e0, #090f1770 24%, transparent 62%); }
.editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, .77fr) minmax(0, 1fr);
  gap: clamp(1.6rem, 6vw, 7rem);
  padding-block: clamp(3.5rem, 9vw, 7rem);
}
.editorial-grid h2 { font-size: clamp(2.7rem, 5.2vw, 5.8rem); }
.roof-section { align-content: end; align-items: start; min-height: max(29rem, calc(var(--viewport) * .72)); }
.roof-section:first-child { padding-top: clamp(7rem, 23vh, 14rem); }
.editorial-rows { border-bottom: 1px solid var(--line); }
.editorial-row { border-top: 1px solid var(--line); padding-block: 1.12rem; }
.editorial-row h3 { font-size: clamp(1.05rem, 1.6vw, 1.36rem); line-height: 1.2; }
.editorial-row p { max-width: 39rem; margin-top: .46rem; color: #d8e0e6; }
.editorial-row .opening-status { margin-bottom: .55rem; }
.footer { background: #090f17ac; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 5.3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.footer .brand { width: 6.5rem; }
dialog { width: min(33rem, calc(100% - 2rem)); border: 1px solid var(--line); border-radius: .15rem; padding: clamp(1.5rem, 4vw, 2.65rem); color: var(--white); background: #13202a; }
dialog::backdrop { background: #080e16df; }
dialog h2 { font-size: clamp(2rem, 6vw, 3.45rem); }
dialog p { margin: 1rem 0 1.3rem; color: var(--muted); }
.button-dark { color: var(--ink); background: var(--white); }

@media (max-width: 850px) {
  .nav-links { display: none; }
  .nav { grid-template-columns: 1fr 1fr; min-height: 4.55rem; }
  .stage-grade { background: linear-gradient(0deg, #080e15f2, #080e15ac 46%, #080e151a 80%), linear-gradient(180deg, #080e1580, transparent 26%); }
  .hero-copy { max-width: 39rem; }
  .ascent-layout { min-height: 45rem; }
}

@media (max-width: 630px) {
  .story {
    --desk: url("./assets/mesa-empalme.jpg");
    --turn: url("./assets/giro-ventanal.jpg");
  }
  .hero { min-height: max(32rem, var(--viewport)); }
  .nav { grid-template-columns: minmax(0, 1fr) max-content; gap: .4rem; }
  .nav .brand { width: clamp(5rem, 23vw, 6.5rem); }
  .nav .button { padding: .5rem .45rem; font-size: .75rem; white-space: nowrap; }
  .nav-end { gap: .4rem; }
  .language button { min-width: 1.6rem; padding-inline: .15rem; }
  .stage-shot { background: var(--deep); --shot-position: 72%; }
  .stage-cab { --shot-image: var(--cab); --shot-position: 53%; }
  [data-opening-arriving] .stage-cab { --shot-position: 72%; }
  .stage-desk { --shot-image: var(--desk); }
  .stage-turn::before { content: none; }
  .turn-art { --turn-crop: 45%; }
  .turn-detail { background-position: 72% center; mask-image: none; }
  .stage-roof { --shot-image: var(--roof); --shot-position: 73%; }
  .stage-shot::before, .hero-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
  .stage-shot::before {
    content: "";
    background: var(--shot-image) var(--shot-position) center / cover no-repeat;
  }
  .hero-media {
    object-position: var(--shot-position) center;
    transition: object-position .5s ease-in-out;
  }
  [data-opening-playing] .stage-cab::before { visibility: hidden; }
  .stage-grade {
    background: linear-gradient(180deg, #080e159e, transparent 16%),
      linear-gradient(0deg, #080e15e6, #080e1566 48%, transparent 72%);
  }
  .hero-body { padding-block: 4rem 3rem; }
  h1 { font-size: clamp(3rem, 13.5vw, 5.3rem); }
  :lang(en) h1 { font-size: clamp(2.63rem, 10.9vw, 4.75rem); }
  .hero-copy p { margin-top: 1.1rem; }
  .hero-copy p + p { margin-top: .5rem; }
  .hero-actions { gap: .5rem 1rem; margin-top: 1.2rem; }
  .hero-actions .button { gap: .8rem; min-height: 2.82rem; padding-inline: .7rem; }
  .hero-launch { font-size: .85rem; }
  .turn-layout { padding-bottom: 3.4rem; }
  .ascent-layout { min-height: max(41rem, var(--viewport)); grid-template-columns: 1fr; align-content: end; gap: 1.4rem; padding-block: 7rem 2rem; }
  .ascent-cabin::after { bottom: 24%; }
  .ascent-instrument { width: 100%; padding: .65rem .75rem .5rem; }
  .levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .level { justify-content: center; gap: .13rem; }
  .level::before { margin-inline: .1rem; }
  .opening { min-height: max(30rem, calc(var(--viewport) * .93)); }
  .opening h2 { font-size: clamp(2.25rem, 11.35vw, 3.15rem); }
  .journey-benefits { grid-template-columns: 1fr; }
  .editorial-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .hero-media { visibility: hidden; }
  [data-opening-playing] .stage-cab::before { visibility: visible; }
}
