/* ============================================================
   desca.works — Sunset Stone Design System
   Zen Opulence / Layered Depth / Sharp Angles
   ============================================================ */

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

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

body {
    font-family: 'Varela Round', sans-serif;
    color: #E8D5C4;
    background: #1A0F0A;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

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

/* --- Fixed Background Canvas (Ember Particles) --- */
#ember-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* --- Deep Background (Layer 3) --- */
#deep-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(165deg, #E8943A 0%, #D4654A 35%, #3D1F0E 70%, #1A0F0A 100%);
    z-index: 1;
    pointer-events: none;
}

/* --- Diagonal Lines Texture --- */
#diagonal-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
    opacity: 0.5;
}

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

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E8943A;
    opacity: 0.35;
    cursor: pointer;
    transition: all 200ms ease-out;
}

.nav-dot:hover {
    width: 12px;
    height: 12px;
    margin-left: -2px;
    margin-top: -2px;
    margin-bottom: -2px;
}

.nav-dot.active {
    opacity: 1;
    box-shadow: 0 0 10px #E8943A, 0 0 20px rgba(232, 148, 58, 0.3);
    animation: dotPulse 3s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 8px #E8943A, 0 0 16px rgba(232, 148, 58, 0.2); }
    50% { box-shadow: 0 0 14px #E8943A, 0 0 28px rgba(232, 148, 58, 0.4); }
}

/* --- Section Base --- */
.section {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    overflow: hidden;
}

.section-inner {
    position: relative;
    width: 100%;
    min-height: inherit;
    display: flex;
    align-items: center;
}

/* --- Perspective Container --- */
.perspective-container {
    perspective: 800px;
    transform-style: preserve-3d;
}

/* --- Layer System --- */
.layer-0 {
    position: relative;
    z-index: 30;
}

.layer-1 {
    position: relative;
    z-index: 20;
    transform: translateZ(-30px);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.layer-2 {
    position: absolute;
    inset: 0;
    z-index: 10;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Golden Ratio Layout --- */
.golden-wide {
    width: 61.8%;
    padding-left: 5vw;
}

.golden-narrow {
    width: 38.2%;
    padding-right: 3vw;
    display: flex;
    flex-direction: column;
    gap: 28px;
    align-items: flex-start;
}


/* ============================================================
   SECTION 0: OPENING THRESHOLD
   ============================================================ */

#section-opening {
    min-height: 100vh;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 3vh));
}

#section-opening .section-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-left: 38.2%;
    padding-top: 0;
    min-height: 100vh;
}

/* Position at golden ratio intersection: 61.8% from left, 38.2% from top */
#section-opening .layer-0 {
    position: absolute;
    left: 61.8%;
    top: 38.2%;
    transform: translate(-50%, -50%);
}

.opening-title {
    font-size: clamp(4rem, 8vw, 7rem);
    color: #FFF5E6;
    white-space: nowrap;
}

.opening-chevron {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    animation: chevronPulse 3s ease-in-out infinite;
}

@keyframes chevronPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.opening-subtitle {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(232, 213, 196, 0.7);
    margin-top: 16px;
    text-align: center;
    opacity: 0;
    transition: opacity 1.2s ease;
}

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


/* ============================================================
   SECTION 1: SURFACE
   ============================================================ */

#section-surface {
    min-height: 100vh;
    background: linear-gradient(180deg, #FFF5E6 0%, #E8D5C4 100%);
    clip-path: polygon(0 3vh, 100% 0, 100% 100%, 0 calc(100% - 3vh));
}

#section-surface .section-inner {
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding: 8vh 0;
}

.surface-ambient {
    background: radial-gradient(ellipse at 70% 20%, rgba(232, 148, 58, 0.15) 0%, transparent 60%);
}

/* Radial bar chart */
.surface-chart-container {
    position: absolute;
    left: 10%;
    top: 50%;
    transform: translateY(-50%) translateZ(-30px);
    width: 60vw;
    max-width: 600px;
    opacity: 0.85;
}

.radial-chart {
    width: 100%;
    height: auto;
}

/* Surface content layer */
.surface-content {
    display: flex;
    width: 100%;
    align-items: center;
    min-height: 80vh;
}

.surface-heading {
    color: #2B1810;
    margin-bottom: 3rem;
}

/* Counter row */
.counter-row {
    display: flex;
    gap: 4vw;
    margin-top: 2rem;
}

.counter-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.counter-value {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 3rem;
    color: #D4654A;
    font-variant-numeric: tabular-nums;
}

/* Annotations */
.annotation {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.annotation.visible {
    opacity: 1;
    transform: translateX(0);
}

.annotation-line {
    display: block;
    width: 40px;
    height: 1px;
    background: #8B6B7D;
    flex-shrink: 0;
}

.annotation-text {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5C4033;
}


/* ============================================================
   SECTION 2: STRATA
   ============================================================ */

#section-strata {
    min-height: 150vh;
    background: #3D1F0E;
    clip-path: polygon(0 3vh, 100% 0, 100% 100%, 0 calc(100% - 3vh));
}

#section-strata .section-inner {
    display: flex;
    align-items: flex-start;
    min-height: 150vh;
    padding-top: 15vh;
}

.strata-charts {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    pointer-events: none;
}

.area-chart {
    position: absolute;
    bottom: 0;
    left: -10%;
    width: 120%;
    height: 100%;
}

#area-chart-1 { opacity: 0.4; }
#area-chart-2 { opacity: 0.25; transform: translateX(0); }
#area-chart-3 { opacity: 0.15; transform: translateX(0); }

.strata-heading {
    color: #FFF5E6;
    margin-bottom: 3rem;
}

.strata-text {
    max-width: 55ch;
    line-height: 1.75;
    color: #E8D5C4;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
}

.strata-text p {
    margin-bottom: 1.5em;
}

.strata-content {
    width: 100%;
}


/* ============================================================
   SECTION 3: CORE
   ============================================================ */

#section-core {
    min-height: 100vh;
    background: #1A0F0A;
    clip-path: polygon(0 3vh, 100% 0, 100% 100%, 0 calc(100% - 3vh));
}

#section-core .section-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

#scatter-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.core-content {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.core-heading {
    font-size: 6rem;
    color: #E8943A;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 1s ease, transform 1s ease;
}

.core-heading.visible {
    opacity: 1;
    transform: scale(1);
}

.infinity-counter {
    position: fixed;
    bottom: 30px;
    right: 60px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    color: rgba(139, 107, 125, 0.4);
    z-index: 50;
    opacity: 0;
    transition: opacity 1s ease;
}

.infinity-counter.visible {
    opacity: 1;
}


/* ============================================================
   SECTION 4: ASCENT
   ============================================================ */

#section-ascent {
    min-height: 80vh;
    background: linear-gradient(180deg, #1A0F0A 0%, #FFF5E6 100%);
    clip-path: polygon(0 3vh, 100% 0, 100% 100%, 0 100%);
}

#section-ascent .section-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.ascent-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ascent-chevrons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
}

.ascent-chevron {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.ascent-chevron.visible {
    opacity: 1;
    transform: translateY(0);
}

.ascent-title {
    font-size: clamp(4rem, 8vw, 7rem);
    color: #FFF5E6;
    margin-bottom: 1.5rem;
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

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

.ascent-closing {
    font-family: 'Varela Round', sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: #5C4033;
    opacity: 0;
    transition: opacity 1s ease 0.8s;
}

.ascent-closing.visible {
    opacity: 1;
}


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

@media (max-width: 768px) {
    .golden-wide {
        width: 100%;
        padding: 0 5vw;
    }

    .golden-narrow {
        width: 100%;
        padding: 2rem 5vw;
    }

    .surface-content {
        flex-direction: column;
    }

    .surface-chart-container {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 80vw;
        margin: 0 auto 2rem;
    }

    #section-opening .layer-0 {
        left: 50%;
        top: 40%;
    }

    .counter-row {
        flex-direction: column;
        gap: 1.5rem;
    }

    #nav-dots {
        right: 12px;
    }

    .core-heading {
        font-size: 4rem;
    }

    .infinity-counter {
        bottom: 16px;
        right: 20px;
    }
}
