/* ============================================
   mysterious.day - Nocturnal Aquarium Noir
   ============================================ */
:root {
    --abyssal-black: #050508;
    --midnight-hull: #0a0e1a;
    --deep-current: #0d2b3e;
    --electric-seafoam: #00ffcc;
    --discus-gold: #e8c547;
    --betta-crimson: #c4243b;
    --reef-mist: #8fa8b8;
    --deep-slate: #5a6e7a;
    --phantom-violet: #2a1f4e;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    background: var(--abyssal-black);
    color: var(--reef-mist);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* --- Scroll Progress Indicator --- */
.scroll-indicator {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--electric-seafoam);
    opacity: 0.4;
    z-index: 100;
    transition: transform 300ms ease, opacity 300ms ease;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 255, 204, 0.3);
}

/* ==============================
   THE DESCENT
   ============================== */
.descent {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--abyssal-black);
    overflow: hidden;
    z-index: 1;
}

/* Caustic overlay */
.caustic-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    animation: causticRotate 20s linear infinite;
    opacity: 0.8;
}
@keyframes causticRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(2deg); }
}

/* Light shafts */
.light-shaft {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    animation: lightShift 12s ease-in-out infinite alternate;
}
.light-shaft--1 {
    width: 60vw;
    height: 60vw;
    top: -20%;
    left: -10%;
    background: radial-gradient(ellipse at 30% 40%, rgba(13, 43, 62, 0.4) 0%, transparent 60%);
}
.light-shaft--2 {
    width: 50vw;
    height: 50vw;
    bottom: -15%;
    right: -5%;
    background: radial-gradient(ellipse at 60% 70%, rgba(42, 31, 78, 0.3) 0%, transparent 60%);
    animation-delay: -6s;
}
@keyframes lightShift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -20px) scale(1.1); }
}

/* Angelfish silhouette */
.angelfish {
    position: absolute;
    width: 80px;
    height: 100px;
    animation: swimAcross 30s linear infinite;
    opacity: 0.12;
    pointer-events: none;
}
@keyframes swimAcross {
    0% { transform: translateX(-20vw) translateY(0); }
    25% { transform: translateX(25vw) translateY(-30px); }
    50% { transform: translateX(50vw) translateY(0); }
    75% { transform: translateX(75vw) translateY(20px); }
    100% { transform: translateX(120vw) translateY(0); }
}
.angelfish-body {
    position: absolute;
    width: 50px;
    height: 60px;
    top: 20px;
    left: 15px;
    background: var(--deep-current);
    border-radius: 40% 60% 50% 50% / 50% 50% 40% 60%;
}
.angelfish-fin-top {
    position: absolute;
    width: 30px;
    height: 25px;
    top: 0;
    left: 25px;
    background: var(--deep-current);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
.angelfish-fin-bottom {
    position: absolute;
    width: 25px;
    height: 20px;
    bottom: 0;
    left: 27px;
    background: var(--deep-current);
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
}
.angelfish-tail {
    position: absolute;
    width: 20px;
    height: 30px;
    top: 35px;
    left: 0;
    background: var(--deep-current);
    clip-path: polygon(100% 50%, 0% 0%, 0% 100%);
}

/* Descent Typography */
.descent-title {
    font-family: 'Monoton', cursive;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 8rem);
    letter-spacing: 0.15em;
    color: var(--electric-seafoam);
    text-shadow:
        0 0 20px rgba(0, 255, 204, 0.4),
        0 0 60px rgba(0, 255, 204, 0.15),
        0 0 120px rgba(0, 255, 204, 0.05);
    animation: glowPulse 8s ease-in-out infinite;
    position: relative;
    z-index: 2;
    text-align: center;
}
@keyframes glowPulse {
    0%, 100% {
        text-shadow: 0 0 20px rgba(0,255,204,0.4), 0 0 60px rgba(0,255,204,0.15), 0 0 120px rgba(0,255,204,0.05);
    }
    50% {
        text-shadow: 0 0 40px rgba(0,255,204,0.5), 0 0 80px rgba(0,255,204,0.25), 0 0 140px rgba(0,255,204,0.1);
    }
}
.descent-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    color: var(--deep-slate);
    letter-spacing: 0.08em;
    margin-top: 1.5rem;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeInSlow 2s ease-out 1s forwards;
}
@keyframes fadeInSlow {
    to { opacity: 1; }
}

/* ==============================
   GYOTAKU TRANSITION
   ============================== */
.gyotaku-band {
    position: relative;
    width: 100%;
    height: 120px;
    background: var(--midnight-hull);
    overflow: hidden;
}
.gyotaku-band--lower {
    height: 80px;
}
.gyotaku-fish {
    position: absolute;
    opacity: 0.06;
}
.gyotaku-fish--1 {
    width: 200px;
    height: 80px;
    left: 15%;
    top: 20px;
    background: radial-gradient(ellipse at 60% 50%, var(--deep-current) 0%, transparent 70%);
    border-radius: 60% 40% 45% 55% / 50% 50% 50% 50%;
}
.gyotaku-fish--2 {
    width: 120px;
    height: 60px;
    right: 20%;
    top: 30px;
    background: radial-gradient(ellipse at 50% 50%, var(--deep-current) 0%, transparent 65%);
    border-radius: 50% 50% 40% 60% / 50% 50% 50% 50%;
}
.gyotaku-fish--3 {
    width: 160px;
    height: 50px;
    left: 40%;
    top: 15px;
    background: radial-gradient(ellipse at 55% 50%, var(--deep-current) 0%, transparent 60%);
    border-radius: 55% 45% 45% 55% / 45% 55% 45% 55%;
}

/* ==============================
   THE TANK WALL
   ============================== */
.tank-wall {
    position: relative;
    z-index: 1;
    padding: clamp(1rem, 3vw, 3rem);
    background: var(--abyssal-black);
}
.tank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2px;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Tank Card --- */
.tank-card {
    position: relative;
    background: var(--midnight-hull);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid rgba(0, 255, 204, 0.08);
    overflow: hidden;
    transition: transform 400ms ease, box-shadow 400ms ease;
}
.tank-card--tall {
    grid-row: span 2;
}
.tank-card:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.08), inset 0 0 60px rgba(0, 255, 204, 0.03);
}

/* Card noise */
.card-noise {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='64' height='64' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    background-size: 64px 64px;
}

/* Scale header texture */
.scale-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 255, 204, 0.06);
    background-image: repeating-radial-gradient(
        circle at 2px 2px,
        rgba(0, 255, 204, 0.04) 0px,
        rgba(0, 255, 204, 0.04) 1px,
        transparent 1px,
        transparent 4px
    );
    background-size: 8px 8px;
    padding: 0.75rem;
    margin: -0.5rem -0.5rem 1rem;
}

/* Bubble Column */
.bubble-column {
    position: absolute;
    right: 12px;
    bottom: 0;
    width: 20px;
    top: 0;
    pointer-events: none;
}
.bubble-column::before,
.bubble-column::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 255, 204, 0.06);
    animation: rise 8s ease-in infinite;
    animation-delay: var(--bubble-delay, 0s);
}
.bubble-column::before {
    width: 5px;
    height: 5px;
    left: 4px;
    bottom: 0;
}
.bubble-column::after {
    width: 3px;
    height: 3px;
    left: 10px;
    bottom: 0;
    animation-delay: calc(var(--bubble-delay, 0s) + 3s);
    animation-duration: 10s;
}
@keyframes rise {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-300px) translateX(3px); opacity: 0; }
}

/* Card Typography */
.card-title-retro {
    font-family: 'Bungee Shade', cursive;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 2.2rem);
    color: var(--discus-gold);
    letter-spacing: 0.04em;
    line-height: 1.3;
}
.card-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--deep-slate);
    letter-spacing: 0.04em;
    font-style: italic;
    margin-top: 0.25rem;
}
.card-body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    line-height: 1.75;
    color: var(--reef-mist);
    margin-bottom: 1.5rem;
}

/* ==============================
   CSS FISH SPECIMENS
   ============================== */

/* --- Discus --- */
.fish-specimen--discus {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 1rem auto 0;
}
.discus-body {
    width: 100%;
    height: 100%;
    border-radius: 62% 38% 55% 45% / 40% 60% 35% 65%;
    background:
        radial-gradient(circle at 40% 50%, var(--discus-gold) 0%, transparent 50%),
        conic-gradient(from 0deg at 50% 50%, var(--betta-crimson), var(--discus-gold), var(--phantom-violet), var(--discus-gold), var(--betta-crimson));
    mix-blend-mode: screen;
    opacity: 0.8;
    animation: fishIdle 6s ease-in-out infinite;
}
.discus-eye {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--abyssal-black);
    top: 45%;
    left: 65%;
    box-shadow: inset 1px 1px 0 rgba(0, 255, 204, 0.3);
}
@keyframes fishIdle {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(5px) rotate(1deg); }
    75% { transform: translateX(-5px) rotate(-1deg); }
}

/* --- Betta --- */
.fish-specimen--betta {
    position: relative;
    width: 120px;
    height: 80px;
    margin: 1rem auto 0;
}
.betta-body {
    position: absolute;
    width: 40px;
    height: 30px;
    left: 40px;
    top: 25px;
    background: var(--betta-crimson);
    border-radius: 50% 50% 40% 60% / 50% 50% 40% 60%;
    z-index: 2;
}
.betta-fin {
    position: absolute;
    mix-blend-mode: screen;
    opacity: 0.6;
    animation: sway 6s ease-in-out infinite;
}
.betta-fin--1 {
    width: 50px;
    height: 40px;
    left: 10px;
    top: 10px;
    background: radial-gradient(ellipse at 70% 50%, var(--betta-crimson) 0%, var(--phantom-violet) 80%);
    clip-path: polygon(100% 50%, 0% 0%, 20% 100%);
    animation-delay: -1s;
}
.betta-fin--2 {
    width: 45px;
    height: 35px;
    left: 15px;
    top: 35px;
    background: radial-gradient(ellipse at 60% 30%, var(--betta-crimson) 0%, rgba(42, 31, 78, 0.6) 80%);
    clip-path: polygon(100% 30%, 0% 0%, 10% 100%);
    animation-delay: -2.5s;
}
.betta-fin--3 {
    width: 35px;
    height: 50px;
    right: 10px;
    top: 15px;
    background: radial-gradient(ellipse at 30% 50%, var(--betta-crimson) 0%, var(--phantom-violet) 70%);
    clip-path: polygon(0% 50%, 100% 0%, 80% 100%);
    animation-delay: -0.5s;
}
@keyframes sway {
    0%, 100% { transform: rotate(0deg) scaleX(1); }
    25% { transform: rotate(3deg) scaleX(0.95); }
    75% { transform: rotate(-3deg) scaleX(1.05); }
}

/* --- Neon Tetra --- */
.tetra-school {
    position: relative;
    height: 40px;
    margin-top: 1rem;
}
.tetra-school--large {
    height: 60px;
}
.neon-tetra {
    position: absolute;
    width: 24px;
    height: 8px;
    border-radius: 12px 8px 8px 12px / 50%;
    background: linear-gradient(90deg, var(--deep-slate) 0%, var(--electric-seafoam) 30%, var(--electric-seafoam) 60%, var(--betta-crimson) 90%);
    animation: schoolSwim 8s ease-in-out infinite;
    opacity: 0.9;
}
.neon-tetra--1 { left: 10%; top: 20%; animation-delay: 0s; }
.neon-tetra--2 { left: 25%; top: 50%; animation-delay: -1.5s; }
.neon-tetra--3 { left: 45%; top: 30%; animation-delay: -3s; }
.neon-tetra--4 { left: 60%; top: 60%; animation-delay: -4.5s; }
.neon-tetra--5 { left: 75%; top: 40%; animation-delay: -6s; }
@keyframes schoolSwim {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(10px) translateY(-3px); }
    50% { transform: translateX(20px) translateY(0); }
    75% { transform: translateX(10px) translateY(3px); }
}

/* --- Angelfish Card --- */
.fish-specimen--angel {
    position: relative;
    width: 80px;
    height: 120px;
    margin: 1rem auto 0;
}
.angel-body {
    position: absolute;
    width: 60px;
    height: 70px;
    left: 10px;
    top: 25px;
    background: linear-gradient(90deg, var(--reef-mist) 0%, var(--deep-slate) 100%);
    border-radius: 45% 55% 50% 50% / 50% 50% 45% 55%;
    opacity: 0.7;
}
.angel-stripe {
    position: absolute;
    width: 4px;
    background: var(--midnight-hull);
    border-radius: 2px;
    opacity: 0.6;
}
.angel-stripe--1 { height: 50px; left: 28px; top: 35px; }
.angel-stripe--2 { height: 45px; left: 40px; top: 37px; }
.angel-stripe--3 { height: 40px; left: 52px; top: 40px; }
.angel-fin-top {
    position: absolute;
    width: 30px;
    height: 30px;
    left: 25px;
    top: 0;
    background: var(--reef-mist);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    opacity: 0.5;
}
.angel-fin-bottom {
    position: absolute;
    width: 25px;
    height: 25px;
    left: 27px;
    bottom: 0;
    background: var(--reef-mist);
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
    opacity: 0.5;
}

/* ==============================
   THE ABYSS
   ============================== */
.abyss {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--midnight-hull) 0%, var(--abyssal-black) 40%);
    z-index: 1;
}
.abyss-text {
    font-family: 'Monoton', cursive;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 3rem);
    letter-spacing: 0.15em;
    color: var(--electric-seafoam);
    text-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
    opacity: 0;
    transition: opacity 800ms ease;
}
.abyss-text.visible {
    animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ==============================
   REVEAL ANIMATION
   ============================== */
[data-reveal] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    .tank-grid {
        grid-template-columns: 1fr;
    }
    .tank-card--tall {
        grid-row: span 1;
    }
    .scroll-indicator {
        top: 12px;
        right: 12px;
        width: 10px;
        height: 10px;
    }
    .angelfish {
        display: none;
    }
}
@media (min-width: 769px) and (max-width: 1200px) {
    .tank-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
