/* ============================================
   gabs.games - Aquarium Lounge Styles
   ============================================ */

/* ---- CSS Custom Properties ---- */
:root {
    --abyss-black: #0A0812;
    --oxblood-leather: #2D0F1A;
    --electric-fuchsia: #FF2D7B;
    --bioluminescent-cyan: #00F5D4;
    --molten-gold: #FFB800;
    --parchment-cream: #F2E8D5;
    --deep-teal: #062A2D;
    --neon-aquamarine: #0DFFC2;
    --burnished-umber: #5C2A1E;
    --dark-amber: #0F0A06;
    --mid-teal: #0A3D3F;
}

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

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

body {
    background-color: var(--abyss-black);
    color: var(--parchment-cream);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography ---- */
.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.02em;
    color: var(--parchment-cream);
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 3vw, 2.4rem);
    color: var(--parchment-cream);
    text-align: center;
    margin-top: 0.5em;
    opacity: 0.85;
    position: relative;
    z-index: 2;
}

.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.02em;
    color: var(--parchment-cream);
    margin-bottom: 1.2em;
}

.panel-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: -0.01em;
    color: var(--parchment-cream);
    margin-bottom: 0.8em;
}

.body-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    color: var(--parchment-cream);
    margin-bottom: 1.2em;
}

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

.deep-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    color: var(--parchment-cream);
    text-align: center;
    line-height: 1.4;
}

.golden-heading {
    color: var(--molten-gold);
    text-shadow: 0 0 20px rgba(255, 184, 0, 0.4), 0 0 60px rgba(255, 184, 0, 0.15);
}

.surface-wordmark {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 2rem;
    letter-spacing: -0.02em;
    color: var(--parchment-cream);
    text-align: center;
}

/* ---- Neon Glow Effects ---- */
.neon-glow {
    text-shadow:
        0 0 20px #FF2D7B,
        0 0 60px rgba(255, 45, 123, 0.33),
        0 0 120px rgba(255, 45, 123, 0.13);
    animation: neonPulse 4s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow:
            0 0 20px #FF2D7B,
            0 0 60px rgba(255, 45, 123, 0.33),
            0 0 120px rgba(255, 45, 123, 0.13);
    }
    50% {
        text-shadow:
            0 0 16px rgba(255, 45, 123, 0.8),
            0 0 48px rgba(255, 45, 123, 0.26),
            0 0 96px rgba(255, 45, 123, 0.1);
    }
}

.neon-glow-fade {
    text-shadow:
        0 0 12px rgba(255, 45, 123, 0.5),
        0 0 36px rgba(255, 45, 123, 0.2);
    animation: neonFade 4s ease-in-out infinite;
}

@keyframes neonFade {
    0%, 100% {
        text-shadow:
            0 0 12px rgba(255, 45, 123, 0.5),
            0 0 36px rgba(255, 45, 123, 0.2);
    }
    50% {
        text-shadow:
            0 0 8px rgba(255, 45, 123, 0.3),
            0 0 24px rgba(255, 45, 123, 0.1);
    }
}

/* ---- Scene Base ---- */
.scene {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ---- Water Caustic Overlay ---- */
#caustic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
}

#caustic-overlay svg {
    width: 100%;
    height: 100%;
}

/* ---- Bubble Particles ---- */
#bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: var(--bioluminescent-cyan);
    animation: bubbleRise linear infinite;
    pointer-events: none;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-110vh) translateX(var(--bubble-drift));
        opacity: 0;
    }
}

/* ---- Foreground Fish Layer ---- */
#foreground-fish-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 998;
}

/* ---- Section Indicator ---- */
#section-indicator {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.indicator-fish {
    color: rgba(242, 232, 213, 0.2);
    transition: color 600ms ease-out, filter 600ms ease-out;
    cursor: pointer;
}

.indicator-fish.active {
    color: var(--bioluminescent-cyan);
    filter: drop-shadow(0 0 6px rgba(0, 245, 212, 0.6));
}

/* ---- Water Current Backgrounds ---- */
.water-current {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(170deg, #062A2D 0%, #0A3D3F 40%, #0DFFC2 100%);
    opacity: 0.12;
    animation: waterFlow 25s ease-in-out infinite alternate;
    z-index: 0;
}

.water-current-visible {
    opacity: 0.2;
}

.water-current-deep {
    opacity: 0.25;
    animation: waterFlowDeep 20s ease-in-out infinite alternate;
}

@keyframes waterFlow {
    0% {
        transform: translateX(0) translateY(0);
    }
    100% {
        transform: translateX(-30%) translateY(-5%);
    }
}

@keyframes waterFlowDeep {
    0% {
        transform: translateX(-10%) translateY(0) rotate(-2deg);
    }
    100% {
        transform: translateX(-40%) translateY(-3%) rotate(2deg);
    }
}

/* ---- Wave Dividers ---- */
.wave-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 5;
}

/* ---- Zoom Focus Animation ---- */
.zoom-focus {
    transform: scale(0.82);
    opacity: 0.6;
    transition: transform 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 400ms ease-out;
}

.zoom-focus.in-view {
    transform: scale(1) !important;
    opacity: 1 !important;
}

.zoom-focus-slow {
    transform: scale(0.6);
    opacity: 0.5;
    transition: transform 2000ms cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 1500ms ease-out;
}

.zoom-focus-slow.in-view {
    transform: scale(1);
    opacity: 1;
}

/* ============================================
   SCENE 1: THE AQUARIUM WALL
   ============================================ */
#scene-aquarium {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--abyss-black);
}

.aquarium-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.aquarium-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}

/* Hero Angelfish */
.hero-angelfish {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.35;
    animation: angelfishDrift 30s ease-in-out infinite;
}

@keyframes angelfishDrift {
    0% {
        transform: translate(-50%, -50%) rotate(-2deg) scale(1);
    }
    25% {
        transform: translate(-45%, -48%) rotate(1deg) scale(1.02);
    }
    50% {
        transform: translate(-52%, -52%) rotate(2deg) scale(0.98);
    }
    75% {
        transform: translate(-48%, -50%) rotate(-1deg) scale(1.01);
    }
    100% {
        transform: translate(-50%, -50%) rotate(-2deg) scale(1);
    }
}

/* Neon Tetra positioning and animation */
.neon-tetra {
    position: absolute;
    z-index: 2;
}

.tetra-1 { top: 15%; animation: tetraSwim1 22s linear infinite; }
.tetra-2 { top: 25%; animation: tetraSwim2 18s linear infinite; animation-delay: -3s; }
.tetra-3 { top: 35%; animation: tetraSwim3 25s linear infinite; animation-delay: -7s; }
.tetra-4 { top: 45%; animation: tetraSwim1 20s linear infinite; animation-delay: -11s; }
.tetra-5 { top: 55%; animation: tetraSwim2 28s linear infinite; animation-delay: -2s; }
.tetra-6 { top: 65%; animation: tetraSwim3 19s linear infinite; animation-delay: -14s; }
.tetra-7 { top: 20%; animation: tetraSwim1 24s linear infinite; animation-delay: -5s; }
.tetra-8 { top: 30%; animation: tetraSwim2 21s linear infinite; animation-delay: -9s; }
.tetra-9 { top: 40%; animation: tetraSwim3 26s linear infinite; animation-delay: -1s; }
.tetra-10 { top: 50%; animation: tetraSwim1 17s linear infinite; animation-delay: -13s; }
.tetra-11 { top: 60%; animation: tetraSwim2 23s linear infinite; animation-delay: -6s; }
.tetra-12 { top: 70%; animation: tetraSwim3 20s linear infinite; animation-delay: -10s; }
.tetra-13 { top: 18%; animation: tetraSwim1 27s linear infinite; animation-delay: -4s; }
.tetra-14 { top: 75%; animation: tetraSwim2 22s linear infinite; animation-delay: -8s; }
.tetra-15 { top: 80%; animation: tetraSwim3 19s linear infinite; animation-delay: -12s; }
.tetra-16 { top: 22%; animation: tetraSwim1 24s linear infinite; animation-delay: -15s; }
.tetra-17 { top: 85%; animation: tetraSwim2 21s linear infinite; animation-delay: -2s; }
.tetra-18 { top: 12%; animation: tetraSwim3 26s linear infinite; animation-delay: -7s; }
.tetra-19 { top: 48%; animation: tetraSwim1 18s linear infinite; animation-delay: -11s; }
.tetra-20 { top: 68%; animation: tetraSwim2 23s linear infinite; animation-delay: -4s; }

@keyframes tetraSwim1 {
    0% {
        left: -5%;
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-30px) rotate(2deg);
    }
    50% {
        transform: translateY(20px) rotate(-1deg);
    }
    75% {
        transform: translateY(-40px) rotate(3deg);
    }
    100% {
        left: 105%;
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes tetraSwim2 {
    0% {
        left: 105%;
        transform: translateY(0) rotate(180deg) scaleY(-1);
    }
    25% {
        transform: translateY(25px) rotate(182deg) scaleY(-1);
    }
    50% {
        transform: translateY(-35px) rotate(178deg) scaleY(-1);
    }
    75% {
        transform: translateY(15px) rotate(183deg) scaleY(-1);
    }
    100% {
        left: -5%;
        transform: translateY(0) rotate(180deg) scaleY(-1);
    }
}

@keyframes tetraSwim3 {
    0% {
        left: -8%;
        transform: translateY(0) rotate(1deg);
    }
    20% {
        transform: translateY(-50px) rotate(-2deg);
    }
    40% {
        transform: translateY(30px) rotate(2deg);
    }
    60% {
        transform: translateY(-20px) rotate(-3deg);
    }
    80% {
        transform: translateY(40px) rotate(1deg);
    }
    100% {
        left: 108%;
        transform: translateY(0) rotate(1deg);
    }
}

/* Scroll Indicator */
.scroll-indicator {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: scrollBounce 2.5s ease-in-out infinite;
    position: relative;
    z-index: 10;
}

.scroll-tetra {
    transform: rotate(90deg);
    opacity: 0.7;
}

.scroll-tetra-2 {
    opacity: 0.4;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(12px);
        opacity: 0.6;
    }
}

/* ============================================
   SCENE 2: THE LEATHER LOUNGE
   ============================================ */
#scene-lounge {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10vh 0;
    background: var(--abyss-black);
    position: relative;
}

.betta-background {
    position: absolute;
    top: 50%;
    right: -5%;
    transform: translateY(-50%);
    z-index: 1;
    opacity: 0.15;
    animation: bettaDrift 35s ease-in-out infinite;
}

@keyframes bettaDrift {
    0% {
        transform: translateY(-50%) translateX(0) rotate(0deg);
    }
    25% {
        transform: translateY(-48%) translateX(-20px) rotate(2deg);
    }
    50% {
        transform: translateY(-52%) translateX(15px) rotate(-1deg);
    }
    75% {
        transform: translateY(-49%) translateX(-10px) rotate(1.5deg);
    }
    100% {
        transform: translateY(-50%) translateX(0) rotate(0deg);
    }
}

/* ---- Leather Panel Base ---- */
.leather-panel {
    position: relative;
    background-color: var(--oxblood-leather);
    border-radius: 12px;
    border: 1px solid var(--burnished-umber);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 5;
    transition: box-shadow 600ms ease-out;
}

.leather-panel:hover {
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.28);
}

.leather-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='10' cy='10' r='0.8' fill='%235C2A1E' opacity='0.5'/%3E%3Ccircle cx='30' cy='5' r='0.6' fill='%235C2A1E' opacity='0.4'/%3E%3Ccircle cx='50' cy='15' r='0.7' fill='%235C2A1E' opacity='0.45'/%3E%3Ccircle cx='5' cy='30' r='0.5' fill='%235C2A1E' opacity='0.35'/%3E%3Ccircle cx='25' cy='25' r='0.9' fill='%235C2A1E' opacity='0.5'/%3E%3Ccircle cx='45' cy='35' r='0.6' fill='%235C2A1E' opacity='0.4'/%3E%3Ccircle cx='15' cy='45' r='0.7' fill='%235C2A1E' opacity='0.45'/%3E%3Ccircle cx='35' cy='50' r='0.5' fill='%235C2A1E' opacity='0.35'/%3E%3Ccircle cx='55' cy='55' r='0.8' fill='%235C2A1E' opacity='0.5'/%3E%3Ccircle cx='20' cy='58' r='0.6' fill='%235C2A1E' opacity='0.3'/%3E%3Cpath d='M0 20 Q15 18 30 20 Q45 22 60 20' stroke='%235C2A1E' stroke-width='0.3' fill='none' opacity='0.25'/%3E%3Cpath d='M0 40 Q15 42 30 40 Q45 38 60 40' stroke='%235C2A1E' stroke-width='0.3' fill='none' opacity='0.2'/%3E%3C/svg%3E") repeat;
    opacity: 0.08;
    pointer-events: none;
    transition: opacity 600ms ease-out;
    z-index: 0;
}

.leather-panel:hover .leather-texture {
    opacity: 0.14;
}

.panel-content {
    position: relative;
    z-index: 1;
    padding: clamp(2rem, 4vw, 3.5rem);
}

/* Lounge Panel */
.lounge-panel {
    margin-left: 40px;
    max-width: 680px;
    width: 85%;
}

@media (min-width: 768px) {
    .lounge-panel {
        margin-left: 8%;
        width: 60%;
        max-width: 720px;
    }
}

/* ============================================
   SCENE 3: THE IRIDESCENT GALLERY
   ============================================ */
.scene-gallery {
    min-height: 120vh;
    padding: 10vh 0 15vh;
    background: var(--abyss-black);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5vh;
    position: relative;
}

@media (min-width: 900px) {
    .scene-gallery {
        display: block;
        padding: 10vh 0 15vh;
    }
}

.gallery-panel {
    max-width: 440px;
    width: 80%;
}

.panel-fish-decoration {
    float: right;
    margin: 0 0 10px 15px;
}

.discus-medallion {
    animation: discusSpin 40s linear infinite;
}

@keyframes discusSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tetra-school-decoration {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    opacity: 0.7;
}

/* Gallery panel positioning (desktop) */
@media (min-width: 900px) {
    .gallery-panel-1 {
        position: absolute;
        top: 8vh;
        left: 8%;
    }

    .gallery-panel-2 {
        position: absolute;
        top: 45vh;
        left: 50%;
        transform: translateX(-50%) rotate(2deg) !important;
    }

    .gallery-panel-2.in-view {
        transform: translateX(-50%) rotate(0deg) scale(1) !important;
    }

    .gallery-panel-3 {
        position: absolute;
        top: 18vh;
        right: 6%;
        left: auto;
    }

    .gallery-panel-4 {
        position: absolute;
        top: 78vh;
        left: 12%;
    }
}

/* Mobile stacking */
@media (max-width: 899px) {
    .gallery-panel {
        margin: 0 auto;
    }
}

/* ============================================
   SCENE 4: THE DEEP CURRENT
   ============================================ */
.scene-deep {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--abyss-black);
    position: relative;
}

.deep-phrase {
    position: relative;
    z-index: 10;
    max-width: 700px;
    padding: 0 30px;
}

/* Deep tetra fish */
.deep-tetra {
    position: absolute;
    z-index: 3;
}

.deep-tetra-1 { top: 20%; animation: tetraSwim1 30s linear infinite; }
.deep-tetra-2 { top: 35%; animation: tetraSwim2 26s linear infinite; animation-delay: -5s; }
.deep-tetra-3 { top: 50%; animation: tetraSwim3 32s linear infinite; animation-delay: -10s; }
.deep-tetra-4 { top: 65%; animation: tetraSwim1 28s linear infinite; animation-delay: -15s; }
.deep-tetra-5 { top: 25%; animation: tetraSwim2 24s linear infinite; animation-delay: -3s; }
.deep-tetra-6 { top: 45%; animation: tetraSwim3 29s linear infinite; animation-delay: -8s; }
.deep-tetra-7 { top: 75%; animation: tetraSwim1 33s linear infinite; animation-delay: -12s; }
.deep-tetra-8 { top: 80%; animation: tetraSwim2 27s linear infinite; animation-delay: -18s; }

/* ============================================
   SCENE 5: THE GOLDEN CHAMBER
   ============================================ */
.scene-golden {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-amber);
    position: relative;
    padding: 10vh 0;
}

.golden-panel {
    max-width: 700px;
    width: 85%;
    border-color: var(--molten-gold);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 184, 0, 0.08);
}

@media (min-width: 768px) {
    .golden-panel {
        margin-left: 15%;
        width: 55%;
    }
}

.discus-decoration {
    position: absolute;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    opacity: 0.5;
}

.fish-rotate {
    animation: discusRotate 50s linear infinite;
}

@keyframes discusRotate {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

@media (max-width: 899px) {
    .discus-decoration {
        width: 160px;
        height: 160px;
        right: 5%;
        opacity: 0.3;
    }
}

/* ============================================
   SCENE 6: THE SURFACE
   ============================================ */
.scene-surface {
    height: 40vh;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.surface-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--abyss-black) 0%, var(--deep-teal) 100%);
    z-index: 0;
}

.surface-content {
    position: relative;
    z-index: 10;
}

/* ============================================
   FISH SWIM BASE ANIMATION (override per-fish)
   ============================================ */
.fish-swim {
    will-change: transform;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 600px) {
    #section-indicator {
        bottom: 15px;
        right: 15px;
    }

    .indicator-fish svg {
        width: 18px;
        height: 12px;
    }

    .hero-angelfish {
        width: 250px;
        height: 333px;
    }

    .betta-background {
        width: 350px;
        height: 280px;
    }
}

/* ============================================
   SURFACE BUBBLE INTENSITY ZONE
   ============================================ */
.scene-surface .bubble {
    animation-duration: calc(var(--bubble-speed) * 0.5) !important;
}
