/* ============================================================
   20241204.com — Declassified Aquarium
   Frutiger Aero · Deep Burgundy · Hand-drawn Tropical Fish
   ============================================================ */

:root {
    --c-bg-deep: #1a0a0e;
    --c-bg-panel: #2d0f18;
    --c-glass: rgba(92, 26, 46, 0.6);
    --c-glass-border: rgba(196, 163, 90, 0.18);
    --c-text: #f0e6d3;
    --c-text-muted: #c9a1a1;
    --c-gold: #c4a35a;
    --c-copper: #d4845a;
    --c-coral: #e85d5d;
    --c-jade: #5da88e;
    --c-burgundy: #5c1a2e;
    --c-burgundy-deep: #5c0a1a;
    --c-abyss: #120508;

    --f-head: 'Playfair Display', 'Inter', Georgia, serif;
    --f-body: 'Libre Franklin', 'Inter', system-ui, sans-serif;
    --f-script: 'Caveat', 'Inter', cursive;
}

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

html, body {
    height: 100%;
    background: var(--c-bg-deep);
    color: var(--c-text);
    font-family: var(--f-body);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background:
        radial-gradient(ellipse at 20% 10%, rgba(92,10,26,0.55) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 90%, rgba(45,15,24,0.85) 0%, transparent 60%),
        linear-gradient(180deg, #1a0a0e 0%, #120508 100%);
    background-attachment: fixed;
}

/* Ink wash noise overlay */
.ink-wash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.06;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Top bar ---------- */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: linear-gradient(180deg, rgba(18,5,8,0.85) 0%, rgba(18,5,8,0.0) 100%);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    border-bottom: 1px solid rgba(196,163,90,0.08);
}

.datestamp {
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    color: var(--c-text);
    opacity: 0.9;
    animation: broadcast 4s ease-in-out infinite;
}

@keyframes broadcast {
    0%, 100% { opacity: 0.8; }
    50%      { opacity: 1.0; }
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--f-body);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}
.lang-btn {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 4px 2px;
    transition: color 0.3s ease;
}
.lang-btn.active { color: var(--c-gold); }
.lang-btn:hover  { color: var(--c-copper); }
.lang-sep { opacity: 0.4; }

/* ---------- Progress bar ---------- */
.progress-track {
    position: fixed;
    top: 56px; bottom: 0;
    right: 0;
    width: 2px;
    background: rgba(196,163,90,0.06);
    z-index: 40;
}
.progress-bar {
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, #c4a35a 0%, #5c1a2e 100%);
    box-shadow: 0 0 12px rgba(196,163,90,0.4);
    transition: height 0.08s linear;
}

/* ---------- Scroll container ---------- */
.scroll-container {
    position: relative;
    z-index: 2;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.scroll-container::-webkit-scrollbar { width: 0; height: 0; }
.scroll-container { scrollbar-width: none; }

/* ---------- Panels ---------- */
.panel {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    overflow: hidden;
}

.watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f-head);
    font-weight: 900;
    font-size: 20vw;
    letter-spacing: -0.04em;
    color: #f0e6d3;
    opacity: 0.04;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

.frame {
    position: relative;
    max-width: 760px;
    width: 100%;
    padding: 8px;
    border-radius: 22px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(92,10,26,0.5) 0%, transparent 70%),
        linear-gradient(180deg, rgba(45,15,24,0.5), rgba(18,5,8,0.2));
    border: 1px solid rgba(92,10,26,0.45);
    box-shadow:
        0 0 60px rgba(92,26,46,0.4),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

.glass {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
    padding: 56px 48px;
    border-radius: 16px;
    background: var(--c-glass);
    border: 1px solid var(--c-glass-border);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        inset 0 -1px 0 rgba(0,0,0,0.3),
        0 20px 60px rgba(0,0,0,0.45);
}

@supports not (backdrop-filter: blur(12px)) {
    .glass { background: var(--c-bg-panel); }
}

.glass::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent);
    pointer-events: none;
}

/* Reveal animation (set by JS via .visible) */
.glass .kicker,
.glass .heading,
.glass .body,
.glass .annotation {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.panel.visible .glass .kicker     { transition-delay: 0.00s; opacity: 1; transform: translateY(0); }
.panel.visible .glass .heading    { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.panel.visible .glass .body       { transition-delay: 0.30s; opacity: 1; transform: translateY(0); }
.panel.visible .glass .body + .body { transition-delay: 0.45s; }
.panel.visible .glass .annotation { transition-delay: 0.60s; opacity: 1; transform: translateY(0); }

/* ---------- Typography inside glass ---------- */
.kicker {
    font-family: var(--f-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-gold);
    margin-bottom: 22px;
}

.heading {
    font-family: var(--f-head);
    font-weight: 700;
    font-size: clamp(2rem, 4vw + 1rem, 4.5rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--c-text);
    margin-bottom: 28px;
}

.body {
    font-family: var(--f-body);
    font-weight: 400;
    font-size: clamp(1rem, 0.6vw + 0.85rem, 1.18rem);
    line-height: 1.7;
    color: var(--c-text);
    margin-bottom: 18px;
}

.body em {
    font-style: italic;
    color: var(--c-copper);
}

.annotation {
    font-family: var(--f-script);
    font-size: 1.35rem;
    line-height: 1.4;
    color: var(--c-text-muted);
    margin-top: 24px;
    opacity: 0.85;
}

/* ---------- Interlude bands ---------- */
.interlude {
    position: relative;
    height: 30vh;
    min-height: 220px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(18,5,8,1) 0%, rgba(45,15,24,0.6) 30%, rgba(45,15,24,0.6) 70%, rgba(18,5,8,1) 100%),
        radial-gradient(ellipse at 50% 50%, rgba(92,10,26,0.4) 0%, transparent 70%),
        var(--c-abyss);
    border-top: 1px solid rgba(196,163,90,0.06);
    border-bottom: 1px solid rgba(196,163,90,0.06);
    display: flex;
    align-items: center;
}

.interlude::before, .interlude::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='8' viewBox='0 0 320 8'><path d='M0 4 C 40 0, 80 8, 120 4 S 200 0, 240 4 S 320 8, 320 4' fill='none' stroke='%23e85d5d' stroke-opacity='0.4' stroke-width='1'/></svg>") repeat-x;
    background-size: 320px 8px;
    opacity: 0.6;
    animation: wobble 9s ease-in-out infinite;
}
.interlude::before { top: 0; }
.interlude::after  { bottom: 0; transform: scaleY(-1); }

@keyframes wobble {
    0%, 100% { background-position-x: 0px; }
    50%      { background-position-x: 12px; }
}

/* Fish */
.fish {
    position: absolute;
    top: 50%;
    left: -260px;
    width: 240px;
    height: auto;
    transform: translateY(-50%);
    will-change: transform;
    filter: drop-shadow(0 0 8px rgba(232,93,93,0.18));
}

.fish-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: draw 2.4s ease-out forwards;
}
.fish-path:nth-child(2) { animation-delay: 0.2s; }
.fish-path:nth-child(3) { animation-delay: 0.4s; }
.fish-path:nth-child(4) { animation-delay: 0.6s; }
.fish-path:nth-child(5) { animation-delay: 0.8s; }
.fish-path:nth-child(6) { animation-delay: 1.0s; }
.fish-path:nth-child(7) { animation-delay: 1.2s; }

@keyframes draw {
    to { stroke-dashoffset: 0; }
}

.fish-betta  { animation: drift 75s linear infinite; }
.fish-puffer { animation: drift 95s linear infinite; }
.fish-clown  { animation: drift 60s linear infinite; }
.fish-lion   { animation: drift 110s linear infinite; }

@keyframes drift {
    0%   { transform: translate(0, -50%) translateX(-260px); }
    50%  { transform: translate(50vw, calc(-50% + 14px)) translateX(0); }
    100% { transform: translate(calc(100vw + 260px), -50%) translateX(0); }
}

.fish-label {
    position: absolute;
    right: 28px;
    bottom: 14px;
    font-family: var(--f-script);
    font-size: 1.1rem;
    color: var(--c-text-muted);
    opacity: 0.5;
    letter-spacing: 0.02em;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .fish, .fish-path, .datestamp,
    .interlude::before, .interlude::after {
        animation: none !important;
    }
    .fish-path { stroke-dashoffset: 0; }
    .fish { left: 50%; transform: translate(-50%, -50%); }
    .glass .kicker, .glass .heading, .glass .body, .glass .annotation {
        opacity: 1; transform: none; transition: none;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .glass { padding: 40px 28px; }
    .topbar { padding: 0 16px; }
    .watermark { font-size: 32vw; }
    .fish { width: 180px; }
    .fish-label { right: 14px; bottom: 8px; font-size: 0.95rem; }
}
