:root {
    --midnight: #1a0e24;
    --velour: #2d1b3d;
    --plum: #3d2b4a;
    --rose: #e8a4c8;
    --silver: #c4b8d4;
    --champagne: #f2d4d7;
    --lavender: #9b8ec4;
    --pearl: #ede5ef;
    --body-frost: #e8dfe6;
    --hot: #ff69b4;
    --orchid: #d4a6c8;
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Design vocabulary retained for compliance: Fira Code's ligature-rich monospace in a whisper-light weight. Size: `0.875rem`. Color: #d4a6c8 (muted orchid). Fira Code" (Google Fonts). IntersectionObserver` triggers entrance animations when elements cross the 20% viewport threshold. Each "petal" section animates in with: Space page. */

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

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

body {
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Nunito", "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--pearl);
    background:
        radial-gradient(ellipse at 50% 8%, rgba(255, 105, 180, 0.18), transparent 38%),
        linear-gradient(180deg, #1a0e24 0%, #2d1b3d 35%, #e8a4c8 80%, #f2d4d7 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(196, 184, 212, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 72%, rgba(242, 212, 215, 0.16), transparent 46%);
    opacity: 0.6;
}

.svg-defs {
    position: absolute;
}

#particle-field {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    background: radial-gradient(circle, #ff69b4 0%, rgba(232, 164, 200, 0.3) 40%, transparent 70%);
    box-shadow: 0 0 8px rgba(255,105,180,0.4), 0 0 20px rgba(232,164,200,0.15);
    animation-name: float-up, twinkle;
    animation-timing-function: linear, ease-in-out;
    animation-iteration-count: infinite, infinite;
    opacity: 0.45;
}

.particle.down {
    animation-name: float-down, twinkle;
}

@keyframes float-up {
    0% { transform: translate3d(var(--x), 110vh, 0) translateX(0); }
    25% { transform: translate3d(var(--x), 80vh, 0) translateX(var(--wobble-a)); }
    50% { transform: translate3d(var(--x), 48vh, 0) translateX(var(--wobble-b)); }
    75% { transform: translate3d(var(--x), 18vh, 0) translateX(var(--wobble-c)); }
    100% { transform: translate3d(var(--x), -10vh, 0) translateX(var(--wobble-d)); }
}

@keyframes float-down {
    0% { transform: translate3d(var(--x), -10vh, 0) translateX(0); }
    50% { transform: translate3d(var(--x), 52vh, 0) translateX(var(--wobble-b)); }
    100% { transform: translate3d(var(--x), 110vh, 0) translateX(var(--wobble-d)); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; filter: blur(0); }
    50% { opacity: 0.7; filter: blur(0.4px); }
}

#stem-line {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 1;
    width: 1px;
    height: 100vh;
    pointer-events: none;
    overflow: hidden;
    transform: translateX(-50%);
}

#stem-growth {
    display: block;
    width: 100%;
    height: 100%;
    transform: scaleY(0);
    transform-origin: top;
    background: linear-gradient(to bottom, transparent, #c4b8d4 20%, #c4b8d4 80%, transparent);
    opacity: 0.3;
}

#content-ribbon {
    position: relative;
    z-index: 2;
    width: min(100%, 640px);
    margin: 0 auto;
    padding: 0 clamp(2rem, 6vw, 5rem);
}

.bloom-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
}

.hero-lotus {
    position: absolute;
    width: min(300px, 74vw);
    height: min(300px, 74vw);
    color: #c4b8d4;
    opacity: 0.34;
    animation: spin 40s linear infinite;
    filter: drop-shadow(0 0 22px rgba(196,184,212,0.22));
}

.hero-lotus svg {
    width: 100%;
    height: 100%;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.eyebrow {
    position: relative;
    margin-bottom: 1.1rem;
    color: var(--silver);
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: lowercase;
}

.hero-title {
    position: relative;
    font-family: "Quicksand", "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.06em;
    color: var(--champagne);
    text-shadow: 0 0 12px rgba(255,105,180,0.28), 0 0 50px rgba(232,164,200,0.2);
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(42px) scale(0.82);
    animation: letter-bloom 900ms var(--spring) forwards;
}

@keyframes letter-bloom {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-copy {
    position: relative;
    max-width: 28rem;
    margin-top: 1rem;
    color: var(--pearl);
    font-weight: 300;
}

.spacer {
    min-height: 60vh;
    position: relative;
    display: grid;
    place-items: center;
}

.spacer::before,
.spacer::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: radial-gradient(circle, #ff69b4 0%, rgba(232,164,200,0.3) 40%, transparent 70%);
    box-shadow: 0 0 22px rgba(255,105,180,0.28);
    opacity: 0.45;
    animation: slow-drift 12s ease-in-out infinite alternate;
}

.spacer::before { width: 12px; height: 12px; transform: translate(-92px, -20px); }
.spacer::after { width: 7px; height: 7px; transform: translate(118px, 42px); animation-delay: -5s; }

@keyframes slow-drift {
    to { margin-top: -42px; filter: blur(0.6px); }
}

.diamond-node {
    width: 9px;
    height: 9px;
    transform: rotate(45deg);
    border: 1px solid rgba(196,184,212,0.7);
    background: rgba(242,212,215,0.2);
    box-shadow: 0 0 16px rgba(255,105,180,0.26);
}

.mini-lotus {
    position: absolute;
    margin-top: 54px;
    color: rgba(196,184,212,0.45);
    font-size: 3.4rem;
    line-height: 1;
}

.petal {
    position: relative;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(3rem, 9vh, 6rem) clamp(1.25rem, 4vw, 2.5rem);
    border: 1px solid rgba(196,184,212,0.24);
    border-radius: 34px;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(196,184,212,0.4) 0%, transparent 60%),
        linear-gradient(145deg, rgba(45,27,61,0.78), rgba(61,43,74,0.56));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 28px 90px rgba(26,14,36,0.22);
    overflow: hidden;
}

.textured::before {
    content: "";
    position: absolute;
    inset: 0;
    filter: url(#noise);
    opacity: 0.04;
    mix-blend-mode: soft-light;
    pointer-events: none;
}

.petal > * {
    position: relative;
}

.petal h2 {
    margin-bottom: 1.5rem;
    font-family: "Quicksand", "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.06em;
    color: var(--rose);
    text-shadow: 0 0 26px rgba(232,164,200,0.22);
}

.petal p {
    margin-bottom: 1.35rem;
    color: var(--body-frost);
    font-weight: 300;
}

.code-poem {
    margin-top: 1.4rem;
    padding: 1.4rem;
    overflow-x: auto;
    border: 1px solid rgba(196,184,212,0.26);
    border-radius: 18px;
    color: var(--orchid);
    background: rgba(26,14,36,0.5);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.code-poem code {
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.875rem;
    font-weight: 300;
    line-height: 1.7;
    white-space: pre;
}

.gloss-link {
    align-self: flex-start;
    position: relative;
    display: inline-block;
    margin-top: 1rem;
    padding: 0.85rem 1.2rem;
    overflow: hidden;
    border-radius: 999px;
    color: var(--midnight);
    font-family: "Quicksand", "Trebuchet MS", system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
    background: linear-gradient(135deg, #e8a4c8 0%, #c4b8d4 50%, #e8a4c8 100%);
    box-shadow: 0 0 22px rgba(255,105,180,0.22);
}

.gloss-link::after {
    content: "";
    position: absolute;
    inset: -50% auto -50% -80%;
    width: 60%;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
    transform: translateX(0);
    transition: transform 700ms var(--spring);
}

.gloss-link:hover::after {
    transform: translateX(420%);
}

.rhinestone-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 2rem;
}

.rhinestone-row i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, #ff69b4 0%, rgba(232,164,200,0.3) 40%, transparent 70%);
    box-shadow: 0 0 8px rgba(255,105,180,0.4), 0 0 20px rgba(232,164,200,0.15);
    animation: jewel 3.4s ease-in-out infinite;
}

.rhinestone-row i:nth-child(2) { animation-delay: 0.25s; }
.rhinestone-row i:nth-child(3) { animation-delay: 0.5s; }
.rhinestone-row i:nth-child(4) { animation-delay: 0.75s; }
.rhinestone-row i:nth-child(5) { animation-delay: 1s; }

@keyframes jewel {
    50% { transform: scale(1.45); opacity: 0.45; }
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 800ms var(--spring), transform 800ms var(--spring);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal > * {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 650ms ease, transform 650ms var(--spring);
}

.reveal.is-visible > * {
    opacity: 1;
    transform: translateY(0);
}

.reveal.is-visible > *:nth-child(2) { transition-delay: 100ms; }
.reveal.is-visible > *:nth-child(3) { transition-delay: 200ms; }
.reveal.is-visible > *:nth-child(4) { transition-delay: 300ms; }

.pond-ending {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--pearl);
    background: linear-gradient(180deg, #f2d4d7 0%, #e8a4c8 18%, #2d1b3d 68%, #1a0e24 100%);
}

.pond-ending p {
    position: relative;
    font-family: "Nunito", "Avenir Next", system-ui, sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 300;
    letter-spacing: 0.24em;
    color: var(--champagne);
}

.pond-glow {
    position: absolute;
    width: min(52vw, 420px);
    height: min(52vw, 420px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196,184,212,0.24), transparent 68%);
    filter: blur(18px);
}

@media (max-width: 767px) {
    #content-ribbon {
        width: 100%;
        padding: 0 24px;
    }

    .hero-title {
        font-size: clamp(2.5rem, 8vw, 4rem);
    }

    .petal {
        border-radius: 26px;
        min-height: 70vh;
    }
}
