.hero {
  position: relative; isolation: isolate;
  height: 100svh; min-height: 660px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media picture, .hero__media img { width: 100%; height: 100%; }
.hero__media img { object-fit: cover; object-position: 30% 42%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgb(8 11 16 / 0.5), transparent 22%, transparent 42%, rgb(8 11 16 / 0.95)),
    linear-gradient(90deg, rgb(8 11 16 / 0.45), transparent 55%);
}
.hero__content { position: relative; z-index: 2; padding-bottom: clamp(36px, 7vh, 80px); }
.hero__title {
  margin-left: -0.03em;
  font-size: clamp(4.2rem, 10.4vw, 9.4rem);
  font-weight: 700;
  line-height: 0.88;
}
.hero__title .line { display: block; }
.motion .hero__title { visibility: hidden; animation: ff-show 0s 2s forwards; }
@keyframes ff-show { to { visibility: visible; } }
.hero__foot {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px 48px;
  margin-top: clamp(24px, 3.6vh, 40px);
}
.hero__foot > p { max-width: 34em; color: var(--mist); font-size: var(--step-1); }
.hero__note { margin-top: 16px; font-size: 0.9rem; }
.hero__note a { color: var(--mist); }
.hero__note a:hover { color: var(--accent); }

.hud { position: absolute; inset: 0; z-index: 1; pointer-events: none; color: var(--cloud); }
.hud__ladder {
  position: absolute; left: 76%; top: 42%;
  width: min(46vw, 540px); aspect-ratio: 4 / 3;
  transform: translate(-50%, -50%);
  opacity: 0.6; overflow: visible;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.6));
}
.hud__ladder * { vector-effect: non-scaling-stroke; }
.hud__ladder text { font: 400 10px var(--f-data); fill: currentColor; }
.hud__ladder .acc { stroke: var(--accent); fill: none; }

.flights { position: relative; background: var(--ink-3); }
.scene { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
.scene__media { position: absolute; inset: 0; }
.scene__media picture, .scene__media img { width: 100%; height: 100%; }
.scene__media img { object-fit: cover; }
.scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgb(8 11 16 / 0.78), transparent 60%),
    linear-gradient(270deg, rgb(8 11 16 / 0.72), transparent 26%),
    linear-gradient(0deg, rgb(8 11 16 / 0.8), transparent 46%);
}
.scene__cap {
  position: absolute; z-index: 2;
  left: var(--gutter); bottom: clamp(56px, 11vh, 120px);
  width: min(620px, 100% - 2 * var(--gutter));
}
.scene__cap h2 {
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 7.2rem); font-weight: 700;
  line-height: 0.9;
}
.scene__cap p { max-width: 32em; color: var(--mist); font-size: var(--step-1); }
.scene__cap p span { color: var(--accent); }

.flights__ui { display: none; }
.motion .flights__stage { position: relative; height: 100svh; overflow: hidden; }
.motion .scene { position: absolute; inset: 0; height: auto; min-height: 0; }
.motion .scene:not(:first-child) { clip-path: inset(0 0 0 100%); }
.motion .flights__ui { display: block; }

.flights__count {
  position: absolute; z-index: 5; right: var(--gutter); top: calc(var(--nav-h) + 20px);
  display: flex; align-items: center; gap: 8px;
  color: var(--cloud); font-size: 0.85rem;
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.9), 0 0 16px rgb(0 0 0 / 0.7);
}
.flights__digits { display: inline-block; height: 1.2em; overflow: hidden; font: 400 1.6rem/1.2 var(--f-data); color: var(--cloud); }
.flights__digits-col { display: block; will-change: transform; }
.flights__digits-col span { display: block; height: 1.2em; }

.rail {
  position: absolute; z-index: 5; right: var(--gutter); top: 50%;
  display: flex; flex-direction: column;
  transform: translateY(-50%);
}
.rail button {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  min-height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  font-size: 0.9rem; color: var(--cloud);
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.9), 0 0 16px rgb(0 0 0 / 0.7);
  transition: color 0.3s;
}
.rail button::after { content: ""; width: 28px; height: 2px; background: rgb(232 236 242 / 0.4); transition: width 0.5s var(--ease-out), background-color 0.5s; }
.rail button:hover, .rail button[aria-current="step"] { color: var(--cloud); }
.rail button[aria-current="step"]::after { width: 60px; background: var(--accent); }
.flights__progress { position: absolute; z-index: 5; inset: auto 0 0; height: 3px; background: rgb(232 236 242 / 0.1); }
.flights__progress i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }

.world { padding: clamp(110px, 14vw, 200px) 0 clamp(90px, 11vw, 160px); }
.world__intro { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 6vw, 96px); align-items: end; }
.world__statement {
  max-width: 24em;
  font: 500 clamp(1.45rem, 2.5vw, 2.2rem)/1.25 var(--f-body);
  color: var(--mist);
}

.layers {
  display: grid; grid-template-columns: 5fr 6fr; gap: clamp(36px, 7vw, 110px);
  margin-top: clamp(72px, 9vw, 130px);
  align-items: start;
}
.layers__frame { position: sticky; top: calc(var(--nav-h) + 24px); height: calc(100svh - var(--nav-h) - 48px); max-height: 800px; }
.lens {
  position: relative; height: 100%; margin: 0;
  overflow: hidden; border-radius: var(--radius);
  background: var(--ink-2);
  box-shadow: 0 40px 80px -36px rgb(0 0 0 / 0.9);
}
.lens picture, .lens > picture img { width: 100%; height: 100%; }
/* every mode uses the same filter functions in the same order, or the browser can't animate between them */
.lens > picture img { object-fit: cover; object-position: 32% 50%; transform: scale(1.04); filter: grayscale(0) brightness(1) contrast(1) saturate(1); transition: filter 0.9s var(--ease-out); }
.lens[data-mode="terrain"] > picture img { filter: grayscale(1) brightness(0.6) contrast(1.3) saturate(1); }
.lens[data-mode="roads"] > picture img { filter: grayscale(0.85) brightness(0.36) contrast(1.15) saturate(1); }
.lens[data-mode="night"] > picture img { filter: grayscale(0.6) brightness(0.16) contrast(1.4) saturate(1); }
.lens[data-mode="weather"] > picture img { filter: grayscale(0) brightness(0.76) contrast(1) saturate(0.5); }

.fx { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.8s var(--ease-out); }
.fx canvas, .fx svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lens[data-mode="terrain"] .fx--terrain,
.lens[data-mode="imagery"] .fx--tiles,
.lens[data-mode="roads"] .fx--roads,
.lens[data-mode="night"] .fx--night,
.lens[data-mode="weather"] .fx--weather { opacity: 1; }
.fx--tiles { display: grid; grid-template-columns: repeat(var(--cols, 6), 1fr); }
.fx--tiles i { position: relative; border: 0.5px solid rgb(232 236 242 / 0.16); }
.fx--tiles b { position: absolute; inset: 0; background: var(--ink-2); }
.fx--roads path { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; }
.fx--roads rect { fill: rgb(245 197 24 / 0.75); }
.fx--night { background: radial-gradient(120% 80% at 50% 110%, oklch(32% 0.06 255 / 0.5), transparent 70%); }
.blip { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; color: var(--accent); font: 400 10px/1 var(--f-data); }
.blip::before { content: ""; width: 9px; height: 9px; background: currentColor; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.lens__hud {
  position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 48px 20px 18px;
  background: linear-gradient(0deg, rgb(6 8 12 / 0.85), transparent);
  font-size: 0.82rem;
}
.lens__name { font: 700 1.4rem/1 var(--f-display); letter-spacing: 0.04em; text-transform: uppercase; color: var(--cloud); }
.lens__src { color: var(--mist); text-align: right; }

.layers__list { list-style: none; }
.layer {
  min-height: clamp(220px, 34vh, 340px);
  padding: 30px 0 36px;
  border-top: 1px solid var(--line);
  transition: border-color 0.4s;
}
.layer:last-child { min-height: 0; border-bottom: 1px solid var(--line); }
.layer h3 { font-size: var(--step-h3); color: var(--haze); transition: color 0.4s; }
.layer p { max-width: 34em; margin-top: 12px; color: var(--haze); }
.layer em { font-style: normal; color: var(--cloud); }
.layer.is-active { border-top-color: var(--accent); }
.layer.is-active h3, html:not(.js) .layer h3 { color: var(--cloud); }

.release { padding: clamp(100px, 13vw, 180px) 0; background: var(--ink-2); border-block: 1px solid var(--line); }
.release__head { display: grid; grid-template-columns: 7fr 5fr; gap: 24px 60px; align-items: end; }
.release__head .lead { justify-self: end; margin-top: 0; }
.release__list {
  list-style: none;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 clamp(24px, 3vw, 48px);
  margin: clamp(48px, 6vw, 80px) 0 clamp(40px, 5vw, 64px);
}
.release__list li {
  padding: 24px 0 30px;
  border-top: 1px solid var(--line);
  font: 500 clamp(1.1rem, 1.4vw, 1.3rem)/1.4 var(--f-body);
  color: var(--mist);
}
.release__list b { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

.download { padding: clamp(100px, 13vw, 180px) 0; background: var(--ink-2); border-top: 1px solid var(--line); }
.download__grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.download code { font: 400 0.92em var(--f-data); color: var(--cloud); }
.files { list-style: none; margin-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--line); }
.files a {
  display: grid; grid-template-columns: 7.5rem 1fr auto 16px; gap: 16px; align-items: center;
  min-height: 56px; padding: 10px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--mist);
  transition: background-color 0.2s, padding 0.3s var(--ease-out), color 0.2s;
}
.files a::after {
  content: ""; width: 14px; height: 14px; background: currentColor; opacity: 0.6;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M7 1v10M2.5 6.5 7 11l4.5-4.5M1.5 13h11'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M7 1v10M2.5 6.5 7 11l4.5-4.5M1.5 13h11'/%3E%3C/svg%3E") center / contain no-repeat;
}
.files a:hover { padding-inline: 10px; background: rgb(255 255 255 / 0.03); color: var(--cloud); }
.files a:hover::after { opacity: 1; background: var(--accent); }
.files b { color: var(--cloud); font-weight: 700; }
.files .tnum { font-family: var(--f-data); font-size: 0.88rem; color: var(--haze); }
.files li.is-yours a { color: var(--cloud); }
.files li.is-yours span:not(.tnum)::after { content: " · your system"; color: var(--accent); }
.files__note { margin-top: 16px; color: var(--haze); font-size: 0.88rem; }
.files__note a { color: var(--mist); }

.build h3 { font-size: var(--step-h3); }
.build > p { margin-top: 10px; color: var(--haze); }
.term { margin-top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-3); }
.term__bar { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 16px; border-bottom: 1px solid var(--line); color: var(--haze); font-size: 0.82rem; }
.term__bar button { min-height: 40px; padding: 0 12px; border: 0; border-radius: 4px; background: none; cursor: pointer; color: var(--accent); font-size: 0.85rem; }
.term__bar button:hover { background: rgb(255 255 255 / 0.06); }
.term pre { margin: 0; padding: 20px 18px; overflow-x: auto; font: 400 0.88rem/1.9 var(--f-data); color: var(--cloud); }
.build__help { margin-top: 28px; max-width: 34em; color: var(--haze); }
.build__help a { color: var(--cloud); }
.build__help a:hover { color: var(--accent); }

@media (max-width: 1100px) {
  .hud__ladder { left: 66%; top: 38%; width: min(62vw, 480px); opacity: 0.45; }
  .release__list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .world__intro, .release__head, .download__grid { grid-template-columns: minmax(0, 1fr); }
  .release__head .lead { justify-self: start; }
  .rail { display: none; }
  .layers { grid-template-columns: 1fr; gap: 0; }
  .layers__frame { top: calc(var(--nav-h) + 8px); z-index: 2; height: 44svh; }
  .layers__list { margin-top: 28px; }
  .layer { min-height: 50svh; }
}
@media (max-width: 640px) {
  .hud__ladder { display: none; }
  .release__list { grid-template-columns: 1fr; }
  .files a { grid-template-columns: 5.2rem 1fr auto 14px; gap: 10px; font-size: 0.92rem; }
  .files li.is-yours span:not(.tnum)::after { content: ""; }
  .files li.is-yours b { color: var(--accent); }
}
