:root {
    --abyssal-teal: #0B3D4E;
    --oxidized-copper: #2A7F6F;
    --salt-foam: #F0EDE4;
    --cliff-gold: #C9963A;
    --storm-slate: #4A5568;
    --sea-mist: #E8F4F0;
    --weathered-rust: #8B5E3C;
    --deep-obsidian: #0A1A24;
}

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

body {
    background-color: var(--deep-obsidian);
    color: var(--salt-foam);
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 2.2vw, 1.55rem);
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Particle Canvas */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 30;
}

/* Generative Canvas */
.gen-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Sections */
.section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

/* Harbor Level */
.section-harbor {
    min-height: 100vh;
    background: var(--abyssal-teal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.harbor-watermark {
    position: absolute;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(20rem, 50vw, 40rem);
    color: var(--cliff-gold);
    opacity: 0.05;
    z-index: 1;
    pointer-events: none;
    line-height: 0.8;
}

.harbor-content {
    position: relative;
    z-index: 20;
    text-align: center;
}

.harbor-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3.5rem, 8vw, 7.2rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--cliff-gold);
    text-shadow: 0 1px 3px rgba(10, 26, 36, 0.25);
}

.title-dot {
    color: var(--oxidized-copper);
}

.chevron-down {
    margin-top: 48px;
    cursor: pointer;
    animation: chevronPulse 2s ease-in-out infinite;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(6px); }
}

/* Labels */
.label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--oxidized-copper);
    margin-bottom: 16px;
}

/* Lower Quarter */
.section-lower {
    min-height: 120vh;
    background: var(--abyssal-teal);
    padding: 80px 0;
    display: flex;
    flex-direction: column;
    gap: 5vh;
}

.panel {
    width: 100%;
    min-height: 35vh;
    display: flex;
    align-items: center;
    padding: 0 15%;
    position: relative;
    z-index: 20;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.panel-text {
    max-width: 520px;
}

.panel-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--cliff-gold);
    margin-bottom: 16px;
    text-shadow: 0 1px 3px rgba(10, 26, 36, 0.25);
}

.panel-body {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    color: var(--salt-foam);
    line-height: 1.72;
}

/* Generative Dividers */
.gen-divider {
    width: 100%;
    height: 60px;
    position: relative;
    z-index: 20;
    opacity: 0.15;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 20px,
        var(--oxidized-copper) 20px,
        var(--oxidized-copper) 20.5px
    );
    mask-image: linear-gradient(90deg, transparent 5%, black 20%, black 80%, transparent 95%);
    -webkit-mask-image: linear-gradient(90deg, transparent 5%, black 20%, black 80%, transparent 95%);
}

/* Market District */
.section-market {
    min-height: 150vh;
    background: var(--salt-foam);
    padding: 80px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.market-column {
    max-width: 680px;
    width: 85%;
    position: relative;
    z-index: 20;
    padding: 64px 0;
}

.market-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--abyssal-teal);
    line-height: 1.15;
    margin-bottom: 32px;
    text-shadow: 0 1px 2px rgba(201, 150, 58, 0.12);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.market-heading.revealed {
    opacity: 1;
    transform: translateY(0);
}

.market-para {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    color: var(--storm-slate);
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.market-para.revealed {
    opacity: 1;
    transform: translateY(0);
}

.section-market .label {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.section-market .gen-divider {
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 20px,
        var(--storm-slate) 20px,
        var(--storm-slate) 20.5px
    );
    opacity: 0.08;
    height: 40px;
    margin: 16px 0;
}

/* Upper Terraces */
.section-terraces {
    min-height: 130vh;
    background: var(--abyssal-teal);
    padding: 80px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 48px;
}

.terrace-block {
    position: relative;
    max-width: 480px;
    padding: 32px 40px;
    z-index: 20;
    opacity: 0;
    transform: rotate(5deg);
    transition: opacity 0.6s ease-out, transform 0.4s ease-out;
    box-shadow: 0 8px 30px rgba(10, 26, 36, 0.4);
    background: rgba(11, 61, 78, 0.8);
}

.terrace-block.revealed {
    opacity: 1;
}

.terrace-block-1 {
    align-self: flex-start;
    margin-left: 8%;
}

.terrace-block-1.revealed { transform: rotate(-1.5deg); }

.terrace-block-2 {
    align-self: flex-end;
    margin-right: 12%;
}

.terrace-block-2.revealed { transform: rotate(2deg); }

.terrace-block-3 {
    align-self: flex-start;
    margin-left: 5%;
}

.terrace-block-3.revealed { transform: rotate(-1deg); }

.terrace-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    color: var(--salt-foam);
    line-height: 1.72;
}

/* Corner Brackets */
.corner-bracket {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--cliff-gold);
    opacity: 0.5;
}

.corner-bracket.tl { top: -6px; left: -6px; border-right: none; border-bottom: none; }
.corner-bracket.tr { top: -6px; right: -6px; border-left: none; border-bottom: none; }
.corner-bracket.bl { bottom: -6px; left: -6px; border-right: none; border-top: none; }
.corner-bracket.br { bottom: -6px; right: -6px; border-left: none; border-top: none; }

/* Clifftop */
.section-clifftop {
    min-height: 100vh;
    background: var(--deep-obsidian);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clifftop-content {
    position: relative;
    z-index: 20;
    text-align: center;
    max-width: 620px;
    padding: 48px;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 1s ease, transform 1s ease;
}

.clifftop-content.revealed {
    opacity: 1;
    transform: scale(1);
}

.clifftop-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--cliff-gold);
    line-height: 1.1;
    margin-bottom: 32px;
    text-shadow: 0 1px 3px rgba(10, 26, 36, 0.3);
}

.clifftop-body {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--salt-foam);
    line-height: 1.72;
    margin-bottom: 48px;
}

.clifftop-colophon {
    color: var(--oxidized-copper);
    opacity: 0.5;
}

/* Horizon Lines */
.horizon-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--oxidized-copper);
    opacity: 0.15;
    z-index: 5;
}

/* Responsive */
@media (max-width: 768px) {
    .panel {
        padding: 0 24px;
    }

    .terrace-block {
        max-width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
        align-self: stretch !important;
    }

    .section-terraces {
        padding: 80px 24px;
    }

    .market-column {
        width: 100%;
        padding: 32px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .panel, .market-heading, .market-para,
    .section-market .label, .terrace-block,
    .clifftop-content {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .terrace-block-1.revealed { transform: rotate(-1.5deg); }
    .terrace-block-2.revealed { transform: rotate(2deg); }
    .terrace-block-3.revealed { transform: rotate(-1deg); }

    .chevron-down {
        animation: none;
        opacity: 0.7;
    }
}
