/* bada.city - Cyberpunk Ocean Metropolis */
/* Colors: #0A0E1A #0F1B2D #00E5CC #FF2D7B #2979FF #D0E8F2 #1B5E20 #FFAB00 */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0A0E1A;
    color: #D0E8F2;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* ===== Scanlines Overlay ===== */
#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,229,204,0.03) 2px,
        rgba(0,229,204,0.03) 3px
    );
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.2s ease;
}

#scanlines.glitch {
    opacity: 1;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,229,204,0.15) 2px,
        rgba(0,229,204,0.15) 3px
    );
    transform: translateX(2px);
}

/* ===== Bioluminescent Glow ===== */
#bio-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.5s ease;
    background:
        conic-gradient(from 0deg at 30% 70%, rgba(0,229,204,0.08) 0deg, transparent 90deg, rgba(41,121,255,0.05) 180deg, transparent 270deg),
        conic-gradient(from 120deg at 70% 40%, rgba(255,45,123,0.04) 0deg, transparent 90deg, rgba(0,229,204,0.06) 180deg, transparent 270deg),
        conic-gradient(from 240deg at 50% 90%, rgba(41,121,255,0.04) 0deg, transparent 120deg, rgba(0,229,204,0.03) 240deg, transparent 360deg);
    animation: bioRotate 30s linear infinite;
}

#bio-glow.visible {
    opacity: 1;
}

@keyframes bioRotate {
    from { filter: hue-rotate(0deg); }
    to { filter: hue-rotate(360deg); }
}

/* ===== Rain Particles ===== */
#rain-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.rain-drop {
    position: absolute;
    width: 2px;
    background: #00E5CC;
    opacity: 0.2;
    animation: rainFall linear infinite;
}

@keyframes rainFall {
    from { transform: translateY(-20px); }
    to { transform: translateY(100vh); }
}

/* ===== Data Streams ===== */
.data-stream {
    position: fixed;
    top: 0;
    width: 40px;
    height: 100%;
    z-index: 60;
    overflow: hidden;
    pointer-events: none;
}

.data-stream-left { left: 0; }
.data-stream-right { right: 0; }

.stream-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: streamScroll 25s linear infinite;
}

.stream-content span {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: #00E5CC;
    opacity: 0.25;
    writing-mode: vertical-rl;
    white-space: nowrap;
}

.data-stream-right .stream-content {
    animation-direction: reverse;
    animation-duration: 30s;
}

.data-stream-right .stream-content span {
    color: #2979FF;
    opacity: 0.2;
}

@keyframes streamScroll {
    from { transform: translateY(-100%); }
    to { transform: translateY(100%); }
}

/* ===== Sonar Navigation ===== */
#sonar-nav {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 80;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0F1B2D;
    border: 2px solid #2979FF;
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-dot.active {
    background: #2979FF;
    animation: sonarPulse 2s ease-in-out infinite;
}

.nav-dot:hover {
    border-color: #00E5CC;
}

@keyframes sonarPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(41,121,255,0.4); }
    50% { box-shadow: 0 0 0 10px rgba(41,121,255,0); }
}

.sonar-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #2979FF;
    opacity: 0;
    pointer-events: none;
}

.nav-dot:hover .sonar-ring {
    animation: sonarPing 1.5s ease-out;
}

.nav-dot:hover .ring-2 {
    animation: sonarPing 1.5s ease-out 0.2s;
}

.nav-dot:hover .ring-3 {
    animation: sonarPing 1.5s ease-out 0.4s;
}

@keyframes sonarPing {
    0% { width: 12px; height: 12px; opacity: 0.4; }
    100% { width: 60px; height: 60px; opacity: 0; }
}

/* ===== Depth Indicator ===== */
#depth-indicator {
    position: fixed;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 80;
}

.depth-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.3rem;
    letter-spacing: 0.15em;
    color: #00E5CC;
    display: block;
    text-shadow: 0 0 10px rgba(0,229,204,0.4);
}

.depth-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: #2979FF;
    opacity: 0.6;
    display: block;
    margin-top: 4px;
}

/* ===== Depth Sections ===== */
.depth-section {
    min-height: 100vh;
    position: relative;
    padding: 100px 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ===== Surface Hero ===== */
#surface {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    background: #0A0E1A;
}

.city-silhouette {
    position: absolute;
    bottom: 40%;
    width: 100%;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.city-silhouette.visible {
    opacity: 1;
}

.water-line {
    position: absolute;
    bottom: 40%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 5%, #00E5CC 25%, #00E5CC 75%, transparent 95%);
    opacity: 0;
    z-index: 6;
    transition: opacity 0.5s ease;
}

.water-line.visible {
    opacity: 0.4;
}

.city-reflection {
    position: absolute;
    top: 60%;
    width: 100%;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.city-reflection.visible {
    opacity: 1;
}

.city-name {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #D0E8F2;
    z-index: 10;
    min-height: 1.2em;
    text-shadow: 0 0 30px rgba(0,229,204,0.3), 0 0 60px rgba(41,121,255,0.15);
}

.city-name span {
    display: inline-block;
}

/* ===== Diagonal Transitions ===== */
.diagonal-transition {
    position: absolute;
    top: -50px;
    left: 0;
    width: 100%;
    height: 100px;
    background: inherit;
    clip-path: polygon(0 0, 100% 50px, 100% 100px, 0 50px);
    z-index: 5;
}

.diagonal-transition.reverse {
    clip-path: polygon(0 50px, 100% 0, 100% 50px, 0 100px);
}

/* ===== Section Content ===== */
.section-content {
    max-width: 700px;
    z-index: 10;
    position: relative;
}

.section-header {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    letter-spacing: 0.08em;
    color: #00E5CC;
    margin-bottom: 28px;
    text-shadow: 0 0 15px rgba(0,229,204,0.3);
}

.section-header span {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, letter-spacing 0.3s ease;
}

.section-header span.revealed {
    opacity: 1;
    transform: translateY(0);
}

.section-content p {
    margin-bottom: 1.2em;
    opacity: 0.85;
}

.section-content p:last-child {
    margin-bottom: 0;
}

/* ===== Progressive Darkening ===== */
#shallows {
    background: #0C1220;
}

#depths {
    background: #080E18;
}

.abyss-section {
    background: #050810;
}

/* ===== Reef Grid ===== */
.reef-grid {
    display: flex;
    gap: 20px;
    margin-top: 48px;
    flex-wrap: wrap;
    z-index: 10;
    position: relative;
}

.reef-card {
    background: rgba(15,27,45,0.85);
    border: 1px solid rgba(0,229,204,0.2);
    padding: 28px;
    width: 240px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.reef-card-1 {
    transform: rotate(2deg);
}

.reef-card-2 {
    transform: rotate(-1.5deg);
    margin-top: -15px;
}

.reef-card-3 {
    transform: rotate(2.5deg);
    margin-top: 20px;
}

.reef-card:hover {
    box-shadow: 0 0 25px rgba(0,229,204,0.25);
    border-color: rgba(0,229,204,0.5);
}

.reef-card h3 {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #00E5CC;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.reef-card p {
    font-size: 0.9rem;
    color: #D0E8F2;
    opacity: 0.65;
    line-height: 1.6;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .depth-section {
        padding: 80px 24px;
    }

    .data-stream {
        display: none;
    }

    #sonar-nav {
        right: 12px;
    }

    #depth-indicator {
        left: 12px;
        top: auto;
        bottom: 20px;
        transform: none;
    }

    .reef-grid {
        flex-direction: column;
    }

    .reef-card {
        width: 100%;
        transform: none;
        margin-top: 0;
    }

    .city-name {
        font-size: clamp(2rem, 10vw, 4rem);
    }
}
