/* Ski Baron site. Arc fundamentals (semantic tokens, sentence case, 400/500 body weights, keyboard-only focus
   rings, reduced motion, light and dark) dressed in the game's art direction (REDESIGN.md palette, Lilita One). */

@font-face {
  font-family: "Lilita One";
  src: url("/fonts/lilita-one.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Semantic tokens */
  --background: #f7fbff;
  --surface: #ffffff;
  --surface-muted: #eef5ff;
  --foreground: #14305a;
  --text-secondary: #3e5679;
  --text-muted: #566d8f;
  --border: #d6e4f5;
  --accent: #2563c8;
  --accent-subtle: #e3eefa;
  --success: #2e8a14;

  /* Game palette (REDESIGN.md 1.2) */
  --ink: #14305a;
  --on-art: #ffffff;
  --plate: #1d4b87;
  --sky-top: #58b7f5;
  --sky-bottom: #cfeeff;
  --snowflake: rgb(255 255 255 / 0.9);

  /* Bands */
  --band-sky: #d4efff;
  --band-snow: #f7fbff;
  --band-night: #11295a;
  --band-night-fg: #ffffff;
  --band-night-fg-2: #c6daf5;

  /* Scene fills */
  --far-lit: #e8f3ff;
  --far-shade: #c5d8f0;
  --near-lit: #f7fbff;
  --near-shade: #b9cfea;
  --ground: #ffffff;
  --ground-shade: #e3eefa;
  --pine: #2f9e6a;
  --pine-dark: #1f7a56;

  --font-display: "Lilita One", ui-rounded, system-ui, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --text-4xl: 34px;
  --text-5xl: 40px;

  --radius-control: 14px;
  --radius-panel: 20px;
  --radius-surface: 24px;
  --shadow-floating: 0 24px 48px -12px rgb(20 48 90 / 0.35);

  --duration-fast: 160ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --page-max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --wave: 48px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #0b1830;
    --surface: #12264a;
    --surface-muted: #173057;
    --foreground: #eaf3ff;
    --text-secondary: #b9cfea;
    --text-muted: #98b1d3;
    --border: #23406a;
    --accent: #8cc8ff;
    --accent-subtle: #1b3a64;
    --success: #7be04f;
    --sky-top: #0c1f45;
    --sky-bottom: #2d5596;
    --band-sky: #12305c;
    --band-snow: #0b1830;
    --band-night: #060f22;
    --far-lit: #5a76a8;
    --far-shade: #3d5689;
    --near-lit: #a9bfe2;
    --near-shade: #7088b8;
    --ground: #c9d8ef;
    --ground-shade: #a8bbdb;
    --pine: #1f7a56;
    --pine-dark: #14573d;
    --shadow-floating: 0 24px 48px -12px rgb(0 0 0 / 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #0b1830;
  --surface: #12264a;
  --surface-muted: #173057;
  --foreground: #eaf3ff;
  --text-secondary: #b9cfea;
  --text-muted: #98b1d3;
  --border: #23406a;
  --accent: #8cc8ff;
  --accent-subtle: #1b3a64;
  --success: #7be04f;
  --sky-top: #0c1f45;
  --sky-bottom: #2d5596;
  --band-sky: #12305c;
  --band-snow: #0b1830;
  --band-night: #060f22;
  --far-lit: #5a76a8;
  --far-shade: #3d5689;
  --near-lit: #a9bfe2;
  --near-shade: #7088b8;
  --ground: #c9d8ef;
  --ground-shade: #a8bbdb;
  --pine: #1f7a56;
  --pine-dark: #14573d;
  --shadow-floating: 0 24px 48px -12px rgb(0 0 0 / 0.6);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--background);
  color: var(--foreground);
  font: 400 var(--text-lg) / 1.55 var(--font-body);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.container { width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus-visible { left: 16px; top: 16px; z-index: 20; padding: 8px 12px; background: var(--surface); color: var(--foreground); border: 1px solid var(--border); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header */
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--foreground); text-decoration: none; font-weight: 500; font-size: var(--text-lg); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.nav { display: flex; gap: 4px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 14px; color: var(--foreground); text-decoration: none; font-size: var(--text-base); font-weight: 500; border-radius: var(--radius-control); transition: background-color var(--duration-fast) var(--ease-standard); }
.nav a:hover { background: rgb(255 255 255 / 0.35); }
.home .site-header { position: absolute; inset: 0 0 auto; z-index: 5; }

/* Outlined game display text */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--on-art);
  -webkit-text-stroke: 0.16em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.07em 0 var(--ink);
}

/* Hero */
.hero { position: relative; min-height: max(560px, 90svh); display: flex; }
.scene { position: absolute; inset: 0; overflow: clip; background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom) 70%); }
.scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.far-lit { fill: var(--far-lit); } .far-shade { fill: var(--far-shade); }
.near-lit { fill: var(--near-lit); } .near-shade { fill: var(--near-shade); }
.ground { fill: var(--ground); } .ground-shade { fill: var(--ground-shade); }
.pine { fill: var(--pine); } .pine-dark { fill: var(--pine-dark); }
.scene .st { position: absolute; height: auto; filter: drop-shadow(0 10px 12px rgb(20 48 90 / 0.18)); }
.st-lodge { left: 2%; bottom: 3%; width: clamp(140px, 15vw, 300px); }
.st-hut { left: 22%; bottom: 11%; width: clamp(96px, 10vw, 190px); }
.st-gondola { left: 44%; bottom: 6%; width: clamp(120px, 13vw, 240px); }

.hero-content { position: relative; z-index: 3; width: 100%; max-width: var(--page-max); margin-inline: auto; padding: clamp(92px, 13vh, 150px) var(--gutter) 0; }
.hero-text { max-width: 640px; }
.hero-icon { width: 76px; height: 76px; border-radius: 20px; margin-bottom: 18px; box-shadow: 0 8px 20px -6px rgb(20 48 90 / 0.45); }
.hero h1 { font-size: clamp(64px, 11vw, 124px); line-height: 0.95; }
.hero .pitch { margin-top: 20px; max-width: 30ch; font-size: clamp(var(--text-lg), 2vw, var(--text-2xl)); line-height: 1.45; color: var(--ink); font-weight: 500; }
.store { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.badge-soon { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding-inline: 22px; border-radius: var(--radius-control); background: var(--plate); color: #fff; font-size: var(--text-base); font-weight: 500; box-shadow: 0 6px 0 var(--ink); }
.facts { font-size: var(--text-sm); color: var(--ink); font-weight: 500; }
.hero-pip { position: absolute; z-index: 4; right: max(2%, calc((100% - var(--page-max)) / 2)); bottom: calc(var(--wave) * -1.4); width: clamp(150px, 19vw, 330px); filter: drop-shadow(0 18px 18px rgb(20 48 90 / 0.25)); }

/* Dark mode: text over the night sky */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero .pitch, :root:not([data-theme="light"]) .facts { color: #eaf3ff; }
  :root:not([data-theme="light"]) .hero .pitch { text-shadow: 0 1px 3px rgb(6 15 34 / 0.9); }
  :root:not([data-theme="light"]) .home .nav a { color: #eaf3ff; }
  :root:not([data-theme="light"]) .badge-soon { background: #ffffff; color: var(--ink); }
}
:root[data-theme="dark"] .hero .pitch, :root[data-theme="dark"] .facts, :root[data-theme="dark"] .home .nav a { color: #eaf3ff; }
:root[data-theme="dark"] .hero .pitch { text-shadow: 0 1px 3px rgb(6 15 34 / 0.9); }
:root[data-theme="dark"] .badge-soon { background: #ffffff; color: var(--ink); }

/* Snowfall: three tiled layers drifting down. Pure CSS, off for reduced motion. */
.snow { position: absolute; inset: -240px 0 0; pointer-events: none; background-repeat: repeat; will-change: transform; }
.snow-1 { background-image: radial-gradient(circle, var(--snowflake) 0 2px, transparent 2.6px), radial-gradient(circle, var(--snowflake) 0 1.5px, transparent 2px); background-size: 160px 160px, 160px 160px; background-position: 0 0, 80px 90px; animation: fall-1 14s linear infinite; opacity: 0.9; }
.snow-2 { background-image: radial-gradient(circle, var(--snowflake) 0 3px, transparent 3.6px); background-size: 240px 240px; background-position: 40px 60px; animation: fall-2 22s linear infinite; opacity: 0.75; }
.snow-3 { background-image: radial-gradient(circle, var(--snowflake) 0 1.2px, transparent 1.7px); background-size: 110px 110px; background-position: 20px 30px; animation: fall-3 10s linear infinite; opacity: 0.6; }
@keyframes fall-1 { to { transform: translate3d(-40px, 160px, 0); } }
@keyframes fall-2 { to { transform: translate3d(60px, 240px, 0); } }
@keyframes fall-3 { to { transform: translate3d(-20px, 220px, 0); } }

/* Bands with wavy snow edges */
.band { position: relative; background: var(--band-bg); color: var(--band-fg, var(--foreground)); padding-block: clamp(80px, 11vw, 140px); }
.band::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: var(--wave); background: var(--band-bg); -webkit-mask: url("/img/wave.svg") center bottom / 100% 100% no-repeat; mask: url("/img/wave.svg") center bottom / 100% 100% no-repeat; pointer-events: none; }
.band-sky { --band-bg: var(--band-sky); }
.band-snow { --band-bg: var(--band-snow); }
.band-night { --band-bg: var(--band-night); --band-fg: var(--band-night-fg); }
.band-night .lede, .band-night .muted { color: var(--band-night-fg-2); }
.band-night a { color: #9fd4ff; }

.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(40px, 6vw, 96px); }
.feature.reverse .feature-media { order: -1; }
.feature-text { max-width: 520px; }
.feature.reverse .feature-text { justify-self: end; }
.band h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.005em; font-size: clamp(var(--text-4xl), 5.4vw, 64px); line-height: 1; }
.lede { margin-top: 18px; font-size: clamp(var(--text-lg), 1.6vw, var(--text-xl)); line-height: 1.6; color: var(--text-secondary); }
.points { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: var(--text-base); }
.points li { display: flex; gap: 10px; align-items: baseline; }
.points li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--success)); transform: translateY(-1px); }
.band-night .points li::before { --dot: #ffc83d; }

.feature-media { display: flex; justify-content: center; }
.phone { width: min(300px, 72vw); border: 10px solid #0f1f38; border-radius: 48px; overflow: hidden; background: #0f1f38; box-shadow: var(--shadow-floating); transform: rotate(-4deg); }
.feature.reverse .phone { transform: rotate(4deg); }
.phone img { border-radius: 38px; }

/* Characters strip */
.crew { margin: 48px auto 0; max-width: 960px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; }
.crew li { text-align: center; }
.crew img { width: clamp(104px, 11vw, 140px); margin: 0 auto 12px; transition: transform var(--duration-fast) var(--ease-standard); }
.crew li:nth-child(odd) img { transform: rotate(-4deg); }
.crew li:nth-child(even) img { transform: rotate(4deg); }
.crew li:hover img { transform: rotate(0) translateY(-6px); }
.crew b { display: block; font-weight: 500; font-size: var(--text-lg); }
.crew span { display: block; margin-top: 2px; font-size: var(--text-sm); color: var(--text-secondary); }
.section-head { max-width: 640px; }
.section-head.center { margin-inline: auto; text-align: center; }

/* Mountains row */
.peaks { margin: 48px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; align-items: end; }
.peaks li { text-align: center; }
.peaks img { width: 100%; max-width: 200px; margin: 0 auto 10px; }
.peaks b { display: block; font-weight: 500; }
.peaks span { font-size: var(--text-sm); color: var(--text-secondary); }

/* Gallery */
.gallery { margin: 48px 0 0; padding: 4px max(var(--gutter), calc((100% - var(--page-max)) / 2 + var(--gutter))) 16px; list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: clamp(220px, 21vw, 300px); gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scroll-padding-inline: max(var(--gutter), calc((100% - var(--page-max)) / 2 + var(--gutter))); scrollbar-width: thin; }
.gallery li { scroll-snap-align: start; }
.gallery img { width: 100%; border-radius: 22px; box-shadow: var(--shadow-floating); }
.gallery-hint { margin-top: 8px; font-size: var(--text-sm); }

/* FAQ */
.faq-wrap { max-width: 860px; }
.faq { margin-top: 32px; border: 1px solid var(--border); border-radius: var(--radius-surface); background: var(--surface); color: var(--foreground); }
.faq details + details { border-top: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 14px 22px; font-weight: 500; font-size: var(--text-lg); border-radius: var(--radius-surface); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px; border-right: 1.75px solid var(--text-muted); border-bottom: 1.75px solid var(--text-muted); transform: translateY(-2px) rotate(45deg); transition: transform var(--duration-fast) var(--ease-standard); }
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details p { padding: 0 22px 20px; color: var(--text-secondary); font-size: var(--text-base); line-height: 1.65; max-width: 68ch; }

/* Footer with a mountain silhouette edge */
.site-footer { position: relative; margin-top: 96px; background: var(--band-night); color: var(--band-night-fg-2); }
.home .site-footer { margin-top: 0; }
.footer-peaks { position: absolute; left: 0; bottom: calc(100% - 1px); width: 100%; height: clamp(48px, 7vw, 96px); fill: var(--band-night); }
.site-footer .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 28px 40px; font-size: var(--text-sm); }
.site-footer .brand { color: #fff; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.site-footer a:not(.brand) { color: var(--band-night-fg-2); text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.site-footer a:not(.brand):hover { color: #fff; text-decoration: underline; }
.site-footer .copy { width: 100%; }

/* Legal and support pages */
.doc-page .site-header .container, .doc-page .site-footer .container { max-width: 768px; }
.doc { max-width: 768px; margin-inline: auto; padding: 32px var(--gutter) 0; }
.doc h1 { font-size: clamp(var(--text-3xl), 6vw, var(--text-5xl)); }
.doc .meta { margin-top: 8px; color: var(--text-muted); font-size: var(--text-sm); }
.doc h2 { font-size: var(--text-2xl); margin-top: 40px; }
.doc h3 { font-size: var(--text-lg); margin-top: 24px; }
.doc p, .doc li { color: var(--text-secondary); font-size: var(--text-base); line-height: 1.7; }
.doc p { margin-top: 12px; }
.doc ul { margin: 12px 0 0; padding-left: 20px; }
.doc li + li { margin-top: 6px; }
.doc strong { color: var(--foreground); font-weight: 500; }
.doc .callout { margin-top: 24px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface-muted); font-size: var(--text-base); line-height: 1.7; color: var(--text-secondary); }
.doc .callout p:first-child { margin-top: 0; }
.doc .faq { margin-top: 16px; }
.doc .faq details p { margin: 0; }
.doc-page .nav a:hover { background: var(--surface-muted); }

/* Responsive */
@media (max-width: 900px) {
  .feature, .feature.reverse { grid-template-columns: minmax(0, 1fr); }
  .feature.reverse .feature-media { order: 0; }
  .feature.reverse .feature-text { justify-self: start; }
  .peaks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero-content { text-align: center; padding-top: 96px; }
  .hero-text { margin-inline: auto; }
  .hero-icon { margin-inline: auto; width: 72px; height: 72px; }
  .hero .pitch { margin-inline: auto; }
  .store { justify-content: center; flex-direction: column; }
  .st-hut { display: none; }
  .st-lodge { left: -4%; bottom: 3%; width: 46vw; }
  .st-gondola { left: 40%; bottom: 10%; width: 30vw; }
  .hero-pip { right: 2%; width: 36vw; }
  .peaks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .peaks li:last-child { grid-column: 1 / -1; }
  .peaks li:last-child img { max-width: 50%; }
  .gallery { grid-auto-columns: 68%; }
  .crew { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .snow { animation: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
