:root {
  color-scheme: dark;
  --bg: #07080a;
  --white: #f4f5f9;
  --muted: #a0a7ba;
  --line: #2a2b32;
  --signal: #aeb8ff;
  --gutter: clamp(24px, 6.15vw, 110px);
  --mono: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font: 400 16px/1.55 Inter, system-ui, sans-serif;
}

img { max-width: 100%; }
a { color: inherit; }
p, figure, h1, h2, dl, dd { margin: 0; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: var(--gutter);
  padding: 12px;
  color: var(--bg);
  background: var(--signal);
  transform: translateY(-160%);
}

.skip:focus { transform: none; }

.mark {
  font-size: clamp(.9rem, 1.7vw, 1.24rem);
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
}

.story {
  display: grid;
  grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr);
  grid-template-areas: "copy stage";
  column-gap: clamp(20px, 4vw, 80px);
  max-width: 1590px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.story-copy {
  grid-area: copy;
  min-width: 0;
}

.chapter {
  display: grid;
  align-items: center;
  min-height: 100svh;
  padding-block: 50px;
  border-bottom: 1px solid var(--line);
}

.chapter:last-child { border-bottom: 0; }

.chapter h1,
.chapter h2 {
  font-weight: 700;
  line-height: .96;
  letter-spacing: -.071em;
  text-wrap: balance;
}

.chapter h1 { font-size: clamp(58px, 7.1vw, 114px); }
.chapter h2 { font-size: clamp(42px, 5.75vw, 94px); }
.chapter :is(h1, h2) span { color: var(--signal); }

.eyebrow {
  margin-bottom: 19px;
  color: #b5c0ff;
  font: 500 .72rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .09em;
}

.lede {
  max-width: 34ch;
  margin-top: 24px;
  color: #e8eaf1;
  font-size: clamp(18px, 1.8vw, 26px);
  letter-spacing: -.032em;
  line-height: 1.43;
}

.hero-specs {
  display: flex;
  justify-content: space-between;
  align-items: start;
  column-gap: 8px;
  max-width: 410px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.hero-specs > div {
  display: grid;
  row-gap: 4px;
}

.hero-specs dd {
  grid-row: 1;
  font-size: clamp(27px, 3.2vw, 42px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.055em;
}

.hero-specs dt {
  grid-row: 2;
  color: var(--muted);
  font: 500 .68rem/1.35 var(--mono);
  white-space: nowrap;
}

.feature-detail {
  max-width: 43ch;
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(.9rem, 1.2vw, 1.02rem);
}

.feature-detail strong {
  color: var(--white);
  font-weight: 600;
}

.feature-note {
  margin-top: 14px;
  color: var(--muted);
}

.feature-note small {
  font-size: .79rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-height: 46px;
  padding-inline: 20px;
  border: 1px solid transparent;
  border-radius: 100px;
  background: #e4e7fb;
  color: #13172b;
  font-family: inherit;
  font-weight: 700;
  font-size: .84rem;
  text-decoration: none;
}

.button:hover { background: #fff; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 27px;
}

.download-picker { position: relative; }

.download-picker summary {
  cursor: pointer;
  list-style: none;
}

.download-picker summary::-webkit-details-marker { display: none; }
.download-picker[open] summary span { transform: rotate(180deg); }

.download-panel {
  position: absolute;
  z-index: 3;
  inset: calc(100% + 8px) auto auto 0;
  width: min(310px, calc(100vw - var(--gutter) * 2));
  padding: 6px;
  border: 1px solid #3e414e;
  border-radius: 14px;
  background: #111319;
  box-shadow: 0 15px 40px #0009;
}

.download-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.download-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding-inline: 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: .84rem;
  text-decoration: none;
}

.download-option:is(a) {
  background: #242940;
  color: var(--white);
  font-weight: 600;
}

.download-option:is(a):hover { background: #343c5b; }

.download-option small,
.store-button small { font: 400 .66rem/1.25 var(--mono); }

.button-secondary {
  border-color: #3e414e;
  background: transparent;
  color: var(--white);
}
.button-secondary:hover { border-color: #6e7595; background: #181d2c; }

.download-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 8px;
  font-size: .82rem;
}
.download-heading > span { color: var(--muted); font: 400 .66rem/1.4 var(--mono); }
.download-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding-inline: 10px;
  border-radius: 8px;
  color: var(--white);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
}
.download-choice:hover { background: #242940; }
.download-install { background: #242940; }
.download-install:hover { background: #343c5b; }
.download-panel .download-list { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.download-panel { max-height: min(380px, 60svh); overflow-y: auto; overscroll-behavior: contain; }
.download-picker.opens-up .download-panel { inset: auto auto calc(100% + 8px) 0; }

.hero-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 22px;
  margin-top: 8px;
}
.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--muted);
  font-size: .79rem;
  font-weight: 500;
  text-decoration: none;
}
.hero-links a:hover { color: var(--white); text-decoration: underline; text-underline-offset: .19em; }
.store-button:disabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 .72rem/1.4 Inter, system-ui, sans-serif;
  opacity: .8;
}
.store-button small { font: 400 .62rem/1.4 var(--mono); }

.explore-link { margin-top: 0; }
.hero-links .manual-link { color: var(--white); }

.explore-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 7px;
  color: var(--signal);
  font-size: .84rem;
  font-weight: 600;
  text-underline-offset: .19em;
}

.stage {
  grid-area: stage;
  position: sticky;
  top: 16px;
  align-self: start;
  height: min(calc(100svh - 32px), 820px);
  margin: 16px 0;
  min-width: 0;
  isolation: isolate;
  background: radial-gradient(ellipse 54% 49% at 44% 43%, #192437, #101623 38%, transparent 80%);
}

.stage-device {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease-out, visibility 0s linear 180ms;
}

.stage-device.is-active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
  z-index: 1;
}

.stage-device .pt-device {
  width: min(95%, 740px);
  filter: drop-shadow(9px 22px 19px #000d) drop-shadow(-1px -1px 2px #94bcff20);
}

.stage-device .pt-3ds { width: min(88%, 68svh, 585px); }
.stage-device .pt-fm1 { width: min(100%, 790px); }
.stage-device .pt-n95 { width: min(39%, 26svh, 225px); }

footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px;
  padding: 24px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}

.footer-contact {
  display: grid;
  gap: 8px;
  flex-basis: 100%;
  font-size: .95rem;
}

.footer-contact a,
.footer-credits {
  color: var(--signal);
  text-underline-offset: .22em;
}

@media (max-width: 730px) {
  :root {
    --stage-height: clamp(178px, 36svh, 330px);
  }

  .story {
    display: block;
    padding-inline: 0;
  }

  .story-copy { padding-inline: var(--gutter); }

  .stage {
    top: 0;
    z-index: 2;
    height: var(--stage-height);
    margin: 0;
    background: radial-gradient(ellipse 54% 49% at 43% 43%, #192437, #101623 38%, var(--bg) 78%);
  }

  .stage-device .pt-device { width: min(91%, 58svh, 430px); }
  .stage-device .pt-3ds { width: min(82%, 34svh, 285px); }
  .stage-device .pt-n95 { width: min(35%, 13.5svh, 125px); }

  .chapter {
    align-items: start;
    min-height: calc(100svh - var(--stage-height) / 2);
    padding-block: 42px 48px;
    scroll-margin-top: var(--stage-height);
  }

  .chapter-intro {
    align-items: start;
    min-height: calc(100svh - var(--stage-height));
  }

  .chapter h1 { font-size: clamp(49px, 12.4vw, 78px); }
  .chapter h2 { font-size: clamp(43px, 10.4vw, 70px); }
  .eyebrow { margin-bottom: 13px; }
  .lede { margin-top: 17px; }
  .hero-actions { margin-top: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .stage-device { transition: none; }
}
