/* ========================================
   mystery.boo — Goblincore Curiosity Cabinet
   ======================================== */

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

:root {
    --ice-blue: #D0D8E8;
    --muted-blue: #8090A8;
    --ethereal-teal: #5A8AA0;
    --goblin-dark: #0C1018;
    --panel-dark: #141C28;
    --geo-line: #3A4A60;
    --moss-accent: #506040;
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--geo-line) var(--goblin-dark);
}

body {
    background: var(--goblin-dark);
    color: var(--muted-blue);
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    line-height: 1.8;
    overflow-x: hidden;
    overflow-y: hidden;
    height: 100vh;
    cursor: none;
}

::selection {
    background: var(--ethereal-teal);
    color: var(--goblin-dark);
}

/* ========================================
   Cursor-Follow Eye
   ======================================== */

.cursor-eye {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    filter: drop-shadow(0 0 6px rgba(90, 138, 160, 0.4));
}

.cursor-eye.active {
    opacity: 1;
}

/* ========================================
   Scroll Indicator
   ======================================== */

.scroll-indicator {
    position: fixed;
    bottom: 2.5rem;
    right: 3rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transition: opacity 1.2s ease 1.5s;
    pointer-events: none;
}

.scroll-indicator.visible {
    opacity: 1;
}

.scroll-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--ethereal-teal);
    opacity: 0.6;
}

.scroll-arrow {
    stroke: var(--ethereal-teal);
}

/* ========================================
   Horizontal Cabinet
   ======================================== */

.cabinet {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    height: 100vh;
    width: 100vw;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.cabinet::-webkit-scrollbar {
    height: 3px;
}

.cabinet::-webkit-scrollbar-track {
    background: var(--goblin-dark);
}

.cabinet::-webkit-scrollbar-thumb {
    background: var(--geo-line);
    border-radius: 2px;
}

/* ========================================
   Panel Base
   ======================================== */

.cabinet-panel {
    flex: 0 0 80vw;
    height: 100vh;
    scroll-snap-align: center;
    position: relative;
    overflow: hidden;
    background: var(--panel-dark);
    margin-right: 2px;
    display: flex;
    align-items: center;
}

.cabinet-panel:first-child {
    flex: 0 0 100vw;
}

.cabinet-panel:last-child {
    flex: 0 0 85vw;
}

/* Panel border - thin vertical line between drawers */
.cabinet-panel::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--geo-line) 20%,
        var(--geo-line) 80%,
        transparent
    );
    opacity: 0.3;
}

.cabinet-panel:last-child::after {
    display: none;
}

/* ========================================
   Geometric Backgrounds
   ======================================== */

.panel-geometric-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 20% 80%, rgba(90, 138, 160, 0.08) 0%, transparent 30%),
                radial-gradient(circle at 80% 20%, rgba(90, 138, 160, 0.06) 0%, transparent 35%),
                linear-gradient(45deg, rgba(58, 74, 96, 0.05) 0%, transparent 50%);
}

.panel-geometric-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 30%, rgba(58, 74, 96, 0.1) 0%, transparent 25%),
        radial-gradient(circle at 70% 70%, rgba(58, 74, 96, 0.08) 0%, transparent 30%);
    opacity: 0.5;
}

/* ========================================
   Instruments (corner ornaments)
   ======================================== */

.panel-corner-instrument {
    position: absolute;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease;
}

.panel-corner-instrument.visible {
    opacity: 1;
}

.top-left {
    top: 2rem;
    left: 2rem;
}

.top-right {
    top: 2rem;
    right: 2rem;
}

.bottom-left {
    bottom: 2rem;
    left: 2rem;
}

.bottom-right {
    bottom: 2rem;
    right: 2rem;
}

/* ========================================
   Panel Content
   ======================================== */

.panel-content {
    position: relative;
    z-index: 5;
    padding: 4rem 5vw;
    width: 100%;
    max-width: 72vw;
}

/* ========================================
   Title Panel (Panel 0)
   ======================================== */

.panel-title {
    flex: 0 0 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-content {
    display: flex;
    gap: 8vw;
    align-items: flex-start;
    max-width: 80vw;
    padding: 0 8vw;
}

.title-cluster {
    flex: 0 0 auto;
}

.site-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 7vw, 6rem);
    color: var(--ice-blue);
    letter-spacing: 0.08em;
    line-height: 0.95;
    text-shadow: 0 0 40px rgba(90, 138, 160, 0.25), 0 0 80px rgba(90, 138, 160, 0.1);
    margin-top: 0.5rem;
}

.title-rule {
    width: 4rem;
    height: 1px;
    background: var(--ethereal-teal);
    margin: 1.5rem 0;
    opacity: 0.5;
}

.title-sub {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: var(--muted-blue);
    line-height: 1.9;
    letter-spacing: 0.02em;
}

.title-aside {
    max-width: 22rem;
    padding-top: 1.2rem;
    border-left: 1px solid rgba(90, 138, 160, 0.15);
    padding-left: 2rem;
}

.aside-text {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--muted-blue);
    opacity: 0.7;
}

/* ========================================
   Specimen Labels & Headings
   ======================================== */

.specimen-label {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    color: var(--ethereal-teal);
    display: block;
    margin-bottom: 0.3rem;
}

.panel-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--ice-blue);
    letter-spacing: 0.04em;
    line-height: 1.1;
    margin-top: 0.25rem;
}

.specimen-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(58, 74, 96, 0.3);
}

/* ========================================
   Specimen Body
   ======================================== */

.specimen-body {
    display: grid;
    grid-template-columns: 1fr 18rem;
    gap: 4rem;
    align-items: start;
}

.specimen-body-alt {
    grid-template-columns: 18rem 1fr;
}

.specimen-desc p {
    margin-bottom: 1.2rem;
}

.specimen-desc p:last-child {
    margin-bottom: 0;
}

/* ========================================
   Specimen Data Rows
   ======================================== */

.specimen-data {
    padding-top: 0.5rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(58, 74, 96, 0.15);
    font-size: 0.8rem;
}

.data-row:last-child {
    border-bottom: none;
}

.data-key {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--ethereal-teal);
    opacity: 0.7;
}

.data-val {
    color: var(--muted-blue);
    text-align: right;
}

.moss-text {
    color: var(--moss-accent);
}

/* ========================================
   Specimen Visual (Map panel)
   ======================================== */

.specimen-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 1px solid rgba(58, 74, 96, 0.2);
    background: rgba(12, 16, 24, 0.5);
}

.map-specimen {
    width: 100%;
    max-width: 240px;
}

/* ========================================
   Index Panel (Panel 5)
   ======================================== */

.panel-index {
    align-items: flex-start;
    padding-top: 12vh;
}

.index-content {
    max-width: 60vw;
}

.index-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(58, 74, 96, 0.3);
}

.index-entries {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.index-entry {
    display: grid;
    grid-template-columns: 8rem 1fr 8rem;
    gap: 2rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(58, 74, 96, 0.12);
    align-items: baseline;
    transition: background 0.3s ease;
}

.index-entry:hover {
    background: rgba(90, 138, 160, 0.03);
}

.index-ref {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--ethereal-teal);
    opacity: 0.6;
}

.index-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 500;
    font-size: 1.05rem;
    color: var(--ice-blue);
    letter-spacing: 0.03em;
}

.index-status {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: var(--muted-blue);
    text-align: right;
    opacity: 0.7;
}

.redacted .index-name,
.redacted .index-status {
    opacity: 0.3;
}

.redacted .index-ref {
    opacity: 0.35;
}

.index-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(58, 74, 96, 0.2);
}

.footer-note {
    margin-top: 0.8rem;
    font-size: 0.78rem;
    opacity: 0.5;
    max-width: 36rem;
}

/* ========================================
   Panel Reveal Animations
   ======================================== */

.panel-content {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Staggered instrument entrance */
.cabinet-panel.in-view .panel-corner-instrument {
    opacity: 1;
}

.cabinet-panel.in-view .top-left {
    transition-delay: 0.3s;
}

.cabinet-panel.in-view .top-right {
    transition-delay: 0.5s;
}

.cabinet-panel.in-view .bottom-left {
    transition-delay: 0.4s;
}

.cabinet-panel.in-view .bottom-right {
    transition-delay: 0.6s;
}

/* ========================================
   Panel ambient glow — subtle ethereal illumination
   ======================================== */

.cabinet-panel::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 40%;
    background: radial-gradient(ellipse, rgba(90, 138, 160, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

/* ========================================
   Scrollbar & misc
   ======================================== */

body::-webkit-scrollbar {
    display: none;
}

/* ========================================
   Responsive — maintain horizontal cabinet on narrower screens
   ======================================== */

@media (max-width: 900px) {
    .cabinet-panel {
        flex: 0 0 92vw;
    }

    .cabinet-panel:first-child {
        flex: 0 0 100vw;
    }

    .panel-content {
        padding: 3rem 6vw;
    }

    .title-content {
        flex-direction: column;
        gap: 2.5rem;
        padding: 0 6vw;
    }

    .title-aside {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(90, 138, 160, 0.15);
        padding-top: 1.5rem;
    }

    .specimen-body,
    .specimen-body-alt {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .index-entry {
        grid-template-columns: 6rem 1fr 6rem;
        gap: 1rem;
    }

    .site-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
}

@media (max-width: 600px) {
    .cabinet-panel {
        flex: 0 0 96vw;
    }

    .panel-content {
        padding: 2.5rem 5vw;
    }

    .index-entry {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .index-status {
        text-align: left;
    }

    #scroll-indicator {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}
