/* ppuzzl.in - Swiss Aquarium Exhibition Catalog */
/* Color Palette:
   Deep Abyss: #0a1520
   Glacier Night: #0f2030
   Ice Light: #d8eaf4
   Reef Mist: #a8c4d6
   Deep Teal: #6a9bb5
   Parrotfish Gold: #e8b84d
   Angelfish Teal: #3dd4c0
   Frost: #b8d0da
*/

:root {
    --deep-abyss: #0a1520;
    --glacier-night: #0f2030;
    --ice-light: #d8eaf4;
    --reef-mist: #a8c4d6;
    --deep-teal: #6a9bb5;
    --parrotfish-gold: #e8b84d;
    --angelfish-teal: #3dd4c0;
    --frost: #b8d0da;
    --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
    --text-color: #a8c4d6;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-abyss);
    color: var(--reef-mist);
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== FROST GRAIN OVERLAY ===== */
#frost-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: var(--frost-opacity, 0.06);
    transition: opacity 0.5s var(--ease-smooth);
}

#frost-grain::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* ===== PUZZLE WATERMARK ===== */
#puzzle-watermark {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.8;
}

/* ===== RIPPLE CONTAINER ===== */
#ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.click-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(61, 212, 192, 0.06);
    transform: scale(0);
    animation: ripple-expand 1.2s var(--ease-smooth) forwards;
    pointer-events: none;
}

@keyframes ripple-expand {
    0% {
        transform: scale(0);
        opacity: 0.06;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}
/* ===== AMBIENT RIPPLES ===== */
#ambient-ripples {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.ambient-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(61, 212, 192, 0.02) 0%, transparent 70%);
    animation: ambient-pulse 20s var(--ease-smooth) infinite;
}

.ambient-ripple-1 {
    width: 60vmax;
    height: 60vmax;
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.ambient-ripple-2 {
    width: 50vmax;
    height: 50vmax;
    top: 40%;
    right: -15%;
    animation-delay: -7s;
}

.ambient-ripple-3 {
    width: 70vmax;
    height: 70vmax;
    bottom: -10%;
    left: 20%;
    animation-delay: -13s;
}

@keyframes ambient-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* ===== BACKGROUND FISH ===== */
#background-fish {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

.drift-fish {
    position: absolute;
    opacity: 0;
    transition: opacity 2s var(--ease-smooth);
}

.drift-fish.visible {
    opacity: 0.04;
}

.drift-fish.terminal-visible {
    opacity: 0.08;
}

.fish-1 {
    width: 350px;
    top: 15%;
    left: -350px;
    animation: drift-right 75s linear infinite;
}

.fish-2 {
    width: 280px;
    top: 35%;
    right: -280px;
    animation: drift-left 90s linear infinite;
    animation-delay: -20s;
}

.fish-3 {
    width: 320px;
    top: 55%;
    left: -320px;
    animation: drift-right 65s linear infinite;
    animation-delay: -35s;
}

.fish-4 {
    width: 250px;
    top: 70%;
    right: -250px;
    animation: drift-left 80s linear infinite;
    animation-delay: -10s;
}

.fish-5 {
    width: 300px;
    top: 85%;
    left: -300px;
    animation: drift-right 70s linear infinite;
    animation-delay: -50s;
}

@keyframes drift-right {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 700px)); }
}

@keyframes drift-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-100vw - 700px)); }
}

/* ===== SECTION INDICATOR ===== */
#section-indicator {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.6s var(--ease-smooth);
}

#section-indicator.visible {
    opacity: 1;
}

.indicator-text {
    font-family: "JetBrains Mono", monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--deep-teal);
}
/* ===== HERO ===== */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.hero-title {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    font-size: clamp(3rem, 7vw, 6rem);
    color: var(--ice-light);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    animation: hero-fade-in 1s var(--ease-smooth) 1.5s forwards;
    text-align: center;
}

@keyframes hero-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ===== CONTENT COLUMN ===== */
#content-column {
    position: relative;
    width: min(640px, 88vw);
    margin: 0 auto;
    padding: 4rem 0 20rem;
    z-index: 10;
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
    position: relative;
    margin-bottom: 8rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 2px;
    box-shadow: 0 0 120px rgba(180, 220, 240, 0.04);
}

.content-section + .content-section {
    margin-top: -6rem;
}

/* ===== SECTION RULES ===== */
.section-rule {
    border: none;
    height: 1px;
    background: rgba(180, 210, 230, 0.15);
    margin: 0 0 2rem 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease-smooth);
}

.content-section.in-view .section-rule {
    transform: scaleX(1);
}

/* ===== SECTION FISH ICONS ===== */
.section-fish-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
    color: var(--deep-teal);
    opacity: 0;
    transition: opacity 0.2s var(--ease-smooth) 0.6s;
}

.section-fish-icon svg {
    width: 100%;
    height: 100%;
}

.content-section.in-view .section-fish-icon {
    opacity: 0.4;
}

/* ===== SECTION TITLES ===== */
.section-title {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    color: var(--ice-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.1;
    margin: 0 0 0.5rem 0;
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity 0.4s var(--ease-smooth) 0.8s, transform 0.4s var(--ease-smooth) 0.8s;
}

.content-section.in-view .section-title {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SECTION LABELS ===== */
.section-label {
    display: block;
    font-family: "JetBrains Mono", monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--deep-teal);
    margin: 0 0 2rem 4rem;
    opacity: 0;
    transition: opacity 0.4s var(--ease-smooth) 1s;
}

.content-section.in-view .section-label {
    opacity: 1;
}

/* ===== SECTION BODY ===== */
.section-body {
    margin-left: 2rem;
    opacity: 0;
    transition: opacity 0.4s var(--ease-smooth) 1.2s, color 2s var(--ease-smooth);
}

.content-section.in-view .section-body {
    opacity: 1;
}

.section-body p {
    margin-bottom: 1.2rem;
    font-weight: 300;
}

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

/* ===== FISH ENCOUNTER ===== */
.fish-encounter .section-body {
    --text-color: var(--reef-mist);
    color: var(--text-color);
}

.fish-encounter.bioluminescent .section-body {
    color: var(--frost);
}

/* ===== TERMINAL SECTION ===== */
.terminal-section {
    margin-bottom: 0;
}

.terminal-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30vh;
    background: linear-gradient(to bottom, transparent, var(--deep-abyss));
    pointer-events: none;
    z-index: 11;
}

/* ===== INTERACTIVE HOVER FISH ===== */
.section-title {
    position: relative;
    cursor: default;
}

.hover-fish {
    position: absolute;
    top: 50%;
    right: -60px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    opacity: 0;
    color: var(--angelfish-teal);
    pointer-events: none;
}

.section-title:hover .hover-fish {
    animation: fish-swim-past 0.8s var(--ease-smooth) forwards;
}

@keyframes fish-swim-past {
    0% { opacity: 0; transform: translateY(-50%) translateX(-20px) scale(0.8); }
    40% { opacity: 0.6; transform: translateY(-50%) translateX(0) scale(1); }
    100% { opacity: 0; transform: translateY(-50%) translateX(30px) scale(0.8); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .section-label {
        margin-left: 2rem;
    }
    .section-body {
        margin-left: 1rem;
    }
    #section-indicator {
        top: 1rem;
        left: 1rem;
    }
}