/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    background: #1a1a1e;
}

body {
    font-family: 'Libre Baskerville', serif;
    color: #f0e4cc;
    background: #1a1a1e;
    line-height: 1.72;
    letter-spacing: 0.015em;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    overflow-x: hidden;
}

/* === NEON GLOW ANIMATION === */
@keyframes neonPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

@keyframes heroReveal {
    0% { clip-path: circle(0% at 50% 50%); }
    100% { clip-path: circle(75% at 50% 50%); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes underlineDraw {
    from { stroke-dashoffset: 300; }
    to { stroke-dashoffset: 0; }
}

/* === LEATHER TEXTURE === */
.leather-bg {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Crect width='100' height='100' fill='%236b3a2a'/%3E%3Ccircle cx='12' cy='8' r='0.8' fill='%235a2e1f' opacity='0.6'/%3E%3Ccircle cx='45' cy='15' r='0.5' fill='%237a4530' opacity='0.5'/%3E%3Ccircle cx='78' cy='5' r='0.7' fill='%235a2e1f' opacity='0.4'/%3E%3Ccircle cx='23' cy='32' r='0.6' fill='%237a4530' opacity='0.5'/%3E%3Ccircle cx='56' cy='38' r='0.9' fill='%235a2e1f' opacity='0.4'/%3E%3Ccircle cx='88' cy='28' r='0.5' fill='%237a4530' opacity='0.6'/%3E%3Ccircle cx='8' cy='55' r='0.7' fill='%235a2e1f' opacity='0.5'/%3E%3Ccircle cx='34' cy='62' r='0.6' fill='%237a4530' opacity='0.4'/%3E%3Ccircle cx='67' cy='50' r='0.8' fill='%235a2e1f' opacity='0.5'/%3E%3Ccircle cx='92' cy='68' r='0.5' fill='%237a4530' opacity='0.6'/%3E%3Ccircle cx='15' cy='82' r='0.9' fill='%235a2e1f' opacity='0.4'/%3E%3Ccircle cx='48' cy='78' r='0.6' fill='%237a4530' opacity='0.5'/%3E%3Ccircle cx='73' cy='88' r='0.7' fill='%235a2e1f' opacity='0.5'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 30% 40%, #7a4530 0%, #6b3a2a 40%, #5a2e1f 100%);
}

/* === HERO === */
.hero {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1e;
    position: relative;
    overflow: hidden;
}

.hero-leather {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Crect width='100' height='100' fill='%236b3a2a'/%3E%3Ccircle cx='12' cy='8' r='0.8' fill='%235a2e1f' opacity='0.6'/%3E%3Ccircle cx='45' cy='15' r='0.5' fill='%237a4530' opacity='0.5'/%3E%3Ccircle cx='78' cy='5' r='0.7' fill='%235a2e1f' opacity='0.4'/%3E%3Ccircle cx='23' cy='32' r='0.6' fill='%237a4530' opacity='0.5'/%3E%3Ccircle cx='56' cy='38' r='0.9' fill='%235a2e1f' opacity='0.4'/%3E%3Ccircle cx='88' cy='28' r='0.5' fill='%237a4530' opacity='0.6'/%3E%3Ccircle cx='8' cy='55' r='0.7' fill='%235a2e1f' opacity='0.5'/%3E%3Ccircle cx='34' cy='62' r='0.6' fill='%237a4530' opacity='0.4'/%3E%3Ccircle cx='67' cy='50' r='0.8' fill='%235a2e1f' opacity='0.5'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 30% 40%, #7a4530 0%, #6b3a2a 40%, #5a2e1f 100%);
    animation: heroReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

/* Brass Corners */
.brass-corner {
    position: absolute;
    width: 60px;
    height: 60px;
    z-index: 2;
    opacity: 0;
    animation: fadeIn 0.5s ease 1.6s both;
}

.brass-corner::before,
.brass-corner::after {
    content: '';
    position: absolute;
    background: linear-gradient(135deg, #d4b76a, #c5a356, #8a7434);
}

.brass-corner--tl { top: 20px; left: 20px; }
.brass-corner--tl::before { top: 0; left: 0; width: 40px; height: 4px; }
.brass-corner--tl::after { top: 0; left: 0; width: 4px; height: 40px; }

.brass-corner--tr { top: 20px; right: 20px; }
.brass-corner--tr::before { top: 0; right: 0; width: 40px; height: 4px; }
.brass-corner--tr::after { top: 0; right: 0; width: 4px; height: 40px; }

.brass-corner--bl { bottom: 20px; left: 20px; }
.brass-corner--bl::before { bottom: 0; left: 0; width: 40px; height: 4px; }
.brass-corner--bl::after { bottom: 0; left: 0; width: 4px; height: 40px; }

.brass-corner--br { bottom: 20px; right: 20px; }
.brass-corner--br::before { bottom: 0; right: 0; width: 40px; height: 4px; }
.brass-corner--br::after { bottom: 0; right: 0; width: 4px; height: 40px; }

/* Hero Content */
.hero-content {
    text-align: center;
    z-index: 3;
    opacity: 0;
    animation: fadeIn 0.8s ease 1.8s both;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 8vw, 7rem);
    color: #f0e4cc;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.hero-tagline {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: #00f5e4;
    text-shadow: 0 0 8px #00f5e4, 0 0 24px #00f5e4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    animation: neonPulse 3s ease-in-out infinite;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #00f5e4;
    display: inline-block;
}

/* Desk Objects */
.desk-object {
    position: absolute;
    opacity: 0;
    animation: fadeIn 0.6s ease 2.2s both;
    transition: transform 0.3s ease, filter 0.3s ease;
    z-index: 2;
}

.desk-object:hover {
    transform: translateY(-3px) rotate(-1deg);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.desk-obj-vial { bottom: 25%; right: 15%; animation-delay: 2.4s; }
.desk-obj-pen { bottom: 30%; left: 10%; transform: rotate(-15deg); animation-delay: 2.6s; }

/* === VU METER (Sticky) === */
.vu-meter {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 80px;
    height: 50px;
    z-index: 100;
    background: radial-gradient(circle, #1a1a1e 60%, #0d0d0f 100%);
    border: 1px solid #c5a356;
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5), inset 0 0 10px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.vu-meter.visible { opacity: 1; }

#vu-needle {
    transform-origin: 40px 45px;
    transition: transform 0.3s ease;
}

/* === ZONES (General) === */
.zone {
    padding: 5rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.zone-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 7vw, 6rem);
    letter-spacing: 0.03em;
    color: #f0e4cc;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.zone-heading .underline-svg {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 6px;
    overflow: visible;
}

.zone-heading .underline-svg line {
    stroke: #00f5e4;
    stroke-width: 2;
    filter: drop-shadow(0 0 4px #00f5e4);
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
}

.zone-heading.animated .underline-svg line {
    animation: underlineDraw 0.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* === DIVIDERS === */
.divider {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.leather-strap {
    height: 30px;
    background: linear-gradient(180deg, #5a2e1f, #6b3a2a, #5a2e1f);
    border-top: 2px solid #8b5e3c;
    border-bottom: 2px solid #4a2010;
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.strap-buckle {
    width: 40px;
    height: 24px;
    border: 3px solid #c5a356;
    border-radius: 4px;
    background: linear-gradient(135deg, #d4b76a, #8a7434);
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    position: relative;
}

.strap-buckle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid #6b3a2a;
}

.circuit-trace {
    height: 20px;
    margin: 2rem auto;
}

.circuit-trace svg {
    width: 100%;
    height: 20px;
    filter: drop-shadow(0 0 4px rgba(0, 245, 228, 0.3));
}

.torn-paper {
    height: 20px;
    margin: 2rem auto;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 10px,
        #f0e4cc 10px,
        #f0e4cc 12px,
        transparent 12px,
        transparent 18px
    );
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 20'%3E%3Cpath d='M0,10 Q25,2 50,10 T100,10 T150,10 T200,10 T250,10 T300,10 T350,10 T400,10 T450,10 T500,10 T550,10 T600,10 T650,10 T700,10 T750,10 T800,10 T850,10 T900,10 T950,10 T1000,10 L1000,20 L0,20 Z' fill='white'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 20'%3E%3Cpath d='M0,10 Q25,2 50,10 T100,10 T150,10 T200,10 T250,10 T300,10 T350,10 T400,10 T450,10 T500,10 T550,10 T600,10 T650,10 T700,10 T750,10 T800,10 T850,10 T900,10 T950,10 T1000,10 L1000,20 L0,20 Z' fill='white'/%3E%3C/svg%3E");
}

/* === ZONE 1: THE GAUGE === */
.zone-gauge {
    text-align: center;
}

.gauge-display {
    max-width: 500px;
    margin: 0 auto;
}

.vu-large {
    width: 100%;
    max-width: 400px;
    filter: drop-shadow(0 0 8px rgba(0, 245, 228, 0.2));
}

.gauge-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    fill: #00f5e4;
    text-anchor: middle;
    letter-spacing: 0.1em;
}

.gauge-label.danger {
    fill: #ff2d7b;
}

.gauge-reading {
    font-family: 'Share Tech Mono', monospace;
    font-size: 28px;
    fill: #ffb627;
    text-anchor: middle;
    text-shadow: 0 0 8px #ffb627;
    filter: drop-shadow(0 0 8px #ffb627);
    animation: neonPulse 3s ease-in-out infinite;
}

.gauge-caption {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.9rem, 1.5vw, 1.3rem);
    color: #c5a356;
    margin-top: 1.5rem;
    transform: rotate(-1deg);
}

#gauge-needle {
    transform-origin: 200px 200px;
    transition: transform 0.8s ease;
}

/* === ZONE 2: THE JOURNAL === */
.zone-journal {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Crect width='100' height='100' fill='%236b3a2a'/%3E%3Ccircle cx='12' cy='8' r='0.8' fill='%235a2e1f' opacity='0.6'/%3E%3Ccircle cx='45' cy='15' r='0.5' fill='%237a4530' opacity='0.5'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 50% 50%, #7a4530 0%, #6b3a2a 60%);
    border-radius: 4px;
    padding: 4rem 3rem;
    max-width: 1000px;
}

.journal-book {
    display: grid;
    grid-template-columns: 1fr 4px 1fr;
    gap: 2rem;
}

.journal-spine {
    background: #5a2e1f;
    box-shadow: 2px 0 4px rgba(0,0,0,0.3), -2px 0 4px rgba(0,0,0,0.3);
    border-radius: 2px;
}

.journal-left, .journal-right {
    background: #f0e4cc;
    color: #0d0d0f;
    padding: 2rem;
    border-radius: 2px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

.journal-left p {
    margin-bottom: 1rem;
    text-indent: 1.5em;
}

.journal-date {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6b3a2a;
    text-indent: 0 !important;
    margin-bottom: 1.5rem !important;
    border-bottom: 1px solid #d4b76a;
    padding-bottom: 0.5rem;
}

/* Annotations */
.annotation {
    background: transparent;
    padding: 0.8rem;
    margin: 1rem 0;
}

.annotation-text {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.9rem, 1.5vw, 1.3rem);
    color: #6b3a2a;
    font-weight: 700;
}

/* Data Table */
.data-table {
    margin: 1.5rem 0;
    border: 1px solid #c5a356;
    border-radius: 2px;
    overflow: hidden;
}

.data-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.8rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    letter-spacing: 0.12em;
    color: #1a1a1e;
    border-bottom: 1px solid rgba(197, 163, 86, 0.3);
}

.data-row:last-child { border-bottom: none; }
.data-year { font-weight: bold; }

.data-val.neon-cyan {
    color: #00f5e4;
    text-shadow: 0 0 8px #00f5e4;
    font-weight: bold;
}

.molecular-diagram {
    text-align: center;
    margin-top: 1.5rem;
    opacity: 0.7;
}

/* === ZONE 3: SPECIMEN TRAY === */
.zone-specimens {
    text-align: center;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.specimen-card {
    background: linear-gradient(145deg, #1a1a1e 0%, #2a2a2e 100%);
    border: 1px solid #c5a356;
    border-radius: 4px;
    padding: 1.5rem;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.6);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.specimen-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.6), 0 8px 20px rgba(0,0,0,0.4);
}

.specimen-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #f0e4cc;
    margin-bottom: 1rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.specimen-card:hover .specimen-label {
    color: #00f5e4;
    text-shadow: 0 0 8px #00f5e4, 0 0 24px #00f5e4;
}

.specimen-svg {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    display: block;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.specimen-card:hover .specimen-svg { opacity: 1; }

.specimen-info { text-align: left; }

.specimen-formula {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: #ffb627;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.5rem;
}

.specimen-desc {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.85rem;
    color: #f0e4cc;
    opacity: 0.8;
    line-height: 1.6;
}

/* === ZONE 4: THE MAP === */
.zone-map {
    text-align: center;
}

.map-container {
    max-width: 900px;
    margin: 0 auto;
    border: 3px solid #c5a356;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    overflow: hidden;
    position: relative;
}

.topo-map { width: 100%; height: auto; display: block; }

.map-label-neon {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    fill: #00f5e4;
    letter-spacing: 0.1em;
    text-anchor: middle;
}

.map-label-amber {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    fill: #ffb627;
    letter-spacing: 0.1em;
    text-anchor: middle;
}

.map-label-ink {
    font-family: 'Caveat', cursive;
    font-size: 14px;
    fill: #6b3a2a;
}

.map-annotation {
    font-family: 'Caveat', cursive;
    font-size: 11px;
    fill: #6b3a2a;
    opacity: 0.6;
}

.contour-glow {
    filter: drop-shadow(0 0 4px currentColor);
    animation: neonPulse 3s ease-in-out infinite;
}

.map-caption {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.9rem, 1.5vw, 1.3rem);
    color: #c5a356;
    margin-top: 1.5rem;
    transform: rotate(0.5deg);
    padding: 0 1rem;
}

/* === ZONE 5: THE LETTER === */
.zone-letter {
    text-align: center;
}

.letter-paper {
    max-width: 650px;
    margin: 0 auto;
    background: #f0e4cc;
    color: #0d0d0f;
    padding: 3rem;
    border-radius: 2px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4), inset 0 0 30px rgba(0,0,0,0.05);
    text-align: left;
    position: relative;
    transform: rotate(-0.5deg);
}

.letter-salutation {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    color: #6b3a2a;
    margin-bottom: 1.5rem;
}

.letter-paper p {
    margin-bottom: 1rem;
    text-indent: 1.5em;
}

.letter-paper p:first-of-type { text-indent: 0; }

.letter-closing {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    color: #6b3a2a;
    margin-top: 2rem;
    text-indent: 0 !important;
}

.letter-signature {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #1a1a1e;
}

.wax-seal {
    position: absolute;
    bottom: -20px;
    right: 30px;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
}

.wax-seal svg {
    display: block;
}

/* === BOTTOM NAVIGATION DRAWER === */
.nav-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-pull-tab {
    width: 60px;
    height: 24px;
    background: linear-gradient(180deg, #d4b76a, #c5a356, #8a7434);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.nav-pull-tab:hover { transform: translateY(-2px); }

.pull-tab-line {
    width: 24px;
    height: 2px;
    background: #6b3a2a;
    border-radius: 1px;
}

.nav-panel {
    width: 100%;
    background:
        linear-gradient(180deg, #5a2e1f, #6b3a2a);
    border-top: 2px solid #c5a356;
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.nav-panel.open {
    max-height: 80px;
    padding: 1rem 2rem;
}

.nav-tab {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #f0e4cc;
    text-decoration: none;
    padding: 0.5rem 1.2rem;
    border: 1px solid #c5a356;
    border-radius: 2px;
    margin: 0 0.3rem;
    background: linear-gradient(135deg, rgba(212,183,106,0.1), rgba(138,116,52,0.1));
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.nav-tab:hover {
    color: #00f5e4;
    box-shadow: 0 0 8px rgba(0, 245, 228, 0.3);
    background: linear-gradient(135deg, rgba(0,245,228,0.1), rgba(0,245,228,0.05));
}

/* === MOBILE === */
@media (max-width: 768px) {
    .journal-book {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .journal-spine { display: none; }

    .journal-right {
        position: relative;
    }

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

    .desk-obj-vial, .desk-obj-pen { display: none; }

    .zone { padding: 3rem 1rem; }

    .nav-tab { font-size: 0.7rem; padding: 0.4rem 0.6rem; }

    .letter-paper { padding: 2rem 1.5rem; }

    .brass-corner { width: 40px; height: 40px; }
    .brass-corner::before { width: 25px; }
    .brass-corner::after { height: 25px; }
}

@media (max-width: 480px) {
    .specimen-grid {
        grid-template-columns: 1fr;
    }
}
