/* namu.market - Dark Academia Aquarium */
/* Color Palette */
:root {
    --bg-deep: #1c1510;
    --bg-surface: #2e2018;
    --text-primary: #e8dcc8;
    --accent-warm: #c4913a;
    --accent-iridescent: #4fa8c7;
    --accent-vivid: #d4734a;
    --muted-decoration: #6b5d4f;
    --highlight-glow: #68c4a8;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Newsreader', Georgia, serif;
    font-variation-settings: 'opsz' 14;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* Typography */
.title-specimen {
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: clamp(2.6rem, 7vw, 5.4rem);
    font-variation-settings: 'opsz' 72, 'WONK' 1;
    font-weight: 400;
    letter-spacing: -0.015em;
    color: var(--accent-warm);
    animation: pulse 4s ease-in-out infinite;
    transition: font-weight 300ms ease;
}

.title-specimen:hover {
    font-weight: 700;
}

.title-subtitle {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'CASL' 0.5, 'MONO' 0.7;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--muted-decoration);
    margin-top: 1rem;
}

.chamber-heading {
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-variation-settings: 'opsz' 72, 'WONK' 0;
    font-weight: 400;
    letter-spacing: -0.015em;
    color: var(--accent-warm);
    margin-bottom: 2rem;
    transition: font-variation-settings 300ms ease;
}

.chamber-heading:hover {
    font-variation-settings: 'opsz' 72, 'WONK' 1;
}

.body-text {
    font-family: 'Newsreader', Georgia, serif;
    font-variation-settings: 'opsz' 14;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.72;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.accent-text {
    font-family: 'Fraunces', 'Georgia', serif;
    font-variation-settings: 'opsz' 36, 'WONK' 1;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-style: italic;
    color: var(--accent-warm);
    line-height: 1.6;
}

.attribution {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'CASL' 0.5, 'MONO' 0.7;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--muted-decoration);
    display: block;
    margin-top: 1rem;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

@keyframes bubbleRise1 {
    0% { transform: translateY(0) translateX(0); opacity: 0.4; }
    50% { transform: translateY(-40vh) translateX(5px); opacity: 0.2; }
    100% { transform: translateY(-80vh) translateX(-3px); opacity: 0; }
}

@keyframes bubbleRise2 {
    0% { transform: translateY(0) translateX(0); opacity: 0.3; }
    50% { transform: translateY(-45vh) translateX(-4px); opacity: 0.15; }
    100% { transform: translateY(-85vh) translateX(6px); opacity: 0; }
}

@keyframes bubbleRise3 {
    0% { transform: translateY(0) translateX(0); opacity: 0.35; }
    50% { transform: translateY(-38vh) translateX(7px); opacity: 0.2; }
    100% { transform: translateY(-75vh) translateX(-2px); opacity: 0; }
}

@keyframes fishBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes swimLeft1 {
    0% { transform: translateX(100%) translateY(0); }
    25% { transform: translateX(50%) translateY(-8px); }
    50% { transform: translateX(0%) translateY(3px); }
    75% { transform: translateX(-50%) translateY(-5px); }
    100% { transform: translateX(-100%) translateY(0); }
}

@keyframes swimLeft2 {
    0% { transform: translateX(120%) translateY(0) scaleX(-1); }
    25% { transform: translateX(60%) translateY(5px) scaleX(-1); }
    50% { transform: translateX(0%) translateY(-6px) scaleX(-1); }
    75% { transform: translateX(-60%) translateY(3px) scaleX(-1); }
    100% { transform: translateX(-120%) translateY(0) scaleX(-1); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 0.2;
        transform: translateY(0);
    }
}

@keyframes cardSettle1 {
    from {
        opacity: 0;
        transform: translateY(-15px) rotate(-2deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(-1.5deg);
    }
}

@keyframes cardSettle2 {
    from {
        opacity: 0;
        transform: translateY(-15px) rotate(1.3deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(0.8deg);
    }
}

@keyframes cardSettle3 {
    from {
        opacity: 0;
        transform: translateY(-15px) rotate(-1deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(-0.5deg);
    }
}

/* Chamber Layout */
.chamber {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 3rem;
}

/* Glass Transition Zones */
.glass-transition {
    height: 30vh;
    background: linear-gradient(180deg, #1c1510 0%, #2e2018 30%, rgba(79, 168, 199, 0.06) 50%, #2e2018 70%, #1c1510 100%);
}

/* Chamber 1 - Entrance Plaque */
.chamber-1 {
    background: var(--bg-deep);
    flex-direction: column;
    overflow: hidden;
}

.chamber-1-content {
    position: relative;
    text-align: center;
    z-index: 2;
}

.angelfish-bg {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: auto;
    color: var(--accent-iridescent);
    opacity: 0.15;
    z-index: 1;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(232, 220, 200, 0.15);
    animation-delay: 2s;
    animation-fill-mode: both;
    animation-iteration-count: infinite;
}

.bubble-1 {
    width: 4px;
    height: 4px;
    left: 48%;
    bottom: -20px;
    animation: bubbleRise1 8s linear 2s infinite;
}

.bubble-2 {
    width: 3px;
    height: 3px;
    left: 52%;
    bottom: -20px;
    animation: bubbleRise2 11s linear 2s infinite;
}

.bubble-3 {
    width: 5px;
    height: 5px;
    left: 46%;
    bottom: -20px;
    animation: bubbleRise3 14s linear 2s infinite;
}

/* Chamber 2 - Taxonomy Wall */
.chamber-2 {
    background: var(--bg-deep);
    padding: 6rem 4rem;
}

.taxonomy-layout {
    display: flex;
    gap: 4rem;
    max-width: 1200px;
    width: 100%;
    align-items: flex-start;
}

.taxonomy-left {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fish-stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.fish-silhouette {
    color: var(--accent-warm);
    opacity: 0;
    width: 80px;
    height: auto;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fish-silhouette.visible {
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.fish-s-angelfish { width: 60px; }
.fish-s-discus { width: 70px; }
.fish-s-betta { width: 90px; }
.fish-s-arowana { width: 100px; }

.specimen-label {
    margin-top: 2rem;
    border: 1px solid var(--muted-decoration);
    background: rgba(46, 32, 24, 0.8);
    padding: 0.5rem 1rem;
}

.label-text {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'CASL' 0.5, 'MONO' 0.7;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--muted-decoration);
}

.taxonomy-right {
    flex: 0 0 70%;
}

/* Chamber 3 - Field Notes */
.chamber-3 {
    background: var(--bg-deep);
    flex-direction: column;
    padding: 6rem 4rem;
}

.chamber-3-heading {
    text-align: center;
    margin-bottom: 4rem;
}

.field-notes-container {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.field-card {
    background: rgba(46, 32, 24, 0.85);
    border: 2px solid var(--muted-decoration);
    outline: 1px solid rgba(107, 93, 79, 0.3);
    outline-offset: 4px;
    padding: 2rem;
    max-width: 340px;
    width: 100%;
    opacity: 0;
}

.card-1 {
    transform: rotate(-1.5deg);
    margin-top: 0;
}

.card-2 {
    transform: rotate(0.8deg);
    margin-top: 40px;
}

.card-3 {
    transform: rotate(-0.5deg);
    margin-top: 80px;
}

.field-card.visible.card-1 {
    animation: cardSettle1 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.field-card.visible.card-2 {
    animation: cardSettle2 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 150ms forwards;
}

.field-card.visible.card-3 {
    animation: cardSettle3 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 300ms forwards;
}

.card-heading {
    font-family: 'Fraunces', 'Georgia', serif;
    font-variation-settings: 'opsz' 48, 'WONK' 1;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 400;
    color: var(--accent-warm);
    margin-bottom: 1rem;
    letter-spacing: -0.015em;
}

.card-text {
    font-family: 'Newsreader', Georgia, serif;
    font-variation-settings: 'opsz' 14;
    font-size: 0.95rem;
    line-height: 1.72;
    color: var(--text-primary);
}

/* Chamber 4 - Observation Log */
.chamber-4 {
    background: var(--bg-deep);
    background-image: repeating-linear-gradient(
        transparent,
        transparent 1.72rem,
        rgba(107, 93, 79, 0.08) 1.72rem,
        rgba(107, 93, 79, 0.08) calc(1.72rem + 1px)
    );
    position: relative;
    overflow: hidden;
}

.observation-column {
    max-width: 38rem;
    width: 100%;
    position: relative;
    z-index: 2;
}

.margin-annotation {
    position: absolute;
    font-family: 'Recursive', monospace;
    font-variation-settings: 'CASL' 0.5, 'MONO' 0.7;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--muted-decoration);
    opacity: 0.6;
    white-space: nowrap;
}

.annotation-1 {
    left: -10rem;
    top: 60%;
}

.annotation-2 {
    left: -8rem;
    top: 30%;
}

.margin-fish {
    position: absolute;
    width: 40px;
    height: auto;
    color: var(--accent-iridescent);
    opacity: 0.15;
    z-index: 1;
}

.margin-fish-1 {
    top: 25%;
    left: 5%;
    animation: swimLeft1 20s linear infinite;
}

.margin-fish-2 {
    top: 65%;
    left: 8%;
    animation: swimLeft2 25s linear infinite;
}

/* Chamber 5 - Archive */
.chamber-5 {
    background: var(--bg-deep);
    flex-direction: column;
    padding: 6rem 4rem;
}

.chamber-5-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.archive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    max-width: 800px;
    width: 100%;
}

.archive-panel {
    aspect-ratio: 1;
    background: var(--bg-surface);
    border: 2px solid var(--muted-decoration);
    outline: 1px solid rgba(107, 93, 79, 0.3);
    outline-offset: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
}

.panel-label {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Recursive', monospace;
    font-variation-settings: 'CASL' 0.5, 'MONO' 0.7;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    color: var(--muted-decoration);
    white-space: nowrap;
    border: 1px solid var(--muted-decoration);
    background: rgba(46, 32, 24, 0.8);
    padding: 0.25rem 0.6rem;
}

/* Panel 1 - Discus Roundel */
.panel-1 .discus-roundel {
    width: 60%;
    max-width: 150px;
    height: auto;
    color: var(--accent-vivid);
    opacity: 0.4;
}

/* Panel 2 - Moss Texture */
.panel-2 .moss-texture {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, #3a5c3a 0%, transparent 3%),
        radial-gradient(circle at 60% 20%, #3a5c3a 0%, transparent 4%),
        radial-gradient(circle at 40% 60%, #3a5c3a 0%, transparent 3.5%),
        radial-gradient(circle at 80% 50%, #3a5c3a 0%, transparent 2.5%),
        radial-gradient(circle at 30% 80%, #3a5c3a 0%, transparent 4%),
        radial-gradient(circle at 70% 75%, #3a5c3a 0%, transparent 3%),
        radial-gradient(circle at 15% 55%, #3a5c3a 0%, transparent 5%),
        radial-gradient(circle at 85% 25%, #3a5c3a 0%, transparent 3.5%),
        radial-gradient(circle at 50% 45%, #3a5c3a 0%, transparent 4.5%),
        radial-gradient(circle at 25% 15%, #3a5c3a 0%, transparent 3%),
        radial-gradient(circle at 65% 85%, #3a5c3a 0%, transparent 4%),
        radial-gradient(circle at 45% 10%, #3a5c3a 0%, transparent 2.5%),
        radial-gradient(circle at 10% 70%, #3a5c3a 0%, transparent 3.5%),
        radial-gradient(circle at 90% 65%, #3a5c3a 0%, transparent 3%),
        radial-gradient(circle at 55% 90%, #3a5c3a 0%, transparent 4%);
    opacity: 0.08;
}

/* Panel 3 - Tetra Frieze */
.panel-3 .tetra-frieze {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 1rem;
}

.tetra-frieze::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 12'%3E%3Cpath d='M3 6 C5 2, 10 1, 18 3 C22 4, 25 5, 27 6 C25 7, 22 8, 18 9 C10 11, 5 10, 3 6Z M1 6 C0 5, 0 7, 1 6Z M5 5 C6 4.5, 7 5, 6.5 6 C6 6.5, 5 6, 5 5Z' fill='%234fa8c7'/%3E%3C/svg%3E");
    background-size: 35px 14px;
    opacity: 0.2;
}

/* Panel 4 - Driftwood Frame */
.panel-4 .driftwood-frame {
    border: 1px solid var(--muted-decoration);
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.panel-4 .driftwood-frame::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: var(--muted-decoration);
    opacity: 0.5;
}

.panel-4 .driftwood-frame::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 15%;
    right: 15%;
    height: 1px;
    background: var(--muted-decoration);
    opacity: 0.5;
}

.driftwood-text {
    text-align: center;
}

/* Fish Navigator */
.fish-navigator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 40px;
    height: 20px;
    color: var(--accent-warm);
    opacity: 0.6;
    cursor: pointer;
    z-index: 100;
    animation: fishBob 3s ease-in-out infinite;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fish-navigator:hover {
    opacity: 1;
    transform: scale(1.2);
}

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

/* Responsive */
@media (max-width: 768px) {
    .chamber {
        padding: 4rem 1.5rem;
    }

    .taxonomy-layout {
        flex-direction: column;
        gap: 3rem;
    }

    .taxonomy-left {
        flex: none;
        width: 100%;
    }

    .fish-stack {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .taxonomy-right {
        flex: none;
        width: 100%;
    }

    .field-notes-container {
        flex-direction: column;
        align-items: center;
    }

    .field-card {
        max-width: 100%;
    }

    .card-2 {
        margin-top: 0;
    }

    .card-3 {
        margin-top: 0;
    }

    .archive-grid {
        grid-template-columns: 1fr;
    }

    .margin-annotation {
        display: none;
    }

    .angelfish-bg {
        width: 200px;
        right: 5%;
    }

    .chamber-2 {
        padding: 4rem 2rem;
    }

    .chamber-3 {
        padding: 4rem 2rem;
    }

    .chamber-5 {
        padding: 4rem 2rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .title-specimen {
        animation: none;
        opacity: 1;
    }

    .bubble {
        animation: none;
        display: none;
    }

    .fish-navigator {
        animation: none;
    }

    .margin-fish {
        animation: none;
    }

    .fish-silhouette {
        opacity: 0.2;
    }

    .field-card {
        opacity: 1;
    }
}
