/* Alpine Lines. Palette from the game (RuntimeTheme, GameGeometry) and its trailer. */
:root {
  --snow: #fff;
  --ink: #202632;
  --muted: #626b78;
  --night: rgb(21% 24% 30%); /* RuntimeTheme.scene_background_for_dark */
  --night-ink: #f5f9ff;
  --night-muted: rgb(78% 83% 90%);

  /* Map palette: day. Views override these for night. */
  --run-0: #5b6ee1;
  --run-1: #e15b5b;
  --run-2: #2c2c2c;
  --q-0: rgba(92, 110, 224, .30);
  --q-1: rgba(224, 92, 92, .30);
  --q-2: rgba(20, 20, 20, .46);
  --station-fill: #fff;
  --station-border: #161b22;
  --contour: rgb(23% 27% 33%); /* RuntimeTheme.altimetry_contour_color */
  --water: #d2e9fa;
  --track: #6f7a8c;
  --cabin-outline: #2c2c2c;
  --cabin-fill: #f6f6f6;
  --preview: rgb(44% 48% 55% / .45); /* RuntimeTheme.preview_line_color */
  --gs: 1;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1240px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--snow);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
/* clip, unlike hidden, also stops sideways scrolling in iOS Safari without creating a scroll container. */
html { scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--snow); line-height: 1.5; overflow-x: clip; }
img, svg { display: block; }
a { color: inherit; }
h1, h2, h3, p, ul { margin: 0; }
h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--run-0); outline-offset: 3px; border-radius: 4px; }

.c-blue { color: var(--run-0); }
.c-red { color: var(--run-1); }

/* ---------- Shared world layers ---------- */

.world-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.view { overflow: visible; }
.view .water { fill: var(--water); }
.view .contours { fill: none; stroke: var(--contour); }
/* Native contour alpha: 0.23 × (0.4 + 0.6 × normalized altitude), in both themes. */
#contours path { stroke-opacity: calc(.23 * var(--k)); stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.run { fill: none; }
.run-0 { stroke: var(--run-0); stroke-width: calc(4.54px * var(--gs)); }
.run-1 { stroke: var(--run-1); stroke-width: calc(3.97px * var(--gs)); }
.run-2 { stroke: var(--run-2); stroke-width: calc(2.84px * var(--gs)); }
.run.closed { opacity: .32; }
.run.open { opacity: .95; }
.track { stroke: var(--track); stroke-width: calc(1.7px * var(--gs)); fill: none; stroke-linecap: butt; }
.node { transform: scale(var(--gs)); }
.station { fill: var(--station-fill); stroke: var(--station-border); }
.spawn { fill: none; stroke: var(--station-border); }
.queue circle { fill: none; }
.q-0 { stroke: var(--q-0); }
.q-1 { stroke: var(--q-1); }
.q-2 { stroke: var(--q-2); }

.cabin-out { fill: var(--cabin-outline); }
.cabin-in { fill: var(--cabin-fill); }
.skier-out { fill: #fff; } /* skier.gdshader: white rim in both themes */
/* SkierManager.COLORS: skier and passenger colors stay the same at night. */
.s-0 { fill: #5b6ee1; }
.s-1 { fill: #e15b5b; }
.s-2 { fill: #2c2c2c; }
.preview { fill: none; stroke: var(--preview); stroke-linejoin: round; }

/* Growth entrance on the hero's own elements, held until site.js adds .grow:
   runs wipe downhill, stations pop 0 → 1.14 → 1 like the game's shader. */
/* Round caps would draw zero-length dashes as dots at both stations, so unrevealed runs
   stay hidden, and the gap and offset keep every dash clear of the path's ends. */
.motion .view-hero .run { stroke-dasharray: 1 2; stroke-dashoffset: 1.01; visibility: hidden; }
.motion .view-hero .pop { transform: scale(0); }
.motion .view-hero .track, .motion .view-hero .queue { opacity: 0; }
.grow .view-hero .run { animation: wipe var(--dur) var(--delay) cubic-bezier(.45, 0, .25, 1) forwards; }
.grow .view-hero .pop { animation: pop .5s var(--delay) both; }
.grow .view-hero .track, .grow .view-hero .queue { animation: fade .6s var(--delay) forwards; }
.grow .view-hero .queue.busy { animation: fade .6s var(--delay) forwards, breathe 9s calc(var(--delay) + .6s) ease-in-out infinite; }
/* Elsewhere the resort is already built; only the busiest queue breathes. */
.motion .queue.busy { animation: breathe 9s ease-in-out infinite; }
@keyframes wipe {
  from { stroke-dashoffset: 1.01; visibility: visible; }
  to { stroke-dashoffset: 0; visibility: visible; }
}
@keyframes pop {
  0% { transform: scale(0); }
  50% { transform: scale(1.14); }
  100% { transform: scale(1); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes breathe { 50% { transform: scale(.78); } }

/* ---------- Top bar ---------- */

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  padding: 18px var(--gutter);
  overflow: hidden; /* keeps the nav's soft backdrop inside the screen */
}
.topbar nav { position: relative; isolation: isolate; display: flex; gap: clamp(16px, 3vw, 32px); align-items: center; font-size: 15px; padding: 8px 4px; }
.topbar nav::before {
  /* A soft patch of snow so the links stay legible over the map. */
  content: "";
  position: absolute;
  inset: -22px -40px;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .96) 55%, rgba(255, 255, 255, 0));
  pointer-events: none;
}
.topbar nav a { text-decoration: none; color: var(--muted); }
.topbar nav a:hover { color: var(--ink); }
.topbar nav .topbar-get { color: var(--ink); font-weight: 700; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  min-height: min(100svh, 900px);
  display: flex;
  align-items: center;
  padding: 110px var(--gutter) 80px;
}
.view-hero {
  --gs: 1.3;
  position: absolute;
  right: max(-3vw, calc((100vw - 1500px) / 2));
  top: 50%;
  width: min(60vw, 960px);
  height: auto;
  aspect-ratio: 1160 / 1120;
  transform: translateY(-46%);
}
.hero::before {
  /* Text-safe wash, as in the trailer's title cards. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 84%, var(--snow)),
    linear-gradient(90deg, var(--snow) 0, rgba(255, 255, 255, .9) 34%, rgba(255, 255, 255, 0) 52%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 2; width: min(500px, 42vw); margin-left: max(0px, calc((100vw - var(--max)) / 2 - var(--gutter))); }
.hero-logo { width: min(100%, 440px); height: auto; margin-left: -2.6%; }
.genre {
  margin-top: 26px;
  font-size: 14px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.lead { margin-top: 14px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; max-width: 30em; }
/* One rhythm from the intro to the trailer pill to the badges. */
.actions { --stack: 24px; margin-top: var(--stack); display: flex; flex-direction: column; align-items: flex-start; gap: var(--stack); }
.badges { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.badges img { height: 48px; width: auto; }
.badges a { border-radius: 9px; }

.trailer-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px 0 10px;
  border-radius: 999px;
  /* The game's main start-screen action (RuntimeTheme.START_SCREEN_BLUE_SLOPE_COLOR). */
  background: #1b70af;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s;
}
.trailer-button svg { width: 28px; height: 28px; }
.trailer-button circle { fill: #fff; }
.trailer-button path { fill: #1b70af; }
.trailer-button:hover { background: #155c91; }

/* ---------- Trailer ---------- */

.trailer { padding: clamp(56px, 9vw, 120px) var(--gutter); max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; }
.trailer-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; margin-bottom: 24px; }
.trailer-head h2 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -.02em; line-height: 1.05; }
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #eef1f5;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(32, 38, 50, .1);
}
.player-poster, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-poster img { width: 100%; height: 100%; object-fit: cover; }
.player-play {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px 8px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--snow);
  font-weight: 700;
  font-size: 17px;
  transition: background .2s;
}
.player-play svg { width: 44px; height: 44px; }
.player-play circle { fill: var(--snow); }
.player-play path { fill: var(--ink); }
.player-poster:hover .player-play { background: #000; }
.player-alt { margin-top: 14px; font-size: 15px; color: var(--muted); }

/* ---------- How it plays ---------- */
/* One mountain, one camera: the map stays put while the camera moves between beats. */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.play {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(40px, 6vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 5vw, 72px);
}
.beat {
  min-height: min(84vh, 780px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
}
.beat h3 { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.02; letter-spacing: -.025em; }
.beat p { margin-top: 16px; font-size: 18px; color: var(--muted); max-width: 26em; }
/* Beat emphasis follows the scroll position (site.js). */
.view-beat { display: none; }
.camera { position: relative; }
.view-camera {
  --gs: 1.15;
  position: sticky;
  top: max(72px, calc(50vh - min(20vw, 240px)));
  width: 100%;
  height: auto;
  aspect-ratio: 10 / 7;
  overflow: hidden;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent);
  mask-image: radial-gradient(closest-side, #000 62%, transparent);
}
.legend { list-style: none; padding: 0; margin-top: 22px; display: grid; gap: 10px; font-size: 17px; }
.legend li { display: flex; align-items: flex-start; gap: 12px; }
.legend b { font-weight: 700; }
.dot { width: 14px; height: 14px; margin-top: .3em; border-radius: 50%; flex: none; }
.d-blue { background: var(--run-0); }
.d-red { background: var(--run-1); }
.d-black { background: var(--run-2); }

/* ---------- Night ---------- */

.night {
  /* RuntimeTheme's dark palette, as revealed at the end of the trailer. */
  --run-0: rgb(47% 61% 100%);
  --run-1: rgb(98% 49% 49%);
  --run-2: rgb(72% 77% 85%);
  --q-0: rgba(56%, 67%, 100%, .38);
  --q-1: rgba(100%, 56%, 56%, .38);
  --q-2: rgba(94%, 97%, 100%, .46);
  --station-fill: rgb(18% 21% 27%);
  --station-border: rgb(96% 98% 100%);
  --contour: rgb(82% 87% 94%);
  --water: #6983a5; /* lake fill blended 72% toward the dark tint */
  --preview: rgb(78% 84% 92% / .52);
  position: relative;
  overflow: hidden;
  background: var(--night);
  color: var(--night-ink);
  padding: clamp(72px, 10vw, 140px) var(--gutter);
}
.view-night {
  --gs: 1.4;
  position: absolute;
  right: max(-6vw, calc((100vw - 1560px) / 2));
  top: 50%;
  width: min(62vw, 980px);
  height: auto;
  aspect-ratio: 1160 / 1120;
  transform: translateY(-50%);
}
.night::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, var(--night) 0, rgb(21% 24% 30% / .92) 36%, rgb(21% 24% 30% / 0) 58%);
  pointer-events: none;
}
.night-copy { position: relative; z-index: 2; width: min(520px, 46vw); margin-left: max(0px, calc((100vw - var(--max)) / 2 - var(--gutter))); }
.night h2 { font-size: clamp(38px, 5vw, 64px); line-height: 1.02; letter-spacing: -.025em; }
.night-lead { margin-top: 10px; font-size: clamp(20px, 2vw, 24px); }
.night-copy > p:not(.night-lead):not(.night-note) { margin-top: 20px; font-size: 18px; color: var(--night-muted); max-width: 28em; }
.extras { list-style: none; padding: 0; margin-top: 22px; display: grid; gap: 10px; font-size: 17px; }
.extras li { display: flex; gap: 12px; align-items: flex-start; }
.extras li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: .5em;
  border-radius: 50%;
  background: var(--night-ink);
}
.night-logo { width: 220px; height: auto; margin: 52px 0 22px -6px; }
.night-note { margin-top: 26px; color: var(--night-muted); font-size: 15px; }

/* ---------- Privacy policy ---------- */

.legal { max-width: 720px; margin: 0 auto; padding: 40px var(--gutter) clamp(56px, 8vw, 96px); }
.legal-home { display: inline-block; }
.legal-home img { width: 140px; height: auto; margin-left: -4px; }
.legal h1 { margin-top: 40px; font-size: clamp(36px, 5vw, 52px); line-height: 1.05; letter-spacing: -.025em; }
.legal-date { margin-top: 10px; color: var(--muted); font-size: 15px; }
.legal h2 { margin-top: 40px; font-size: 22px; letter-spacing: -.01em; }
.legal p, .legal li { font-size: 17px; line-height: 1.6; color: var(--muted); }
.legal p { margin-top: 12px; }
.legal ul { margin: 12px 0 0; padding-left: 1.2em; display: grid; gap: 8px; }
.legal strong { color: var(--ink); }
.legal-short { padding: 2px 0 2px 18px; border-left: 3px solid var(--run-0); color: var(--ink); }
.legal code { font-size: .92em; }

/* ---------- Footer ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  justify-content: space-between;
  padding: 26px var(--gutter);
  background: var(--night);
  color: var(--night-muted);
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.footer a { color: var(--night-ink); }

/* ---------- Phones and narrow tablets ---------- */

@media (max-width: 820px) {
  .topbar { padding-top: 14px; padding-bottom: 14px; }
  .topbar nav a:not(.topbar-get) { display: none; }
  .topbar nav::before { inset: -18px -28px; }

  .hero { flex-direction: column; align-items: stretch; min-height: 0; padding: 84px var(--gutter) 0; }
  .hero::before { display: none; }
  #contours path { stroke-width: .8px; }
  .hero-copy { width: auto; margin: 0; }
  .hero-logo { width: min(78%, 340px); margin: 0 auto; }
  .genre, .lead { text-align: center; }
  .genre { margin-top: 22px; font-size: 13px; }
  .lead { margin: 10px auto 0; }
  .actions { align-items: center; --stack: 22px; }
  .badges { justify-content: center; }
  .badges img { height: 44px; }
  .view-hero {
    order: 2;
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 160%; /* a closer camera than desktop; the network runs off both sides */
    margin: 0 -30%;
    /* Portrait: the map fades out vertically, into the badges above and the trailer below. */
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 78%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 78%, transparent 100%);
  }

  .play { display: block; }
  .camera { display: none; }
  .beat { min-height: 0; padding: 28px 0 8px; }
  .beat h3 { font-size: clamp(32px, 9vw, 44px); }
  .beat p { font-size: 17px; }
  .view-beat {
    --gs: 1.15; /* same as the desktop camera */
    display: block;
    order: 3;
    margin: 12px calc(-1 * var(--gutter)) 0;
    width: calc(100% + 2 * var(--gutter));
    height: auto;
    overflow: hidden;
    -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent);
    mask-image: radial-gradient(closest-side, #000 62%, transparent);
  }

  .night { padding-top: 0; }
  .night::before { background: linear-gradient(180deg, rgb(21% 24% 30% / 0) 0, rgb(21% 24% 30% / .4) 26%, var(--night) 44%); }
  .view-night {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 140%;
    margin: 0 -20% -30%;
  }
  .night-copy { width: auto; margin: 0; }
  .player-play { bottom: 7%; gap: 8px; padding: 5px 14px 5px 5px; font-size: 15px; }
  .player-play svg { width: 32px; height: 32px; }
  .night-logo { width: 180px; }
  .night .badges { justify-content: flex-start; }
}

@media (max-width: 380px) {
  .trailer-button { width: 100%; justify-content: center; }
  .badges img { height: 40px; }
}
