/* ============================================
   gabs.wiki - Deep Ocean Research Terminal
   Ethereal Blue Monochromatic Design System
   ============================================ */

/* === CSS Custom Properties === */
:root {
    --abyss: #080f18;
    --deep: #0d1a2a;
    --trench: #132840;
    --current: #1e3a5c;
    --signal: #3d8ab5;
    --glow: #7eb8da;
    --surface-color: #94b8cc;
    --ice: #c8e6f5;
    --foam: #e8f4fa;
    --font-display: "Space Mono", monospace;
    --font-body: "Inter", sans-serif;
    --font-code: "JetBrains Mono", monospace;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--abyss);
    color: var(--surface-color);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* === Section Indicator (fixed top-left) === */
.section-indicator {
    position: fixed;
    top: 32px;
    left: 32px;
    z-index: 100;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5a8a9f;
}

.indicator-label {
    display: inline-block;
    transition: opacity 150ms ease-out;
}

.indicator-label.fading {
    opacity: 0;
}

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

/* === Sections === */
.section {
    position: relative;
    width: 100%;
    z-index: 2;
}

/* === Surface (Hero) === */
.section--surface {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--abyss);
    overflow: hidden;
}

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

.domain-title {
    font-family: var(--font-display);
    font-size: clamp(48px, 10vw, 96px);
    font-weight: 700;
    color: var(--ice);
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 40px;
}

.char {
    display: inline-block;
    transform: translateY(var(--char-offset, 0));
    transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.surface-tagline {
    font-family: var(--font-body);
    font-size: 17px;
    color: var(--surface-color);
    margin-bottom: 80px;
    font-weight: 400;
}

.scroll-chevron {
    display: flex;
    justify-content: center;
    animation: chevron-pulse 2s ease-in-out infinite;
}

.chevron-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--signal);
    border-bottom: 2px solid var(--signal);
    transform: rotate(45deg);
}

@keyframes chevron-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* === Organic Blobs === */
.blob {
    position: absolute;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    background: var(--signal);
    opacity: 0.06;
    z-index: 0;
    pointer-events: none;
}

.blob--1 {
    width: 500px;
    height: 500px;
    top: 10%;
    left: 40%;
    animation: blob-morph-1 25s ease-in-out infinite;
}

.blob--2 {
    width: 400px;
    height: 400px;
    bottom: 15%;
    left: 15%;
    animation: blob-morph-2 30s ease-in-out infinite;
}

.blob--3 {
    width: 350px;
    height: 350px;
    top: 50%;
    right: 10%;
    animation: blob-morph-3 22s ease-in-out infinite;
}

.blob--4 {
    width: 450px;
    height: 450px;
    top: 20%;
    right: 5%;
    animation: blob-morph-1 28s ease-in-out infinite;
}

.blob--5 {
    width: 380px;
    height: 380px;
    top: 30%;
    right: 8%;
    animation: blob-morph-2 24s ease-in-out infinite;
}

.blob--6 {
    width: 520px;
    height: 520px;
    top: 10%;
    right: 3%;
    animation: blob-morph-3 26s ease-in-out infinite;
}

.blob--7 {
    width: 420px;
    height: 420px;
    top: 40%;
    right: 10%;
    animation: blob-morph-1 20s ease-in-out infinite;
}

@keyframes blob-morph-1 {
    0%   { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    33%  { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
    66%  { border-radius: 50% 60% 30% 60% / 50% 40% 70% 40%; }
    100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

@keyframes blob-morph-2 {
    0%   { border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%; }
    33%  { border-radius: 30% 60% 70% 40% / 50% 30% 60% 70%; }
    66%  { border-radius: 50% 50% 40% 60% / 70% 40% 50% 30%; }
    100% { border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%; }
}

@keyframes blob-morph-3 {
    0%   { border-radius: 50% 50% 60% 40% / 60% 30% 50% 70%; }
    33%  { border-radius: 40% 70% 50% 30% / 40% 60% 30% 60%; }
    66%  { border-radius: 70% 30% 40% 60% / 60% 50% 70% 30%; }
    100% { border-radius: 50% 50% 60% 40% / 60% 30% 50% 70%; }
}

/* === Photic Zone Sections === */
.section--photic {
    background-color: var(--deep);
    padding: 12vh 0;
    overflow: hidden;
}

.section-inner {
    max-width: 720px;
    margin-left: 12vw;
    padding: 0 24px;
    position: relative;
    z-index: 3;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 40px);
    font-weight: 700;
    color: var(--ice);
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 24px;
    padding-left: 20px;
    border-left: 2px solid var(--glow);
    box-shadow: -4px 0 8px rgba(126, 184, 218, 0.3);
}

.section-intro {
    font-size: 17px;
    color: var(--surface-color);
    margin-bottom: 40px;
    line-height: 1.72;
}

.body-text {
    font-size: 17px;
    color: var(--surface-color);
    line-height: 1.72;
    max-width: 680px;
    margin-bottom: 24px;
}

/* === Zoom-Focus Reveal === */
.reveal-block {
    transform: scale(0.92);
    opacity: 0.4;
    filter: blur(1px);
    transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1),
                opacity 500ms ease-out,
                filter 500ms ease-out;
    transition-delay: calc(var(--index) * 80ms);
}

.reveal-block.visible {
    transform: scale(1);
    opacity: 1;
    filter: blur(0px);
}

/* === Content Grid === */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 16px;
}

.grid-item--wide {
    grid-column: 1 / -1;
}

/* === Entry Cards === */
.entry-card {
    background: rgba(13, 26, 42, 0.8);
    border: 1px solid rgba(126, 184, 218, 0.1);
    border-radius: 4px;
    padding: 28px;
    transition: border-color 300ms ease-out, box-shadow 300ms ease-out;
}

.entry-card:hover {
    border-color: rgba(126, 184, 218, 0.25);
    box-shadow: 0 0 4px rgba(61, 138, 181, 0.2), 0 0 16px rgba(61, 138, 181, 0.1), 0 0 32px rgba(61, 138, 181, 0.05);
}

.entry-meta {
    display: block;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5a8a9f;
    margin-bottom: 12px;
}

.entry-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--ice);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    line-height: 1.3;
}

.entry-excerpt {
    font-size: 15px;
    color: var(--surface-color);
    line-height: 1.65;
    margin-bottom: 16px;
}

.entry-link {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 400;
    color: var(--signal);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 300ms ease-out, text-shadow 300ms ease-out;
}

.entry-link:hover {
    color: var(--glow);
    text-shadow: 0 0 4px rgba(61, 138, 181, 0.2), 0 0 16px rgba(61, 138, 181, 0.1), 0 0 32px rgba(61, 138, 181, 0.05);
}

/* === Code Blocks === */
.code-block {
    font-family: var(--font-code);
    font-size: 14px;
    font-weight: 400;
    color: var(--glow);
    background: rgba(126, 184, 218, 0.08);
    border: 1px solid rgba(126, 184, 218, 0.15);
    border-left: 3px solid var(--signal);
    border-radius: 4px;
    padding: 24px;
    overflow-x: auto;
    line-height: 1.6;
    transition: border-left-color 200ms ease-out;
}

.code-block:hover {
    border-left-color: var(--glow);
}

/* === Experiment Items === */
.experiment-item {
    padding: 28px;
    border-left: 2px solid var(--current);
    margin-bottom: 8px;
    transition: border-left-color 300ms ease-out;
}

.experiment-item:hover {
    border-left-color: var(--signal);
}

.experiment-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--ice);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    line-height: 1.3;
}

/* === Flowing Curve Separators === */
.curve-separator {
    position: relative;
    z-index: 2;
    height: 120px;
    overflow: hidden;
    background: transparent;
}

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

.flowing-curve {
    fill: none;
    stroke: var(--current);
    stroke-width: 1.5;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease-out;
}

.flowing-curve.drawn {
    stroke-dashoffset: 0;
}

/* === Abyssal Zone (Footer) === */
.section--abyssal {
    background-color: #060c14;
    padding: 16vh 0 8vh;
}

.section-inner--abyssal {
    max-width: 720px;
    margin-left: 12vw;
    padding: 0 24px;
    position: relative;
    z-index: 3;
}

.abyssal-text {
    font-size: 14px;
    color: #5a8a9f;
    line-height: 1.72;
    margin-bottom: 32px;
    max-width: 480px;
}

.abyssal-timestamp {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5a8a9f;
    margin-bottom: 40px;
}

.abyssal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 60px;
}

.abyssal-link {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 400;
    color: var(--signal);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 300ms ease-out, text-shadow 300ms ease-out;
}

.abyssal-link:hover {
    color: var(--glow);
    text-shadow: 0 0 4px rgba(61, 138, 181, 0.2), 0 0 16px rgba(61, 138, 181, 0.1), 0 0 32px rgba(61, 138, 181, 0.05);
}

.abyssal-domain {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 400;
    color: #5a8a9f;
    letter-spacing: 0.08em;
    opacity: 0.6;
}

/* === Responsive === */
@media (max-width: 768px) {
    .section-inner,
    .section-inner--abyssal {
        margin-left: 5vw;
        margin-right: 5vw;
        max-width: none;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .section-indicator {
        top: 16px;
        left: 16px;
    }

    .domain-title {
        font-size: clamp(36px, 12vw, 64px);
    }

    .abyssal-nav {
        flex-direction: column;
        gap: 16px;
    }

    .blob {
        display: none;
    }
}