/* =========================================
   SocialDebug.Org — Ocean Deep Styles
   ========================================= */

/* --- CSS Custom Properties --- */
:root {
    --abyssal-navy: #0B1622;
    --twilight-indigo: #142840;
    --bathyal-slate: #1E3A5F;
    --bio-teal: #00E5CC;
    --deep-coral: #FF6B5A;
    --kelp-gold: #C9A84C;
    --sea-foam-white: #E8F1F2;
    --drift-gray: #8BA7B8;
    --translucent-aqua: rgba(0, 229, 204, 0.08);
    --sediment-brown: #3D2E1F;

    --font-display: 'Anybody', sans-serif;
    --font-kinetic: 'Syne', sans-serif;
    --font-body: 'Source Sans 3', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    color: var(--sea-foam-white);
    background-color: var(--abyssal-navy);
    overflow-x: hidden;
}

/* --- Section Labels --- */
.section-label {
    font-family: var(--font-kinetic);
    font-weight: 800;
    font-size: clamp(14px, 2vw, 18px);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--drift-gray);
    margin-bottom: 3rem;
    text-align: center;
}

/* =========================================
   DEPTH ZONE 1: SURFACE (Hero)
   ========================================= */
#surface {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, var(--twilight-indigo), var(--abyssal-navy) 70%);
    overflow: hidden;
}

.hero-blob-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 0;
}

.hero-blob-svg {
    width: 120%;
    height: 120%;
    opacity: 0.5;
}

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

/* Kinetic Title */
.kinetic-title {
    font-family: var(--font-kinetic);
    font-weight: 800;
    font-size: clamp(48px, 10vw, 96px);
    color: var(--sea-foam-white);
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    text-shadow:
        0 0 20px rgba(0, 229, 204, 0.3),
        0 0 40px rgba(0, 229, 204, 0.15),
        0 0 80px rgba(0, 229, 204, 0.05);
    margin-bottom: 1.5rem;
}

.letter {
    display: inline-block;
    animation: letterBob calc(2.5s + var(--i) * 0.12s) ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.2s);
}

@keyframes letterBob {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(calc(-3px - var(--i) * 0.3px));
    }
}

/* Hero Tagline */
.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 400;
    color: var(--drift-gray);
    opacity: 0;
    transform: scale(0.85);
    animation: taglineFadeIn 2.5s ease-out 0.5s forwards;
}

@keyframes taglineFadeIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hero Floating Bubble */
.hero-bubble {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 229, 204, 0.2), rgba(0, 229, 204, 0.05) 60%, transparent 70%);
    border: 1px solid rgba(0, 229, 204, 0.15);
    top: 20%;
    left: 10%;
    animation: heroBubbleDrift 18s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes heroBubbleDrift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(60vw, -10vh); }
    50% { transform: translate(70vw, 5vh); }
    75% { transform: translate(20vw, -15vh); }
    100% { transform: translate(0, 0); }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 1;
    animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-text {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--drift-gray);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.scroll-arrow {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* =========================================
   DEPTH ZONE 2: THERMOCLINE
   ========================================= */
#thermocline {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    background: linear-gradient(180deg, var(--abyssal-navy) 0%, var(--bathyal-slate) 100%);
    transition: background 0.5s ease;
}

.blob-text-container {
    max-width: 640px;
    padding: 3rem;
    border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%;
    background: linear-gradient(135deg, var(--twilight-indigo), var(--bathyal-slate));
    border: 1px solid rgba(0, 229, 204, 0.12);
    position: relative;
}

.mission-text {
    font-family: var(--font-body);
    font-size: clamp(16px, 2vw, 18px);
    font-weight: 400;
    line-height: 1.65;
    color: var(--sea-foam-white);
    margin-bottom: 1.5rem;
}

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

/* =========================================
   BUBBLE STREAMS
   ========================================= */
.bubble-stream {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    pointer-events: none;
}

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

.bubble-circle {
    fill: rgba(0, 229, 204, 0.08);
    stroke: rgba(0, 229, 204, 0.15);
    stroke-width: 0.3;
}

/* =========================================
   DEPTH ZONE 3: MESOPELAGIC (Portfolio Grid)
   ========================================= */
#mesopelagic {
    position: relative;
    min-height: 300vh;
    padding: 6rem 2rem 8rem;
    background: linear-gradient(180deg, var(--bathyal-slate) 0%, var(--twilight-indigo) 30%, var(--abyssal-navy) 100%);
}

.debug-grid {
    max-width: 85vw;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: clamp(16px, 3vw, 40px);
}

/* --- Blob Cards --- */
.blob-card {
    position: relative;
    padding: 2rem;
    background: linear-gradient(145deg, var(--twilight-indigo), var(--bathyal-slate));
    border: 1px solid rgba(0, 229, 204, 0.2);
    border-radius: var(--br-1, 40%) var(--br-2, 60%) var(--br-3, 50%) var(--br-4, 70%) / var(--br-5, 60%) var(--br-6, 40%) var(--br-7, 70%) var(--br-8, 50%);
    cursor: pointer;
    transition: border-radius 600ms ease-in-out, box-shadow 400ms ease, transform 300ms ease;
    opacity: 0;
    transform: scale(0.7);
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.blob-card.card-visible {
    opacity: 1;
    transform: scale(1);
    transition: opacity 800ms ease, transform 800ms ease, border-radius 600ms ease-in-out, box-shadow 400ms ease;
}

.blob-card:hover {
    box-shadow:
        0 0 12px rgba(0, 229, 204, 0.2),
        0 0 30px rgba(0, 229, 204, 0.1),
        inset 0 0 20px rgba(0, 229, 204, 0.05);
    transform: scale(1.02);
}

.blob-card.card-tall {
    grid-row: span 2;
    min-height: 460px;
}

.blob-card.card-wide {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .blob-card.card-wide {
        grid-column: span 1;
    }
    .blob-card.card-tall {
        grid-row: span 1;
        min-height: 220px;
    }
}

/* Card Status Indicator */
.card-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

.status-open {
    background-color: var(--deep-coral);
    box-shadow: 0 0 8px rgba(255, 107, 90, 0.5);
}

.status-resolved {
    background-color: var(--bio-teal);
    box-shadow: 0 0 8px rgba(0, 229, 204, 0.5);
}

.status-investigating {
    background-color: var(--kelp-gold);
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.5);
}

/* Card Content */
.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-stretch: 110%;
    font-size: clamp(20px, 2.5vw, 24px);
    color: var(--sea-foam-white);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.card-summary {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    color: var(--drift-gray);
    line-height: 1.55;
    margin-bottom: 1rem;
}

.card-label {
    font-family: var(--font-code);
    font-size: 12px;
    font-weight: 400;
    color: var(--bio-teal);
    text-shadow: 0 0 6px rgba(0, 229, 204, 0.3);
    letter-spacing: 0.05em;
}

/* --- Card Overlay & Expansion --- */
.card-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 22, 34, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms ease;
}

.card-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.expanded-card {
    position: relative;
    width: 90%;
    max-width: 720px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 3rem;
    background: linear-gradient(145deg, var(--twilight-indigo), var(--bathyal-slate));
    border: 1px solid rgba(0, 229, 204, 0.25);
    border-radius: 42% 58% 48% 52% / 55% 45% 60% 40%;
    transform: scale(0.8);
    transition: transform 500ms ease;
    box-shadow:
        0 0 40px rgba(0, 229, 204, 0.15),
        0 0 80px rgba(0, 229, 204, 0.05);
}

.card-overlay.active .expanded-card {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0.7;
    transition: opacity 200ms;
    z-index: 2;
}

.close-btn:hover {
    opacity: 1;
}

.expanded-content .card-title {
    font-size: 28px;
    margin-bottom: 1rem;
}

.expanded-content .card-summary {
    font-size: 16px;
    color: var(--sea-foam-white);
    margin-bottom: 1.5rem;
}

.expanded-content .card-detail {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--drift-gray);
    line-height: 1.65;
    margin-bottom: 1rem;
}

.expanded-content .card-stack-trace {
    font-family: var(--font-code);
    font-size: 13px;
    color: var(--bio-teal);
    text-shadow: 0 0 6px rgba(0, 229, 204, 0.3);
    padding: 1rem;
    background: rgba(0, 229, 204, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 204, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* =========================================
   DEPTH ZONE 4: BATHYPELAGIC (Deep Dives)
   ========================================= */
#bathypelagic {
    position: relative;
    padding: 6rem 2rem 8rem;
    background: linear-gradient(180deg, var(--abyssal-navy) 0%, #080f1a 50%, var(--abyssal-navy) 100%);
}

.deep-case {
    position: relative;
    max-width: 900px;
    margin: 0 auto 6rem;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Collage Panels */
.collage-panel {
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 700ms ease, transform 700ms ease;
}

.collage-panel.panel-visible {
    opacity: 1;
    transform: translateY(0) rotate(var(--rotate, 0deg)) translate(var(--offset-x, 0), var(--offset-y, 0));
}

.panel-main {
    padding: 2.5rem;
    background: linear-gradient(135deg, var(--twilight-indigo), rgba(30, 58, 95, 0.8));
    border: 1px solid rgba(0, 229, 204, 0.15);
    border-radius: 12px;
}

.collage-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-stretch: 125%;
    font-size: clamp(28px, 4vw, 40px);
    color: var(--sea-foam-white);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.stack-trace {
    font-family: var(--font-code);
    font-size: 13px;
    font-weight: 400;
    color: var(--bio-teal);
    text-shadow: 0 0 8px rgba(0, 229, 204, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(0, 229, 204, 0.04);
    border-radius: 6px;
    border-left: 3px solid rgba(0, 229, 204, 0.3);
}

.trace-line::before {
    content: '> ';
    color: var(--kelp-gold);
}

.panel-annotation {
    padding: 1.5rem 2rem;
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 8px;
    max-width: 80%;
    margin-left: auto;
}

.annotation-text {
    font-family: var(--font-code);
    font-size: 13px;
    font-weight: 400;
    color: var(--kelp-gold);
    line-height: 1.6;
}

.panel-evidence {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(20, 40, 64, 0.9), rgba(30, 58, 95, 0.6));
    border: 1px solid rgba(139, 167, 184, 0.15);
    border-radius: 10px;
    max-width: 85%;
}

.evidence-label {
    font-family: var(--font-code);
    font-size: 12px;
    color: var(--drift-gray);
    display: block;
    margin-bottom: 0.75rem;
}

.evidence-text {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--sea-foam-white);
    line-height: 1.65;
}

.panel-overlay {
    position: absolute;
    width: 60%;
    height: 120px;
    background: linear-gradient(135deg, rgba(0, 229, 204, 0.03), rgba(255, 107, 90, 0.03));
    border: 1px solid rgba(0, 229, 204, 0.06);
    border-radius: 8px;
    top: 40%;
    left: 25%;
    pointer-events: none;
    z-index: -1;
}

.panel-diagnostic {
    padding: 1.5rem 2rem;
    background: rgba(11, 22, 34, 0.9);
    border: 1px solid rgba(0, 229, 204, 0.2);
    border-radius: 8px;
    max-width: 70%;
    margin-left: auto;
}

.diagnostic-header {
    font-family: var(--font-code);
    font-size: 11px;
    font-weight: 400;
    color: var(--drift-gray);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(139, 167, 184, 0.15);
}

.diagnostic-readout {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.diag-line {
    font-family: var(--font-code);
    font-size: 13px;
    color: var(--drift-gray);
}

.diag-key {
    color: var(--bio-teal);
    text-shadow: 0 0 4px rgba(0, 229, 204, 0.2);
}

.diag-coral {
    color: var(--deep-coral);
}

.diag-gold {
    color: var(--kelp-gold);
}

.diag-teal {
    color: var(--bio-teal);
}

/* =========================================
   DEPTH ZONE 5: ABYSSAL (Footer)
   ========================================= */
#abyssal {
    position: relative;
    padding: 8rem 2rem 4rem;
    background: var(--sediment-brown);
    clip-path: polygon(
        0% 8%,
        5% 5%,
        10% 7%,
        15% 4%,
        20% 6%,
        25% 3%,
        30% 5%,
        35% 4%,
        40% 6%,
        45% 3%,
        50% 5%,
        55% 4%,
        60% 7%,
        65% 3%,
        70% 5%,
        75% 4%,
        80% 6%,
        85% 3%,
        90% 5%,
        95% 4%,
        100% 6%,
        100% 100%,
        0% 100%
    );
    text-align: center;
    overflow: hidden;
}

.footer-noise-overlay {
    position: absolute;
    inset: 0;
    filter: url(#noiseFilter);
    background: var(--sediment-brown);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.footer-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.footer-title {
    font-family: var(--font-kinetic);
    font-weight: 800;
    font-size: 32px;
    color: var(--sea-foam-white);
    margin-bottom: 1rem;
}

.footer-closing {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    color: var(--drift-gray);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.bio-node {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--drift-gray);
    font-family: var(--font-body);
    font-size: 14px;
    transition: color 300ms ease;
}

.bio-node:hover {
    color: var(--sea-foam-white);
}

.node-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bio-teal);
    box-shadow: 0 0 6px rgba(0, 229, 204, 0.4);
    transition: box-shadow 300ms ease;
}

.bio-node:hover .node-dot {
    box-shadow:
        0 0 8px rgba(0, 229, 204, 0.6),
        0 0 20px rgba(0, 229, 204, 0.3),
        0 0 40px rgba(0, 229, 204, 0.1);
}

.node-label {
    letter-spacing: 0.05em;
}

/* =========================================
   BIOLUMINESCENT GLOW PULSE
   ========================================= */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 4px rgba(0, 229, 204, 0.3);
    }
    50% {
        box-shadow: 0 0 12px rgba(0, 229, 204, 0.5);
    }
}

a {
    color: var(--bio-teal);
    text-decoration: none;
    transition: color 300ms ease, text-shadow 300ms ease;
}

a:hover {
    text-shadow: 0 0 10px rgba(0, 229, 204, 0.4);
}

/* =========================================
   BUBBLE ANIMATION KEYFRAMES
   ========================================= */
@keyframes bubbleRise {
    0% {
        transform: translateY(100%) translateX(0);
        opacity: 0.6;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-100%) translateX(var(--wobble, 10px));
        opacity: 0;
    }
}

/* =========================================
   DECORATIVE MARGIN BUBBLES
   ========================================= */
.margin-bubble {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 500ms ease;
    background: radial-gradient(circle at 35% 35%, rgba(0, 229, 204, 0.15), rgba(0, 229, 204, 0.03) 60%, transparent 70%);
    border: 1px solid rgba(0, 229, 204, 0.1);
}

.margin-bubble.visible {
    opacity: 1;
}

.margin-bubble .bubble-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: var(--bio-teal);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .debug-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .debug-grid {
        grid-template-columns: 1fr;
        max-width: 95vw;
    }

    .blob-text-container {
        border-radius: 30% 70% 50% 50% / 50% 50% 50% 50%;
        padding: 2rem;
    }

    .panel-annotation,
    .panel-evidence,
    .panel-diagnostic {
        max-width: 100%;
    }

    #abyssal {
        clip-path: polygon(
            0% 4%,
            10% 2%,
            20% 4%,
            30% 2%,
            40% 3%,
            50% 2%,
            60% 4%,
            70% 2%,
            80% 3%,
            90% 2%,
            100% 4%,
            100% 100%,
            0% 100%
        );
        padding-top: 5rem;
    }

    .deep-case {
        min-height: auto;
    }

    .footer-links {
        gap: 1.5rem;
    }

    .expanded-card {
        width: 95%;
        padding: 2rem;
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .kinetic-title {
        font-size: clamp(36px, 12vw, 56px);
    }

    .collage-title {
        font-size: 24px;
    }

    .hero-bubble {
        width: 50px;
        height: 50px;
    }
}

/* =========================================
   SCROLLBAR STYLING
   ========================================= */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--abyssal-navy);
}

::-webkit-scrollbar-thumb {
    background: var(--bathyal-slate);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--drift-gray);
}

/* =========================================
   SELECTION STYLING
   ========================================= */
::selection {
    background: rgba(0, 229, 204, 0.3);
    color: var(--sea-foam-white);
}
