:root {
    --color-indigo: #2D1B4E;
    --color-amethyst: #5B4B91;
    --color-rose-mauve: #8B5F9B;
    --color-pale-rose: #E8D7E8;
    --color-rose-gold: #D4AF90;
    --color-pale-amethyst: #C9B8D4;
    --color-soft-charcoal: #4A4A4A;
    --color-off-white: #F5F5F5;
    --color-muted-purple: #8B7B9B;
    --color-divider: #D9C9D9;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.8;
    color: var(--color-off-white);
    background-color: var(--color-indigo);
    overflow-x: hidden;
}

/* =====================================================
   BACKGROUND GRADIENT LAYER (z-0)
   Dynamic gradient controlled by JS scroll position
   ===================================================== */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(
        180deg,
        var(--color-indigo) 0%,
        var(--color-amethyst) 25%,
        var(--color-rose-mauve) 50%,
        var(--color-pale-rose) 80%,
        #F0E8F0 100%
    );
    background-size: 100% 300%;
    background-position: 0% 0%;
    transition: background-position 0.05s linear;
    pointer-events: none;
}

/* =====================================================
   CONSTELLATION BACKGROUND (z-1)
   ===================================================== */

.constellation-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.08;
    pointer-events: none;
    animation: constellationRotate 180s linear infinite;
    transform-origin: center center;
}

@keyframes constellationRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.constellation-background line {
    stroke: var(--color-off-white);
    stroke-width: 0.5;
}

.constellation-background circle {
    fill: var(--color-off-white);
}

/* =====================================================
   SCROLL PROGRESS INDICATOR (z-20)
   ===================================================== */

.scroll-progress {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    z-index: 20;
    background: conic-gradient(
        var(--color-rose-gold) 0deg,
        var(--color-muted-purple) 0deg 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.scroll-progress.visible {
    opacity: 1;
}

.scroll-progress-inner {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--color-indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.8s ease;
}

.progress-symbol {
    width: 40px;
    height: 40px;
    transition: transform 0.6s ease;
}

/* =====================================================
   PAGE CONTENT (z-10)
   ===================================================== */

.page-content {
    position: relative;
    z-index: 10;
    max-width: 70%;
    margin: 0 auto;
    padding: 0;
}

/* =====================================================
   SECTIONS
   ===================================================== */

.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 0;
    position: relative;
}

.section-inner {
    position: relative;
    padding: 0 2rem;
}

/* Section titles */

.section-title {
    font-family: 'Abril Fatface', serif;
    font-size: clamp(2.2rem, 6vw, 5rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--color-rose-gold);
    margin-bottom: 1rem;
    text-align: left;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-subtitle {
    font-family: 'IM Fell English', serif;
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--color-pale-amethyst);
    margin-bottom: 3rem;
    text-align: left;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out 0.1s, transform 0.8s ease-out 0.1s;
}

.section.revealed .section-title,
.section.revealed .section-subtitle {
    opacity: 1;
    transform: translateY(0);
}

/* =====================================================
   HERO SECTION
   ===================================================== */

.section-hero {
    text-align: left;
    padding-top: 10vh;
}

.section-hero .section-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-title {
    font-family: 'Abril Fatface', serif;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--color-rose-gold);
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.section-hero.revealed .hero-title {
    opacity: 1;
    transform: translateY(0);
}

.hero-tagline {
    font-family: 'Karla', sans-serif;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-pale-amethyst);
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out 0.3s, transform 1s ease-out 0.3s;
}

.section-hero.revealed .hero-tagline {
    opacity: 1;
    transform: translateY(0);
}

.hero-geometry {
    width: 280px;
    height: auto;
    opacity: 0;
    transition: opacity 1.2s ease-out 0.6s;
}

.section-hero.revealed .hero-geometry {
    opacity: 1;
}

/* =====================================================
   CONTENT PANELS (Frosted Glass)
   ===================================================== */

.content-panel {
    position: relative;
    margin-bottom: 2rem;
    max-width: 620px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section.revealed .content-panel {
    opacity: 1;
    transform: translateY(0);
}

.section.revealed .content-panel:nth-child(3) {
    transition-delay: 0.1s;
}

.section.revealed .content-panel:nth-child(4) {
    transition-delay: 0.2s;
}

.section.revealed .content-panel:nth-child(5) {
    transition-delay: 0.3s;
}

.section.revealed .content-panel:nth-child(6) {
    transition-delay: 0.4s;
}

.glass-panel {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(45, 27, 78, 0.15);
    border: 1px solid rgba(212, 175, 144, 0.12);
    border-radius: 2px;
    padding: 2rem 2.5rem;
}

.panel-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    border-radius: 2px 0 0 2px;
    background: var(--color-rose-gold);
    opacity: 0.4;
}

.content-panel p {
    font-family: 'Lora', serif;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    font-weight: 400;
    line-height: 1.8;
    color: var(--color-off-white);
    opacity: 0.9;
}

.accent-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.1rem, 2vw, 1.4rem) !important;
    font-weight: 600;
    color: var(--color-rose-gold) !important;
    opacity: 1 !important;
    font-style: italic;
}

/* Sections with lighter backgrounds need darker text */

.section-deeper .content-panel p,
.section-dawn .content-panel p {
    color: var(--color-soft-charcoal);
    opacity: 0.9;
}

.section-deeper .content-panel .accent-text,
.section-dawn .content-panel .accent-text {
    color: var(--color-rose-gold) !important;
}

.section-deeper .section-title,
.section-dawn .section-title {
    text-shadow: none;
}

.section-deeper .section-subtitle,
.section-dawn .section-subtitle {
    color: var(--color-muted-purple);
}

/* =====================================================
   GEOMETRIC DIVIDERS (z-5)
   ===================================================== */

.geometric-divider {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 70%;
    margin: 0 auto;
    padding: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.divider-svg {
    width: 100%;
    height: 40px;
    overflow: visible;
}

.divider-line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 0.6s ease-out;
}

.geometric-divider.revealed .divider-line {
    stroke-dashoffset: 0;
}

.divider-shape {
    opacity: 0;
    transition: opacity 0.4s ease-out 0.3s;
}

.geometric-divider.revealed .divider-shape {
    opacity: 1;
}

/* =====================================================
   FLOATING ACCENT ELEMENTS (z-15)
   ===================================================== */

.floating-accent {
    position: absolute;
    z-index: 15;
    pointer-events: none;
    will-change: transform, opacity;
}

.accent-circle {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1.2px solid var(--color-rose-gold);
    background: transparent;
}

.accent-square {
    width: 5px;
    height: 5px;
    border: 1px solid var(--color-pale-amethyst);
    background: transparent;
}

.accent-triangle {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 7px solid var(--color-muted-purple);
    background: transparent;
    border-top: none;
}

.accent-rotate {
    animation: accentRotate 45s linear infinite;
}

.accent-pulse {
    animation: accentPulse 3.5s ease-in-out infinite;
}

@keyframes accentRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes accentPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* =====================================================
   GEOMETRY SHOWCASES
   ===================================================== */

.geometry-showcase {
    margin: 3rem 0;
    display: flex;
    justify-content: flex-start;
    opacity: 0;
    transition: opacity 1s ease-out 0.4s;
}

.section.revealed .geometry-showcase {
    opacity: 1;
}

.showcase-svg {
    width: 250px;
    height: auto;
}

.closing-geometry {
    width: 180px;
    height: auto;
    margin: 3rem 0;
    opacity: 0;
    transition: opacity 1.2s ease-out 0.5s;
}

.section-dawn.revealed .closing-geometry {
    opacity: 1;
}

/* =====================================================
   LINK STYLING (text links with rose-gold underlines)
   ===================================================== */

a {
    color: var(--color-rose-gold);
    text-decoration: none;
    border-bottom: 1px solid var(--color-rose-gold);
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.7;
}

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

@media (max-width: 768px) {
    .page-content {
        max-width: 85%;
    }

    .geometric-divider {
        max-width: 85%;
    }

    .section {
        min-height: auto;
        padding: 4rem 0;
    }

    .section-inner {
        padding: 0 1rem;
    }

    .hero-title {
        letter-spacing: 0.01em;
    }

    .section-title {
        letter-spacing: 0.01em;
    }

    .scroll-progress {
        width: 80px;
        height: 80px;
        top: 1rem;
        right: 1rem;
    }

    .scroll-progress-inner {
        width: 64px;
        height: 64px;
    }

    .progress-symbol {
        width: 28px;
        height: 28px;
    }

    .glass-panel {
        padding: 1.5rem 1.8rem;
    }

    .content-panel {
        max-width: 100%;
    }

    .showcase-svg {
        width: 200px;
    }

    .closing-geometry {
        width: 140px;
    }
}

@media (max-width: 480px) {
    .page-content {
        max-width: 92%;
    }

    .geometric-divider {
        max-width: 92%;
    }

    .scroll-progress {
        width: 60px;
        height: 60px;
    }

    .scroll-progress-inner {
        width: 48px;
        height: 48px;
    }

    .progress-symbol {
        width: 22px;
        height: 22px;
    }
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
    .constellation-background {
        animation-duration: 0.01s;
    }

    .accent-rotate {
        animation-duration: 0.2s;
    }

    .accent-pulse {
        animation: none;
        opacity: 0.8;
    }

    .section-title,
    .section-subtitle,
    .content-panel,
    .hero-title,
    .hero-tagline,
    .geometry-showcase,
    .closing-geometry,
    .hero-geometry {
        transition-duration: 0.2s;
    }

    .divider-line {
        transition-duration: 0.2s;
    }

    .divider-shape {
        transition-duration: 0.1s;
    }
}
