:root {
    --abyssal-teal: #0D3B3E;
    --burnt-coral: #C95D3A;
    --searing-orange: #E8762B;
    --bleached-sand: #F0DCC0;
    --submerged-slate: #1A2E35;
    --trench-black: #0A1214;
    --phosphor-green: #4ECDC4;
    --spindrift-white: #E8F0ED;
    --zone-twilight: #122428;
    --zone-midnight: #0E1A1E;
    --bg-current: #0D3B3E;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw + 0.4rem, 1.25rem);
    background: var(--trench-black);
    color: var(--bleached-sand);
    line-height: 1.65;
    overflow-x: hidden;
}

main {
    width: 100%;
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(180deg, var(--abyssal-teal) 0%, var(--submerged-slate) 70%, var(--zone-twilight) 100%);
    overflow: hidden;
    padding: 4rem 2rem;
}

/* Hero Blobs */
.hero-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.blob {
    position: absolute;
    will-change: transform, border-radius;
    filter: blur(30px);
}

.blob-1 {
    width: 50vw;
    height: 50vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(ellipse at center, var(--phosphor-green), transparent 70%);
    opacity: 0.2;
    top: 10%;
    left: -10%;
    animation: blob-drift-1 22s ease-in-out infinite;
}

.blob-2 {
    width: 45vw;
    height: 45vw;
    max-width: 450px;
    max-height: 450px;
    background: radial-gradient(ellipse at center, var(--burnt-coral), transparent 70%);
    opacity: 0.18;
    top: 30%;
    right: -5%;
    animation: blob-drift-2 25s ease-in-out infinite;
    animation-delay: -5s;
}

.blob-3 {
    width: 40vw;
    height: 40vw;
    max-width: 400px;
    max-height: 400px;
    background: radial-gradient(ellipse at center, var(--phosphor-green), transparent 70%);
    opacity: 0.15;
    bottom: 5%;
    left: 15%;
    animation: blob-drift-3 18s ease-in-out infinite;
    animation-delay: -10s;
}

.blob-4 {
    width: 55vw;
    height: 55vw;
    max-width: 550px;
    max-height: 550px;
    background: radial-gradient(ellipse at center, var(--searing-orange), transparent 70%);
    opacity: 0.12;
    top: -5%;
    right: 20%;
    animation: blob-drift-4 20s ease-in-out infinite;
    animation-delay: -3s;
}

@keyframes blob-drift-1 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    25% {
        transform: translate(5vw, -3vh) rotate(90deg) scale(1.05);
        border-radius: 50% 50% 30% 70% / 60% 40% 60% 40%;
    }
    50% {
        transform: translate(-3vw, 5vh) rotate(180deg) scale(0.95);
        border-radius: 70% 30% 50% 50% / 40% 70% 30% 60%;
    }
    75% {
        transform: translate(2vw, -2vh) rotate(270deg) scale(1.02);
        border-radius: 40% 60% 60% 40% / 70% 30% 50% 50%;
    }
}

@keyframes blob-drift-2 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%;
    }
    25% {
        transform: translate(-4vw, 2vh) rotate(80deg) scale(0.97);
        border-radius: 40% 60% 50% 50% / 30% 70% 60% 40%;
    }
    50% {
        transform: translate(3vw, -4vh) rotate(160deg) scale(1.04);
        border-radius: 50% 50% 70% 30% / 60% 30% 70% 40%;
    }
    75% {
        transform: translate(-2vw, 3vh) rotate(240deg) scale(0.98);
        border-radius: 70% 30% 40% 60% / 40% 60% 30% 70%;
    }
}

@keyframes blob-drift-3 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        border-radius: 40% 60% 50% 50% / 60% 40% 50% 50%;
    }
    33% {
        transform: translate(4vw, -5vh) rotate(120deg) scale(1.06);
        border-radius: 60% 40% 30% 70% / 40% 60% 70% 30%;
    }
    66% {
        transform: translate(-5vw, 2vh) rotate(240deg) scale(0.94);
        border-radius: 30% 70% 60% 40% / 70% 30% 40% 60%;
    }
}

@keyframes blob-drift-4 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        border-radius: 50% 50% 40% 60% / 40% 60% 50% 50%;
    }
    25% {
        transform: translate(-3vw, 4vh) rotate(70deg) scale(1.03);
        border-radius: 70% 30% 60% 40% / 50% 50% 30% 70%;
    }
    50% {
        transform: translate(5vw, -2vh) rotate(150deg) scale(0.96);
        border-radius: 30% 70% 40% 60% / 60% 40% 70% 30%;
    }
    75% {
        transform: translate(-2vw, -3vh) rotate(230deg) scale(1.01);
        border-radius: 60% 40% 70% 30% / 30% 70% 40% 60%;
    }
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 900px;
    padding-top: 10vh;
}

.hero-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2.5rem, 7vw + 0.5rem, 7rem);
    font-weight: 800;
    color: var(--bleached-sand);
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    line-height: 1;
}

.hero-proclamation {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw + 0.4rem, 1.25rem);
    color: var(--bleached-sand);
    opacity: 0.75;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.65;
}

/* City Silhouette */
.city-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 2;
    pointer-events: none;
}

/* ==========================================
   WAVE DIVIDERS
   ========================================== */
.wave-divider-wrapper {
    position: relative;
    z-index: 5;
    margin-top: -2px;
    margin-bottom: -2px;
    line-height: 0;
}

.wave-divider {
    display: block;
    width: 100%;
    height: 80px;
}

.wave-1 {
    animation: wave-sway-1 8s ease-in-out infinite;
}

.wave-2 {
    animation: wave-sway-2 10s ease-in-out infinite;
}

.wave-3 {
    animation: wave-sway-3 7s ease-in-out infinite;
}

@keyframes wave-sway-1 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-15px); }
}

@keyframes wave-sway-2 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(20px); }
}

@keyframes wave-sway-3 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-10px); }
}

/* ==========================================
   DEPTH ZONES
   ========================================== */
.depth-zone {
    position: relative;
    padding: 6rem 2rem;
    overflow: hidden;
}

.zone-twilight {
    background: linear-gradient(180deg, var(--submerged-slate) 0%, var(--zone-twilight) 100%);
}

.zone-midnight {
    background: linear-gradient(180deg, var(--zone-twilight) 0%, var(--zone-midnight) 100%);
}

.zone-abyssal {
    background: linear-gradient(180deg, var(--zone-midnight) 0%, var(--trench-black) 100%);
}

/* ==========================================
   BIOLUMINESCENT PARTICLES
   ========================================== */
.bioluminescent-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bio-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--phosphor-green);
    opacity: 0;
    animation: bio-pulse var(--pulse-duration, 4s) ease-in-out infinite;
    animation-delay: var(--pulse-delay, 0s);
}

@keyframes bio-pulse {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 0.8; transform: scale(1); }
}

/* ==========================================
   CARD SECTIONS
   ========================================== */
.cards-row {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
    flex-wrap: wrap;
}

.cards-row-2 .card-flip-container {
    flex: 0 1 420px;
}

.cards-row-3 .card-flip-container {
    flex: 0 1 340px;
}

.card-flip-container {
    perspective: 1000px;
    height: 320px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.card-flip-container.visible {
    opacity: 1;
}

.card-flip {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-style: preserve-3d;
    cursor: pointer;
}

.card-flip-container:hover .card-flip,
.card-flip-container.flipped .card-flip {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(10, 18, 20, 0.5);
    overflow: hidden;
}

.card-front {
    background: var(--submerged-slate);
    border: 1px solid rgba(78, 205, 196, 0.15);
}

.card-front h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--spindrift-white);
    position: relative;
    z-index: 2;
}

.card-blob {
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background: radial-gradient(ellipse at center, var(--phosphor-green), transparent 60%);
    opacity: 0.06;
    border-radius: 40% 60% 50% 50% / 50% 40% 60% 50%;
    animation: card-blob-morph 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes card-blob-morph {
    0%, 100% { border-radius: 40% 60% 50% 50% / 50% 40% 60% 50%; transform: rotate(0deg); }
    33% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: rotate(120deg); }
    66% { border-radius: 30% 70% 60% 40% / 40% 70% 30% 60%; transform: rotate(240deg); }
}

.card-back {
    background: var(--abyssal-teal);
    transform: rotateY(180deg);
    border: 1px solid rgba(201, 93, 58, 0.3);
    gap: 1rem;
}

.card-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.95rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--burnt-coral);
}

.card-back p {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--bleached-sand);
}

.card-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.95rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--phosphor-green);
    opacity: 0.7;
}

/* Card rotational offsets */
.card-flip-container[data-tilt="-2"] {
    transform: rotate(-2deg);
}

.card-flip-container[data-tilt="1.5"] {
    transform: rotate(1.5deg);
}

.card-flip-container[data-tilt="2"] {
    transform: rotate(2deg);
}

.card-flip-container[data-tilt="-1"] {
    transform: rotate(-1deg);
}

.card-flip-container[data-tilt="3"] {
    transform: rotate(3deg);
}

.card-flip-container[data-tilt="-2.5"] {
    transform: rotate(-2.5deg);
}

.card-flip-container[data-tilt="1"] {
    transform: rotate(1deg);
}

/* Visible state preserves tilt rotation */
.card-flip-container[data-tilt="-2"].visible {
    transform: rotate(-2deg);
    opacity: 1;
}

.card-flip-container[data-tilt="1.5"].visible {
    transform: rotate(1.5deg);
    opacity: 1;
}

.card-flip-container[data-tilt="2"].visible {
    transform: rotate(2deg);
    opacity: 1;
}

.card-flip-container[data-tilt="-1"].visible {
    transform: rotate(-1deg);
    opacity: 1;
}

.card-flip-container[data-tilt="3"].visible {
    transform: rotate(3deg);
    opacity: 1;
}

.card-flip-container[data-tilt="-2.5"].visible {
    transform: rotate(-2.5deg);
    opacity: 1;
}

.card-flip-container[data-tilt="1"].visible {
    transform: rotate(1deg);
    opacity: 1;
}

/* ==========================================
   SONAR FOOTER
   ========================================== */
.sonar-footer {
    background: var(--trench-black);
    border-top: 1px solid rgba(78, 205, 196, 0.3);
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--phosphor-green);
    opacity: 0.4;
    animation: scanline-sweep 4s linear infinite;
    z-index: 2;
}

@keyframes scanline-sweep {
    0% { top: 0; opacity: 0.4; }
    50% { opacity: 0.2; }
    100% { top: 100%; opacity: 0.4; }
}

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

.sonar-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.sonar-row:last-child {
    margin-bottom: 0;
}

.sonar-data {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.95rem);
    color: var(--phosphor-green);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sonar-timestamp {
    margin-top: 0.5rem;
    opacity: 0.6;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 900px) {
    .cards-row {
        flex-direction: column;
        align-items: center;
    }

    .cards-row-2 .card-flip-container,
    .cards-row-3 .card-flip-container {
        flex: 0 1 auto;
        width: 100%;
        max-width: 420px;
    }

    .card-flip-container {
        height: 280px;
    }

    .sonar-row {
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .hero-section {
        padding: 3rem 1.5rem;
    }

    .hero-content {
        padding-top: 5vh;
    }

    .depth-zone {
        padding: 4rem 1.5rem;
    }

    .card-flip-container {
        height: 260px;
    }

    .card-front h3 {
        font-size: 1.3rem;
    }

    .card-back p {
        font-size: 0.85rem;
    }

    .sonar-row {
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
    }

    .sonar-footer {
        padding: 2rem 1rem;
    }
}
