/* === RESET === */
/* Design trace: IntersectionObserver` for scroll-triggered reveals on Dossier blocks and Archive items IntersectionObserver` to toggle a `.visible` class that triggers CSS transitions: `opacity: 0 → 1` */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === CSS VARIABLES === */
:root {
    --midnight: #0b1a2e;
    --deep-current: #142d4a;
    --coral: #e8927c;
    --sand: #f5f0e8;
    --teal: #2b8a8a;
    --gold: #f2c661;
    --ink: #1e1e24;
    --faded: #6b6860;
}

/* === BASE === */
html {
    scroll-behavior: smooth;
}

body {
    font-family: Quicksand, "Trebuchet MS", Verdana, sans-serif;
    font-weight: 400;
    color: var(--ink);
    background: var(--sand);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.17;
    background-image: radial-gradient(rgba(30, 30, 36, 0.18) 0.7px, transparent 0.7px);
    background-size: 4px 4px;
    mix-blend-mode: multiply;
}

/* === FISH SVGs (reusable) === */
@keyframes swimRight {
    from { transform: translateX(-120px) translateY(0); }
    25% { transform: translateX(25vw) translateY(-8px); }
    50% { transform: translateX(50vw) translateY(4px); }
    75% { transform: translateX(75vw) translateY(-6px); }
    to { transform: translateX(calc(100vw + 120px)) translateY(0); }
}

@keyframes swimLeft {
    from { transform: translateX(calc(100vw + 120px)) translateY(0); }
    25% { transform: translateX(75vw) translateY(8px); }
    50% { transform: translateX(50vw) translateY(-4px); }
    75% { transform: translateX(25vw) translateY(6px); }
    to { transform: translateX(-120px) translateY(0); }
}

@keyframes bubbleRise {
    from { transform: translateY(0) scale(1); opacity: 0.3; }
    to { transform: translateY(-200px) scale(0.6); opacity: 0; }
}

@keyframes breathe {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.015); }
}

/* === SECTION 1: THE TANK === */
.tank {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.tank-surface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(180deg, #fff7e8 0%, var(--sand) 74%, #eadfcf 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

.tank-depths {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: radial-gradient(circle at 20% 10%, rgba(43, 138, 138, 0.25), transparent 34%), linear-gradient(180deg, var(--midnight) 0%, #060e1a 100%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.hero-word {
    font-family: Nunito, "Arial Rounded MT Bold", Arial, sans-serif;
    font-weight: 900;
    font-size: clamp(6rem, 15vw, 14rem);
    letter-spacing: -0.04em;
    line-height: 0.9;
    user-select: none;
    text-shadow: 0 0.04em 0 rgba(232, 146, 124, 0.12);
}

.waterline {
    position: absolute;
    top: 0;
    left: -5%;
    width: 110%;
    height: 18px;
    background: repeating-linear-gradient(90deg, rgba(245, 240, 232, 0.08) 0 22px, rgba(43, 138, 138, 0.28) 22px 44px);
    filter: blur(0.2px);
    opacity: 0.8;
    animation: waterDrift 8s ease-in-out infinite alternate;
    z-index: 4;
}

@keyframes waterDrift {
    from { transform: translateX(-16px) skewX(-8deg); }
    to { transform: translateX(16px) skewX(8deg); }
}

.hero-word--top {
    color: var(--ink);
    transform: translateY(50%);
}

.hero-word--bottom {
    color: var(--sand);
    transform: translateY(-50%);
    position: relative;
    z-index: 2;
}

.fish-container,
.aquarium-fish {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.bubbles-container,
.aquarium-bubbles {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.scroll-cue {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: Quicksand, "Trebuchet MS", Verdana, sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--faded);
    z-index: 3;
    animation: breathe 4s ease-in-out infinite;
}

.fish-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: var(--teal);
    pointer-events: none;
}

/* === SECTION 2: THE DOSSIER === */
.dossier {
    background: var(--sand);
    min-height: 300vh;
    padding: 9rem 1rem 10rem;
    position: relative;
}

.section-kicker {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding-left: calc((100% / 12) + 2rem);
    font-family: Quicksand, "Trebuchet MS", Verdana, sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--faded);
}

.dossier-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.dossier-block {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    padding: 2.5rem;
    position: relative;
    background: rgba(255, 248, 235, 0.28);
    border-radius: 24px;
}

.dossier-block::before {
    content: "";
    position: absolute;
    inset: 1rem;
    border-top: 2px solid rgba(232, 146, 124, 0.35);
    border-left: 2px solid rgba(43, 138, 138, 0.22);
    pointer-events: none;
}

.dossier-block--left {
    grid-column: 2 / 7;
    transform: translateX(-30px);
}

.dossier-block--right {
    grid-column: 7 / 12;
    transform: translateX(30px);
}

.dossier-block.visible {
    opacity: 1;
    transform: translateX(0);
}

.swim-lane {
    grid-column: 1 / -1;
    height: 80px;
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

.dossier-label {
    font-family: Quicksand, "Trebuchet MS", Verdana, sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--faded);
    display: block;
    margin-bottom: 0.5rem;
}

.dossier-headline {
    font-family: Nunito, "Arial Rounded MT Bold", Arial, sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--ink);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.dossier-body {
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    color: var(--ink);
    margin-bottom: 1.5rem;
}

.score-badge {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background: var(--midnight);
    border: 3px solid var(--coral);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Baloo 2", "Arial Rounded MT Bold", Arial, sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--coral);
    transition: background 0.3s ease, color 0.3s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: scale(0.5);
}

.score-badge.visible {
    transform: scale(1);
}

.score-badge:hover {
    background: var(--coral);
    color: var(--midnight);
    cursor: default;
}

/* === SECTION 3: THE AQUARIUM WALL === */
.aquarium {
    position: relative;
    height: 100vh;
    background: radial-gradient(circle at 72% 24%, rgba(43, 138, 138, 0.34), transparent 24%), radial-gradient(circle at 28% 80%, rgba(232, 146, 124, 0.12), transparent 28%), linear-gradient(180deg, var(--midnight) 0%, var(--deep-current) 50%, var(--midnight) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.aquarium::after {
    content: "";
    position: absolute;
    inset: 2rem;
    border: 1px solid rgba(245, 240, 232, 0.14);
    border-radius: 28px;
    box-shadow: inset 0 0 80px rgba(245, 240, 232, 0.06);
    pointer-events: none;
}

.aquarium-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.aquarium-question {
    font-family: Nunito, "Arial Rounded MT Bold", Arial, sans-serif;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--sand);
    animation: breathe 4s ease-in-out infinite;
}

.betta-fish {
    position: absolute;
    width: 200px;
    height: 160px;
    bottom: 15%;
    right: 15%;
    z-index: 1;
    opacity: 0.6;
    animation: swimBetta 20s ease-in-out infinite alternate;
}

@keyframes swimBetta {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-30px, -15px) rotate(-3deg); }
    50% { transform: translate(20px, 10px) rotate(2deg); }
    75% { transform: translate(-15px, 20px) rotate(-2deg); }
    100% { transform: translate(10px, -10px) rotate(1deg); }
}

/* === SECTION 4: THE ARCHIVE === */
.archive {
    background: var(--sand);
    min-height: 200vh;
    padding: 8rem 2rem 12rem;
}

.archive-title {
    font-family: Nunito, "Arial Rounded MT Bold", Arial, sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--ink);
    text-align: left;
    max-width: 1200px;
    margin: 0 auto 4rem;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.archive-item {
    opacity: 0;
    transform: translateY(30px);
    grid-column: span 4;
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.archive-item:nth-child(2),
.archive-item:nth-child(6),
.archive-item:nth-child(9) {
    margin-top: 5rem;
}

.archive-item:nth-child(3),
.archive-item:nth-child(8) {
    margin-top: 2rem;
}

.archive-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.archive-item--wide {
    grid-column: span 6;
}

.vintage-photo {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    border: 4px solid var(--sand);
    box-shadow: 4px 6px 20px rgba(11, 26, 46, 0.25);
    filter: sepia(0.35) contrast(1.05) saturate(0.85);
    position: relative;
    overflow: hidden;
    transition: filter 0.4s ease;
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 25%, rgba(245, 240, 232, 0.25), transparent 20%), linear-gradient(120deg, transparent 0 45%, rgba(245, 240, 232, 0.12) 46% 48%, transparent 49% 100%);
}

.archive-item--wide .vintage-photo {
    aspect-ratio: 16 / 9;
}

.vintage-photo:hover {
    filter: sepia(0.15) contrast(1.1) saturate(1);
}

.archive-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.25rem;
}

.archive-caption-text {
    font-family: Quicksand, "Trebuchet MS", Verdana, sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--faded);
}

.archive-score {
    font-family: "Baloo 2", "Arial Rounded MT Bold", Arial, sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--coral);
    line-height: 1;
    font-size: 2.5rem;
}

/* === SECTION 5: THE VERDICT === */
.verdict {
    height: 100vh;
    background: var(--midnight);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.verdict-ten {
    width: clamp(200px, 40vw, 400px);
}

.verdict-name {
    font-family: Nunito, "Arial Rounded MT Bold", Arial, sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.08em;
    color: var(--sand);
    opacity: 0.6;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .dossier-block--left,
    .dossier-block--right {
        grid-column: 1 / -1;
    }

    .archive-item--wide {
        grid-column: 1 / -1;
    }

    .archive-item {
        grid-column: 1 / -1;
        margin-top: 0 !important;
    }

    .section-kicker {
        padding-left: 0;
    }

    .betta-fish {
        width: 120px;
        height: 96px;
        right: 5%;
        bottom: 10%;
    }
}
