/* The journey at the top of the store page: the 3D board, its stations and the progress rail.
   Loaded after site.css, which holds the tokens, the header, buttons and everything else the
   pages share. */
/* The 3D board sits behind everything and fades in once its first frame is ready. */
.world {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.scene-on .world { opacity: 1; }

/* Over the pinned journey nothing scrolls beneath the header, so it gives the scene the full screen. */
.pinned.over-journey .top { border-bottom-color: transparent; background: linear-gradient(180deg, rgba(6, 8, 11, .78), rgba(6, 8, 11, 0)); }
/* Still backdrop for visitors without the 3D scene: a faint board grid under a single light. */
html:not(.pinned) body {
  background:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 100% 72px,
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 72px 100%,
    radial-gradient(110% 70% at 72% 0%, #0e1c30 0%, var(--bg) 62%) fixed;
}
html:not(.pinned) .world { display: none; }

/* Stations. Without the pinned class they are ordinary full-height sections, one after another. */
.journey { position: relative; z-index: 1; }
.station {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 104px var(--gutter) 112px;
  border-bottom: 1px solid var(--line);
}
/* Each panel is a size container, so headlines can be sized from the panel they have to fit in
   (cqw) in both the pinned and the stacked layout. */
.panel { position: relative; z-index: 1; width: min(44vw, 640px); container-type: inline-size; }
.station[data-panel="right"] .panel { justify-self: end; }
/* The opening text keeps to the left half; the Launcher screen stands in the right half of the scene. */
.station-hero .panel { align-self: end; width: min(46vw, 680px); }
/* The first size is for browsers without container units; the second fits "Launcher." to the panel. */
.station-hero .display { font-size: clamp(34px, min(5.6vw, 9.6vh), 96px); font-size: clamp(34px, min(13cqw, 9.6vh), 96px); }
.hero-launcher { display: none; margin: 0; }
.hero-launcher img { display: block; width: 100%; height: auto; border: 1px solid var(--line-strong); border-radius: 10px; }
html:not(.pinned) .station-hero { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); column-gap: var(--gutter); }
html:not(.pinned) .station-hero .panel { width: auto; align-self: center; }
html:not(.pinned) .hero-launcher { display: block; }
.station-end .panel { justify-self: center; align-self: end; width: min(90vw, 900px); text-align: center; }

.label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
  color: var(--ink-dim);
  font: 500 12px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.station-end .label,
.station-end .actions { justify-content: center; }
.addr { color: var(--family); text-transform: none; }
.label .count { color: var(--ink-faint); }
.label .count::before { content: ""; display: inline-block; width: 28px; height: 1px; margin-right: 14px; background: var(--line-strong); vertical-align: middle; }

/* Headlines contrast the widest, heaviest cut of the typeface with its narrowest, lightest one. */
.display {
  margin: 0;
  font: 800 clamp(42px, 6.6vw, 104px)/.94 var(--sans);
  font-stretch: 125%;
  letter-spacing: -.035em;
  text-transform: uppercase;
}
/* Family titles share one size, set from the longest line among them (--chars) so none outgrows
   the panel. No capital in this cut is wider than 1em, so one em per character always fits. */
.station-family .display,
.station-picks .display { font-size: clamp(30px, calc(40vw / var(--chars, 8)), 104px); font-size: clamp(30px, calc(100cqw / var(--chars, 8)), 104px); }
.station-end .display { font-size: clamp(34px, 5.8vw, 92px); font-size: clamp(34px, 11.2cqw, 92px); }
.display .line { display: block; overflow: hidden; padding-bottom: .07em; }
.display .line > span { display: block; }
.display em { color: var(--family); font-style: normal; font-weight: 200; font-stretch: 62%; letter-spacing: -.01em; }
.display-pre {
  display: block;
  margin-bottom: .5em;
  color: var(--ink-dim);
  font-size: .2em;
  font-weight: 300;
  font-stretch: 100%;
  letter-spacing: .42em;
  line-height: 1;
}
.note { margin: 10px 0 0; color: var(--ink-dim); font: 400 13px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.lede { max-width: 56ch; margin: 26px 0 0; color: var(--ink-dim); font-size: clamp(17px, 1.35vw, 20px); line-height: 1.5; }
.station-end .lede { margin-inline: auto; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  font: 500 13px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.facts li { padding: 2px 18px; border-left: 1px solid var(--line-strong); }
.facts li:first-child { padding-left: 0; border-left: 0; }
.facts .state::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: currentColor; }
.facts .online { color: #4be0a4; }
.facts .testing { color: #ffd166; }
.facts .updating { color: #ffad42; }
.facts .offline { color: #ff5d73; }

.names {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  max-width: 560px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-size: 15px;
}
.names li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.names .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A community favourite carries its review score beside its name. */
.names .rated { flex: 0 0 auto; color: #ffd166; font: 500 12px/1 var(--mono); letter-spacing: .06em; }
.names .more { color: var(--ink-faint); }
.names .more-narrow { display: none; }

/* Community favourites: a ranked list where each row opens that product in the store. */
.picks { max-width: 560px; margin: 22px 0 0; padding: 0; list-style: none; }
.picks li { break-inside: avoid; }
.picks a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 44px;
  align-items: baseline;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: border-color .25s var(--ease);
}
.picks a:hover,
.picks a:focus-visible { border-top-color: var(--family); outline: none; }
.pick-rank { color: var(--ink-faint); font: 500 12px/1 var(--mono); letter-spacing: .1em; }
.pick-name { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; transition: color .25s var(--ease); }
.picks a:hover .pick-name,
.picks a:focus-visible .pick-name { color: var(--family); }
.pick-score { color: var(--family); font: 500 13px/1 var(--mono); letter-spacing: .06em; }
.pick-count { color: var(--ink-faint); font: 500 12px/1 var(--mono); letter-spacing: .06em; text-align: right; }
/* Without the scene this stop is skipped: the full Community favourites list follows in the store. */
html:not(.pinned) .station-picks { display: none; }
.station[data-panel="right"] .names { margin-left: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.figures {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 0 44px;
  width: fit-content;
  margin: 38px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.figures dt { color: var(--ink-faint); font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.figures dd { margin: 9px 0 0; font: 700 30px/1 var(--sans); font-stretch: 112%; font-variant-numeric: tabular-nums; }

/* A scroll hint beside the opening buttons. Only the pinned journey needs one. */
.cue {
  display: none;
  align-items: center;
  gap: 14px;
  margin-left: 14px;
  color: var(--ink-dim);
  font: 500 11px/1 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.cue span { position: relative; width: 56px; height: 1px; overflow: hidden; background: var(--line); }
.cue span::after { content: ""; position: absolute; inset: 0; background: var(--ink); animation: cue-travel 2.2s var(--ease) infinite; }
@keyframes cue-travel {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.rail { display: none; }

/* Without the scene, each family shows its emblem in the half of the section the text leaves free.
   A product with artwork of its own overlaps the corner, as it does in the scene. */
.station-art { display: none; }
html:not(.pinned) .station-family { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); }
html:not(.pinned) .station-family .panel { grid-row: 1; grid-column: 2; width: auto; justify-self: stretch; }
html:not(.pinned) .station-family[data-panel="left"] .panel { grid-column: 1; }
html:not(.pinned) .station-art { position: relative; display: block; grid-row: 1; grid-column: 1; justify-self: center; width: min(100%, 420px); }
html:not(.pinned) .station-family[data-panel="left"] .station-art { grid-column: 2; }
.station-emblem { display: block; width: 100%; aspect-ratio: 1; border: 1px solid var(--line-strong); border-radius: 6px; object-fit: cover; }
.station-emblem-extra { position: absolute; right: -7%; bottom: -7%; width: 42%; box-shadow: 0 0 0 6px var(--bg); }

/* Pinned mode: the stage stays in view while the page scrolls underneath it, and one station
   shows at a time. The journey's height is the scroll distance. */
.pinned .journey { height: calc(var(--stations, 2) * 100vh); }
.pinned .stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
/* A shade under the progress rail, which runs along the bottom over the brightest traces. */
.pinned .stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  z-index: 0;
  height: 160px;
  background: linear-gradient(0deg, rgba(6, 8, 11, .9), rgba(6, 8, 11, 0));
  pointer-events: none;
}
.pinned .station {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-bottom: 0;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s .4s;
}
.pinned .station.is-active { visibility: visible; pointer-events: auto; transition: none; }
/* Keeps text readable over the scene without boxing it in. */
.pinned .station::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 8, 11, .9) 0%, rgba(6, 8, 11, .62) 30%, rgba(6, 8, 11, 0) 60%);
  opacity: 0;
  transition: opacity .4s ease;
}
.pinned .station[data-panel="right"]::before { transform: scaleX(-1); }
.pinned .station-end::before { background: linear-gradient(0deg, rgba(6, 8, 11, .92) 0%, rgba(6, 8, 11, .5) 38%, rgba(6, 8, 11, 0) 68%); }
.pinned .station.is-active::before { opacity: 1; transition: opacity .8s ease; }

.pinned [data-rise] { opacity: 0; transform: translate3d(0, 20px, 0); transition: opacity .3s ease, transform .3s ease; }
.pinned .is-active [data-rise] {
  opacity: 1;
  transform: none;
  transition: opacity .8s var(--ease) calc(var(--i, 0) * 70ms + 160ms), transform 1s var(--ease) calc(var(--i, 0) * 70ms + 160ms);
}
.pinned .display .line > span { transform: translate3d(0, 106%, 0); transition: transform .3s ease; }
.pinned .is-active .display .line > span { transform: none; transition: transform 1.1s var(--ease) calc(var(--i, 0) * 80ms + 120ms); }
.pinned .display-pre { opacity: 0; transition: opacity .3s ease; }
.pinned .is-active .display-pre { opacity: 1; transition: opacity .8s ease .1s; }

.pinned .cue { display: inline-flex; }
.pinned .rail {
  position: absolute;
  right: var(--gutter);
  bottom: 26px;
  left: var(--gutter);
  z-index: 3;
  display: flex;
  align-items: flex-end;
  gap: 24px;
}
.rail ol { display: flex; flex: 1 1 auto; gap: 6px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.rail li { flex: 1 1 0; min-width: 0; }
.rail button {
  display: block;
  width: 100%;
  padding: 12px 0 0;
  border: 0;
  background: none;
  color: var(--ink-faint);
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .3s var(--ease);
}
.rail button:hover,
.rail button:focus-visible { color: var(--ink); outline: none; }
.rail .tick { position: relative; display: block; height: 2px; margin-bottom: 10px; overflow: hidden; background: var(--line); }
.rail .tick::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tick, var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .7s var(--ease);
}
.rail .is-past .tick::after { transform: scaleX(1); opacity: .35; }
.rail button[aria-current="true"] { color: var(--ink); }
.rail button[aria-current="true"] .tick::after { transform: scaleX(1); opacity: 1; }
.rail-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-now { display: flex; gap: 8px; margin: 0; color: var(--ink-faint); font: 500 11px/1 var(--mono); letter-spacing: .12em; white-space: nowrap; }
.rail-now span:first-child { color: var(--ink); }

/* Touch screens: every station is a snap point that a flick cannot pass, so momentum never
   carries the page over a family. The markers stand where landing.js places each station: the
   scroll distance is the journey less one stage. Snapping has to be mandatory for the stop to
   hold; a looser setting lets a hard flick through. Mouse and trackpad scrolling keep the freer
   glide, which landing.js settles. */
.stop { display: none; }
@media (hover: none) and (pointer: coarse) {
  html.pinned { scroll-snap-type: y mandatory; }
  /* Past the journey the page scrolls freely: a snap area taller than the screen may rest
     anywhere inside itself, and the footer is one more place to rest. */
  .pinned .store { scroll-snap-align: start; }
  .pinned .foot { scroll-snap-align: end; }
  .pinned .stop {
    position: absolute;
    top: calc((100% - 100vh) * var(--k) / (var(--stations) - 1));
    top: calc((100% - 100dvh) * var(--k) / (var(--stations) - 1));
    left: 0;
    display: block;
    width: 100%;
    height: 1px;
    pointer-events: none;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}

/* Tall layout: phones, and any screen taller than it is wide. Text sits at the bottom and the
   scene frames its subject above it. landing.js gives the scene this same condition. */
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .station { align-items: end; padding: 84px var(--gutter) 92px; }
  .panel,
  .station-hero .panel,
  .station-end .panel { width: 100%; justify-self: stretch; text-align: left; }
  .station-end .label,
  .station-end .actions { justify-content: flex-start; }
  .station-end .lede { margin-inline: 0; }
  /* The slightly narrower cut used on phones leaves room for larger type in the same panel. */
  .display { font-stretch: 112%; }
  .station-hero .display { font-size: clamp(32px, 9.4vw, 62px); font-size: clamp(32px, min(14cqw, 7.4vh), 62px); }
  .station-family .display,
  .station-picks .display { font-size: clamp(30px, calc(86vw / var(--chars, 8)), 62px); font-size: clamp(30px, calc(100cqw / (var(--chars, 8) * .86)), 62px); }
  .picks .wide-only { display: none; }
  .station-end .display { font-size: clamp(32px, 9.6vw, 58px); font-size: clamp(32px, 12.2cqw, 58px); }
  html:not(.pinned) .station-hero { grid-template-columns: minmax(0, 1fr); row-gap: 26px; }
  html:not(.pinned) .station-family { grid-template-columns: minmax(0, 1fr); align-content: end; row-gap: 22px; }
  html:not(.pinned) .station-family .panel,
  html:not(.pinned) .station-family[data-panel="left"] .panel { grid-row: 2; grid-column: 1; }
  html:not(.pinned) .station-art,
  html:not(.pinned) .station-family[data-panel="left"] .station-art { grid-row: 1; grid-column: 1; justify-self: start; width: min(56vw, 240px); }
  .lede { margin-top: 18px; }
  .facts { margin-top: 18px; }
  .names { grid-template-columns: 1fr; margin-top: 16px; }
  .names .wide-only,
  .names .more-wide { display: none; }
  .names .more-narrow { display: block; }
  .actions { margin-top: 22px; }
  .actions .button { flex: 1 1 auto; }
  .figures { grid-template-columns: repeat(2, auto); gap: 18px 36px; margin-top: 26px; }
  .figures dd { font-size: 24px; }
  /* On a tall screen the core is framed in the upper half, so the shade rises from the bottom. */
  .pinned .station::before,
  .pinned .station[data-panel="right"]::before { background: linear-gradient(0deg, rgba(6, 8, 11, .95) 0%, rgba(6, 8, 11, .72) 42%, rgba(6, 8, 11, 0) 72%); transform: none; }
  /* On a phone the Launcher screen fills the top of the opening view, so the text below it is kept short. */
  .pinned .station-hero .lede-more,
  .pinned .station-hero .figures,
  .pinned .cue,
  .rail-name { display: none; }
  .pinned .rail { bottom: 20px; align-items: center; }
  .rail button { padding: 12px 0; }
  .rail .tick { margin-bottom: 0; }
}

/* Short screens: drop the least important rows rather than run into the rail. */
@media (max-height: 760px) {
  .pinned .station-hero .figures,
  .pinned .picks .wide-only { display: none; }
}
@media (max-height: 640px) {
  .names { display: none; }
}

