/* ==========================================================
   concurrent.day - Subaquatic Digital Observatory
   Seapunk aesthetic rebuilt as reverent oceanic concurrency.
   Ma (negative space) as structural principle.
   Colors: #0a2e3d, #0d1f3c, #0a0a1a, #7dffc3, #c4b5fd,
           #5eead4, #f0abfc, #e0f4f4, #7a9e9e
   Fonts: Outfit 600, Hind 400, IBM Plex Mono 300, Lora italic
   ========================================================== */

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

html {
    scroll-behavior: smooth;
    --scroll-progress: 0;
    --cursor-x: 50%;
    --cursor-y: 50%;
}

body {
    font-family: 'Hind', sans-serif;
    background-color: #0a2e3d;
    color: #e0f4f4;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ---- Living Background Gradient (z-index 0) ---- */
#bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(
        180deg,
        var(--bg-top, #0a2e3d) 0%,
        var(--bg-mid, #0d1f3c) 50%,
        var(--bg-bottom, #0a0a1a) 100%
    );
    transition: background 0.3s ease;
}

/* ---- Cursor Aurora Blooms ---- */
#cursor-aurora {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.aurora-bloom {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    mix-blend-mode: screen;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: left 0.15s ease-out, top 0.15s ease-out;
}

.aurora-green {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #7dffc3 0%, transparent 70%);
    opacity: 0.03;
    left: var(--cursor-x);
    top: var(--cursor-y);
}

.aurora-violet {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
    opacity: 0.02;
    left: var(--cursor-x);
    top: var(--cursor-y);
}

/* ---- Lens Flare System ---- */
#lens-flares {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.lens-flare {
    position: absolute;
    pointer-events: none;
}

.flare-ring {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Zone 0 flares - sunlight */
.flare-surface {
    opacity: var(--flare-surface-opacity, 1);
    transition: opacity 0.5s ease;
}

.flare-s1 {
    top: 5%;
    left: 20%;
}

.flare-s1 .flare-ring:nth-child(1) {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #7dffc3 0%, transparent 70%);
    opacity: 0.08;
    filter: blur(30px);
    animation: flarePulse 6s ease-in-out infinite;
}

.flare-s1 .flare-ring:nth-child(2) {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
    opacity: 0.06;
    filter: blur(20px);
    animation: flarePulse 6s ease-in-out infinite 1s;
}

.flare-s1 .flare-ring:nth-child(3) {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #e0f4f4 0%, transparent 70%);
    opacity: 0.12;
    filter: blur(10px);
    animation: flarePulse 6s ease-in-out infinite 2s;
}

.flare-s2 {
    top: 3%;
    left: 65%;
}

.flare-s2 .flare-ring:nth-child(1) {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
    opacity: 0.06;
    filter: blur(40px);
    animation: flarePulse 8s ease-in-out infinite;
}

.flare-s2 .flare-ring:nth-child(2) {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, #7dffc3 0%, transparent 70%);
    opacity: 0.05;
    filter: blur(25px);
    animation: flarePulse 8s ease-in-out infinite 1.5s;
}

.flare-s2 .flare-ring:nth-child(3) {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #5eead4 0%, transparent 70%);
    opacity: 0.08;
    filter: blur(15px);
    animation: flarePulse 8s ease-in-out infinite 3s;
}

.flare-s2 .flare-ring:nth-child(4) {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #e0f4f4 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(8px);
    animation: flarePulse 8s ease-in-out infinite 4s;
}

.flare-s3 {
    top: 8%;
    left: 42%;
}

.flare-s3 .flare-ring:nth-child(1) {
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, #5eead4 0%, transparent 70%);
    opacity: 0.07;
    filter: blur(25px);
    animation: flarePulse 5s ease-in-out infinite;
}

.flare-s3 .flare-ring:nth-child(2) {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, #7dffc3 0%, transparent 70%);
    opacity: 0.1;
    filter: blur(15px);
    animation: flarePulse 5s ease-in-out infinite 1s;
}

.flare-s3 .flare-ring:nth-child(3) {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #e0f4f4 0%, transparent 70%);
    opacity: 0.12;
    filter: blur(8px);
    animation: flarePulse 5s ease-in-out infinite 2s;
}

/* Zone 3 flares - bioluminescence */
.flare-deep {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.flare-d1 {
    bottom: 25%;
    left: 30%;
    top: auto;
}

.flare-d1 .flare-ring:nth-child(1) {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #f0abfc 0%, transparent 70%);
    opacity: 0.06;
    filter: blur(40px);
    animation: flarePulse 7s ease-in-out infinite;
}

.flare-d1 .flare-ring:nth-child(2) {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
    opacity: 0.05;
    filter: blur(30px);
    animation: flarePulse 7s ease-in-out infinite 1s;
}

.flare-d1 .flare-ring:nth-child(3) {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #7dffc3 0%, transparent 70%);
    opacity: 0.07;
    filter: blur(20px);
    animation: flarePulse 7s ease-in-out infinite 2s;
}

.flare-d1 .flare-ring:nth-child(4) {
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, #5eead4 0%, transparent 70%);
    opacity: 0.1;
    filter: blur(12px);
    animation: flarePulse 7s ease-in-out infinite 3s;
}

.flare-d1 .flare-ring:nth-child(5) {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #e0f4f4 0%, transparent 70%);
    opacity: 0.12;
    filter: blur(6px);
    animation: flarePulse 7s ease-in-out infinite 4s;
}

.flare-d2 {
    bottom: 35%;
    right: 20%;
    top: auto;
}

.flare-d2 .flare-ring:nth-child(1) {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
    opacity: 0.05;
    filter: blur(35px);
    animation: flarePulse 6s ease-in-out infinite;
}

.flare-d2 .flare-ring:nth-child(2) {
    width: 130px;
    height: 130px;
    background: radial-gradient(circle, #f0abfc 0%, transparent 70%);
    opacity: 0.06;
    filter: blur(22px);
    animation: flarePulse 6s ease-in-out infinite 1.5s;
}

.flare-d2 .flare-ring:nth-child(3) {
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, #7dffc3 0%, transparent 70%);
    opacity: 0.09;
    filter: blur(10px);
    animation: flarePulse 6s ease-in-out infinite 3s;
}

@keyframes flarePulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: inherit; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: inherit; }
}

/* ---- Fish Layer (behind content) ---- */
#fish-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.fish {
    position: absolute;
    pointer-events: none;
    will-change: transform;
}

/* ---- Depth Zones ---- */
.depth-zone {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Zone 0: Surface (100vh) */
#zone-0 {
    min-height: 100vh;
    padding: 0 40px;
}

.surface-content {
    text-align: center;
}

#site-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 64px;
    color: #7dffc3;
    letter-spacing: 0.04em;
    line-height: 1.05;
    margin-bottom: 24px;
}

#site-tagline {
    font-family: 'Hind', sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #e0f4f4;
    letter-spacing: 0.02em;
    opacity: 0;
    animation: fadeInTagline 1s ease forwards;
    animation-delay: 1s;
}

@keyframes fadeInTagline {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 0.7; transform: translateY(0); }
}

/* Zone 1: Shallows (120vh) */
#zone-1 {
    min-height: 120vh;
    padding: 80px 40px;
    gap: 60px;
}

.card-z1-a {
    align-self: flex-start;
    margin-left: 8%;
    max-width: 520px;
}

.card-z1-b {
    align-self: flex-end;
    margin-right: 10%;
    max-width: 480px;
}

.card-z1-c {
    align-self: center;
    max-width: 440px;
}

/* Zone 2: Reef (140vh) */
#zone-2 {
    min-height: 140vh;
    padding: 80px 40px;
}

.reef-constellation {
    position: relative;
    width: 100%;
    max-width: 1200px;
    min-height: 120vh;
    display: flex;
    flex-direction: column;
    gap: 60px;
    align-items: center;
}

.reef-node {
    max-width: 500px;
    width: 100%;
}

.reef-node-0 {
    align-self: flex-start;
    transform: translateX(5%) translateY(0);
}

.reef-node-1 {
    align-self: flex-end;
    transform: translateX(-8%) translateY(0);
}

.reef-node-2 {
    align-self: center;
    transform: translateX(15%) translateY(0);
}

.reef-node-3 {
    align-self: flex-start;
    transform: translateX(20%) translateY(0);
}

.reef-node-4 {
    align-self: flex-end;
    transform: translateX(-12%) translateY(0);
}

/* Zone 3: Deep (100vh) */
#zone-3 {
    min-height: 100vh;
    padding: 80px 40px;
    gap: 120px;
}

.card-z3-a {
    align-self: flex-start;
    margin-left: 12%;
    max-width: 560px;
}

.card-z3-b {
    align-self: flex-end;
    margin-right: 8%;
    max-width: 500px;
}

/* Zone 4: Abyss (100vh) */
#zone-4 {
    min-height: 100vh;
    padding: 80px 40px;
}

.abyss-content {
    text-align: center;
    max-width: 600px;
}

.abyss-heading {
    opacity: 0.8;
}

.abyss-text {
    opacity: 0.7;
}

/* ---- Content Cards ---- */
.content-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px 48px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.4s cubic-bezier(0.03, 0.98, 0.52, 0.99);
    /* Concurrent reveal */
    opacity: 0;
    transform: translateY(30px);
}

.content-card.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* ---- Typography ---- */
.heading-primary {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 48px;
    color: #7dffc3;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 20px;
}

.heading-secondary {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 36px;
    color: #c4b5fd;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 16px;
}

.body-text {
    font-family: 'Hind', sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.7;
    color: #e0f4f4;
    letter-spacing: 0.01em;
}

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

.body-text-accent {
    font-family: 'Hind', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.7;
    color: #e0f4f4;
    letter-spacing: 0.01em;
}

.body-text-accent em {
    font-family: 'Lora', serif;
    font-style: italic;
    color: #f0abfc;
}

.data-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 300;
    color: #5eead4;
    opacity: 0.5;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

/* ---- Metric Row ---- */
.metric-row {
    display: flex;
    gap: 48px;
    justify-content: center;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.metric-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 36px;
    font-weight: 400;
    color: #5eead4;
    line-height: 1;
}

.metric-unit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 300;
    color: #7a9e9e;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 8px;
}

/* ---- Code Block ---- */
.code-block {
    background: rgba(13, 31, 60, 0.7);
    border: 1px solid rgba(125, 255, 195, 0.12);
    border-radius: 8px;
    padding: 24px 28px;
    overflow-x: auto;
}

.code-block code {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    line-height: 1.8;
    color: #e0f4f4;
    white-space: pre;
}

.code-keyword { color: #c4b5fd; }
.code-fn { color: #7dffc3; }
.code-name { color: #5eead4; }
.code-comment { color: #7a9e9e; font-style: italic; }

/* ---- Glyph Row ---- */
.glyph-row {
    display: flex;
    gap: 24px;
    margin-top: 32px;
    justify-content: center;
}

.glyph {
    width: 40px;
    height: 40px;
    animation: glyphPulse 3s ease-in-out infinite;
}

.glyph:nth-child(1) { animation-delay: 0s; }
.glyph:nth-child(2) { animation-delay: 0s; }
.glyph:nth-child(3) { animation-delay: 0s; }
.glyph:nth-child(4) { animation-delay: 0s; }

@keyframes glyphPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* ---- Floor ---- */
#floor {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 80px 40px 120px;
}

.floor-domain {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: #7dffc3;
    opacity: 0.4;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.floor-sub {
    font-family: 'Hind', sans-serif;
    font-size: 14px;
    color: #7a9e9e;
    letter-spacing: 0.02em;
    font-style: italic;
}

/* ---- Persistent Watermark ---- */
#watermark {
    position: fixed;
    bottom: 20px;
    right: 24px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 300;
    color: #5eead4;
    opacity: 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

#watermark.visible {
    opacity: 0.3;
}

/* ---- Fish Swim Animation ---- */
@keyframes swimRight {
    from { transform: translateX(-150px) translateY(0); }
    to { transform: translateX(calc(100vw + 150px)) translateY(0); }
}

@keyframes swimLeft {
    from { transform: translateX(calc(100vw + 150px)) scaleX(-1) translateY(0); }
    to { transform: translateX(-150px) scaleX(-1) translateY(0); }
}

@keyframes fishBob {
    0%, 100% { margin-top: 0px; }
    50% { margin-top: -8px; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    #site-title {
        font-size: 40px;
    }

    .heading-primary {
        font-size: 32px;
    }

    .heading-secondary {
        font-size: 26px;
    }

    .content-card {
        padding: 32px 28px;
        max-width: 85vw !important;
    }

    .card-z1-a,
    .card-z1-b,
    .card-z1-c,
    .card-z3-a,
    .card-z3-b {
        align-self: center;
        margin-left: 0;
        margin-right: 0;
    }

    .reef-node-0,
    .reef-node-1,
    .reef-node-2,
    .reef-node-3,
    .reef-node-4 {
        align-self: center;
        transform: none;
    }

    .reef-constellation {
        gap: 40px;
    }

    #zone-1 {
        gap: 40px;
    }

    .metric-row {
        gap: 28px;
    }

    .metric-value {
        font-size: 28px;
    }

    .depth-zone {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .flare-s3 {
        display: none;
    }
}

@media (max-width: 480px) {
    #site-title {
        font-size: 32px;
    }

    .heading-primary {
        font-size: 28px;
    }

    .content-card {
        padding: 24px 20px;
    }

    .metric-row {
        flex-direction: column;
        gap: 20px;
    }
}
