:root {
    --abyss: #0b1628;
    --depth: #0f2b3c;
    --glow: #4de8c2;
    --surface: #a8e6cf;
    --kelp: #2d6a5a;
    --text-primary: #e8f4f0;
    --text-secondary: #8ba7b8;
    --alert: #e84d8a;
    --font-heading: 'Josefin Sans', sans-serif;
    --font-body: 'Nunito Sans', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-display: 'Cormorant Garamond', serif;
    --blur-duration: 800ms;
    --split-left: 45%;
    --split-right: 55%;
}

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

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

body {
    background-color: var(--abyss);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ===== HOME GLYPH ===== */
.home-glyph {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 100;
    opacity: 0.7;
    transition: opacity 400ms ease;
    text-decoration: none;
}

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

/* ===== SECTION PIPS ===== */
.section-pips {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--kelp);
    cursor: pointer;
    transition: background 400ms ease, box-shadow 400ms ease;
}

.pip.active {
    background: var(--glow);
    box-shadow: 0 0 8px var(--glow), 0 0 16px rgba(77, 232, 194, 0.3);
}

/* ===== BUBBLE PARTICLES ===== */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -20px;
    left: var(--x);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--glow);
    opacity: var(--opacity);
    animation: bubbleRise var(--duration) var(--delay) infinite linear;
    will-change: transform;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: var(--opacity);
    }
    50% {
        transform: translateY(-50vh) translateX(var(--drift));
        opacity: var(--opacity);
    }
    100% {
        transform: translateY(-110vh) translateX(calc(var(--drift) * -1));
        opacity: 0;
    }
}

/* ===== ZONES ===== */
.zone {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ===== SPLIT CONTAINER ===== */
.split-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.split-default .panel-left {
    width: var(--split-left);
}

.split-default .panel-right {
    width: var(--split-right);
}

.split-scholarly .panel-wide {
    width: 60%;
}

.split-scholarly .panel-narrow {
    width: 40%;
}

.split-inverted .panel-wide-inv {
    width: 55%;
}

.split-inverted .panel-narrow-inv {
    width: 45%;
}

/* ===== PANELS ===== */
.panel {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.panel-scholarly {
    background: var(--abyss);
}

.panel-seapunk {
    background: var(--depth);
}

.panel-content {
    padding: 6rem 4rem 4rem 4rem;
    position: relative;
    height: 100%;
}

/* ===== GRID OVERLAY ===== */
.grid-overlay {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(77, 232, 194, 0.04) 0px,
        rgba(77, 232, 194, 0.04) 1px,
        transparent 1px,
        transparent 40px
    ),
    repeating-linear-gradient(
        90deg,
        rgba(77, 232, 194, 0.04) 0px,
        rgba(77, 232, 194, 0.04) 1px,
        transparent 1px,
        transparent 40px
    );
    pointer-events: none;
    z-index: 1;
}

/* ===== DIVIDER LINE ===== */
.divider-line {
    width: 1px;
    background: var(--glow);
    z-index: 10;
    animation: dividerPulse 4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes dividerPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ===== BLUR-FOCUS ENTRY ===== */
.blur-entry {
    filter: blur(12px);
    opacity: 0.3;
    transition: filter var(--blur-duration) ease-out, opacity var(--blur-duration) ease-out;
}

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

/* ===== TYPOGRAPHY ===== */
.site-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(3rem, 7vw, 5.5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.manifesto {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    color: var(--text-secondary);
    max-width: 480px;
    position: relative;
    z-index: 2;
}

/* ===== MARGINALIA ===== */
.marginalia {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-secondary);
    opacity: 0.5;
    white-space: nowrap;
    z-index: 2;
}

.marginalia-left {
    left: 0.75rem;
    transform: rotate(-90deg);
    transform-origin: left center;
}

.marginalia-right {
    right: 0.75rem;
    transform: rotate(90deg);
    transform-origin: right center;
}

/* ===== SCHOLARLY TEXT ===== */
.scholarly-text {
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin: 0 auto;
}

.scholarly-text p {
    margin-bottom: 1.5rem;
    text-align: justify;
    hyphens: auto;
}

/* ===== DROP CAPS ===== */
.drop-cap::first-letter {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 4em;
    float: left;
    color: var(--glow);
    line-height: 0.8;
    margin-right: 0.08em;
    margin-top: 0.05em;
}

/* ===== FOOTNOTE MARKERS ===== */
.fn-marker {
    color: var(--glow);
    font-size: 0.75em;
    cursor: pointer;
    transition: color 300ms ease;
}

.fn-marker:hover {
    color: var(--surface);
}

/* ===== FOOTNOTES ===== */
.footnotes {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--kelp);
    position: relative;
    z-index: 2;
}

.footnote {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--kelp);
    position: relative;
}

.fn-num {
    color: var(--glow);
    font-weight: 400;
}

/* ===== FIGURE LABELS ===== */
.figure-label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    display: block;
}

/* ===== DUOTONE PHOTO ===== */
.duotone-photo {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.photo-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

.infrastructure-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.duotone-photo .figure-label {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    z-index: 5;
}

/* ===== KELP STRANDS ===== */
.kelp-strand {
    position: absolute;
    height: 100%;
    width: 20px;
    top: 0;
    pointer-events: none;
    z-index: 3;
}

.kelp-strand path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: kelpDraw 8s ease-in-out infinite alternate;
}

@keyframes kelpDraw {
    0% { stroke-dashoffset: 800; }
    100% { stroke-dashoffset: 0; }
}

.kelp-1 {
    right: 10px;
    opacity: 0.6;
}

.kelp-2 {
    right: 30px;
    opacity: 0.4;
    animation-delay: 1s;
}

.kelp-3 {
    right: 55px;
    opacity: 0.3;
    animation-delay: 2s;
}

/* ===== ZONE 2 - PHOTO STRIP ===== */
.photo-strip {
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
    justify-content: center;
}

.strip-photo {
    position: relative;
}

.strip-svg {
    width: 100%;
    height: auto;
    max-height: 250px;
    display: block;
}

.strip-photo .figure-label {
    padding: 0.5rem 0;
}

/* ===== ZONE 3 - OVERLAP ===== */
.overlap-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlap-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.overlap-svg {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.overlap-text-panel {
    position: relative;
    z-index: 10;
    max-width: 700px;
    padding: 4rem;
    background: rgba(11, 22, 40, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(77, 232, 194, 0.1);
}

/* ===== PULL QUOTE ===== */
.pull-quote {
    font-family: var(--font-display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: 0.02em;
    line-height: 1.5;
    color: var(--text-primary);
    text-align: center;
}

.pull-quote p {
    margin: 0;
}

/* ===== ZONE 4 - THRESHOLD ===== */
.threshold-line {
    position: absolute;
    top: 0;
    left: 5%;
    right: 5%;
    height: 2px;
    background: var(--alert);
    z-index: 20;
    opacity: 0;
    transition: opacity 200ms ease;
}

.threshold-line.flash {
    animation: thresholdFlash 1.5s ease-out forwards;
}

@keyframes thresholdFlash {
    0% { opacity: 0; }
    10% { opacity: 1; }
    30% { opacity: 0.3; }
    50% { opacity: 0.8; }
    70% { opacity: 0.2; }
    100% { opacity: 0; }
}

.inversion-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ===== ZONE 5 - THE DEEP ===== */
.zone5 {
    background: linear-gradient(180deg, var(--depth) 0%, var(--abyss) 100%);
}

.deep-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    position: relative;
}

.deep-content {
    max-width: 640px;
    text-align: center;
    position: relative;
    z-index: 5;
}

.deep-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.deep-signature {
    margin-top: 4rem;
    position: relative;
    z-index: 5;
}

.signature-text {
    font-family: var(--font-display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--glow);
    letter-spacing: 0.02em;
}

/* ===== KELP - DEEP ZONE ===== */
.kelp-deep-left {
    left: 8%;
    opacity: 0.5;
}

.kelp-deep-right {
    right: 8%;
    opacity: 0.5;
}

.kelp-deep-left-2 {
    left: 15%;
    opacity: 0.3;
}

.kelp-deep-right-2 {
    right: 15%;
    opacity: 0.3;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .split-container {
        flex-direction: column;
    }

    .split-default .panel-left,
    .split-default .panel-right,
    .split-scholarly .panel-wide,
    .split-scholarly .panel-narrow,
    .split-inverted .panel-wide-inv,
    .split-inverted .panel-narrow-inv {
        width: 100%;
    }

    .divider-line {
        width: 100%;
        height: 1px;
    }

    .panel-content {
        padding: 3rem 2rem 2rem 2rem;
    }

    .marginalia {
        display: none;
    }

    .section-pips {
        right: 0.75rem;
    }

    .overlap-text-panel {
        padding: 2rem;
        margin: 1rem;
    }

    .scholarly-text {
        max-width: 100%;
    }

    .site-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }
}
