/* ====================================
   LLITTL.com - Deep Sea Aquarium
   Color Palette:
   - Void/Primary BG: #0a0a0f
   - Secondary Surface: #141419
   - Subtle Dividers: #1e1e26
   - Body Text: #9898a8
   - Headline Text: #e8e8f0
   - Pure Accent: #ffffff
   - Bioluminescent Glow: #88ccdd (fish only)
   - Annotation Ink: #7a7a6e (Caveat only)

   Fonts:
   - Space Grotesk (display/headlines)
   - IBM Plex Mono (body/nav)
   - Caveat (annotations)
   ==================================== */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    --scroll-progress: 0;
    --letter-expand: -0.02em;
}

body {
    background: #0a0a0f;
    background: radial-gradient(ellipse at 50% 30%, #141419 0%, #0a0a0f 70%);
    color: #9898a8;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Current Lines (background water movement) --- */
.current-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.current-line {
    position: absolute;
    width: 200%;
    height: 20px;
    opacity: 0.4;
}

.current-line-1 {
    top: 25%;
    animation: currentDrift 60s linear infinite;
}

.current-line-2 {
    top: 55%;
    animation: currentDrift 60s linear infinite reverse;
    animation-delay: -15s;
}

.current-line-3 {
    top: 80%;
    animation: currentDrift 60s linear infinite;
    animation-delay: -30s;
}

@keyframes currentDrift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Bubbles --- */
.bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -20px;
    width: 5px;
    height: 5px;
    border: 1px solid #1e1e26;
    border-radius: 50%;
    opacity: 0;
    animation: bubbleRise linear infinite;
}

.bubble-sm {
    width: 3px;
    height: 3px;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    10% {
        opacity: 0.3;
    }
    50% {
        transform: translateY(-50vh) translateX(10px);
        opacity: 0.2;
    }
    100% {
        transform: translateY(-100vh) translateX(-5px);
        opacity: 0;
    }
}

/* --- Fish SVG Draw-on Animation --- */
.fish-draw-on .fish-path {
    stroke-dasharray: var(--path-length, 1000);
    stroke-dashoffset: var(--path-length, 1000);
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fish-draw-on.revealed .fish-path {
    stroke-dashoffset: 0;
}

.fish-glow {
    filter: drop-shadow(0 0 4px rgba(136, 204, 221, 0.3));
}

.fish-draw-on.revealed .fish-glow {
    filter: drop-shadow(0 0 8px rgba(136, 204, 221, 0.4));
}

/* --- ACT I --- */
.act-i {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 8vw;
    background: transparent;
}

.act-i-content {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.betta-container {
    width: min(600px, 80vw);
    margin-bottom: 4vh;
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 1.5s ease, transform 2s ease;
}

.betta-container.revealed {
    opacity: 1;
    transform: translateX(0);
}

.betta-fish {
    width: 100%;
    height: auto;
}

/* Title: LLITTL */
.title-llittl {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 8rem);
    color: #e8e8f0;
    letter-spacing: var(--letter-expand, -0.02em);
    line-height: 1.0;
    text-align: center;
    display: flex;
    gap: 0.02em;
    font-feature-settings: 'salt' on, 'ss01' on;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px) scale(0.8);
    animation: letterSpring 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-play-state: paused;
}

.title-active .letter {
    animation-play-state: running;
}

@keyframes letterSpring {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateY(-8px) scale(1.05);
    }
    80% {
        transform: translateY(3px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- ACT II --- */
.act-ii {
    min-height: 200vh;
    padding: 15vh 8vw;
    position: relative;
}

.panel {
    position: relative;
    margin-bottom: 15vh;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.panel.revealed {
    opacity: 1;
    transform: translateY(0);
}

.panel-inner {
    position: relative;
}

.panel-left {
    width: 70%;
    margin-right: auto;
}

.panel-right {
    width: 65%;
    margin-left: auto;
}

.panel-center {
    width: 60%;
    margin: 0 auto;
}

.panel-left + .rule + .panel-right {
    margin-top: -5%;
}

.panel .fish-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.panel-right .fish-svg {
    margin-left: auto;
    display: block;
}

.panel-center .fish-svg {
    margin: 0 auto;
    display: block;
}

/* Annotations */
.annotation {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 16px;
    color: #7a7a6e;
    display: block;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.6s ease 0.8s;
}

.panel.revealed .annotation {
    opacity: 1;
}

/* Rules/Dividers */
.rule {
    width: 100%;
    height: 1px;
    background: #1e1e26;
    margin: 5vh 0;
}

/* --- ACT III --- */
.act-iii {
    min-height: 200vh;
    padding: 15vh 8vw;
    position: relative;
}

.act-iii-content {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

/* Seahorse margin ornaments */
.seahorse-margin {
    position: absolute;
    left: -80px;
    top: 0;
    height: 100%;
    width: 60px;
    display: flex;
    flex-direction: column;
    gap: 35vh;
    padding-top: 10vh;
}

.seahorse {
    width: 60px;
    height: auto;
    opacity: 0.6;
}

/* Kinetic text */
.kinetic-text-block {
    margin-bottom: 20vh;
    position: relative;
}

.kinetic-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    color: #e8e8f0;
    line-height: 1.2;
    letter-spacing: var(--letter-expand, -0.02em);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease, font-size 0.3s ease, letter-spacing 0.3s ease, line-height 0.3s ease;
    font-size: clamp(2rem, 8vw, 8vw);
}

.kinetic-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Progressive size reduction through Act III */
.kinetic-1 { font-size: clamp(2.5rem, 8vw, 8vw); }
.kinetic-2 { font-size: clamp(2.2rem, 7vw, 7vw); }
.kinetic-3 { font-size: clamp(2rem, 6vw, 6vw); }
.kinetic-4 { font-size: clamp(1.8rem, 5vw, 5vw); }
.kinetic-5 { font-size: clamp(1.5rem, 4vw, 4vw); }
.kinetic-6 { font-size: clamp(1.3rem, 3vw, 3vw); }
.kinetic-7 { font-size: clamp(1.1rem, 2.5vw, 2.5vw); font-weight: 400; }

/* Parallax fish between text */
.parallax-fish {
    position: relative;
    width: 120px;
    height: 60px;
    margin: 5vh 0;
}

.parallax-fish-1 {
    margin-left: 60%;
}

.parallax-fish-2 {
    margin-left: 20%;
}

.parallax-fish-3 {
    margin-left: 75%;
}

.parallax-fish .fish-svg {
    width: 100%;
    height: auto;
}

/* --- ACT IV --- */
.act-iv {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15vh 8vw 10vh;
}

.act-iv-content {
    position: relative;
    width: 100%;
}

/* Coral reef */
.coral-reef {
    width: 100%;
    margin-bottom: 8vh;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.coral-reef.revealed {
    opacity: 1;
}

.coral-svg {
    width: 100%;
    height: auto;
    max-height: 250px;
}

/* Navigation links */
.act-iv-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.3s, transform 1s ease 0.3s;
}

.act-iv-nav.revealed {
    opacity: 1;
    transform: translateY(0);
}

.nav-link-wrapper {
    position: relative;
}

.nav-link {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    color: #9898a8;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    color: #e8e8f0;
}

/* Clownfish pair hover decoration */
.clownfish-pair {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.clownfish {
    width: 28px;
    height: auto;
}

.clownfish-2 {
    width: 22px;
    margin-top: 3px;
}

.nav-link:hover .clownfish-pair {
    opacity: 1;
    transform: translateX(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .act-ii {
        padding: 10vh 6vw;
    }

    .panel-left,
    .panel-right,
    .panel-center {
        width: 90%;
        margin: 0 auto 12vh;
    }

    .seahorse-margin {
        display: none;
    }

    .act-iii {
        padding: 10vh 6vw;
    }

    .act-iii-content {
        max-width: 100%;
    }

    .kinetic-text-block {
        margin-bottom: 15vh;
    }

    .parallax-fish-1,
    .parallax-fish-2,
    .parallax-fish-3 {
        margin-left: auto;
        margin-right: auto;
    }

    .title-llittl {
        font-size: clamp(2.5rem, 14vw, 6rem);
    }

    .betta-container {
        width: 90vw;
    }

    .act-iv {
        padding: 10vh 6vw 8vh;
    }
}

@media (max-width: 480px) {
    .kinetic-1 { font-size: clamp(2rem, 10vw, 10vw); }
    .kinetic-2 { font-size: clamp(1.8rem, 9vw, 9vw); }
    .kinetic-3 { font-size: clamp(1.6rem, 8vw, 8vw); }
    .kinetic-4 { font-size: clamp(1.4rem, 7vw, 7vw); }
    .kinetic-5 { font-size: clamp(1.2rem, 6vw, 6vw); }
    .kinetic-6 { font-size: clamp(1.1rem, 5vw, 5vw); }
    .kinetic-7 { font-size: clamp(1rem, 4vw, 4vw); }

    .nav-link {
        font-size: 13px;
    }
}

/* --- Selection Color --- */
::selection {
    background: rgba(136, 204, 221, 0.2);
    color: #e8e8f0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
    background: #1e1e26;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9898a8;
}
