/* /santa-helper: the Santa Helper landing page.
   Colors follow the app's night sky and its pieces: a snowy pale blue #EEF5FF
   with navy text #0F2350 in light, night navy #0B1A3A with snow text #F4F8FF
   in dark, holly red #DB2930 and gold #FFD640 as accents. Headings use the
   app's display font, Mountains of Christmas (Apache License 2.0, bundled in
   /css/fonts with its license); body text uses the system font, as the app
   does. Light and dark follow prefers-color-scheme. */

@font-face {
    font-family: "Mountains of Christmas";
    src: url("/css/fonts/mountains-of-christmas-bold.woff2") format("woff2");
    font-weight: 700; font-style: normal; font-display: swap;
}

.sh {
    position: relative;
    --sh-bg: #EEF5FF;
    --sh-surface: #FFFFFF;
    --sh-text: #0F2350;
    --sh-text-2: #3D5585;
    --sh-sep: #C9D8F2;
    --sh-accent: #C41F27;
    --sh-gold: #FFD640;
    --sh-glow: rgba(30, 92, 196, .16);
    --sh-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
    --sh-festive: "Mountains of Christmas", "Chalkboard SE", "Comic Sans MS", cursive;
    --sh-flake: #9DB8E6;
    background: var(--sh-bg);
    color: var(--sh-text);
    font-family: var(--sh-font);
    overflow: clip;
}
@media (prefers-color-scheme: dark) {
    .sh {
        --sh-bg: #0B1A3A;
        --sh-surface: #16295A;
        --sh-text: #F4F8FF;
        --sh-text-2: #B5C6E8;
        --sh-sep: #2B4580;
        --sh-accent: #FF6B72;
        --sh-glow: rgba(255, 214, 64, .1);
        --sh-flake: #F5FAFF;
    }
}
body.sh-page { background: var(--sh-bg, #EEF5FF); }
@media (prefers-color-scheme: dark) { body.sh-page { background: #0B1A3A; } }

.sh::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 140vh; pointer-events: none;
    background: radial-gradient(55% 45% at 75% 22%, var(--sh-glow), transparent 70%);
}

/* ── The sky: falling snow, twinkling stars and the snowy hills──────────────
   A sticky full-screen layer behind the devices and the chapter text (the 3D
   canvas is transparent), clipped to the page so it never runs under the
   footer. Snow and stars are seeded by the page so they fall the same way on
   every visit. */
.sh-sky {
    position: sticky; top: 0; height: 100vh; height: 100svh; margin-bottom: -100vh; margin-bottom: -100svh;
    overflow: hidden; pointer-events: none; z-index: 0;
}
.sh-flake {
    position: absolute; left: var(--x); top: -4vh; display: block;
    width: 8px; height: 8px; border-radius: 50%; background: var(--sh-flake); opacity: .75;
    scale: var(--s); animation: sh-snow var(--t) linear var(--d) infinite;
}
@keyframes sh-snow {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(var(--w), 54vh); }
    100% { transform: translate(calc(var(--w) * -.3), 108vh); }
}
.sh-star {
    position: absolute; left: var(--x); top: var(--y); width: 18px; height: 18px; scale: var(--s);
    background: var(--sh-gold); opacity: 0;
    clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
    animation: sh-twinkle 4.5s ease-in-out var(--d) infinite;
}
@keyframes sh-twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); } 45%, 55% { opacity: .8; transform: scale(1) rotate(45deg); } }
/* The bottom of the app's game screen: two moonlit blue hills with snow on
   their ridges and the three trees, from the app's Art/hills.svg (widened for
   browsers, trees kept on the right as in the app). Same in light and dark,
   as the app's sky is. */
.sh-hills {
    position: absolute; left: 0; right: 0; bottom: 0; height: clamp(150px, 30vh, 320px);
    background: url("/img/santa-helper/hills.svg") right bottom / cover no-repeat;
}

/* Under Reduce Motion the sky holds still: the snow scattered in place. */
@media (prefers-reduced-motion: reduce) {
    .sh-flake { animation: none; top: var(--y); }
    .sh-star { animation: none; opacity: .6; }
}

/* ── Chapter text ─────────────────────────────────────────────────────────── */
.sh-card { position: relative; z-index: 2; max-width: 440px; }
.sh-card h1, .sh-card h2 { font-family: var(--sh-festive); font-weight: 700; color: var(--sh-text); letter-spacing: 0; }
.sh-card h1 { font-size: clamp(3.2rem, 6.4vw, 5rem); line-height: 1; margin: 6px 0 18px; }
.sh-card h2 { font-size: clamp(2.1rem, 3.6vw, 2.9rem); line-height: 1.08; margin: 4px 0 14px; }
.sh-card p { color: var(--sh-text-2); font-size: 1.08rem; line-height: 1.6; margin: 0 0 12px; }
.sh-card .sh-lede { font-size: 1.22rem; color: var(--sh-text); }
.sh-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .8rem !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--sh-accent) !important; margin-bottom: 6px !important;
}
.sh-aside { font-size: .95rem !important; font-weight: 600; color: var(--sh-text) !important; opacity: .8; }
.sh-note { font-size: .92rem !important; }
.sh-credit { font-size: .8rem !important; opacity: .75; }
.sh-icons { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .88rem !important; margin-top: .4rem; }
.sh-icons img { width: 40px; height: 40px; border-radius: 9px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.sh-icons span { flex: 1 1 12rem; }
.sh-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 10px 30px rgba(15, 35, 80, .22); display: block; margin-bottom: 18px; }
.sh-pieces { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 2px 0 12px !important; }
.sh-piece { display: block; height: 44px; width: auto; }

/* The three modes: a word for each, never color alone. */
.sh-modes { list-style: none; padding: 0; margin: 4px 0 14px; border-top: 1px solid var(--sh-sep); }
.sh-modes li {
    display: grid; grid-template-columns: 6rem 1fr; column-gap: 14px; align-items: baseline;
    color: var(--sh-text-2); line-height: 1.5; padding: 9px 0; border-bottom: 1px solid var(--sh-sep);
}
.sh-modes b { font-family: var(--sh-festive); font-size: 1.3rem; color: var(--sh-text); }
.sh-modes .sh-free b { color: var(--sh-accent); }
@media (max-width: 380px) { .sh-modes li { grid-template-columns: 1fr; row-gap: 2px; } }
.sh-price { font-family: var(--sh-festive); font-weight: 700; font-size: 1.5rem !important; color: var(--sh-accent) !important; margin: 6px 0 12px !important; }

/* Bottom center of the first screen; it scrolls away with the hero. */
.sh-scroll-cue {
    position: absolute; left: 50%; top: calc(100svh - var(--nav-h) - 96px); transform: translateX(-50%);
    margin: 0; text-align: center; white-space: nowrap; z-index: 2;
    font-size: .85rem; font-weight: 600; letter-spacing: .04em; color: var(--sh-text-2);
}
.sh-scroll-cue::after { content: ""; display: block; width: 2px; height: 34px; margin: 10px auto 0; background: linear-gradient(var(--sh-accent), transparent); animation: sh-cue 1.8s ease-in-out infinite; }
@keyframes sh-cue { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(8px); opacity: 1; } }

/* ── Store badges ─────────────────────────────────────────────────────────── */
.sh-badges { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 14px; }
.sh-badge {
    display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 18px 8px 14px;
    border-radius: 12px; font-size: 1.2rem; font-weight: 600; line-height: 1.05; text-decoration: none;
    background: #000; color: #fff; border: 1px solid #000; transition: transform .2s, box-shadow .2s;
}
.sh-badge:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .22); color: #fff; }
.sh-badge:focus-visible { outline: 3px solid var(--sh-accent); outline-offset: 3px; }
.sh-badge svg { width: 22px; height: 26px; flex: none; }
.sh-badge span { display: flex; flex-direction: column; }
.sh-badge small { font-size: .68rem; font-weight: 500; letter-spacing: .01em; }
@media (prefers-color-scheme: dark) { .sh-badge { border-color: #A6A6A6; } }
/* Store badges that are not live yet: plain text, not a badge. */
.sh-badge-soon {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
    border-radius: 999px; border: 1px dashed var(--sh-sep);
    font-size: .95rem; font-weight: 600; color: var(--sh-text-2);
}

/* ── Screenshots (shown when the page is not in 3D) ───────────────────────── */
.sh-shot { margin: 0; display: flex; justify-content: center; align-items: center; }
.sh-shot img { display: block; width: auto; max-width: 100%; height: auto; max-height: 640px; border-radius: 32px; box-shadow: 0 24px 60px rgba(15, 35, 80, .22); }
.sh-shot-ipad img { border-radius: 24px; }
.sh-shot-widgets { flex-wrap: wrap; gap: 16px; }
.sh-shot-widgets img { border-radius: 0; box-shadow: none; max-height: 160px; max-width: 100%; }
.sh-shot-widgets picture:first-child img { max-height: 200px; }
.sh-shot-widgets picture:nth-child(2) img { max-height: 200px; }

/* Flat layout: a normal stack of chapters, text beside the screen. */
.sh-ch { padding: 72px 24px; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.sh-ch + .sh-ch { border-top: 1px solid var(--sh-sep); }
.sh-stage { display: none; }
@media (max-width: 820px) {
    .sh-ch { grid-template-columns: 1fr; gap: 28px; padding: 56px 20px; }
    .sh-shot img { max-height: 520px; }
}

/* ── 3D layout (santa-helper.js adds .is-3d once WebGL is up) ─────────────── */
.sh.is-3d .sh-stage {
    display: block; position: sticky; top: 0; height: 100vh; height: 100svh; margin-bottom: -100vh; margin-bottom: -100svh;
    z-index: 0; pointer-events: none;
}
.sh.is-3d .sh-stage canvas { display: block; width: 100%; height: 100%; }
.sh.is-3d .sh-shot { display: none; }
.sh.is-3d .sh-ch {
    display: block; max-width: none; margin: 0; border: 0; position: relative; z-index: 1;
    min-height: 170vh; padding: 24vh max(32px, calc((100vw - 1200px) / 2)) 0;
}
.sh.is-3d .sh-hero { min-height: 130vh; padding-top: max(12vh, 64px); }
.sh.is-3d .sh-feature { min-height: 200vh; }
.sh.is-3d .sh-finale { min-height: 190vh; }
.sh.is-3d .sh-card {
    position: sticky; top: max(calc(var(--nav-h) + 24px), 20vh);
    padding: 30px 32px; border-radius: 26px;
    background: color-mix(in srgb, var(--sh-bg) 74%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
    border: 1px solid color-mix(in srgb, var(--sh-sep) 70%, transparent);
    box-shadow: 0 20px 50px rgba(15, 35, 80, .1);
}
.sh.is-3d .sh-hero .sh-card { top: max(12vh, 64px); background: transparent; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding-left: 0; }

/* Phones and portrait tablets: the devices take the top of the screen and the
   chapter text pins to the bottom. Matches santa-helper.js (aspect below 1). */
@media (max-aspect-ratio: 1/1) {
    .sh.is-3d .sh-ch {
        display: flex; flex-direction: column; justify-content: flex-end;
        padding: 0 14px 0; min-height: 150vh;
    }
    .sh.is-3d .sh-feature { min-height: 175vh; }
    .sh.is-3d .sh-hero { min-height: 120vh; }
    .sh.is-3d .sh-card, .sh.is-3d .sh-hero .sh-card {
        position: sticky; top: auto; bottom: 14px; max-width: 560px; width: 100%; margin: 0 auto;
        padding: 20px 22px; border-radius: 22px;
        background: color-mix(in srgb, var(--sh-bg) 80%, transparent);
        -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
        border: 1px solid color-mix(in srgb, var(--sh-sep) 70%, transparent);
    }
    .sh.is-3d .sh-card h1 { font-size: 2.8rem; margin-bottom: 10px; }
    .sh.is-3d .sh-card h2 { font-size: 1.8rem; margin-bottom: 8px; }
    .sh.is-3d .sh-card p { font-size: .97rem; line-height: 1.5; margin-bottom: 8px; }
    .sh.is-3d .sh-card .sh-lede { font-size: 1.05rem; }
    .sh.is-3d .sh-icon { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 10px; }
    .sh.is-3d .sh-badges { margin: 12px 0 8px; }
    .sh.is-3d .sh-scroll-cue { display: none; }
    .sh.is-3d .sh-modes li { padding: 6px 0; font-size: .92rem; }
    .sh.is-3d .sh-piece { height: 32px; }
}

/* ── The header while the story plays: slim and see-through ───────────────── */
body.sh-page .nav-inner, body.sh-page .nav-links { transition: height .35s ease; }
body.sh-page .nav-logo img { transition: height .35s ease; }
body.sh-page.sh-immersive .nav {
    background: color-mix(in srgb, var(--white) 55%, transparent);
    border-bottom-color: transparent;
}
/* Only the desktop bar shrinks: on phones the menu is a drawer sized from --nav-h. */
@media (min-width: 769px) {
body.sh-page.sh-immersive .nav { --nav-h: 50px; }
body.sh-page.sh-immersive .nav-logo img { height: 34px !important; }
body.sh-page.sh-immersive .nav-links a:not(.nav-cta) { font-size: .82rem; }
}
.sh:not(.is-3d) .sh-scroll-cue { display: none; }

@media (prefers-reduced-motion: reduce) {
    .sh-scroll-cue::after { animation: none; }
    body.sh-page .nav-inner, body.sh-page .nav-links, body.sh-page .nav-logo img { transition: none; }
}

/* ── The 2011 music: a small pill under the header, off until pressed ──────── */
.sh-music {
    position: fixed; z-index: 5; right: 18px; top: calc(var(--nav-h, 64px) + 14px);
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 15px 9px 12px; border-radius: 999px; cursor: pointer;
    font: 600 .88rem/1 var(--sh-font); color: var(--sh-text);
    background: color-mix(in srgb, var(--sh-surface) 82%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid var(--sh-sep); box-shadow: 0 8px 24px rgba(15, 35, 80, .16);
    transition: background-color .2s ease, color .2s ease, transform .15s ease;
}
.sh-music[hidden] { display: none; }
.sh-music:hover { transform: translateY(-1px); }
.sh-music:active { transform: scale(.97); }
.sh-music:focus-visible { outline: 3px solid var(--sh-gold); outline-offset: 3px; }
.sh-music[aria-pressed="true"] { background: var(--sh-accent); border-color: var(--sh-accent); color: #fff; }
.sh-music[aria-pressed="true"] .sh-music-off { display: none; }
@media (prefers-reduced-motion: reduce) { .sh-music { transition: none; } }
