/* ==============================================================
   mores.dev — Luminous Celestial Atelier
   Pastel Celestial palette, oversized-display typography,
   F-pattern layout, border-animate primary interaction.
   ============================================================== */

:root {
    --c-lavender: #E8D5F5;
    --c-rose-quartz: #F5CAC3;
    --c-mint: #D5F5E3;
    --c-butter: #FFF8E1;
    --c-periwinkle: #C5CAE9;
    --c-deep-plum: #4A2040;
    --c-charcoal-plum: #3D2B3D;
    --c-dusty-lavender: #9B8AA5;
    --c-gold: #D4A24E;
    --c-constellation: #D4A5E5;
    --c-mauve: #8B6B8B;

    --font-display: "Playfair Display", "Lora", Georgia, serif;
    --font-italic: "Cormorant Garamond", "Lora", Georgia, serif;
    --font-body: "DM Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "Space Mono", "Space", "Courier New", monospace;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-calligraph: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html {
    scroll-behavior: smooth;
    background: var(--c-lavender);
}

body {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.8;
    font-weight: 400;
    color: var(--c-charcoal-plum);
    background:
        /* Micro-stars: gold filament dots scattered as radial-gradient */
        radial-gradient(circle at 13% 24%, rgba(212, 162, 78, 0.5) 0.7px, transparent 1.4px),
        radial-gradient(circle at 78% 18%, rgba(212, 162, 78, 0.5) 0.5px, transparent 1.2px),
        radial-gradient(circle at 42% 67%, rgba(212, 162, 78, 0.5) 0.6px, transparent 1.3px),
        radial-gradient(circle at 91% 81%, rgba(212, 162, 78, 0.5) 0.5px, transparent 1.2px),
        radial-gradient(circle at 27% 89%, rgba(212, 162, 78, 0.5) 0.7px, transparent 1.4px),
        radial-gradient(circle at 64% 41%, rgba(212, 162, 78, 0.5) 0.5px, transparent 1.2px),
        radial-gradient(circle at 8% 55%, rgba(212, 162, 78, 0.5) 0.6px, transparent 1.3px),
        radial-gradient(circle at 53% 7%, rgba(212, 162, 78, 0.5) 0.5px, transparent 1.2px),
        var(--c-lavender);
    background-attachment: fixed;
    background-size: 280px 280px, 320px 320px, 360px 360px, 240px 240px, 300px 300px, 340px 340px, 260px 260px, 310px 310px, auto;
    transition: background-color 1.6s var(--ease-calligraph);
    overflow-x: hidden;
}

/* Body class set by JS to indicate currently-active section pastel.
   Each class only swaps the SOLID background-color portion via custom prop. */
body.bg-lavender { background-color: var(--c-lavender); }
body.bg-mint { background-color: var(--c-mint); }
body.bg-mint-deep { background-color: #C8EED8; }
body.bg-butter { background-color: var(--c-butter); }
body.bg-butter-deep { background-color: #FAEFC0; }
body.bg-rose { background-color: var(--c-rose-quartz); }
body.bg-rose-deep { background-color: #EBB8B0; }
body.bg-periwinkle { background-color: var(--c-periwinkle); }
body.bg-periwinkle-deep { background-color: #B2B8DD; }

/* Persistent fixed micro-star field (denser, doesn't move with scroll) */
.micro-stars-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(circle at 17% 12%, rgba(212, 162, 78, 0.5) 0.8px, transparent 1.6px),
        radial-gradient(circle at 83% 28%, rgba(212, 162, 78, 0.5) 0.6px, transparent 1.3px),
        radial-gradient(circle at 36% 76%, rgba(212, 162, 78, 0.5) 0.7px, transparent 1.4px),
        radial-gradient(circle at 71% 92%, rgba(212, 162, 78, 0.5) 0.5px, transparent 1.2px),
        radial-gradient(circle at 49% 35%, rgba(212, 162, 78, 0.5) 0.6px, transparent 1.3px);
    background-size: 220px 220px, 260px 260px, 290px 290px, 240px 240px, 310px 310px;
    opacity: 0.85;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.display-heading {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--c-deep-plum);
}

.display-heading em {
    font-style: italic;
    font-weight: 400;
    color: var(--c-mauve);
}

.hero-heading {
    font-size: clamp(3.5rem, 11vw, 14rem);
    font-weight: 900;
}

.stem-block .display-heading {
    font-size: clamp(2.8rem, 6.5vw, 7rem);
}

.body-text {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.8;
    font-weight: 400;
    color: var(--c-charcoal-plum);
    margin-top: 1.5rem;
    max-width: 60ch;
}

.body-text.emphasized {
    font-weight: 500;
    color: var(--c-deep-plum);
    font-style: italic;
    font-family: var(--font-italic);
    font-size: 1.4rem;
    line-height: 1.55;
    letter-spacing: 0.02em;
}

.body-text.mono-line {
    margin-top: 2.5rem;
}

.ui-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.4;
    font-weight: 400;
    color: var(--c-dusty-lavender);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.intro-line {
    font-family: var(--font-italic);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.1rem, 1.7vw, 1.6rem);
    line-height: 1.45;
    letter-spacing: 0.08em;
    color: var(--c-mauve);
    margin-top: 0.6rem;
    max-width: 48ch;
}

/* ============================================================
   WORDMARK
   ============================================================ */

.wordmark {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.6rem, 5.6vw, 5.6rem);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--c-deep-plum);
    display: flex;
    align-items: baseline;
    gap: 0.02em;
    flex-wrap: wrap;
}

.wordmark-mark { color: var(--c-deep-plum); }
.wordmark-dot { color: var(--c-gold); }
.wordmark-tld {
    color: var(--c-mauve);
    font-style: italic;
    font-weight: 400;
    font-family: var(--font-italic);
}

/* ============================================================
   CONSTELLATION SECTIONS (F-pattern)
   ============================================================ */

.constellation {
    position: relative;
    min-height: 100vh;
    width: 100%;
    padding: 0;
    z-index: 1;
}

.f-pattern {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* First horizontal bar (top) */
.f-bar-top {
    position: relative;
    width: 100%;
    min-height: 15vh;
    padding: 3vh 6vw;
    background: linear-gradient(
        90deg,
        rgba(232, 213, 245, 0.85) 0%,
        rgba(245, 202, 195, 0.85) 100%
    );
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4vw;
    border-radius: 2px;
    margin-top: 4vh;
    isolation: isolate;
}

.f-bar-content {
    flex: 0 0 60%;
    max-width: 60%;
}

.f-bar-motif {
    flex: 0 0 40%;
    max-width: 40%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 3vw;
}

/* Second horizontal bar (mid) */
.f-bar-mid {
    position: relative;
    width: 100%;
    min-height: 30vh;
    padding: 6vh 6vw;
    margin-top: 6vh;
    background: linear-gradient(
        90deg,
        rgba(213, 245, 227, 0.78) 0%,
        rgba(255, 248, 225, 0.78) 100%
    );
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4vw;
    border-radius: 2px;
    isolation: isolate;
}

.f-bar-mid .f-bar-content {
    flex: 0 0 55%;
    max-width: 55%;
}

.narrative-content > .ui-label {
    margin-bottom: 1.4rem;
}

/* Vertical stem (left column cascade) */
.f-stem {
    position: relative;
    width: 100%;
    padding: 6vh 6vw 10vh 6vw;
    display: grid;
    grid-template-columns: 55% 45%;
    column-gap: 2vw;
}

.f-stem .stem-block {
    grid-column: 1 / 2;
    position: relative;
    padding: 4vh 3vw 4vh 0;
    margin-bottom: 8vh;
    isolation: isolate;
}

.f-stem .stem-block:last-of-type { margin-bottom: 4vh; }

.stem-block .ui-label { margin-bottom: 1.2rem; }
.stem-block .display-heading { margin-bottom: 1rem; }

.stem-decor {
    grid-column: 2 / 3;
    grid-row: 1 / span 99;
    position: relative;
    pointer-events: none;
    min-height: 100%;
}

.stem-decor .constellation-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Constellation lines and stars (decorative SVG) */
.conn-line {
    fill: none;
    stroke: var(--c-constellation);
    stroke-width: 1.2;
    stroke-opacity: 0.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.medium-stars .m-star {
    fill: var(--c-periwinkle);
    fill-opacity: 0.7;
    stroke: var(--c-constellation);
    stroke-width: 0.8;
    stroke-opacity: 0.5;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.bob-star {
    transform-box: fill-box;
    transform-origin: center;
    animation: bob 6s ease-in-out infinite;
    animation-delay: var(--bob-delay, 0s);
}

/* ============================================================
   COLLAGE (mixed-media)
   ============================================================ */

.collage {
    flex: 0 0 38%;
    max-width: 38%;
    aspect-ratio: 1 / 1;
    position: relative;
    transform: translateY(8%);
    isolation: isolate;
}

.collage-engraved {
    position: absolute;
    inset: 12% 18% 12% 8%;
    width: 74%;
    height: 76%;
    z-index: 3;
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 1s ease-out 0.3s, transform 1s ease-out 0.3s;
}

.collage.in-view .collage-engraved {
    opacity: 1;
    transform: translateX(0);
}

.collage-photo {
    position: absolute;
    border-radius: 2px;
    z-index: 2;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 1.2s ease-out 0.5s, transform 1.2s ease-out 0.5s;
    filter: blur(5px) saturate(0.3);
    mix-blend-mode: multiply;
}

.collage.in-view .collage-photo {
    opacity: 0.32;
    transform: scale(1);
}

.collage-photo-1 {
    inset: 8% -12% auto auto;
    width: 58%;
    height: 56%;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(212, 162, 78, 0.55) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(155, 138, 165, 0.5) 0%, transparent 60%),
        linear-gradient(135deg, rgba(232, 213, 245, 0.7) 0%, rgba(245, 202, 195, 0.7) 100%);
}

.collage-photo-2 {
    inset: auto -10% 6% auto;
    width: 60%;
    height: 50%;
    background:
        radial-gradient(ellipse at 60% 30%, rgba(213, 245, 227, 0.7) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 70%, rgba(212, 162, 78, 0.4) 0%, transparent 55%),
        linear-gradient(45deg, rgba(213, 245, 227, 0.7) 0%, rgba(255, 248, 225, 0.7) 100%);
}

.collage-photo-3 {
    inset: -8% auto auto -10%;
    width: 56%;
    height: 54%;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(255, 248, 225, 0.85) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(212, 162, 78, 0.5) 0%, transparent 55%),
        linear-gradient(225deg, rgba(255, 248, 225, 0.7) 0%, rgba(245, 202, 195, 0.7) 100%);
}

.collage-photo-4 {
    inset: 10% auto auto -12%;
    width: 60%;
    height: 60%;
    background:
        radial-gradient(ellipse at 40% 60%, rgba(245, 202, 195, 0.7) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 30%, rgba(155, 138, 165, 0.45) 0%, transparent 55%),
        linear-gradient(135deg, rgba(245, 202, 195, 0.7) 0%, rgba(232, 213, 245, 0.7) 100%);
}

.collage-photo-5 {
    inset: auto -12% -8% auto;
    width: 58%;
    height: 56%;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(197, 202, 233, 0.7) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 70%, rgba(212, 162, 78, 0.4) 0%, transparent 55%),
        linear-gradient(45deg, rgba(197, 202, 233, 0.7) 0%, rgba(232, 213, 245, 0.7) 100%);
}

.collage-geometric {
    position: absolute;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.collage.in-view .collage-geometric {
    opacity: 0.7;
}

.collage-geo-circle {
    width: 38%;
    height: 38%;
    border-radius: 50%;
    bottom: 0;
    left: 0;
    background: var(--c-rose-quartz);
}

.collage-geo-arc {
    width: 60%;
    height: 60%;
    top: -8%;
    right: -6%;
    border-radius: 50%;
    background:
        conic-gradient(from 180deg, var(--c-mint) 0deg, transparent 90deg, transparent 270deg, var(--c-mint) 360deg);
    -webkit-mask: radial-gradient(circle at center, transparent 56%, #000 57%);
            mask: radial-gradient(circle at center, transparent 56%, #000 57%);
}

.collage-geo-rect {
    width: 32%;
    height: 32%;
    bottom: -4%;
    right: -4%;
    background: var(--c-periwinkle);
    border-radius: 2px;
    transform: rotate(8deg);
}

.collage-geo-radiate {
    width: 50%;
    height: 50%;
    top: -10%;
    left: -10%;
    background:
        repeating-conic-gradient(from 0deg, var(--c-butter) 0deg 10deg, transparent 10deg 20deg);
    border-radius: 50%;
    opacity: 0.6;
}

/* ============================================================
   MACRO STARS
   ============================================================ */

.macro-star {
    width: clamp(80px, 11vw, 140px);
    height: clamp(80px, 11vw, 140px);
    overflow: visible;
}

.six-star-fill {
    fill: var(--c-gold);
    stroke: var(--c-constellation);
    stroke-width: 1;
    stroke-opacity: 0.7;
}

.six-star-stroke {
    fill: var(--c-gold);
    fill-opacity: 0.85;
    stroke: var(--c-constellation);
    stroke-width: 0.8;
    stroke-opacity: 0.7;
}

.six-star-core {
    fill: var(--c-deep-plum);
}

.macro-star-group {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 1.2s var(--ease-calligraph);
}

.rotating-star {
    cursor: default;
}

.rotating-star.rotated .macro-star-group {
    transform: rotate(30deg);
}

/* Spinning idle: very slow ambient rotation of top-bar motif */
@keyframes slow-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.f-bar-motif .macro-star-group {
    animation: slow-rotate 60s linear infinite;
}

/* ============================================================
   INTERSTITIALS
   ============================================================ */

.interstitial {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background-color 0.6s var(--ease-out-expo);
}

.interstitial[data-pastel="mint"] { background: var(--c-mint); }
.interstitial[data-pastel="butter"] { background: var(--c-butter); }
.interstitial[data-pastel="rose"] { background: var(--c-rose-quartz); }
.interstitial[data-pastel="periwinkle"] { background: var(--c-periwinkle); }

.interstitial-inner {
    position: relative;
    text-align: center;
    width: min(80%, 760px);
}

.interstitial-star {
    width: clamp(180px, 26vw, 360px);
    height: clamp(180px, 26vw, 360px);
    display: block;
    margin: 0 auto;
    overflow: visible;
    transform: scale(0);
    opacity: 0;
    transition: opacity 0.4s ease-out;
}

.interstitial.active .interstitial-star {
    animation: spring-scale 1.4s var(--ease-out-expo) forwards;
    opacity: 1;
}

@keyframes spring-scale {
    0% { transform: scale(0); }
    65% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.rad-line {
    stroke: var(--c-gold);
    stroke-width: 1.5;
    stroke-opacity: 0.7;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 2.5s ease-out;
}

.interstitial.active .rad-line:nth-child(1) { transition-delay: 0.7s; }
.interstitial.active .rad-line:nth-child(2) { transition-delay: 0.85s; }
.interstitial.active .rad-line:nth-child(3) { transition-delay: 1.0s; }
.interstitial.active .rad-line:nth-child(4) { transition-delay: 1.15s; }
.interstitial.active .rad-line:nth-child(5) { transition-delay: 1.3s; }
.interstitial.active .rad-line:nth-child(6) { transition-delay: 1.45s; }

.interstitial.active .rad-line {
    stroke-dashoffset: 0;
}

.interstitial-caption {
    font-family: var(--font-italic);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    line-height: 1.55;
    letter-spacing: 0.08em;
    color: var(--c-mauve);
    margin-top: 3rem;
    opacity: 0;
    transition: opacity 0.8s ease-out 2s;
}

.interstitial.active .interstitial-caption {
    opacity: 1;
}

/* ============================================================
   BORDER-ANIMATE — primary interaction pattern
   ============================================================ */

[data-frame] {
    position: relative;
}

.border-animate {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 4;
}

.border-rect {
    fill: none;
    stroke: var(--c-gold);
    stroke-opacity: 0.6;
    stroke-width: 1.5;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    /* dasharray + dashoffset are set inline via JS to match each element's perimeter */
    stroke-linecap: square;
}

[data-frame].in-view .border-rect {
    will-change: stroke-dashoffset;
}

/* ============================================================
   HEADING REVEAL ANIMATION
   ============================================================ */

.display-heading,
.body-text,
.ui-label,
.wordmark,
.intro-line {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 1.2s var(--ease-out-expo), transform 1.2s var(--ease-out-expo);
}

[data-frame].in-view .display-heading,
[data-frame].in-view .body-text,
[data-frame].in-view .ui-label,
[data-frame].in-view .wordmark,
[data-frame].in-view .intro-line {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.4s;
}

[data-frame].in-view .body-text { transition-delay: 0.6s; }
[data-frame].in-view .body-text + .body-text { transition-delay: 0.8s; }

/* Constellation line and bob stars only visible when ambient (no transition cost) */
.constellation-svg .conn-line {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 2.5s ease-out;
}

.constellation.in-view .constellation-svg .conn-line {
    stroke-dashoffset: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
    .f-bar-top {
        flex-direction: column;
        align-items: flex-start;
        padding: 4vh 5vw;
        gap: 2vh;
    }

    .f-bar-content,
    .f-bar-motif {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .f-bar-motif {
        justify-content: flex-start;
        padding-right: 0;
    }

    .f-bar-mid {
        flex-direction: column;
        align-items: flex-start;
        padding: 6vh 5vw;
    }

    .f-bar-mid .f-bar-content {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .collage {
        flex: 0 0 100%;
        max-width: 80%;
        margin: 4vh auto 0;
        transform: none;
    }

    .f-stem {
        grid-template-columns: 1fr;
        padding: 4vh 5vw 8vh 5vw;
    }

    .stem-decor {
        display: none;
    }

    .hero-heading {
        font-size: clamp(3rem, 16vw, 6rem);
    }

    .stem-block .display-heading {
        font-size: clamp(2.2rem, 9vw, 4rem);
    }
}

@media (max-width: 500px) {
    .body-text { font-size: 1rem; }
    .body-text.emphasized { font-size: 1.2rem; }
    .intro-line { font-size: 1.05rem; }
}

/* ============================================================
   PRINT (best-effort)
   ============================================================ */

@media print {
    * { animation: none !important; transition: none !important; }
    .micro-stars-field, .stem-decor { display: none; }
    body { background: white; color: black; }
}
