/* =============================================
   ethica.dev - Surrealist Moral Observatory
   ============================================= */

:root {
    --midnight-indigo: #1B1340;
    --deep-slate: #2D3047;
    --dusty-plum: #4A3348;
    --warm-ash: #D4C8BE;
    --blush: #E8C4B8;
    --lavender-ash: #8B7FAD;
    --twilight-violet: #6B5FA0;
    --terra-ember: #C47D63;
    --gradient-angle: 135deg;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--midnight-indigo);
    color: var(--warm-ash);
    font-family: 'Lora', serif;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.78;
    overflow-x: hidden;
}

/* =============================================
   Plane 1: Background Gradient
   ============================================= */

#gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background: linear-gradient(
        var(--gradient-angle),
        var(--midnight-indigo) 0%,
        var(--deep-slate) 50%,
        var(--dusty-plum) 100%
    );
    opacity: 0;
    transition: opacity 1500ms ease;
}

#gradient-bg.visible {
    opacity: 1;
}

/* =============================================
   Plane 2: Mid-ground Floating Geometries
   ============================================= */

#mid-ground {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.geo-shape {
    position: absolute;
    opacity: 0;
    transition: opacity 600ms ease;
}

.geo-shape.visible {
    opacity: var(--shape-opacity, 0.1);
}

.geo-rect {
    width: 240px;
    height: 148px;
    top: 12%;
    left: 8%;
    --shape-opacity: 0.10;
    --base-rotation: 5deg;
}

.geo-circle {
    width: 180px;
    height: 180px;
    top: 60%;
    right: 12%;
    --shape-opacity: 0.08;
    --base-rotation: 0deg;
}

.geo-triangle {
    width: 140px;
    height: 121px;
    top: 30%;
    right: 20%;
    --shape-opacity: 0.09;
    --base-rotation: -3deg;
}

.geo-rect-2 {
    width: 200px;
    height: 124px;
    bottom: 15%;
    left: 15%;
    --shape-opacity: 0.08;
    --base-rotation: 8deg;
}

.geo-circle-2 {
    width: 280px;
    height: 280px;
    top: 5%;
    right: 5%;
    --shape-opacity: 0.06;
    --base-rotation: 0deg;
}

/* =============================================
   Constellation Canvas
   ============================================= */

#constellation-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* =============================================
   Navigation Line
   ============================================= */

#nav-line {
    position: fixed;
    left: 48px;
    top: 0;
    height: 100vh;
    width: 1px;
    background: rgba(107, 95, 160, 0.3);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    opacity: 0;
    transition: opacity 600ms ease;
}

#nav-line.visible {
    opacity: 1;
}

.nav-marker {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--twilight-violet);
    cursor: pointer;
    transition: background 300ms ease, transform 300ms ease;
    pointer-events: all;
}

.nav-marker.active {
    background: var(--blush);
    animation: pulse-marker 2s ease-in-out infinite;
}

@keyframes pulse-marker {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* =============================================
   Opening Sequence
   ============================================= */

#opening {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

#title-ethica {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 72px;
    letter-spacing: 0.06em;
    color: var(--blush);
    line-height: 1.15;
    filter: blur(20px);
    opacity: 0.4;
    transition: filter 1200ms cubic-bezier(0.16, 1, 0.3, 1),
                opacity 1200ms cubic-bezier(0.16, 1, 0.3, 1);
}

#title-ethica.focused {
    filter: blur(0);
    opacity: 1;
}

#title-ethica.faded {
    opacity: 0;
    transform: translateY(-60px);
    transition: opacity 400ms ease, transform 400ms ease;
}

#subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--lavender-ash);
    margin-top: 20px;
    opacity: 0;
    transition: opacity 800ms ease;
}

#subtitle.visible {
    opacity: 1;
}

#subtitle.faded {
    opacity: 0;
    transform: translateY(-60px);
    transition: opacity 400ms ease, transform 400ms ease;
}

/* =============================================
   Content Sections
   ============================================= */

.content-section {
    position: relative;
    z-index: 1;
    padding: 100px 0;
}

.section-inner {
    max-width: 720px;
    width: 90%;
    margin: 0 auto;
    padding-left: 48px;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 700ms cubic-bezier(0.33, 1, 0.68, 1),
                transform 700ms cubic-bezier(0.33, 1, 0.68, 1);
}

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

.section-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--lavender-ash);
    display: block;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.section-inner.revealed .section-label {
    opacity: 1;
    transform: translateY(0);
}

.section-body {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 500ms ease 200ms, transform 500ms ease 200ms;
}

.section-inner.revealed .section-body {
    opacity: 1;
    transform: translateY(0);
}

.section-body p {
    margin-bottom: 1.6em;
    color: var(--warm-ash);
}

.section-body p:last-child {
    margin-bottom: 0;
}

.lora-semibold {
    font-weight: 600;
}

.section-body em {
    font-style: italic;
    color: var(--blush);
}

/* =============================================
   Threshold Interludes
   ============================================= */

.threshold {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.threshold-inner {
    text-align: center;
    position: relative;
    max-width: 600px;
    padding: 0 24px;
}

.threshold-numeral {
    font-family: 'DM Mono', monospace;
    font-size: 120px;
    font-weight: 400;
    color: var(--twilight-violet);
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -30%);
    z-index: -1;
    transition: opacity 1500ms ease, transform 1500ms ease;
}

.threshold-inner.revealed .threshold-numeral {
    opacity: 0.10;
    transform: translate(-50%, -50%);
}

.threshold-question {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 48px;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--blush);
    filter: blur(20px);
    opacity: 0.4;
    transition: filter 1200ms cubic-bezier(0.16, 1, 0.3, 1),
                opacity 1200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.threshold-inner.revealed .threshold-question {
    filter: blur(0);
    opacity: 1;
}

.threshold-rule {
    width: 0;
    height: 1px;
    background: rgba(107, 95, 160, 0.2);
    margin: 32px auto 0;
    transition: width 600ms ease 400ms;
}

.threshold-inner.revealed .threshold-rule {
    width: 80px;
}

.threshold-veil {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(74, 51, 72, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* =============================================
   Final Chamber (inverted palette)
   ============================================= */

.final-chamber {
    background: var(--warm-ash);
    padding: 200px 0;
    margin-top: 100px;
}

.final-chamber .section-inner {
    padding-left: 48px;
}

.final-chamber .section-body p {
    color: var(--deep-slate);
}

.section-label-dark {
    color: var(--twilight-violet);
}

.final-proposition {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 1.3;
    color: var(--deep-slate);
    letter-spacing: -0.01em;
}

.final-echo {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--lavender-ash);
    margin-top: 80px;
    text-align: center;
}

/* =============================================
   Spacer between sections
   ============================================= */

.content-section + .threshold,
.threshold + .content-section {
    margin-top: 100px;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 768px) {
    #title-ethica {
        font-size: 48px;
    }

    .threshold-question {
        font-size: 32px;
    }

    .threshold-numeral {
        font-size: 80px;
    }

    .final-proposition {
        font-size: 26px;
    }

    .section-inner {
        padding-left: 24px;
    }

    #nav-line {
        left: 20px;
    }

    body {
        font-size: 17px;
    }
}
