/* ===================================
   RRIDDL.com — Ocean-Deep Design
   Colors: #0A1628, #0E1E35, #1A3A5C, #2D5F8A, #4A7C8F, #7FB3D3, #B8CCD8, #E8F0F2, #C9865A
   Fonts: Bebas Neue, Oswald, Source Serif 4, JetBrains Mono
   =================================== */

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

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

body {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    color: #B8CCD8;
    background: #0A1628;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Fixed Bokeh-Mountain Background ===== */
#bokeh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background:
        radial-gradient(circle at 15% 25%, rgba(45,95,138,0.35) 0%, transparent 45%),
        radial-gradient(circle at 55% 15%, rgba(26,58,92,0.5) 0%, transparent 35%),
        radial-gradient(circle at 80% 30%, rgba(45,95,138,0.25) 0%, transparent 50%),
        radial-gradient(circle at 25% 60%, rgba(74,124,143,0.2) 0%, transparent 40%),
        radial-gradient(circle at 70% 55%, rgba(26,58,92,0.45) 0%, transparent 45%),
        radial-gradient(circle at 40% 80%, rgba(45,95,138,0.3) 0%, transparent 50%),
        radial-gradient(circle at 90% 70%, rgba(14,30,53,0.6) 0%, transparent 40%),
        radial-gradient(circle at 10% 85%, rgba(26,58,92,0.35) 0%, transparent 55%),
        radial-gradient(circle at 50% 45%, rgba(45,95,138,0.2) 0%, transparent 60%),
        radial-gradient(circle at 30% 35%, rgba(74,124,143,0.15) 0%, transparent 50%),
        radial-gradient(circle at 65% 75%, rgba(26,58,92,0.4) 0%, transparent 45%),
        radial-gradient(circle at 85% 20%, rgba(45,95,138,0.2) 0%, transparent 40%),
        radial-gradient(circle at 20% 45%, rgba(14,30,53,0.5) 0%, transparent 55%),
        radial-gradient(circle at 45% 65%, rgba(26,58,92,0.3) 0%, transparent 50%),
        radial-gradient(circle at 75% 40%, rgba(74,124,143,0.18) 0%, transparent 45%),
        radial-gradient(circle at 60% 90%, rgba(45,95,138,0.25) 0%, transparent 50%),
        radial-gradient(circle at 35% 10%, rgba(26,58,92,0.3) 0%, transparent 40%),
        radial-gradient(circle at 5% 50%, rgba(45,95,138,0.15) 0%, transparent 55%),
        radial-gradient(circle at 95% 50%, rgba(14,30,53,0.4) 0%, transparent 50%),
        linear-gradient(180deg, #0E1E35 0%, #0A1628 100%);
}

/* ===== Bokeh Particle Canvas ===== */
#bokeh-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ===== Scroll Progress Indicator ===== */
#scroll-progress {
    position: fixed;
    top: 0;
    right: 8px;
    width: 4px;
    height: 100vh;
    z-index: 100;
}

/* ===== R Monogram ===== */
#monogram-wrap {
    position: fixed;
    top: 24px;
    left: 24px;
    width: 48px;
    height: 56px;
    z-index: 200;
    cursor: pointer;
}

#monogram {
    width: 100%;
    height: 100%;
}

#monogram-path {
    stroke-dasharray: 250;
    stroke-dashoffset: 250;
    transition: stroke-dashoffset 2.4s ease-out;
}

#monogram-path.drawn {
    stroke-dashoffset: 0;
}

#monogram-wrap:hover #monogram-path {
    stroke: #E8F0F2;
}

/* ===== Navigation Overlay ===== */
#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 150;
    background: rgba(10, 22, 40, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-masonry {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    max-width: 500px;
    width: 90%;
}

.nav-block {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: rgba(26, 58, 92, 0.4);
    color: #E8F0F2;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 36px;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.3s ease-out, color 0.3s ease-out;
}

.nav-block:hover {
    background: rgba(45, 95, 138, 0.6);
    color: #C9865A;
}

/* ===== Depth Zones — Common ===== */
.depth-zone {
    position: relative;
    z-index: 2;
    min-height: 100vh;
}

.depth-label {
    position: absolute;
    bottom: 20px;
    left: 30px;
}

.mono-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: #4A7C8F;
}

/* ===== SURFACE ZONE ===== */
.zone-surface {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: rgba(26, 58, 92, 0.5);
}

.zone-content {
    text-align: center;
    position: relative;
    z-index: 5;
}

.title-main {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: 120px;
    letter-spacing: 0.08em;
    color: #E8F0F2;
    line-height: 1;
    margin-bottom: 16px;
}

.subtitle {
    font-family: 'Source Serif 4', serif;
    font-size: 20px;
    color: #7FB3D3;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1.2s ease-out 0.8s, transform 1.2s ease-out 0.8s;
}

.subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.ridgeline-surface {
    width: 80%;
    max-width: 1000px;
    height: 120px;
    margin: 0 auto;
}

/* ===== Ridgeline SVGs ===== */
.ridgeline {
    position: absolute;
    width: 100%;
    pointer-events: none;
    z-index: 3;
}

.ridgeline-surface {
    position: relative;
    z-index: 4;
}

.ridge-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.8s ease-out;
}

.ridge-path.drawn {
    stroke-dashoffset: 0;
}

.ridge-delayed-1 { transition-delay: 0s; }
.ridge-delayed-2 { transition-delay: 0.4s; }
.ridge-delayed-3 { transition-delay: 0.8s; }

/* ===== TWILIGHT ZONE ===== */
.zone-twilight {
    min-height: 200vh;
    padding: 80px 0;
    background: rgba(14, 30, 53, 0.7);
    position: relative;
}

.ridgeline-twilight-bg {
    top: 10%;
    height: 200px;
    opacity: 0.6;
}

.fault-line {
    position: absolute;
    left: calc(38% + 1px);
    top: 0;
    width: 4px;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

.fault-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2s linear;
}

.fault-path.drawn {
    stroke-dashoffset: 0;
}

/* ===== Masonry Strata Grid ===== */
.strata-grid {
    display: grid;
    grid-template-columns: 38% 24% 38%;
    gap: 2px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 5;
}

.strata-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ===== Strata Blocks ===== */
.strata-block {
    position: relative;
    padding: 30px 24px;
    background: rgba(10, 22, 40, 0.85);
    border-radius: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.strata-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.strata-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.strata-block:hover::before {
    opacity: 1;
    box-shadow: inset 0 0 0 1px #4A7C8F;
}

.strata-block-content {
    background: rgba(14, 30, 53, 0.85);
}

.strata-block-deep {
    background: rgba(10, 22, 40, 0.9);
}

.strata-empty {
    padding: 20px 10px;
    height: 50px;
    background: transparent;
    display: flex;
    align-items: center;
}

.strata-empty-tall {
    height: 80px;
}

.inline-ridge {
    width: 100%;
    height: 100%;
}

.block-number {
    display: block;
    margin-bottom: 12px;
    color: #4A7C8F;
}

/* ===== Typography ===== */
h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    color: #E8F0F2;
    letter-spacing: 0.08em;
}

h2 {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 36px;
    letter-spacing: 0.03em;
    color: #7FB3D3;
    margin-bottom: 14px;
    line-height: 1.2;
}

h3 {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 26px;
    letter-spacing: 0.03em;
    color: #7FB3D3;
    margin-bottom: 12px;
    line-height: 1.2;
}

p {
    color: #B8CCD8;
    font-size: 17px;
    line-height: 1.65;
}

/* ===== MIDNIGHT ZONE ===== */
.zone-midnight {
    min-height: 200vh;
    padding: 80px 0;
    background: rgba(10, 22, 40, 0.85);
    position: relative;
}

.ridgeline-midnight {
    top: 5%;
    height: 200px;
}

.midnight-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
    position: relative;
    z-index: 5;
}

.strata-block-wide {
    background: rgba(14, 30, 53, 0.8);
    padding: 50px 40px;
    margin-bottom: 2px;
}

.midnight-strata-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin-bottom: 2px;
}

.section-divider {
    margin-top: 30px;
}

.section-divider svg {
    width: 100%;
    height: 4px;
}

.divider-line {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1s ease-out;
}

.divider-line.drawn {
    stroke-dashoffset: 0;
}

/* Hydrothermal Vent Block */
.strata-vent {
    background: rgba(10, 22, 40, 0.9);
    position: relative;
    overflow: hidden;
}

.strata-vent .vent-glow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 120px;
    background: radial-gradient(ellipse at center, rgba(201,134,90,0.2) 0%, transparent 70%);
    pointer-events: none;
}

.accent-warm {
    color: #C9865A;
}

.accent-warm-text {
    color: #C9865A;
}

/* ===== HADAL ZONE ===== */
.zone-hadal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 22, 40, 0.95);
    position: relative;
}

.ridgeline-hadal {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 300px;
    z-index: 3;
}

.ridge-hadal-main {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s ease-out;
}

.ridge-hadal-main.drawn {
    stroke-dashoffset: 0;
}

.ridge-hadal-beyond {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2.5s ease-out 1.5s;
}

.ridge-hadal-beyond.drawn {
    stroke-dashoffset: 0;
}

.hadal-content {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 600px;
    padding: 40px 20px;
}

.hadal-text {
    font-family: 'Source Serif 4', serif;
    font-size: 19px;
    line-height: 1.8;
    color: #B8CCD8;
    margin-bottom: 40px;
}

.hadal-depth {
    display: block;
    text-align: center;
}

/* ===== Floating SVG Layer ===== */
#floating-svg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 6;
    pointer-events: none;
    overflow: hidden;
}

.floating-ridge {
    position: absolute;
}

.float-1 {
    top: 20%;
    left: -5%;
    width: 50%;
    height: 80px;
    animation: floatDrift1 25s linear infinite;
}

.float-2 {
    top: 55%;
    right: -5%;
    width: 40%;
    height: 60px;
    animation: floatDrift2 30s linear infinite;
}

.float-3 {
    top: 78%;
    left: 10%;
    width: 55%;
    height: 70px;
    animation: floatDrift3 35s linear infinite;
}

@keyframes floatDrift1 {
    0% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(30px) translateY(-15px); }
    100% { transform: translateX(0) translateY(0); }
}

@keyframes floatDrift2 {
    0% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(-25px) translateY(10px); }
    100% { transform: translateX(0) translateY(0); }
}

@keyframes floatDrift3 {
    0% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(20px) translateY(-20px); }
    100% { transform: translateX(0) translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .strata-grid {
        grid-template-columns: 1fr 1fr;
    }

    .strata-col-center {
        display: none;
    }

    .fault-line {
        display: none;
    }

    .title-main {
        font-size: 80px;
    }

    h2 {
        font-size: 28px;
    }

    h3 {
        font-size: 22px;
    }
}

@media (max-width: 640px) {
    .strata-grid {
        grid-template-columns: 1fr;
    }

    .strata-col-right {
        display: none;
    }

    .midnight-strata-grid {
        grid-template-columns: 1fr;
    }

    .title-main {
        font-size: 56px;
    }

    .nav-masonry {
        grid-template-columns: 1fr;
    }

    .nav-block {
        font-size: 28px;
        padding: 30px 16px;
    }

    .strata-block {
        padding: 24px 18px;
    }

    .strata-block-wide {
        padding: 36px 24px;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 20px;
    }

    p {
        font-size: 16px;
    }

    #monogram-wrap {
        top: 16px;
        left: 16px;
        width: 36px;
        height: 42px;
    }
}
