/* ============================================
   bable.pro - Styles
   Drowned broadcast station aesthetic
   Ma-negative-space layout
   High-contrast black/bone-white with teal accent
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    background-color: #F5F0EB;
    color: #0A0A0A;
    overflow-x: hidden;
    position: relative;
}

/* --- Typography Utility Classes --- */
.playfair {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
}

.cormorant {
    font-family: 'Cormorant Garamond', Garamond, serif;
    font-weight: 300;
}

.mono {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
}

/* --- Ghost Grid (full page height, 12 columns) --- */
#ghost-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#ghost-grid .grid-line {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background-color: #B8B5B0;
    opacity: 0.08;
    transition: opacity 0.6s ease;
}

/* --- Layer Base --- */
.layer {
    position: relative;
    width: 100%;
}

/* --- Layer 1: Surface (Opening Void) --- */
#layer-surface {
    height: 100vh;
    background-color: #F5F0EB;
    position: relative;
    z-index: 2;
}

.horizon-line {
    position: absolute;
    top: 50vh;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #0A0A0A;
    opacity: 0.12;
}

.domain-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 140px;
    color: #0A0A0A;
    letter-spacing: -0.03em;
    line-height: 0.92;
    position: absolute;
    top: calc(50vh + 24px);
    left: calc(100% / 12 * 2);
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Layer 2: Thermocline (Manifesto Blocks) --- */
#layer-thermocline {
    min-height: 180vh;
    padding-top: 120px;
    padding-bottom: 120px;
    position: relative;
    z-index: 2;
}

.manifesto-block {
    position: relative;
    max-width: 480px;
    cursor: default;
}

.manifesto-left {
    margin-left: calc(100% / 12 * 1);
}

.manifesto-right {
    margin-left: calc(100% / 12 * 7);
}

.manifesto-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 72px;
    color: #0A0A0A;
    letter-spacing: -0.03em;
    line-height: 0.92;
    display: block;
}

.manifesto-spacer {
    height: 480px;
}

/* Rust Coral accent - stress mark dot (< 2% of viewport) */
.manifesto-block::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background-color: #C4453E;
    border-radius: 50%;
    margin-top: 24px;
}

/* --- Layer 3: Mesopelagic (Noise Field) --- */
#layer-mesopelagic {
    height: 100vh;
    background-color: #0E1A2B;
    position: relative;
    z-index: 3;
    overflow: hidden;
}

.noise-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.depth-label {
    position: absolute;
    bottom: 40px;
    left: calc(100% / 12 * 2);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #F5F0EB;
    opacity: 0.4;
    z-index: 4;
}

/* --- Layer 4: Bathypelagic (Grid Reveal) --- */
#layer-bathypelagic {
    min-height: 140vh;
    background-color: #F5F0EB;
    position: relative;
    z-index: 2;
    padding-top: 60px;
    padding-bottom: 60px;
}

.revealed-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Vertical column lines */
    background-image:
        repeating-linear-gradient(
            to right,
            transparent,
            transparent calc(100% / 12 - 1px),
            #0A0A0A calc(100% / 12 - 1px),
            #0A0A0A calc(100% / 12)
        );
    background-size: calc(100% / 12) 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.revealed-grid.active {
    opacity: 1;
}

/* Horizontal rules at 120px intervals */
.revealed-grid::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 119px,
            #0A0A0A 119px,
            #0A0A0A 120px
        );
}

.grid-word {
    position: absolute;
    cursor: default;
    z-index: 5;
}

/* Grid word positions mapped to column/row coordinates */
.grid-word[data-col="3"][data-row="4"] {
    left: calc(100% / 12 * 2);
    top: calc(120px * 4);
}

.grid-word[data-col="8"][data-row="7"] {
    left: calc(100% / 12 * 7);
    top: calc(120px * 7);
}

.grid-word[data-col="2"][data-row="11"] {
    left: calc(100% / 12 * 1);
    top: calc(120px * 11);
}

.grid-word[data-col="10"][data-row="14"] {
    left: calc(100% / 12 * 9);
    top: calc(120px * 14);
}

.grid-word[data-col="6"][data-row="18"] {
    left: calc(100% / 12 * 5);
    top: calc(120px * 18);
}

.grid-coord {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #0A0A0A;
    opacity: 0.4;
    margin-bottom: 4px;
}

.grid-word-text {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 48px;
    color: #0A0A0A;
    letter-spacing: -0.03em;
    line-height: 0.92;
}

/* --- Layer 5: Abyssopelagic (Broken Grid) --- */
#layer-abyssopelagic {
    min-height: 80vh;
    background-color: #F5F0EB;
    position: relative;
    z-index: 2;
    padding-top: 120px;
    padding-bottom: 200px;
    overflow: hidden;
}

.noise-overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
}

.broken-grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.broken-grid-lines line {
    stroke: #0A0A0A;
    stroke-width: 1;
    transition: stroke-dasharray 1.2s ease, opacity 0.8s ease;
}

.broken-text {
    position: relative;
    z-index: 5;
}

.broken-text-1 {
    margin-left: calc(100% / 12 * 2);
    margin-bottom: 180px;
    margin-top: 120px;
}

.broken-text-2 {
    margin-left: calc(100% / 12 * 5);
    margin-bottom: 180px;
}

.broken-text-3 {
    margin-left: calc(100% / 12 * 3);
}

.broken-line {
    font-family: 'Cormorant Garamond', Garamond, serif;
    font-weight: 300;
    font-style: italic;
    font-size: 24px;
    color: #2A2A2A;
    line-height: 1.65;
    letter-spacing: 0.01em;
}

.broken-line-teal {
    color: #0D7377;
}

/* --- Ripple Effect --- */
#ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    border: 1px solid #0D7377;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: ripple-expand 2s ease-out forwards;
}

@keyframes ripple-expand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    100% {
        width: 800px;
        height: 800px;
        opacity: 0;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .domain-title {
        font-size: 64px;
        left: calc(100% / 12 * 1);
    }

    .manifesto-text {
        font-size: 40px;
    }

    .manifesto-left {
        margin-left: 24px;
    }

    .manifesto-right {
        margin-left: 24px;
    }

    .manifesto-spacer {
        height: 240px;
    }

    .grid-word-text {
        font-size: 32px;
    }

    .broken-line {
        font-size: 18px;
    }

    .broken-text-1,
    .broken-text-2,
    .broken-text-3 {
        margin-left: 24px;
    }

    .depth-label {
        left: 24px;
    }

    .grid-coord {
        font-size: 9px;
    }
}
