/* =====================================================================
   Fullmoonstar — shared scroll-story primitives (home + about)
   Default styles = a complete static page. `.is-pinned` (set by
   js/story.js) turns a [data-scene] into a sticky, scroll-driven stage.
   ===================================================================== */

body.story { overflow-x: clip; }
.story main > section { padding: 0; }
.story h1, .story h2, .story h3 { text-wrap: balance; }

/* Shared bits ------------------------------------------------------- */
.eyebrow {
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .45rem .9rem;
    border-radius: 9999px;
    box-shadow: var(--sh-recessed);
    font-family: var(--font-mono);
    font-size: .68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .12em;
    color: var(--ink-muted);
    margin: 0 0 1.25rem;
}
.eyebrow--dark {
    color: var(--on-console-muted);
    background: rgba(0,0,0,.22);
    box-shadow: inset 2px 2px 5px rgba(0,0,0,.45), inset -1px -1px 1px rgba(255,255,255,.06);
}
.sec-head { max-width: 760px; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.sec-head h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.04; letter-spacing: -0.035em; margin: 0 0 1rem; text-shadow: 0 1px 0 #fff; }
.sec-head p { font-size: 1.0625rem; line-height: 1.7; color: var(--ink-muted); max-width: 60ch; margin: 0; }
.story-pad { padding: clamp(5rem, 11vw, 9rem) 0; }

/* Reveal on enter (only when the script is running) */
.js-story .rv { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js-story .rv.in { opacity: 1; transform: none; }
.js-story .ent-ledger .rv:nth-child(2), .js-story .principle-list .rv:nth-child(2), .js-story .why-grid .rv:nth-child(2) { transition-delay: .08s; }
.js-story .ent-ledger .rv:nth-child(3), .js-story .principle-list .rv:nth-child(3), .js-story .why-grid .rv:nth-child(3) { transition-delay: .16s; }
.js-story .ent-ledger .rv:nth-child(4) { transition-delay: .24s; }
.js-story .ent-ledger .rv:nth-child(5) { transition-delay: .32s; }
.js-story .ent-ledger .rv:nth-child(6) { transition-delay: .4s; }

/* Scenes: static by default ------------------------------------------ */
.sc { position: relative; --p: 1; }
.sc-stage { position: relative; padding: clamp(5rem, 10vw, 8rem) 0; }

/* Pinned scenes */
.sc.is-pinned { height: var(--len, 250vh); --p: 0; }
.sc.is-pinned .sc-stage {
    position: sticky; top: 0;
    height: 100vh; height: 100svh;
    padding: 0;
    overflow: hidden;
    display: flex; flex-direction: column; justify-content: center;
}

/* 2. Scrub statement ---------------------------------------------- */
.sc-scrub .sc-stage { padding-left: var(--gutter); padding-right: var(--gutter); }
.scrub-text {
    max-width: 1100px; margin: 0 auto;
    font-size: clamp(1.65rem, 4.2vw, 3.5rem);
    line-height: 1.18; letter-spacing: -0.03em; font-weight: 700;
    color: var(--ink);
}
.scrub-text .w { transition: color .35s ease; }
.sc-scrub.is-pinned .scrub-text .w { color: #b4bcc9; }
.sc-scrub.is-pinned .scrub-text .w.on { color: var(--ink); }
.sc-scrub.is-pinned .scrub-text .w.on:nth-last-child(-n+9) { color: var(--accent-ink); }

/* 4. Belief -------------------------------------------------------- */
.sc-belief { background: linear-gradient(180deg, #262c2e, #1d2224); color: var(--on-console); }
.belief-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .3em; font-size: clamp(2.2rem, 5.8vw, 5.2rem); line-height: 1; letter-spacing: -0.045em; font-weight: 800; }
.belief-lines li { color: #fff; transition: color .5s ease, opacity .5s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.belief-lines li::after { content: ""; display: inline-block; width: .14em; height: .14em; margin-left: .18em; border-radius: 50%; background: var(--accent); box-shadow: var(--glow-red); opacity: 0; transition: opacity .4s ease; vertical-align: .12em; }
.sc-belief.is-pinned .belief-lines li { color: rgba(224,229,236,.14); transform: translateX(-12px); }
.sc-belief.is-pinned .belief-lines li.on { color: #fff; transform: none; }
.sc-belief.is-pinned .belief-lines li.cur::after { opacity: 1; }

/* 6. Products gallery -------------------------------------------- */
.sc-gallery .sc-stage { gap: clamp(1.5rem, 3vw, 2.5rem); }
.gallery-head h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.04; letter-spacing: -0.035em; margin: 0; text-shadow: 0 1px 0 #fff; max-width: 18ch; }
.gallery-track {
    display: flex; gap: clamp(1rem, 2vw, 1.75rem);
    padding: 1.25rem max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))) 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.gallery-track::-webkit-scrollbar { display: none; }
.g-card {
    flex: 0 0 auto;
    width: clamp(270px, 32vw, 430px);
    scroll-snap-align: start;
    scroll-margin-left: var(--gutter);
    display: flex; flex-direction: column; align-items: flex-start;
    background: var(--chassis);
    border: 1px solid rgba(255,255,255,.6);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-card);
    padding: clamp(1.5rem, 2.6vw, 2.25rem);
    min-height: clamp(340px, 46vh, 440px);
}
.g-card__tag { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--font-mono); font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-muted); padding: .4rem .75rem; border-radius: 9999px; box-shadow: var(--sh-recessed); margin-bottom: 1.5rem; }
.g-card h3 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); letter-spacing: -0.03em; margin: 0 0 .5rem; }
.g-card__strap { font-weight: 700; color: var(--accent-ink); margin: 0 0 .75rem; line-height: 1.4; }
.g-card p:not(.g-card__strap) { font-size: .9375rem; line-height: 1.65; color: var(--ink-muted); margin: 0 0 1.5rem; }
.g-card > a, .g-card__links { margin-top: auto; }
.g-card__links { display: flex; flex-wrap: wrap; gap: .6rem; }
.g-card--dark { background: linear-gradient(180deg, #30383b, #262c2e); border-color: #1f2426; }
.g-card--dark h3 { color: #fff; }
.g-card--dark .g-card__strap { color: #ff8a94; }
.g-card--dark p:not(.g-card__strap) { color: var(--on-console-muted); }
.g-card--dark .g-card__tag { color: var(--on-console-muted); box-shadow: inset 2px 2px 5px rgba(0,0,0,.45), inset -1px -1px 1px rgba(255,255,255,.06); }
.gallery-progress { display: none; }

.sc-gallery.is-pinned .gallery-track { overflow: visible; scroll-snap-type: none; transform: translate3d(var(--gx, 0px), 0, 0); will-change: transform; }
.sc-gallery.is-pinned .gallery-progress {
    display: block;
    width: min(320px, 60vw); height: 8px; margin: 0 auto;
    border-radius: 9999px; background: var(--recess);
    box-shadow: inset 1px 1px 3px rgba(0,0,0,.25), inset -1px -1px 1px rgba(255,255,255,.7);
    overflow: hidden;
}
.gallery-progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-deep)); border-radius: inherit; transform-origin: left; transform: scaleX(var(--p)); }


/* Scroll cue */
.scroll-cue {
    position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
    display: none; flex-direction: column; align-items: center; gap: .5rem;
    font-family: var(--font-mono); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase;
    color: var(--on-console-muted);
    opacity: calc(1 - var(--p) * 6);
}
.scroll-cue span { width: 22px; height: 34px; border-radius: 12px; box-shadow: inset 0 0 0 2px rgba(224,229,236,.4); position: relative; }
.scroll-cue span::after { content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: var(--accent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { opacity: 0; } }
.sc.is-pinned .scroll-cue { display: flex; }
.sc-scrub.is-pinned .sc-stage { padding: 0 var(--gutter); }

@media (max-height: 760px) { .g-card { min-height: 300px; } }
@media (max-width: 640px) { .g-card { width: min(84vw, 340px); min-height: 0; } }
@media (max-width: 380px) { .belief-lines { font-size: 2.1rem; } }
@media (prefers-reduced-motion: reduce) {
    .scroll-cue span::after { animation: none; }
    .js-story .rv { opacity: 1; transform: none; transition: none; }
}
