/* gabs.reviews - Deep Burgundy Oceanic Design */

/* ========== CSS Custom Properties ========== */
:root {
    --abyss: #0d0a12;
    --burgundy-core: #3d0f1e;
    --wine-shadow: #2a0814;
    --bio-teal: #1a8f8f;
    --coral-cream: #f0e6db;
    --specimen-cyan: #0fb8b8;
    --pressure-gray: #2d2833;
    --margin-ink: #3a6b6b;
    --ocean-depth: 0;
    --shallow: #0d0a12;
    --deep: #0a0a0a;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--abyss);
    color: var(--coral-cream);
    font-family: 'IBM Plex Sans', 'Helvetica Neue', Helvetica, sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== Bioluminescent Particles ========== */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--specimen-cyan);
    opacity: 0;
    animation: float-up linear infinite;
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(30px);
    }
}

/* ========== Pressure Lines ========== */
#pressure-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 199px,
        rgba(240, 230, 219, 0.06) 199px,
        rgba(240, 230, 219, 0.06) 200px
    );
}

/* ========== Depth Indicator ========== */
#depth-indicator {
    position: fixed;
    right: 12px;
    top: 0;
    width: 30px;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
}

#depth-line {
    position: absolute;
    right: 0;
    top: 0;
    width: 1px;
    height: 0%;
    background: var(--bio-teal);
    transition: height 0.1s linear;
}

#depth-labels {
    position: relative;
    width: 100%;
    height: 100%;
}

.depth-label {
    position: absolute;
    right: 8px;
    font-family: 'Caveat', cursive;
    font-size: 0.7rem;
    color: var(--bio-teal);
    white-space: nowrap;
    opacity: 0.6;
    transform: translateY(-50%);
}

/* ========== Blur-Focus Animation ========== */
.blur-reveal {
    filter: blur(12px);
    opacity: 0.3;
    transform: translateY(20px) scale(0.98);
    transition: filter 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 1.2s ease-out,
                transform 1.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.blur-reveal.in-view {
    filter: blur(0);
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ========== Frontispiece ========== */
.frontispiece {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(175deg, #0d0a12 0%, #2a0814 35%, #3d0f1e 70%, #0d0a12 100%);
    z-index: 2;
}

.frontispiece-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.organism-svg {
    width: 100%;
    height: 100%;
}

.frontispiece-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.site-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(2.8rem, 6.5vw, 5.5rem);
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--coral-cream);
    margin-bottom: 0.5rem;
}

.site-subtitle {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: var(--coral-cream);
    opacity: 0.7;
    letter-spacing: 0.08em;
}

.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-dot {
    animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { cy: 12; }
    50% { cy: 28; }
}

/* ========== SVG Specimen Drawing Animations ========== */
.specimen-line path,
.specimen-line ellipse,
.specimen-line circle,
.specimen-line line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s cubic-bezier(0.4, 0, 0.2, 1);
}

.specimen-line.drawn path,
.specimen-line.drawn ellipse,
.specimen-line.drawn circle,
.specimen-line.drawn line {
    stroke-dashoffset: 0;
}

/* ========== Chapter Sections ========== */
.chapter {
    position: relative;
    margin-block: clamp(6rem, 12vh, 10rem);
    padding-inline: 1rem;
    z-index: 2;
}

.chapter-grid {
    display: grid;
    grid-template-columns: 18vw minmax(0, 42ch) 1fr;
    grid-template-areas: 'margin-note body-column specimen-gutter';
    max-width: 100%;
}

.margin-note {
    grid-area: margin-note;
    padding-right: 2rem;
    text-align: right;
}

.annotation {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    line-height: 1.5;
    color: var(--margin-ink);
    position: sticky;
    top: 30vh;
}

.body-column {
    grid-area: body-column;
}

.chapter-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--coral-cream);
    margin-bottom: 2rem;
}

.body-text {
    margin-bottom: 1.5rem;
    color: var(--coral-cream);
    opacity: 0.92;
}

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

/* ========== Specimen Plates ========== */
.specimen-plate {
    position: relative;
    width: 100vw;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
    margin-block: clamp(4rem, 8vh, 8rem);
}

.seamount-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    mix-blend-mode: screen;
    opacity: 0.15;
}

.seamount-svg {
    width: 100%;
    height: 100%;
}

.plate-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 4rem 2rem;
}

.plate-illustration {
    margin: 0 auto;
    width: clamp(200px, 30vw, 300px);
    height: clamp(200px, 30vw, 300px);
}

.specimen-drawing {
    width: 100%;
    height: 100%;
}

.plate-caption {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    color: var(--margin-ink);
    margin-top: 2rem;
    letter-spacing: 0.02em;
}

/* ========== Specimen Plate Background Glow ========== */
.specimen-plate::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 70%, rgba(26, 143, 143, 0.08) 0%, transparent 65%);
    pointer-events: none;
}

/* ========== Colophon ========== */
.colophon {
    text-align: center;
    padding-block: 8rem;
    z-index: 2;
    position: relative;
}

.colophon-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--coral-cream);
    opacity: 0.4;
}

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

/* Tablet */
@media (max-width: 1024px) {
    .chapter-grid {
        grid-template-columns: 1fr minmax(0, 55ch) 1fr;
        grid-template-areas:
            '. margin-note .'
            '. body-column .';
    }

    .margin-note {
        text-align: left;
        padding-right: 0;
        padding-bottom: 1.5rem;
        border-left: 2px solid var(--margin-ink);
        padding-left: 1rem;
    }

    .annotation {
        position: static;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .chapter-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            'margin-note'
            'body-column';
        padding-inline: 1.5rem;
    }

    .chapter {
        padding-inline: 0;
    }

    .margin-note {
        text-align: left;
        padding-right: 0;
        padding-bottom: 1.5rem;
        padding-left: 1rem;
        border-left: 2px solid var(--margin-ink);
        margin-bottom: 1rem;
    }

    .annotation {
        position: static;
    }

    .site-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .chapter-title {
        font-size: clamp(1.6rem, 6vw, 2.5rem);
    }

    .plate-illustration {
        width: 180px;
        height: 180px;
    }

    #depth-indicator {
        display: none;
    }

    .specimen-plate {
        min-height: 50vh;
    }
}
