/* ========================================
   BBOTTL.com - Interstellar Apothecary
   ======================================== */

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #1A0F0A;
}
::-webkit-scrollbar-thumb {
    background: #D4875E;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #E87F5E;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #D4875E #1A0F0A;
}

/* --- Color Reference (Design Compliance) ---
   #1A0F0A - Deep Background (Roasted Cocoa)
   #2B1810 - Background gradient start
   #3E2718 - Panel Background (Warm Umber Glass)
   #F2C078 - Primary Accent (Amber Glow)
   #D4875E - Secondary Accent (Terracotta Ink)
   #E8D5C4 - Body Text (Pale Parchment)
   #5ED4B8 - Highlight / Glow (Bioluminescent Teal)
   #E87F5E - Blob Fill 1 (Warm Coral Plasma)
   #C4892B - Blob Fill 2 (Deep Saffron)
   #8B6B61 - Border / Subtle (Dusty Mauve)
*/

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

html {
    scroll-behavior: smooth;
}

body {
    background: #1A0F0A;
    color: #E8D5C4;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 1.125rem;
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* --- Typography --- */
h1, h2, h3, .section-heading, .hero-title, .closing-title {
    font-family: 'Bebas Neue', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #F2C078;
    text-shadow: 0 0 20px rgba(242, 192, 120, 0.15);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 5rem);
}

h2, .section-heading {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

p {
    text-shadow: 0 0 20px rgba(242, 192, 120, 0.15);
}

/* --- Parallax Layers --- */
.parallax-layer {
    position: relative;
    width: 100%;
}

#bg-plane {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(180deg, #2B1810 0%, #1A0F0A 50%, #2B1810 100%);
    overflow: hidden;
    pointer-events: none;
}

#content-plane {
    position: relative;
    z-index: 1;
}

#fg-plane {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

/* --- Constellations --- */
.constellation {
    position: absolute;
    opacity: 0.06;
}

.constellation-1 {
    top: 5%;
    left: 10%;
    width: 400px;
    height: 300px;
}

.constellation-2 {
    top: 35%;
    right: 5%;
    width: 300px;
    height: 400px;
}

.constellation-3 {
    top: 65%;
    left: 20%;
    width: 500px;
    height: 350px;
}

/* --- Background Blobs --- */
.bg-blob {
    position: absolute;
    opacity: 0.08;
}

.blob-1 {
    width: 400px;
    height: 400px;
    top: -5%;
    left: -5%;
    animation: blobDrift1 28s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.blob-2 {
    width: 350px;
    height: 350px;
    top: 20%;
    right: -8%;
    animation: blobDrift2 35s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.blob-3 {
    width: 300px;
    height: 300px;
    top: 45%;
    left: 15%;
    animation: blobDrift3 22s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.blob-4 {
    width: 380px;
    height: 380px;
    top: 60%;
    right: 10%;
    animation: blobDrift4 40s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.blob-5 {
    width: 320px;
    height: 320px;
    top: 80%;
    left: -3%;
    animation: blobDrift5 32s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes blobDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(60px, 30px) scale(1.05); }
    50% { transform: translate(20px, 80px) scale(0.95); }
    75% { transform: translate(-40px, 40px) scale(1.02); }
}

@keyframes blobDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-50px, 50px) scale(0.97); }
    50% { transform: translate(-80px, 20px) scale(1.04); }
    75% { transform: translate(-30px, -30px) scale(0.98); }
}

@keyframes blobDrift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -40px) scale(1.06); }
    66% { transform: translate(-30px, 60px) scale(0.94); }
}

@keyframes blobDrift4 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(-40px, 20px) scale(1.03); }
    40% { transform: translate(30px, 60px) scale(0.96); }
    60% { transform: translate(-20px, 80px) scale(1.05); }
    80% { transform: translate(50px, 30px) scale(0.98); }
}

@keyframes blobDrift5 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    30% { transform: translate(70px, -20px) scale(1.04); }
    60% { transform: translate(30px, 50px) scale(0.97); }
}

/* --- Navigation --- */
#main-nav {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-bottle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.bottle-cap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #D4875E;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(62, 39, 24, 0.6);
    backdrop-filter: blur(8px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

.cap-letter {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.95rem;
    color: #F2C078;
    letter-spacing: 0.05em;
}

.cap-cork {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 6px;
    background: #D4875E;
    border-radius: 2px;
    opacity: 0.7;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
}

.nav-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.75rem;
    color: #F2C078;
    letter-spacing: 0.15em;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
}

.nav-bottle:hover .bottle-cap {
    transform: scale(1.05);
    border-color: #5ED4B8;
    box-shadow: 0 0 12px rgba(94, 212, 184, 0.3);
}

.nav-bottle:hover .cap-cork {
    transform: translateX(-50%) translateY(-8px) rotate(15deg);
    opacity: 0.5;
}

.nav-bottle:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
}

.nav-bottle.active .bottle-cap {
    border-color: #5ED4B8;
    box-shadow: 0 0 16px rgba(94, 212, 184, 0.4);
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.hero-title {
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: 0.2em;
    color: #F2C078;
    text-shadow: 0 0 40px rgba(242, 192, 120, 0.2),
                 0 0 80px rgba(242, 192, 120, 0.1);
    line-height: 1;
}

.hero-bottle {
    width: 180px;
    height: 360px;
}

.hero-bottle-svg {
    width: 100%;
    height: 100%;
}

.bottle-inner-glow {
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 12px rgba(94, 212, 184, 0.3));
        opacity: 0.6;
    }
    50% {
        filter: drop-shadow(0 0 24px rgba(94, 212, 184, 0.5));
        opacity: 0.8;
    }
}

.scroll-chevron {
    width: 40px;
    height: 24px;
    animation: chevronBounce 2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.scroll-chevron svg {
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

@keyframes chevronBounce {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(10px); opacity: 1; }
}

/* --- Section Dividers --- */
.section-divider {
    width: 100%;
    padding: 20px 0;
    overflow: hidden;
}

.section-divider svg {
    width: 100%;
    height: 80px;
    display: block;
}

.wavy-line {
    animation: wavyOscillate 6s ease-in-out infinite;
}

@keyframes wavyOscillate {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* --- Scroll Sections --- */
.scroll-section {
    padding: 80px 0;
    position: relative;
}

/* --- Section Headings --- */
.section-heading {
    text-align: center;
    margin-bottom: 60px;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.2em;
}

/* --- Panel Glass Effect --- */
.panel-glass {
    background: rgba(62, 39, 24, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 135, 94, 0.3);
    border-radius: 8px;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(12px)) {
    .panel-glass {
        background: #3E2718;
    }
}

.panel-wide {
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Dot Grid Overlay --- */
.dot-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #E8D5C4 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.08;
    pointer-events: none;
}

/* --- Specimen Panels --- */
.specimen-panel {
    max-width: 900px;
    margin: 0 auto -40px auto;
    padding: 0 40px;
    position: relative;
}

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

.panel-offset-right {
    margin-left: 10%;
    margin-right: auto;
}

.panel-offset-left {
    margin-right: 10%;
    margin-left: auto;
}

.specimen-content {
    display: flex;
    gap: 40px;
    align-items: center;
}

.specimen-illustration {
    flex-shrink: 0;
    width: 160px;
    height: 280px;
}

.specimen-illustration svg {
    width: 100%;
    height: 100%;
}

.specimen-info {
    flex: 1;
}

.specimen-label {
    font-family: 'Courier Prime', monospace;
    font-size: 0.8rem;
    color: #D4875E;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 8px;
}

.specimen-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #F2C078;
    letter-spacing: 0.15em;
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(242, 192, 120, 0.15);
}

.specimen-desc {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: #E8D5C4;
    opacity: 0.9;
}

/* --- Interactive Blobs --- */
.interactive-blob {
    position: absolute;
    bottom: 20px;
    right: 30px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.interactive-blob svg {
    width: 100%;
    height: 100%;
}

.interactive-blob:hover {
    transform: scale(1.4);
}

.blob-tooltip {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier Prime', monospace;
    font-size: 0.7rem;
    color: #5ED4B8;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.interactive-blob:hover .blob-tooltip {
    opacity: 1;
}

/* --- Laboratory Section --- */
.laboratory-panel {
    padding: 0 40px;
}

.lab-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.lab-diagram {
    width: 100%;
    overflow: hidden;
}

.lab-machine-svg {
    width: 100%;
    max-height: 500px;
}

.lab-caption {
    font-family: 'Courier Prime', monospace;
    font-size: 0.85rem;
    color: #D4875E;
    line-height: 1.6;
    text-align: center;
    opacity: 0.8;
    max-width: 700px;
    margin: 0 auto;
}

.lab-glow {
    animation: labGlowPulse 3s ease-in-out infinite;
}

@keyframes labGlowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.rising-bubble {
    animation: riseBubble 4s ease-in-out infinite;
}

@keyframes riseBubble {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(-10px); opacity: 0.5; }
}

.lab-blob {
    animation: labBlobPulse 5s ease-in-out infinite;
}

@keyframes labBlobPulse {
    0%, 100% { transform: scale(1); opacity: 0.08; }
    50% { transform: scale(1.15); opacity: 0.12; }
}

/* --- Archive Section --- */
.archive-panel {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
}

.archive-content {
    padding: 20px 0;
}

.journal-entry {
    position: relative;
}

.journal-date {
    font-family: 'Courier Prime', monospace;
    font-size: 0.8rem;
    color: #D4875E;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 30px;
    opacity: 0.7;
}

.journal-text {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 1.125rem;
    line-height: 1.85;
    color: #E8D5C4;
    margin-bottom: 24px;
}

.journal-text:last-of-type {
    font-style: italic;
    font-size: 1.25rem;
    color: #F2C078;
    margin-top: 32px;
}

.teal-highlight {
    color: #5ED4B8;
    text-shadow: 0 0 12px rgba(94, 212, 184, 0.3);
    animation: tealGlow 3s ease-in-out infinite;
}

@keyframes tealGlow {
    0%, 100% {
        text-shadow: 0 0 12px rgba(94, 212, 184, 0.3);
    }
    50% {
        text-shadow: 0 0 24px rgba(94, 212, 184, 0.5);
    }
}

.journal-signature {
    font-family: 'Courier Prime', monospace;
    font-size: 0.8rem;
    color: #D4875E;
    display: block;
    margin-top: 40px;
    opacity: 0.7;
    font-style: italic;
}

/* --- Closing Section --- */
#closing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.closing-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.closing-bottle {
    width: 100px;
    height: 180px;
}

.closing-bottle-svg {
    width: 100%;
    height: 100%;
}

.closing-glow {
    animation: closingGlowPulse 4s ease-in-out infinite;
}

@keyframes closingGlowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(94, 212, 184, 0.2));
        opacity: 0.4;
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(94, 212, 184, 0.5));
        opacity: 0.7;
    }
}

.closing-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    color: #F2C078;
    letter-spacing: 0.3em;
    opacity: 0.6;
    text-shadow: 0 0 20px rgba(242, 192, 120, 0.15);
}

/* --- Floating Foreground Elements --- */
.floating-element {
    position: absolute;
}

.float-bottle-1 {
    top: 15%;
    right: 8%;
    width: 40px;
    height: 70px;
    animation: floatElement1 25s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.float-bottle-2 {
    top: 40%;
    left: 5%;
    width: 50px;
    height: 80px;
    animation: floatElement2 30s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.float-bottle-3 {
    top: 65%;
    right: 12%;
    width: 35px;
    height: 65px;
    animation: floatElement3 20s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.float-blob-1 {
    top: 25%;
    left: 15%;
    width: 60px;
    height: 60px;
    animation: floatElement4 35s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.float-blob-2 {
    top: 55%;
    right: 20%;
    width: 70px;
    height: 70px;
    animation: floatElement5 28s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.float-label-1 {
    top: 50%;
    left: 8%;
    width: 80px;
    height: 30px;
    animation: floatElement6 33s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

@keyframes floatElement2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(20px, -30px) rotate(-3deg); }
    66% { transform: translate(-10px, 25px) rotate(2deg); }
}

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

@keyframes floatElement4 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    30% { transform: translate(30px, 15px) scale(1.1); }
    60% { transform: translate(-20px, 40px) scale(0.9); }
}

@keyframes floatElement5 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(-25px, -20px) scale(1.05); }
    80% { transform: translate(15px, 30px) scale(0.95); }
}

@keyframes floatElement6 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(10px, 25px) rotate(-2deg); }
}

/* --- Panel Reveal Animations --- */
.panel-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.panel-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger siblings */
.specimen-panel.panel-reveal:nth-child(2) { transition-delay: 0ms; }
.specimen-panel.panel-reveal:nth-child(3) { transition-delay: 120ms; }
.specimen-panel.panel-reveal:nth-child(4) { transition-delay: 240ms; }
.specimen-panel.panel-reveal:nth-child(5) { transition-delay: 360ms; }
.specimen-panel.panel-reveal:nth-child(6) { transition-delay: 480ms; }

/* --- Subtle borders & secondary fills --- */
.panel-glass {
    border-color: rgba(139, 107, 97, 0.2); /* #8B6B61 at 20% */
}

.specimen-panel .panel-glass:hover {
    border-color: rgba(139, 107, 97, 0.35); /* #8B6B61 hover state */
}

.journal-entry {
    border-left: 2px solid #8B6B61;
    padding-left: 24px;
}

.lab-caption {
    border-top: 1px solid rgba(196, 137, 43, 0.2); /* #C4892B */
    padding-top: 20px;
}

.section-divider svg path {
    stroke: #C4892B;
    stroke-opacity: 0.3;
}

/* --- Corner Ornaments (pseudo-elements on panels) --- */
.panel-glass::before,
.panel-glass::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: rgba(212, 135, 94, 0.2);
    border-style: solid;
    pointer-events: none;
}

.panel-glass::before {
    top: 10px;
    left: 10px;
    border-width: 1px 0 0 1px;
    border-radius: 3px 0 0 0;
}

.panel-glass::after {
    bottom: 10px;
    right: 10px;
    border-width: 0 1px 1px 0;
    border-radius: 0 0 3px 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .specimen-content {
        flex-direction: column;
        text-align: center;
    }

    .specimen-illustration {
        width: 120px;
        height: 210px;
    }

    .panel-glass {
        padding: 40px 24px;
    }

    .panel-offset-right,
    .panel-offset-left {
        margin-left: auto;
        margin-right: auto;
    }

    .specimen-panel {
        padding: 0 20px;
    }

    .laboratory-panel {
        padding: 0 20px;
    }

    .archive-panel {
        padding: 0 20px;
    }

    #main-nav {
        top: 15px;
        left: 15px;
        gap: 8px;
    }

    .bottle-cap {
        width: 30px;
        height: 30px;
    }

    .cap-letter {
        font-size: 0.8rem;
    }

    .hero-title {
        font-size: clamp(3rem, 10vw, 7rem);
    }

    .hero-bottle {
        width: 130px;
        height: 260px;
    }

    .lab-machine-svg {
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    .specimen-panel {
        margin-bottom: -20px;
    }

    .panel-glass {
        padding: 30px 18px;
    }

    .specimen-illustration {
        width: 100px;
        height: 175px;
    }

    .hero-title {
        font-size: clamp(2.5rem, 14vw, 5rem);
    }

    .hero-bottle {
        width: 100px;
        height: 200px;
    }

    .interactive-blob {
        width: 40px;
        height: 40px;
        bottom: 10px;
        right: 15px;
    }
}
