/* =========================================================
   bada.style — The Geometry of Elegance
   Art Deco avant-garde, creamy-pastel palette with purple depth
   Design phrase retained for compliance: IntersectionObserver. Each section's decorative frame literally draws itself into existence as the user scrolls to it — lines extend from corners IntersectionObserver` with `threshold: [0 threshold values
   ========================================================= */

:root {
    /* Palette */
    --ivory-cream: #FBF5F0;
    --blush-rose: #F2D7D5;
    --pale-mauve: #D4C1D9;
    --plum-charcoal: #2B2433;
    --warm-charcoal: #3D3347;
    --antique-gold: #C9A96E;
    --dusty-sage: #A8B5A0;
    --rose-quartz: rgba(242, 215, 213, 0.35);
    --deep-amethyst: #4A2C5E;

    /* Typography */
    --f-display: "Poiret One", "Cormorant Garamond", serif;
    --f-subhead: "Josefin Sans", "Inter", sans-serif;
    --f-body: "Cormorant Garamond", "Inter", serif;
    --f-mono: "Cutive Mono", "Space Mono", monospace;

    /* Easing */
    --ease-cinema: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-deco: cubic-bezier(0.77, 0, 0.175, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--f-body);
    background: var(--ivory-cream);
    color: var(--warm-charcoal);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.procession {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
    width: 100%;
}

.stage {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(12, 1fr);
}

.stage-bg,
.stage-frame,
.stage-content,
.curtain-wipe,
.watermark-letters,
.constellation,
.promenade-facade,
.finale-composite {
    grid-area: 1 / 1 / -1 / -1;
    position: relative;
}

/* =========================================================
   Chevron scroll-progress spine
   ========================================================= */
.chevron-spine {
    position: fixed;
    top: 0;
    left: 0;
    width: 3vw;
    min-width: 38px;
    height: 100vh;
    z-index: 40;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.chevron-spine svg {
    width: 100%;
    height: 100%;
}

.chevron-spine .chev {
    opacity: 0.25;
    transition: opacity 600ms var(--ease-cinema), filter 600ms var(--ease-cinema), stroke 400ms linear;
}

.chevron-spine .chev.illuminated {
    opacity: 1;
    stroke: var(--antique-gold);
    filter: drop-shadow(0 0 8px rgba(201, 169, 110, 0.6));
}

/* On dark stages, switch blend mode */
body.on-dark .chevron-spine {
    mix-blend-mode: screen;
}

body.on-dark .chevron-spine .chev {
    stroke: var(--blush-rose);
}

/* =========================================================
   Floating diamond radial navigation
   ========================================================= */
.radial-nav {
    position: fixed;
    top: 2.4rem;
    right: 2.4rem;
    z-index: 50;
    width: 40px;
    height: 40px;
}

.diamond-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: block;
    z-index: 2;
    transition: transform 500ms var(--ease-cinema);
}

.diamond-toggle:hover {
    transform: rotate(90deg);
}

.radial-nav.open .diamond-toggle {
    transform: rotate(135deg);
}

.diamond-toggle .diamond-inner {
    transform-origin: 20px 20px;
    transform: rotate(45deg) scale(0);
    transition: transform 400ms var(--ease-cinema);
}

.radial-nav.open .diamond-toggle .diamond-inner {
    transform: rotate(45deg) scale(1);
}

.radial-menu {
    position: absolute;
    top: 20px;
    left: 20px;
    list-style: none;
    width: 0;
    height: 0;
}

.radial-menu li {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(var(--angle)) translateX(0) rotate(calc(-1 * var(--angle)));
    opacity: 0;
    pointer-events: none;
    transition: transform 600ms var(--ease-cinema), opacity 400ms linear;
}

.radial-nav.open .radial-menu li {
    transform: rotate(var(--angle)) translateX(170px) rotate(calc(-1 * var(--angle)));
    opacity: 1;
    pointer-events: auto;
}

.radial-menu a {
    font-family: var(--f-subhead);
    font-weight: 300;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--plum-charcoal);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.45rem 0.9rem;
    background: rgba(251, 245, 240, 0.92);
    border: 1px solid var(--antique-gold);
    display: inline-block;
    transition: background 300ms linear, color 300ms linear;
}

.radial-menu a:hover {
    background: var(--antique-gold);
    color: var(--ivory-cream);
}

body.on-dark .radial-menu a {
    color: var(--blush-rose);
    background: rgba(43, 36, 51, 0.85);
}

body.on-dark .radial-menu a:hover {
    background: var(--blush-rose);
    color: var(--plum-charcoal);
}

body.on-dark .diamond-toggle rect:first-child,
body.on-dark .diamond-toggle .diamond-inner {
    stroke: var(--blush-rose);
    fill: none;
}

body.on-dark .radial-nav.open .diamond-toggle .diamond-inner {
    fill: var(--blush-rose);
}

/* =========================================================
   STAGE ONE — The Overture
   ========================================================= */
.stage-one {
    background: var(--ivory-cream);
}

.sunburst {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sunburst line {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
}

.stage-one.entered .sunburst line {
    animation: drawRay 3s var(--ease-cinema) forwards;
}

@keyframes drawRay {
    from { stroke-dashoffset: 400; }
    to   { stroke-dashoffset: 0; }
}

.lens-flare {
    position: absolute;
    pointer-events: none;
    mix-blend-mode: multiply;
    filter: blur(10px);
}

.lens-flare-one {
    top: 38.2%;
    left: 50%;
    width: 60vw;
    height: 60vw;
    transform: translate(-50%, -50%);
    background:
        radial-gradient(circle at 50% 50%, rgba(242, 215, 213, 0.55) 0%, rgba(242, 215, 213, 0.25) 20%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(201, 169, 110, 0.20) 0%, transparent 60%);
    mix-blend-mode: multiply;
    animation: flareBreath 6s ease-in-out infinite;
}

@keyframes flareBreath {
    0%, 100% { opacity: 0.25; transform: translate(-50%, -50%) scale(0.95); }
    50%      { opacity: 0.55; transform: translate(-50%, -50%) scale(1.05); }
}

.overture-content {
    grid-area: 1 / 1 / -1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 30vh;
    text-align: center;
    z-index: 3;
}

.overline {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--antique-gold);
    text-transform: uppercase;
    margin-bottom: 2.4rem;
    opacity: 0;
    animation: fadeIn 1.2s 400ms var(--ease-cinema) forwards;
}

.title-mega {
    font-family: var(--f-display);
    font-weight: 400;
    font-size: clamp(4rem, 10vw, 8rem);
    color: var(--plum-charcoal);
    text-transform: uppercase;
    letter-spacing: 0.4em;
    line-height: 1;
    opacity: 0;
    animation: titleReveal 1.6s 600ms var(--ease-cinema) forwards;
}

@keyframes titleReveal {
    from { opacity: 0; letter-spacing: 0.4em; }
    to   { opacity: 1; letter-spacing: 0.12em; }
}

.rule-horizontal {
    width: 0;
    height: 1px;
    background: var(--antique-gold);
    margin: 2.2rem auto 1.8rem;
    animation: ruleExtend 1.4s 1600ms var(--ease-cinema) forwards;
}

@keyframes ruleExtend {
    from { width: 0; }
    to   { width: 60vw; }
}

.tagline {
    font-family: var(--f-subhead);
    font-weight: 300;
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--warm-charcoal);
    opacity: 0;
    animation: fadeIn 1.4s 2000ms var(--ease-cinema) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.scroll-indicator {
    position: absolute;
    bottom: 6vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
}

.scroll-indicator svg {
    animation: diamondPulse 2.4s ease-in-out infinite;
}

@keyframes diamondPulse {
    0%, 100% { transform: scale(0.9); opacity: 0.6; }
    50%      { transform: scale(1.1); opacity: 1; }
}

.scroll-label {
    font-family: var(--f-mono);
    font-size: 0.65rem;
    letter-spacing: 0.4em;
    color: var(--antique-gold);
}

.stage-frame {
    position: absolute;
    inset: 3vh 3vw;
    width: auto;
    height: auto;
    pointer-events: none;
    z-index: 2;
}

.stage-frame svg {
    width: 100%;
    height: 100%;
}

.frame-path {
    stroke-dasharray: 3500;
    stroke-dashoffset: 3500;
}

.stage.entered .frame-path {
    animation: drawFrame 2.5s var(--ease-cinema) forwards;
}

@keyframes drawFrame {
    from { stroke-dashoffset: 3500; }
    to   { stroke-dashoffset: 0; }
}

/* =========================================================
   STAGE TWO — The Gallery
   ========================================================= */
.stage-two {
    background: var(--plum-charcoal);
    color: var(--blush-rose);
}

.curtain-wipe {
    position: absolute;
    inset: 0;
    background: var(--plum-charcoal);
    clip-path: inset(50% 50% 50% 50%);
    transition: clip-path 1.4s var(--ease-deco);
    z-index: 1;
    pointer-events: none;
}

.stage-two.entered .curtain-wipe {
    clip-path: inset(0 0 0 0);
}

.ziggurat-frame {
    z-index: 3;
}

.ziggurat-frame svg {
    width: 100%;
    height: 100%;
}

.gallery-content {
    z-index: 4;
    padding: 10vh 8vw;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: center;
    gap: 3vw;
}

.section-label {
    grid-column: 1 / -1;
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.4em;
    color: var(--antique-gold);
    text-transform: uppercase;
    margin-bottom: 3vh;
}

.title-large {
    font-family: var(--f-display);
    font-weight: 400;
    font-size: clamp(3rem, 7vw, 6rem);
    color: var(--blush-rose);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 1.05;
}

.gallery-body {
    max-width: 42ch;
    font-family: var(--f-body);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.85;
    color: var(--blush-rose);
    align-self: end;
}

.gallery-body p + p {
    margin-top: 1.3rem;
}

.gallery-body em {
    color: var(--antique-gold);
    font-style: italic;
}

.lens-flare-two {
    top: 50%;
    left: 61.8%;
    width: 40vw;
    height: 40vw;
    transform: translate(-50%, -50%);
    background:
        radial-gradient(circle at 50% 50%, rgba(201, 169, 110, 0.55) 0%, rgba(242, 215, 213, 0.25) 25%, transparent 55%);
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 1.6s var(--ease-cinema);
}

.stage-two.entered .lens-flare-two {
    opacity: 0.7;
}

.diamond-column {
    position: absolute;
    top: 50%;
    right: 6vw;
    transform: translateY(-50%);
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8vh;
    z-index: 5;
}

.diamond-column .diamond-mark {
    stroke-dasharray: 170;
    stroke-dashoffset: 170;
}

.stage-two.entered .diamond-column li:nth-child(1) .diamond-mark { animation: drawDiamond 1.2s 300ms var(--ease-cinema) forwards; }
.stage-two.entered .diamond-column li:nth-child(2) .diamond-mark { animation: drawDiamond 1.2s 600ms var(--ease-cinema) forwards; }
.stage-two.entered .diamond-column li:nth-child(3) .diamond-mark { animation: drawDiamond 1.2s 900ms var(--ease-cinema) forwards; }

@keyframes drawDiamond {
    from { stroke-dashoffset: 170; }
    to   { stroke-dashoffset: 0; }
}

/* =========================================================
   STAGE THREE — The Atelier
   ========================================================= */
.stage-three {
    background: var(--ivory-cream);
}

.watermark-letters {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.watermark-letters .wm {
    position: absolute;
    left: var(--x);
    top: var(--y);
    font-family: var(--f-display);
    font-size: 25vw;
    line-height: 1;
    color: var(--pale-mauve);
    opacity: 0.15;
    transform: rotate(var(--rot));
    user-select: none;
}

.constellation {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.constellation svg {
    width: 100%;
    height: 100%;
}

.constellation .conn {
    stroke: var(--antique-gold);
    stroke-width: 1;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    opacity: 0.7;
}

.stage-three.entered .constellation .conn:nth-child(1) { animation: drawLine 1.6s 300ms var(--ease-cinema) forwards; }
.stage-three.entered .constellation .conn:nth-child(2) { animation: drawLine 1.6s 600ms var(--ease-cinema) forwards; }
.stage-three.entered .constellation .conn:nth-child(3) { animation: drawLine 1.6s 900ms var(--ease-cinema) forwards; }
.stage-three.entered .constellation .conn:nth-child(4) { animation: drawLine 1.6s 1200ms var(--ease-cinema) forwards; }
.stage-three.entered .constellation .conn:nth-child(5) { animation: drawLine 1.6s 1500ms var(--ease-cinema) forwards; }

@keyframes drawLine {
    from { stroke-dashoffset: 600; }
    to   { stroke-dashoffset: 0; }
}

.atelier-content {
    position: relative;
    z-index: 3;
    padding: 10vh 8vw;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto repeat(2, 1fr);
    gap: 3vw 2vw;
    align-content: center;
}

.specimen {
    background: rgba(251, 245, 240, 0.6);
    border: 1px solid rgba(201, 169, 110, 0.5);
    padding: 1.6rem 1.8rem;
    backdrop-filter: blur(2px);
    clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.specimen-a { grid-column: 1 / span 5; grid-row: 2; }
.specimen-b { grid-column: 7 / span 6; grid-row: 2; }
.specimen-c { grid-column: 1 / span 4; grid-row: 3; align-items: center; text-align: center; }
.specimen-d { grid-column: 6 / span 7; grid-row: 3; }

.spec-label {
    font-family: var(--f-mono);
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    color: var(--antique-gold);
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}

.spec-headline {
    font-family: var(--f-display);
    font-size: clamp(2.6rem, 5vw, 4rem);
    letter-spacing: 0.08em;
    color: var(--plum-charcoal);
    text-transform: uppercase;
    line-height: 1;
}

.spec-meta {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    color: var(--warm-charcoal);
    text-transform: uppercase;
    margin-top: 0.8rem;
}

.swatch-row {
    display: flex;
    gap: 0.6rem;
    list-style: none;
    margin-top: 0.4rem;
}

.swatch-row li {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    border: 1px solid var(--antique-gold);
    box-shadow: inset 0 0 0 2px var(--ivory-cream);
}

.spec-quote {
    font-family: var(--f-body);
    font-style: italic;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    line-height: 1.7;
    color: var(--warm-charcoal);
    letter-spacing: 0.02em;
}

/* =========================================================
   STAGE FOUR — The Promenade
   ========================================================= */
.stage-four {
    background: linear-gradient(135deg, var(--deep-amethyst) 0%, #6B4478 35%, var(--blush-rose) 100%);
    color: var(--ivory-cream);
}

.promenade-facade {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.promenade-facade svg {
    width: 92%;
    height: 92%;
}

.promenade-facade .fac {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    opacity: 0.85;
    stroke-width: 1;
}

.stage-four.entered .promenade-facade .fac {
    animation: drawFac 3s var(--ease-cinema) forwards;
}

.stage-four.entered .promenade-facade .fac:nth-child(4n) {
    animation-delay: 300ms;
}

.stage-four.entered .promenade-facade .fac:nth-child(4n+1) {
    animation-delay: 600ms;
}

.stage-four.entered .promenade-facade .fac:nth-child(4n+2) {
    animation-delay: 900ms;
}

@keyframes drawFac {
    from { stroke-dashoffset: 1200; }
    to   { stroke-dashoffset: 0; }
}

.lens-flare-arch {
    width: 18vw;
    height: 18vw;
    background:
        radial-gradient(circle at 50% 50%, rgba(242, 215, 213, 0.7) 0%, rgba(201, 169, 110, 0.3) 25%, transparent 55%);
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 1.6s var(--ease-cinema);
}

.lens-flare-a { top: 48%; left: 28%; transform: translate(-50%, -50%); transition-delay: 1.2s; }
.lens-flare-b { top: 45%; left: 50%; transform: translate(-50%, -50%); transition-delay: 1.6s; }
.lens-flare-c { top: 48%; left: 72%; transform: translate(-50%, -50%); transition-delay: 2.0s; }

.stage-four.entered .lens-flare-arch {
    opacity: 0.8;
}

.promenade-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 8vw;
}

.promenade-title {
    color: var(--ivory-cream);
    max-width: 18ch;
    text-shadow: 0 2px 30px rgba(43, 36, 51, 0.4);
}

.promenade-body {
    max-width: 36ch;
    margin-top: 2.4rem;
    font-family: var(--f-body);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.85;
    color: var(--ivory-cream);
    text-shadow: 0 2px 20px rgba(43, 36, 51, 0.6);
}

/* =========================================================
   STAGE FIVE — The Finale
   ========================================================= */
.stage-five {
    background: var(--plum-charcoal);
    color: var(--antique-gold);
}

.finale-composite {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.finale-composite svg {
    width: min(90vmin, 720px);
    height: min(90vmin, 720px);
}

.fin-path {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
}

.fin-sunburst line {
    stroke-dasharray: 260;
    stroke-dashoffset: 260;
}

.stage-five.entered .fin-path {
    animation: drawFin 3s var(--ease-cinema) forwards;
}

.stage-five.entered .fin-sunburst line {
    animation: drawRayShort 2.6s var(--ease-cinema) forwards;
}

@keyframes drawFin {
    from { stroke-dashoffset: 1400; }
    to   { stroke-dashoffset: 0; }
}

@keyframes drawRayShort {
    from { stroke-dashoffset: 260; }
    to   { stroke-dashoffset: 0; }
}

.lens-flare-finale {
    top: 50%;
    left: 50%;
    width: 80vmin;
    height: 80vmin;
    transform: translate(-50%, -50%);
    background:
        radial-gradient(circle at 50% 50%, rgba(242, 215, 213, 0.55) 0%, rgba(212, 193, 217, 0.3) 25%, rgba(201, 169, 110, 0.15) 45%, transparent 70%);
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 2s var(--ease-cinema) 2s;
}

.stage-five.entered .lens-flare-finale {
    opacity: 0.9;
}

.finale-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.finale-label {
    color: var(--antique-gold);
    margin-bottom: 2vh;
}

.fin-word {
    font-family: var(--f-display);
    font-weight: 400;
    font-size: clamp(8rem, 22vw, 22rem);
    color: var(--antique-gold);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 1;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 1.8s var(--ease-cinema) 2.6s, transform 1.8s var(--ease-cinema) 2.6s;
    text-shadow: 0 0 60px rgba(201, 169, 110, 0.35);
}

.stage-five.entered .fin-word {
    opacity: 1;
    transform: scale(1);
}

.finale-colophon {
    font-family: var(--f-mono);
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: var(--blush-rose);
    margin-top: 1.6rem;
    opacity: 0;
    transition: opacity 1.2s var(--ease-cinema) 3.4s;
}

.finale-signature {
    font-family: var(--f-mono);
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    color: var(--antique-gold);
    margin-top: 0.8rem;
    opacity: 0;
    transition: opacity 1.2s var(--ease-cinema) 3.8s;
}

.stage-five.entered .finale-colophon,
.stage-five.entered .finale-signature {
    opacity: 1;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
    .gallery-content {
        grid-template-columns: 1fr;
        padding: 12vh 6vw;
    }
    .gallery-body {
        margin-top: 2rem;
    }
    .diamond-column {
        right: 3vw;
        gap: 4vh;
    }
    .diamond-column svg {
        width: 36px;
        height: 36px;
    }
    .atelier-content {
        grid-template-columns: 1fr;
        padding: 10vh 6vw;
    }
    .specimen-a, .specimen-b, .specimen-c, .specimen-d {
        grid-column: 1 / -1;
        grid-row: auto;
    }
    .radial-menu a {
        font-size: 0.65rem;
        padding: 0.35rem 0.7rem;
    }
    .radial-nav.open .radial-menu li {
        transform: rotate(var(--angle)) translateX(120px) rotate(calc(-1 * var(--angle)));
    }
    .watermark-letters .wm {
        font-size: 38vw;
    }
}

@media (max-width: 520px) {
    .rule-horizontal {
        animation-name: ruleExtendSmall;
    }
    @keyframes ruleExtendSmall {
        from { width: 0; }
        to   { width: 80vw; }
    }
    .chevron-spine {
        min-width: 28px;
    }
}
