/* simidiots.com - The Aquarium of Idiocy */
/* Palette: Translucent Frost */
/* Fonts: Fraunces, Karla, Caveat */

:root {
    --deep-water: #0a1e2a;
    --deep-water-warm: #2a1e1a;
    --frost-1: #e8f0f5;
    --frost-2: #c9dae8;
    --accent-pink: #e87c9f;
    --accent-amber: #f0a64f;
    --bioluminescence: #6fe8c8;
    --text-primary: #1a3040;
    --text-whisper: #d4e4ef;
    --depth: 0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-water);
    overflow-x: hidden;
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    color: rgba(26, 48, 64, 0.85);
    min-height: 100vh;
    position: relative;
    transition: background-color 0.5s ease;
}

/* Bubble Canvas */
.bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Caustic Light Pattern */
.caustics {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(111, 232, 200, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(111, 232, 200, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(111, 232, 200, 0.05) 0%, transparent 50%);
    background-size: 60% 60%, 70% 70%, 50% 50%;
    animation: caustic1 15s ease-in-out infinite alternate, caustic2 23s ease-in-out infinite alternate-reverse, caustic3 37s ease-in-out infinite alternate;
}

@keyframes caustic1 {
    0% { background-position: 0% 0%, 100% 0%, 50% 100%; }
    100% { background-position: 100% 100%, 0% 100%, 50% 0%; }
}

@keyframes caustic2 {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

@keyframes caustic3 {
    0% { background-size: 60% 60%, 70% 70%, 50% 50%; }
    50% { background-size: 70% 70%, 60% 60%, 60% 60%; }
    100% { background-size: 55% 55%, 75% 75%, 45% 45%; }
}

/* Depth Layers */
.depth-layer {
    position: relative;
    width: 100%;
    min-height: 100vh;
    z-index: 2;
    overflow: visible;
}

.depth-layer + .depth-layer {
    margin-top: -15vh;
}

.depth-layer:nth-child(3) { margin-top: -8vh; }
.depth-layer:nth-child(5) { margin-top: -20vh; }
.depth-layer:nth-child(6) { margin-top: -5vh; }
.depth-layer:nth-child(8) { margin-top: -12vh; }
.depth-layer:nth-child(9) { margin-top: -25vh; }

/* Final layer partially off-screen */
.depth-layer--final {
    padding-right: 0;
    min-height: 80vh;
}

.depth-layer--final .whisper--offscreen {
    position: absolute;
    right: -5vw;
    bottom: 20vh;
    font-family: 'Caveat', cursive;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: rgba(212, 228, 239, 0.35);
    transform: rotate(3deg);
}

/* Frost Panels */
.frost-panel {
    position: relative;
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    background: rgba(232, 240, 245, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: clamp(2rem, 5vw, 5rem);
    max-width: 65ch;
    z-index: 3;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 800ms ease, transform 800ms ease, backdrop-filter 800ms ease;
}

.frost-panel.revealed {
    opacity: 1;
    transform: scale(1);
}

.frost-panel--asymmetric-1 {
    border-radius: 40px 12px 30px 8px;
    margin-left: 7%;
    margin-top: 25vh;
}

.frost-panel--asymmetric-2 {
    border-radius: 8px 35px 12px 40px;
    margin-left: 38%;
    margin-top: 15vh;
}

.frost-panel--asymmetric-3 {
    border-radius: 30px 8px 40px 15px;
    margin-left: 15%;
    margin-top: 18vh;
}

.frost-panel--rotated {
    transform: rotate(2.3deg) scale(0.96);
}

.frost-panel--rotated.revealed {
    transform: rotate(2.3deg) scale(1);
}

.frost-panel--asymmetric-4 {
    border-radius: 12px 40px 8px 35px;
    margin-left: 25%;
    margin-top: 12vh;
}

.frost-panel--asymmetric-5 {
    border-radius: 35px 15px 40px 8px;
    margin-left: 10%;
    margin-top: 20vh;
}

.frost-panel--asymmetric-6 {
    border-radius: 8px 30px 15px 40px;
    margin-left: 7%;
    margin-top: 14vh;
}

.frost-panel--asymmetric-7 {
    border-radius: 40px 8px 30px 20px;
    margin-left: 20%;
    margin-top: 16vh;
}

.frost-panel--asymmetric-8 {
    border-radius: 15px 40px 8px 35px;
    margin-left: 12%;
    margin-top: 18vh;
}

/* Typography */
.drift-text {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-variation-settings: 'SOFT' 100, 'WONK' 1;
    font-optical-sizing: auto;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.04em;
    line-height: 0.92;
    color: rgba(212, 228, 239, 0.75);
    mix-blend-mode: screen;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    filter: blur(8px);
    transition: opacity 1200ms ease, transform 1200ms ease, filter 1200ms ease;
}

.drift-text.revealed {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.drift-text--medium {
    font-size: clamp(2rem, 5vw, 4.5rem);
}

.accent-word {
    font-family: 'Caveat', cursive;
    font-size: 1.3em;
    display: inline-block;
    transform: rotate(-2deg);
    color: rgba(232, 124, 159, 0.7);
}

.body-text {
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    line-height: 1.85;
    letter-spacing: 0.015em;
    color: rgba(212, 228, 239, 0.65);
    text-indent: var(--text-indent, 0);
    max-width: 55ch;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(30px);
    filter: blur(8px);
    transition: opacity 1200ms ease 200ms, transform 1200ms ease 200ms, filter 1200ms ease 200ms;
}

.body-text.revealed {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.body-text--final {
    color: rgba(212, 228, 239, 0.5);
    font-weight: 300;
}

.whisper-note {
    font-family: 'Caveat', cursive;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: rgba(212, 228, 239, 0.4);
    transform: rotate(var(--note-rotate, 0deg));
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 1200ms ease 400ms;
}

.whisper-note.revealed {
    opacity: 1;
}

.marginal-note {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    color: rgba(212, 228, 239, 0.35);
    position: absolute;
    left: var(--note-x, 50%);
    bottom: -2rem;
    transform: rotate(var(--note-rotate, 0deg));
    opacity: 0;
    transition: opacity 1200ms ease 600ms;
}

.marginal-note.revealed {
    opacity: 0.55;
}

/* Detached Word (Disruption 1) */
.detached-word {
    position: absolute;
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-variation-settings: 'SOFT' 100, 'WONK' 1;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: rgba(240, 166, 79, 0.5);
    top: 50%;
    left: -20%;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: screen;
}

.detached-word.drifting {
    animation: wordDrift 8s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
}

@keyframes wordDrift {
    0% {
        left: -10%;
        opacity: 0;
        transform: translateY(0) rotate(-3deg);
    }
    15% {
        opacity: 0.6;
    }
    85% {
        opacity: 0.6;
    }
    100% {
        left: 110%;
        opacity: 0;
        transform: translateY(-30px) rotate(5deg);
    }
}

/* Fish Animations */
.fish {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1200ms ease 400ms;
    will-change: transform;
}

.fish.revealed {
    opacity: 1;
}

.fish--betta {
    width: clamp(120px, 18vw, 250px);
    top: 15%;
    right: 8%;
    animation: fishDrift1 18s ease-in-out infinite, fishRotate1 12s ease-in-out infinite, fishBreathe1 8s ease-in-out infinite;
}

.fish--angel {
    width: clamp(80px, 12vw, 160px);
    top: 10%;
    left: 5%;
    animation: fishDrift2 22s ease-in-out infinite, fishRotate2 10s ease-in-out infinite, fishBreathe2 7s ease-in-out infinite;
}

.fish--clown {
    width: clamp(90px, 14vw, 180px);
    top: 20%;
    right: 12%;
    animation: fishDrift3 16s ease-in-out infinite, fishRotate1 14s ease-in-out infinite, fishBreathe1 9s ease-in-out infinite;
}

.fish--tang {
    width: clamp(100px, 16vw, 200px);
    top: 8%;
    left: 15%;
    animation: fishDrift1 20s ease-in-out infinite, fishRotate2 11s ease-in-out infinite, fishBreathe2 6s ease-in-out infinite;
}

.fish--betta-2 {
    width: clamp(110px, 15vw, 220px);
    top: 12%;
    right: 5%;
    animation: fishDrift2 25s ease-in-out infinite, fishRotate1 13s ease-in-out infinite, fishBreathe1 10s ease-in-out infinite;
}

.fish--angel-2 {
    width: clamp(70px, 10vw, 140px);
    top: 15%;
    left: 10%;
    animation: fishDrift3 19s ease-in-out infinite, fishRotate2 9s ease-in-out infinite, fishBreathe2 8s ease-in-out infinite;
}

.fish--clown-2 {
    width: clamp(80px, 12vw, 160px);
    top: 18%;
    right: 15%;
    animation: fishDrift1 23s ease-in-out infinite, fishRotate1 15s ease-in-out infinite, fishBreathe1 7s ease-in-out infinite;
}

.fish--small-1 {
    width: clamp(40px, 6vw, 80px);
    top: 25%;
    left: 30%;
    animation: fishDrift2 14s ease-in-out infinite, fishRotate2 8s ease-in-out infinite, fishBreathe2 6s ease-in-out infinite;
}

.fish--small-2 {
    width: clamp(35px, 5vw, 70px);
    top: 40%;
    right: 25%;
    animation: fishDrift3 17s ease-in-out infinite, fishRotate1 10s ease-in-out infinite, fishBreathe1 5s ease-in-out infinite;
}

@keyframes fishDrift1 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5vw); }
}

@keyframes fishDrift2 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-4vw); }
}

@keyframes fishDrift3 {
    0%, 100% { transform: translateX(0); }
    33% { transform: translateX(3vw); }
    66% { transform: translateX(-2vw); }
}

@keyframes fishRotate1 {
    0%, 100% { rotate: 0deg; }
    25% { rotate: 4deg; }
    75% { rotate: -3deg; }
}

@keyframes fishRotate2 {
    0%, 100% { rotate: 0deg; }
    25% { rotate: -5deg; }
    75% { rotate: 3deg; }
}

@keyframes fishBreathe1 {
    0%, 100% { scale: 1; }
    50% { scale: 1.04; }
}

@keyframes fishBreathe2 {
    0%, 100% { scale: 1; }
    50% { scale: 0.96; }
}

/* Tilt Disruption (applied via JS) */
.body-tilt {
    transition: transform 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
    transform: rotate(1.5deg);
    transform-origin: center center;
}

.body-tilt-return {
    transition: transform 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
    transform: rotate(0deg);
}

/* Font Glitch Disruption (applied via JS) */
.font-glitch .body-text,
.font-glitch .drift-text {
    font-family: 'Caveat', cursive !important;
    transition: font-family 300ms ease;
}

/* Scroll-linked depth coloring via JS custom property */
body {
    background: linear-gradient(
        180deg,
        var(--deep-water) 0%,
        color-mix(in srgb, var(--deep-water) 85%, var(--deep-water-warm)) 50%,
        color-mix(in srgb, var(--deep-water) 70%, var(--deep-water-warm)) 100%
    );
    background-attachment: fixed;
}

/* Responsive considerations */
@media (max-width: 768px) {
    .frost-panel {
        margin-left: 5% !important;
        margin-right: 5%;
        max-width: 90%;
    }

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

    .fish {
        opacity: 0.6;
    }

    .marginal-note {
        position: relative;
        left: 0;
        bottom: 0;
        display: block;
        margin-top: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fish,
    .caustics,
    .detached-word,
    .frost-panel,
    .drift-text,
    .body-text,
    .whisper-note,
    .marginal-note {
        animation: none !important;
        transition: opacity 200ms ease !important;
        filter: none !important;
        transform: none !important;
    }

    .frost-panel--rotated,
    .frost-panel--rotated.revealed {
        transform: rotate(2.3deg) !important;
    }

    .body-tilt {
        transform: none !important;
    }
}