/* ============================================================
   sections.css — distinct motion language per section
   Heritage (narrative) · Craft (horizontal depth) · Research
   (zoom layers) · Seal (object ceremony) · Collection grid · Finale
   ============================================================ */

/* ════════════════════════ HERITAGE ════════════════════════ */
/* one continuous scene: Heritage chapter + the frame film share this pin */
.heritage {
    position: relative;
    height: 900vh;
    background: #000;
}

.heritage__stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    display: grid;
    place-items: center;
    /* frame-1 fallback so the bridge image is present even before the
       canvas decodes (no black flash at the dissolve) */
    background: #000 url("/frame/frame (1).webp") center / cover no-repeat;
}

/* shared frame canvas (MID layer) — holds frame 1, then scrubs the film.
   Hidden until the first frame paints, so the CSS frame-1 fallback (on the
   stage) shows through instead of the canvas's opaque-black backing store. */
.heritage__canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transform-origin: center;
    will-change: transform, opacity;
    /* drawn cover-fit by JS */
}

.heritage__canvas.is-painted {
    opacity: 1;
}

.heritage__bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    transform-origin: center;
    will-change: transform, opacity;
}

.heritage__layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.42) saturate(0.85) blur(2px);
    opacity: 0;
}

.heritage__layer[data-layer="0"] {
    opacity: 1;
}

/* the shared frame-style vignette (.hero__vignette) seats both phases, so the
   edge treatment never changes across the bridge */

.heritage__grain {
    position: absolute;
    inset: -10%;
    z-index: 2;
    pointer-events: none;
    opacity: 0.5;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 4px 4px;
    will-change: transform, opacity;
}

.heritage__light {
    position: absolute;
    inset: -20%;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(40% 40% at 30% 30%, rgba(198, 186, 130, 0.18), transparent 70%);
    mix-blend-mode: screen;
    animation: drift 16s var(--ease-inout) infinite alternate;
    will-change: transform, opacity;
}

@keyframes drift {
    from {
        transform: translate3d(-6%, -4%, 0) scale(1);
    }

    to {
        transform: translate3d(8%, 6%, 0) scale(1.15);
    }
}

.heritage__index {
    position: absolute;
    top: clamp(2.5rem, 7vh, 5rem);
    left: var(--gutter);
    z-index: 4;
    font-size: 0.66rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--gold);
}

.heritage__lines {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    padding-inline: var(--gutter);
}

/* scroll-driven: opacity + upward parallax drift are written every frame by
   heritage.js (no CSS transition, so the text tracks scroll instantly and
   stays anchored to the scene rather than firing on a reveal trigger) */
.hl {
    grid-area: 1 / 1;
    margin: 0;
    max-width: 20ch;
    text-align: center;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.7rem, 4.4vw, 4rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: #fff;
    opacity: 0;
    will-change: opacity, transform;
}

.hl--memo {
    font-size: clamp(0.85rem, 1.5vw, 1.15rem);
    font-style: italic;
    letter-spacing: 0.16em;
    color: var(--gold-soft);
    text-transform: uppercase;
}

/* ═══════ CRAFT — full-screen cinematic horizontal reel ═══════
   Vertical scroll drives a horizontal slide through full-bleed frames.
   Each panel is 100vw/100vh image, ONE title, parallax zoom + drift. */
.craft {
    position: relative;
    height: 400vh;
    background: #000;
}

.craft__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

/* minimal fixed chapter marker — no boxed caption, just a hairline label */
.craft__index {
    position: absolute;
    top: clamp(2.5rem, 7vh, 5rem);
    left: var(--gutter);
    z-index: 5;
    font-size: 0.66rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--gold);
    text-shadow: 0 1px 20px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.craft__track {
    display: flex;
    height: 100%;
    width: max-content;
    /* horizontal position set by JS from vertical scroll — Lenis-smoothed,
       linear mapping → continuous slide, no snapping */
    transform: translate3d(var(--x, 0px), 0, 0);
    will-change: transform;
}

.craft__panel {
    position: relative;
    flex: 0 0 100vw;
    height: 100%;
    overflow: hidden;
}

/* full-bleed image (MID layer) — parallax zoom + drift applied by JS */
.craft__media {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.craft__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08);
    transform-origin: center;
    filter: brightness(0.92) contrast(1.04);
    will-change: transform;
}

/* cinematic legibility gradient — soft, full-bleed, never a box */
.craft__panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(120% 90% at 50% 42%, transparent 42%, rgba(0, 0, 0, 0.45) 100%),
        linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, transparent 46%);
}

/* ONE large title per panel — minimal, luxury spacing, slow opacity+blur reveal */
.craft__title {
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    bottom: clamp(4.5rem, 14vh, 9rem);
    z-index: 2;
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.6rem, 9vw, 8rem);
    line-height: 0.98;
    letter-spacing: 0.01em;
    color: #fff;
    text-shadow: 0 1px 50px rgba(0, 0, 0, 0.55);
    opacity: 0;
    filter: blur(14px);
    transform: translateY(40px);
    will-change: opacity, filter, transform;
}

/* ═══════════ RESEARCH — microscopic discovery interface ═══════ */
.research {
    position: relative;
    height: 360vh;
    background: #050505;
}

.research__stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background: radial-gradient(circle at 50% 48%, #100e0c 0%, #000 72%);
}

.research__particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.research__zoom {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    will-change: transform;
}

/* circular lens holding three cross-fading focal images (one per node) */
.research__disc {
    position: relative;
    width: min(58vmin, 560px);
    height: min(58vmin, 560px);
    border-radius: 50%;
    overflow: hidden;
    background: #0a0908;
    will-change: transform;
    box-shadow:
        0 0 0 1px rgba(198, 186, 130, 0.35),
        0 0 0 11px rgba(198, 186, 130, 0.05);
}

/* inner vignette painted above the imagery */
.research__disc::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: inset 0 0 80px 30px rgba(0, 0, 0, 0.85);
}

.research__layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.04);
    will-change: opacity, transform, filter;
}

.research__refocus {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, transparent 26%, rgba(0, 0, 0, 0.65) 72%);
    opacity: 0;
}

.research__head {
    position: absolute;
    top: clamp(2.5rem, 7vh, 5rem);
    left: var(--gutter);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.research__nodes {
    position: absolute;
    inset: 0;
    z-index: 4;
}

.research__node {
    position: absolute;
    margin: 0;
    max-width: 23rem;
    opacity: 0;
    will-change: opacity, transform, filter;
}

.research__node[data-node="0"] {
    left: clamp(1.5rem, 8vw, 9rem);
    top: 26%;
}

.research__node[data-node="1"] {
    right: clamp(1.5rem, 8vw, 9rem);
    top: 36%;
    text-align: right;
}

.research__node[data-node="2"] {
    left: clamp(1.5rem, 12vw, 14rem);
    bottom: 18%;
}

.research__node::before {
    content: "";
    position: absolute;
    top: -14px;
    left: 0;
    width: clamp(40px, 6vw, 90px);
    height: 1px;
    background: linear-gradient(90deg, var(--gold), transparent);
}

.research__node[data-node="1"]::before {
    left: auto;
    right: 0;
    background: linear-gradient(270deg, var(--gold), transparent);
}

.research__coord {
    display: block;
    font-family: var(--sans);
    font-size: 0.64rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.8rem;
}

.research__node h3 {
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    color: #fff;
    margin-bottom: 0.7rem;
}

.research__node p {
    color: var(--ink-dim);
    font-family: var(--serif);
    max-width: 32ch;
}

.research__node[data-node="1"] p {
    margin-left: auto;
}

/* ════════════ SEAL — reveal ceremony ════════════ */
.seal {
    position: relative;
    background: #000;
}

.seal__pin {
    position: relative;
    height: 260vh;
}

.seal__stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 44%, #0b0a08 0%, #000 70%);
}

.seal__halo {
    position: absolute;
    left: 50%;
    top: 44%;
    transform: translate(-50%, -50%);
    width: 64vmin;
    height: 64vmin;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(198, 186, 130, 0.2), transparent 62%);
    filter: blur(24px);
    opacity: 0;
    pointer-events: none;
}

.seal__object {
    position: absolute;
    left: 50%;
    top: 44%;
    width: min(46vmin, 430px);
    opacity: 0;
    will-change: transform, filter, opacity;
    transform: translate(-50%, -50%) scale(0.82);
}

.seal__svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.seal__ring-text {
    font-family: var(--sans);
    font-weight: 400;
    font-size: 8.4px;
    letter-spacing: 3px;
}

.seal__sweep {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, 0.55) 50%, transparent 58%);
    -webkit-mask: radial-gradient(circle at 50% 50%, #000 45%, transparent 47%);
    mask: radial-gradient(circle at 50% 50%, #000 45%, transparent 47%);
    mix-blend-mode: screen;
}

.seal__text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(8%, 12vh, 14%);
    text-align: center;
    padding-inline: var(--gutter);
    opacity: 0;
    transition: opacity 0.8s var(--ease-out);
}

.seal__text.is-on {
    opacity: 1;
}

.seal__text>* {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.seal__text .kicker {
    color: var(--gold-bright);
    margin-bottom: 1rem;
}

.seal__text h2 {
    font-size: clamp(1.8rem, 4vw, 3.4rem);
    color: #fff;
    margin: 0 0 1rem;
}

.seal__text p {
    margin: 0 auto;
    max-width: 46ch;
    color: var(--ink-dim);
    font-family: var(--serif);
}

.seal__text.is-on>*:nth-child(1) {
    opacity: 1;
    transform: none;
    transition-delay: 0.05s;
}

.seal__text.is-on>*:nth-child(2) {
    opacity: 1;
    transform: none;
    transition-delay: 0.18s;
}

.seal__text.is-on>*:nth-child(3) {
    opacity: 1;
    transform: none;
    transition-delay: 0.32s;
}

/* ════════════ COLLECTION — cinematic vault ════════════ */
.show {
    position: relative;
    height: 680vh;
    background: radial-gradient(circle at 50% 36%, #0c0b09 0%, #000 74%);
}

.show__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* real perspective → the coverflow turns in space */
    perspective: 1700px;
    perspective-origin: 50% 46%;
}

/* ── plane 1 — deep ghosted family name (slow parallax) ── */
.show__ghost {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    pointer-events: none;
}

.show__ghost span {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(4rem, 19vw, 17rem);
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-transform: uppercase;
    color: rgba(198, 186, 130, 0.07);
    opacity: 1;
    transform: translateX(var(--ghost-x, 0));
    transition: opacity 0.8s var(--ease-out);
    will-change: transform, opacity;
}

/* ambient dust + gold haze */
.show__space {
    position: absolute;
    inset: -10%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.6;
    background:
        radial-gradient(60% 50% at 50% 44%, rgba(198, 186, 130, 0.10), transparent 70%),
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: auto, 3px 3px;
}

.show__head {
    position: relative;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: clamp(2rem, 5vh, 4rem) var(--gutter) 0;
}

/* ── plane 2 — 3D coverflow stage ── */
.show__stage {
    position: relative;
    z-index: 3;
    flex: 1;
    display: flex;
    align-items: center;
    transform-style: preserve-3d;
}

.show__track {
    --plate-w: min(32vw, 360px);
    display: flex;
    align-items: center;
    gap: clamp(2rem, 5vw, 5.5rem);
    /* centre EVERY piece as it passes (incl. first & last) */
    padding-inline: calc((100vw - var(--plate-w)) / 2);
    transform: translate3d(var(--x, 0px), 0, 0);
    transform-style: preserve-3d;
    will-change: transform;
}

.show__item {
    flex: 0 0 auto;
    width: var(--plate-w);
    transform-style: preserve-3d;
    will-change: transform;
}

/* ivory lightbox plate — white-bg product shots blend in via multiply,
   so each timepiece floats seamlessly on the dark stage */
.show__plate {
    position: relative;
    margin: 0;
    aspect-ratio: 3 / 4;
    border-radius: 4px;
    background: linear-gradient(180deg, #faf8f3 0%, #ece6d9 100%);
    box-shadow:
        0 50px 95px -34px rgba(0, 0, 0, 0.92),
        0 0 0 1px rgba(198, 186, 130, 0.18);
    will-change: filter, opacity, transform;
}

.show__plate img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8%;
    mix-blend-mode: multiply;
    transform: scale(1);
    transition: transform 1.1s var(--ease-out);
}

/* gentle zoom / focus on the centred piece */
.show__item.is-focus .show__plate img {
    transform: scale(1.05);
}

/* gold halo bloom behind the centred plate */
.show__halo {
    position: absolute;
    inset: -16% -12%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(198, 186, 130, 0.4), transparent 64%);
    opacity: 0;
    filter: blur(26px);
    transition: opacity 0.7s var(--ease-out);
}

.show__item.is-focus .show__halo {
    opacity: 1;
}

/* ── plane 3 — cinematic readout (re-reveals on each centred piece) ── */
.show__readout {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(4rem, 11vh, 7.5rem);
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.55rem;
    padding-inline: var(--gutter);
    pointer-events: none;
}

/* soft warm-charcoal pool seats the text for guaranteed readability over the
   bright ivory plates — a gentle gradient, never a hard block or heavy overlay */
.show__readout::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -2.5rem;
    transform: translateX(-50%);
    width: min(92vw, 58rem);
    height: 17rem;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(56% 92% at 50% 92%,
            rgba(10, 9, 7, 0.74) 0%,
            rgba(10, 9, 7, 0.40) 42%,
            transparent 74%);
}

.show__readout>* {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.show__readout.is-in>* {
    opacity: 1;
    transform: none;
}

.show__readout.is-in .show__ref {
    transition-delay: 0.08s;
}

.show__readout.is-in .show__poem {
    transition-delay: 0.16s;
}

.show__family {
    font-family: var(--sans);
    font-weight: 500;
    font-size: 0.66rem;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: var(--gold-bright);
    text-shadow: 0 1px 18px rgba(0, 0, 0, 0.55);
}

.show__ref {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    color: #fff;
    text-shadow: 0 1px 30px rgba(0, 0, 0, 0.6);
}

.show__poem {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    color: #ddd6c8;
    /* warm light tone — brighter than --ink-dim for readability */
    text-shadow: 0 1px 16px rgba(0, 0, 0, 0.55);
    max-width: 32ch;
}

/* ════════════════════════ FINALE ════════════════════════ */
.finale {
    position: relative;
    background: radial-gradient(120% 120% at 50% 120%, #14110e 0%, var(--bg) 60%);
}

.finale__inner {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-block: var(--section-pad);
    gap: clamp(2.4rem, 5vw, 4rem);
}

.finale__logo {
    width: clamp(150px, 18vw, 260px);
    height: auto;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.finale__quote {
    margin: 0;
    max-width: 22ch;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.8rem, 4.6vw, 4.4rem);
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.finale__quote .line>span {
    transform: translateY(110%);
}

.finale__pledge {
    max-width: 48ch;
    margin: 0 auto;
    color: var(--ink-dim);
    font-family: var(--serif);
    font-style: italic;
}

.finale__footer {
    border-top: 1px solid var(--hair);
    padding-block: clamp(2rem, 4vw, 3rem);
}

.finale__footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.finale__footer-mid {
    color: var(--gold);
}

/* ════════════════════════ RESPONSIVE ════════════════════════ */
@media (max-width: 960px) {
    /* craft panels stay full-bleed 100vw/100vh — nothing to adjust */
    .research__node {
        max-width: 18rem;
    }

    .research__node[data-node="1"] {
        right: var(--gutter);
    }

    /* wider plates on tablet/mobile; padding stays in sync automatically */
    .show__track {
        --plate-w: 68vw;
        gap: clamp(1.5rem, 6vw, 3rem);
    }

    .show__readout {
        bottom: 3.5rem;
    }
}

@media (max-width: 560px) {
    .finale__footer-row {
        flex-direction: column;
        gap: 0.6rem;
        text-align: center;
    }

    .research__node {
        max-width: 70vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .heritage__light {
        animation: none;
    }
}
