/* ============================================
   chloengine.com - Candlelit Neomorphism
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #f0ebe4;
    color: #5a4a3a;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Noise Overlay --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    filter: url(#noise);
    background: rgba(240, 235, 228, 0.5);
}

/* --- Typography --- */
.section-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 42px;
    line-height: 1.15;
    letter-spacing: 0.08em;
    color: #3a2a1a;
    text-shadow: 0 1px 2px rgba(58, 42, 26, 0.15);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.section-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 400;
    font-size: 28px;
    line-height: 1.25;
    letter-spacing: 0.04em;
    color: #5a4a3a;
    margin-bottom: 32px;
}

.body-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.75;
    color: #5a4a3a;
    margin-bottom: 20px;
}

.caption {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: 15px;
    line-height: 1.65;
    color: #5a4a3a;
    margin-top: 12px;
}

/* --- Chambers (Sections) --- */
.chamber {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chamber-bg-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* --- Content Islands (Neomorphic Panels) --- */
.content-island {
    position: relative;
    z-index: 2;
    max-width: 720px;
    width: 90%;
    padding: 56px 48px;
    border-radius: 32px;
    background: #f0ebe4;
    box-shadow:
        -6px -6px 16px rgba(255, 248, 240, 0.7),
        6px 6px 16px rgba(180, 160, 140, 0.25);
}

.content-island-wide {
    max-width: 880px;
}

/* --- Dot Navigation --- */
.dot-nav {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #f0ebe4;
    box-shadow:
        -2px -2px 5px rgba(255, 248, 240, 0.7),
        2px 2px 5px rgba(180, 160, 140, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dot:hover {
    box-shadow:
        inset -2px -2px 5px rgba(255, 248, 240, 0.7),
        inset 2px 2px 5px rgba(180, 160, 140, 0.25);
}

.dot.active {
    background: #e8c87a;
    box-shadow:
        0 0 8px rgba(232, 200, 122, 0.4),
        -2px -2px 5px rgba(255, 248, 240, 0.7),
        2px 2px 5px rgba(180, 160, 140, 0.25);
}

/* === CHAMBER 1: VESTIBULE === */
.chamber-vestibule {
    background: #f0ebe4;
}

.chamber-vestibule .chamber-bg-glow {
    background: radial-gradient(ellipse at 50% 40%, rgba(255, 248, 240, 0.6) 0%, transparent 70%);
}

.vestibule-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, #d4c8ba 0%, #8a6a4a 30%, #5a4a3a 60%, #3a2a1a 100%);
    opacity: 0.4;
    filter: sepia(0.3) contrast(0.9) brightness(1.05) saturate(0.85);
    z-index: 0;
}

.chamber-vestibule .frost-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(240, 235, 228, 0.75);
    backdrop-filter: blur(12px) saturate(1.2);
    z-index: 1;
}

.vestibule-content {
    text-align: center;
    background: transparent;
    box-shadow: none;
    z-index: 3;
}

.site-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 64px;
    line-height: 1.2;
    color: #3a2a1a;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 4px rgba(58, 42, 26, 0.15);
    opacity: 0;
}

.site-title.visible {
    opacity: 1;
}

.title-line {
    width: 0;
    height: 2px;
    background: #e8c87a;
    margin: 20px auto;
    transition: width 0.8s ease-out;
}

.title-line.expanded {
    width: 200px;
}

.site-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 20px;
    letter-spacing: 0.2em;
    color: #5a4a3a;
    opacity: 0;
    transition: opacity 0.8s ease-out;
    text-transform: lowercase;
}

.site-subtitle.visible {
    opacity: 1;
}

/* === CHAMBER 2: THE FLAME === */
.chamber-flame {
    background: #f0ebe4;
}

.chamber-flame .chamber-bg-glow {
    background: radial-gradient(ellipse at 30% 50%, rgba(255, 248, 240, 0.6) 0%, transparent 65%);
}

.flame-section {
    display: flex;
    align-items: center;
    gap: 40px;
}

.flame-container {
    flex-shrink: 0;
}

.flame-recess {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: #f0ebe4;
    box-shadow:
        inset -6px -6px 16px rgba(255, 248, 240, 0.7),
        inset 6px 6px 16px rgba(180, 160, 140, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.flame-wrapper {
    position: relative;
    width: 50px;
    height: 80px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.flame {
    position: absolute;
    bottom: 0;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame-outer {
    width: 40px;
    height: 70px;
    background: radial-gradient(ellipse at 50% 60%, transparent 20%, #e87a3a 80%, transparent 100%);
    animation: flameFlicker1 3.8s ease-in-out infinite;
    opacity: 0.8;
}

.flame-mid {
    width: 28px;
    height: 55px;
    background: radial-gradient(ellipse at 50% 60%, #f4a832 20%, #e87a3a 80%);
    animation: flameFlicker2 4.2s ease-in-out infinite;
    opacity: 0.9;
}

.flame-inner {
    width: 16px;
    height: 40px;
    background: radial-gradient(ellipse at 50% 60%, #fff8f0 10%, #f4a832 70%);
    animation: flameFlicker3 3.5s ease-in-out infinite;
}

.flame-base {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 12px;
    background: #3a2a1a;
    border-radius: 2px 2px 0 0;
}

.flame-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 200, 122, 0.25) 0%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
    animation: glowPulse 4s ease-in-out infinite;
}

.flame-text {
    flex: 1;
}

@keyframes flameFlicker1 {
    0%, 100% { transform: scaleY(1) skewX(0deg); }
    25% { transform: scaleY(1.05) skewX(2deg); }
    50% { transform: scaleY(0.95) skewX(-1deg); }
    75% { transform: scaleY(1.03) skewX(1.5deg); }
}

@keyframes flameFlicker2 {
    0%, 100% { transform: scaleY(1) skewX(0deg); }
    30% { transform: scaleY(0.97) skewX(-2deg); }
    60% { transform: scaleY(1.04) skewX(1deg); }
    85% { transform: scaleY(0.98) skewX(-1.5deg); }
}

@keyframes flameFlicker3 {
    0%, 100% { transform: scaleY(1) skewX(0deg); }
    20% { transform: scaleY(1.06) skewX(1.5deg); }
    45% { transform: scaleY(0.94) skewX(-2deg); }
    70% { transform: scaleY(1.02) skewX(0.5deg); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

/* === CHAMBER 3: ARCHIVE === */
.chamber-archive {
    background: #f0ebe4;
}

.chamber-archive .chamber-bg-glow {
    background: radial-gradient(ellipse at 60% 35%, rgba(255, 248, 240, 0.6) 0%, transparent 65%);
}

.archive-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 24px;
}

.archive-frame {
    position: relative;
    border-radius: 24px;
    background: #f0ebe4;
    box-shadow:
        inset -4px -4px 12px rgba(255, 248, 240, 0.7),
        inset 4px 4px 12px rgba(180, 160, 140, 0.25);
    padding: 16px;
    margin-bottom: -60px;
}

.archive-frame:last-child {
    margin-bottom: 0;
}

.archive-frame:nth-child(1) { z-index: 3; }
.archive-frame:nth-child(2) { z-index: 2; margin-left: 40px; }
.archive-frame:nth-child(3) { z-index: 1; margin-left: 20px; }

.archive-photo {
    width: 100%;
    height: 160px;
    border-radius: 16px;
    filter: sepia(0.3) contrast(0.9) brightness(1.05) saturate(0.85);
}

.photo-1 {
    background: linear-gradient(145deg, #c4b4a4, #8a7a6a, #a09080, #b0a090);
}

.photo-2 {
    background: linear-gradient(165deg, #b0a090, #9a8a7a, #c4b4a4, #8a7a6a);
}

.photo-3 {
    background: linear-gradient(125deg, #9a8a7a, #b0a090, #8a7a6a, #c4b4a4);
}

/* === CHAMBER 4: THE PROCESS === */
.chamber-process {
    background: #f0ebe4;
}

.chamber-process .chamber-bg-glow {
    background: radial-gradient(ellipse at 50% 60%, rgba(255, 248, 240, 0.6) 0%, transparent 65%);
}

.timeline {
    position: relative;
    padding: 40px 0;
}

.timeline-ridge {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    transform: translateX(-50%);
    background: #f0ebe4;
    border-radius: 2px;
    box-shadow:
        -2px 0 4px rgba(255, 248, 240, 0.7),
        2px 0 4px rgba(180, 160, 140, 0.25);
}

.timeline-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 48px;
    width: 100%;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-left {
    justify-content: flex-start;
}

.timeline-right {
    justify-content: flex-end;
}

.timeline-content {
    width: 42%;
    padding: 24px;
    border-radius: 20px;
    background: #f0ebe4;
    box-shadow:
        -4px -4px 10px rgba(255, 248, 240, 0.7),
        4px 4px 10px rgba(180, 160, 140, 0.25);
}

.timeline-left .timeline-content {
    margin-right: auto;
}

.timeline-right .timeline-content {
    margin-left: auto;
}

.timeline-heading {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 22px;
    color: #3a2a1a;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    text-shadow: 0 1px 2px rgba(58, 42, 26, 0.1);
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 28px;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e8c87a;
    box-shadow:
        -2px -2px 4px rgba(255, 248, 240, 0.7),
        2px 2px 4px rgba(180, 160, 140, 0.25),
        0 0 8px rgba(232, 200, 122, 0.3);
    z-index: 2;
}

/* === CHAMBER 5: MATERIALS === */
.chamber-materials {
    background: #f0ebe4;
}

.chamber-materials .chamber-bg-glow {
    background: radial-gradient(ellipse at 40% 55%, rgba(255, 248, 240, 0.6) 0%, transparent 65%);
}

.materials-bg-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(150deg, #a09080, #8a7a6a, #b0a090, #7a6a5a, #c4b4a4);
    filter: sepia(0.3) contrast(0.9) brightness(1.05) saturate(0.85);
    z-index: 0;
}

.frosted-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(240, 235, 228, 0.75);
    backdrop-filter: blur(12px) saturate(1.2);
    z-index: 1;
}

@supports not (backdrop-filter: blur(12px)) {
    .frosted-overlay {
        background: rgba(240, 235, 228, 0.92);
    }
}

.frosted-panel {
    z-index: 2;
    background: rgba(240, 235, 228, 0.85);
    backdrop-filter: blur(8px);
    box-shadow:
        -6px -6px 16px rgba(255, 248, 240, 0.7),
        6px 6px 16px rgba(180, 160, 140, 0.25);
}

/* === CHAMBER 6: ILLUMINATION === */
.chamber-illumination {
    background: #f0ebe4;
}

.chamber-illumination .chamber-bg-glow {
    background: radial-gradient(ellipse at 50% 50%, rgba(255, 248, 240, 0.6) 0%, transparent 65%);
}

.illumination-content {
    text-align: center;
    padding: 32px 0;
}

.pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 56px;
    line-height: 1.2;
    color: #8a6a4a;
    text-shadow:
        -2px -2px 4px rgba(255, 248, 240, 0.7),
        2px 2px 4px rgba(180, 160, 140, 0.2);
    position: relative;
    padding: 20px 0;
}

.quote-mark {
    color: #e8c87a;
    font-size: 72px;
    line-height: 0;
    vertical-align: -0.15em;
}

.quote-attribution {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 16px;
    letter-spacing: 0.1em;
    color: #8a6a4a;
    margin-top: 28px;
    text-transform: lowercase;
}

/* === CHAMBER 7: DEPARTURE === */
.chamber-departure {
    background: #f0ebe4;
    transition: background-color 0.1s linear;
}

.chamber-departure .departure-glow {
    background: radial-gradient(ellipse at 50% 60%, rgba(232, 200, 122, 0.15) 0%, transparent 60%);
    transition: opacity 0.3s ease;
}

.departure-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.departure-flame-container {
    position: relative;
    width: 80px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.flame-small {
    transform: scale(0.6);
}

.flame-glow-small {
    width: 120px;
    height: 120px;
}

.departure-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 32px;
    color: #e8c87a;
    text-align: center;
    letter-spacing: 0.06em;
}

/* --- Smoke Wisps --- */
.smoke-wisp {
    position: absolute;
    width: 2px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(to top, rgba(212, 200, 186, 0.3), transparent);
    opacity: 0.3;
}

.smoke-wisp-1 {
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    animation: smokeRise 8s ease-in-out infinite;
}

.smoke-wisp-2 {
    top: -50px;
    left: calc(50% - 8px);
    animation: smokeRise 8s ease-in-out infinite 1.5s;
    height: 30px;
}

.smoke-wisp-3 {
    top: -55px;
    left: calc(50% + 6px);
    animation: smokeRise 8s ease-in-out infinite 3s;
    height: 35px;
}

@keyframes smokeRise {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 0.3;
    }
    50% {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0.1;
    }
}

/* --- Wax Drip Dividers --- */
.wax-drip {
    position: relative;
    z-index: 5;
    margin-top: -30px;
    margin-bottom: -30px;
    line-height: 0;
}

.wax-drip svg {
    display: block;
    width: 100%;
    height: 60px;
}

/* --- Scroll Reveal --- */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .content-island {
        padding: 36px 28px;
        width: 92%;
    }

    .site-title {
        font-size: 44px;
    }

    .pull-quote {
        font-size: 36px;
    }

    .quote-mark {
        font-size: 48px;
    }

    .section-title {
        font-size: 32px;
    }

    .flame-section {
        flex-direction: column;
        text-align: center;
    }

    .flame-recess {
        width: 140px;
        height: 140px;
    }

    .timeline-ridge {
        left: 20px;
    }

    .timeline-item {
        flex-direction: column;
        padding-left: 44px;
    }

    .timeline-content {
        width: 100%;
    }

    .timeline-left .timeline-content,
    .timeline-right .timeline-content {
        margin-left: 0;
        margin-right: 0;
    }

    .timeline-dot {
        left: 20px;
        top: 0;
    }

    .archive-frame:nth-child(2) { margin-left: 0; }
    .archive-frame:nth-child(3) { margin-left: 0; }

    .dot-nav {
        right: 12px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 36px;
    }

    .pull-quote {
        font-size: 28px;
    }

    .section-title {
        font-size: 28px;
    }

    .content-island {
        padding: 28px 20px;
    }

    .body-text {
        font-size: 15px;
    }
}
