/* chloe.cx - Dreamy Surrealist Atmospheric Experience */

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

:root {
    --bg-deep: #1A0F0A;
    --bg-mid: #2C1810;
    --atmo-1: #4A2A1D;
    --atmo-2: #6B3A2A;
    --accent-primary: #D4A574;
    --accent-secondary: #E8C4A0;
    --text-primary: #F5E6D3;
    --text-muted: #C4A882;
    --blush: #C97B6B;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    letter-spacing: 0.02em;
    line-height: 1.85;
    overflow-x: hidden;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 30% 40%, var(--atmo-1) 0%, var(--bg-mid) 45%, var(--bg-deep) 100%),
        radial-gradient(ellipse at 70% 60%, rgba(212, 165, 116, 0.08) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Breathing background animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 40%, var(--atmo-1) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(212, 165, 116, 0.06) 0%, transparent 45%);
    animation: breatheBackground 45s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes breatheBackground {
    0%, 100% {
        background:
            radial-gradient(ellipse at 30% 40%, rgba(74, 42, 29, 0.5) 0%, transparent 50%),
            radial-gradient(ellipse at 70% 60%, rgba(212, 165, 116, 0.06) 0%, transparent 45%);
    }
    33% {
        background:
            radial-gradient(ellipse at 40% 50%, rgba(74, 42, 29, 0.5) 0%, transparent 55%),
            radial-gradient(ellipse at 60% 45%, rgba(212, 165, 116, 0.08) 0%, transparent 40%);
    }
    66% {
        background:
            radial-gradient(ellipse at 25% 35%, rgba(74, 42, 29, 0.4) 0%, transparent 48%),
            radial-gradient(ellipse at 75% 65%, rgba(212, 165, 116, 0.05) 0%, transparent 50%);
    }
}

/* Film grain overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Dust particles */
.dust-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.dust-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.2;
    animation: dustDrift linear infinite;
}

@keyframes dustDrift {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.2;
    }
    90% {
        opacity: 0.15;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0.5);
        opacity: 0;
    }
}

/* Navigation Glyph */
.nav-glyph {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    transition: opacity 0.8s ease-in-out;
}

.nav-glyph.faded {
    opacity: 0.3;
}

.glyph-dot {
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    animation: pulse 4s ease-in-out infinite;
    transition: transform 0.4s ease-in-out;
}

.nav-glyph:hover .glyph-dot {
    transform: scale(1.3);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(212, 165, 116, 0.4);
    }
    50% {
        box-shadow: 0 0 12px 4px rgba(212, 165, 116, 0.15);
    }
}

.glyph-menu {
    position: absolute;
    bottom: 30px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

.nav-glyph:hover .glyph-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.glyph-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    white-space: nowrap;
    text-align: right;
    opacity: 0.7;
    transition: opacity 0.3s ease-in-out;
}

.glyph-link:hover {
    opacity: 1;
}

/* Scene Base */
.scene {
    position: relative;
    width: 100%;
}

/* Scene 1: The Name */
.scene-name {
    height: 200vh;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.name-container {
    text-align: center;
    transition: opacity 0.1s, transform 0.1s;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.name-container.scrolled {
    position: absolute;
}

.hero-name {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: clamp(3rem, 9vw, 10rem);
    letter-spacing: 0.06em;
    line-height: 1.15;
    color: var(--text-primary);
    text-shadow: 0 0 80px rgba(212, 165, 116, 0.3);
}

.hero-tld {
    display: block;
    font-family: 'Caveat', cursive;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--accent-primary);
    margin-top: 0.5rem;
    margin-left: 2rem;
    opacity: 0;
    animation: fadeInTld 0.8s ease-in-out 0.8s forwards;
}

@keyframes fadeInTld {
    to {
        opacity: 1;
    }
}

/* Scene 2: The Veil */
.scene-veil {
    height: 150vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 15vh;
}

.veil-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    color: var(--text-muted);
    text-align: center;
    max-width: 500px;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    letter-spacing: 0.04em;
}

.veil-text.visible {
    opacity: 0.85;
}

/* Lens flares */
.lens-flare {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: flareGlow 8s ease-in-out infinite;
}

.flare-veil {
    width: 180px;
    height: 180px;
    bottom: 30%;
    left: 15%;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.08) 0%, transparent 70%);
}

@keyframes flareGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

/* Scene 3: Floating Panels */
.scene-panels {
    min-height: 300vh;
    padding: 20vh 0;
    position: relative;
    perspective: 800px;
}

.floating-panel {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255, 245, 238, 0.06);
    border-radius: 24px;
    padding: 2.5rem 3rem;
    margin-bottom: 20vh;
    opacity: 0;
    filter: blur(12px);
    transition: opacity 0.6s ease-in-out, filter 0.6s ease-in-out;
    color: var(--text-muted);
    line-height: 1.85;
}

.floating-panel.focused {
    opacity: 1;
    filter: blur(0);
}

.panel-1 {
    width: 45vw;
    margin-left: 10vw;
}

.panel-2 {
    width: 35vw;
    margin-left: 50vw;
    font-size: clamp(0.85rem, 1vw, 1rem);
    transform: translateZ(-40px) scale(1.05);
}

.panel-2 p {
    margin-bottom: 0.5rem;
    font-style: italic;
}

.panel-3 {
    width: 50vw;
    margin-left: 8vw;
    transform: translateZ(20px);
}

.handwritten-note {
    display: block;
    font-family: 'Caveat', cursive;
    font-size: clamp(0.85rem, 1.1vw, 1.05rem);
    color: var(--accent-primary);
    margin-top: 1.5rem;
}

/* Scene 4: The Embers */
.scene-embers {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.flare-ember-1 {
    width: 150px;
    height: 150px;
    top: 10%;
    left: 20%;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.1) 0%, transparent 70%);
    animation-delay: 0s;
}

.flare-ember-2 {
    width: 200px;
    height: 200px;
    top: 30%;
    right: 15%;
    background: radial-gradient(circle, rgba(201, 123, 107, 0.08) 0%, transparent 70%);
    animation-delay: 2s;
}

.flare-ember-3 {
    width: 120px;
    height: 120px;
    bottom: 40%;
    left: 40%;
    background: radial-gradient(circle, rgba(232, 196, 160, 0.07) 0%, transparent 70%);
    animation-delay: 4s;
}

.flare-ember-4 {
    width: 160px;
    height: 160px;
    bottom: 20%;
    right: 30%;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.09) 0%, transparent 70%);
    animation-delay: 1s;
}

.flare-ember-5 {
    width: 140px;
    height: 140px;
    top: 50%;
    left: 10%;
    background: radial-gradient(circle, rgba(201, 123, 107, 0.06) 0%, transparent 70%);
    animation-delay: 3s;
}

.ember-farewell {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 5;
}

.ember-farewell.visible {
    opacity: 1;
}

.ember-contact {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    margin-top: 2rem;
    z-index: 5;
    letter-spacing: 0.04em;
}

.ember-contact.visible {
    opacity: 0.5;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .dust-particle {
        display: none;
    }

    .floating-panel {
        opacity: 1;
        filter: none;
    }

    .veil-text,
    .ember-farewell,
    .ember-contact {
        opacity: 1;
    }

    .hero-tld {
        opacity: 1;
    }
}
