/* ==========================================================================
   scire.bar - Deep Burgundy Seapunk Knowledge Temple
   ========================================================================== */

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

:root {
    --wine-dark: #4A1A2E;
    --abyss-deep: #1A0A14;
    --bioluminescent-pink: #FF6B9D;
    --amber-glow: #D4A050;
    --pressure-white: #E8D8D0;
    --noise-mauve: #8B6B78;
    --seafloor: #0A0508;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.9;
    color: var(--pressure-white);
    background: linear-gradient(to bottom, #4A1A2E 0%, #1A0A14 40%, #0A0508 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Noise Overlay --- */
#noise-svg {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    transition: opacity 1s ease;
}

/* --- Organisms Container --- */
#organisms-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.organism {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    will-change: opacity, transform;
}

.organism.small {
    width: var(--size, 5px);
    height: var(--size, 5px);
}

.organism.large {
    width: var(--size, 30px);
    height: var(--size, 30px);
}

.organism.pink {
    background: radial-gradient(circle, var(--bioluminescent-pink) 0%, rgba(255, 107, 157, 0.3) 50%, transparent 70%);
    box-shadow: 0 0 8px 2px rgba(255, 107, 157, 0.2);
}

.organism.amber {
    background: radial-gradient(circle, var(--amber-glow) 0%, rgba(212, 160, 80, 0.3) 50%, transparent 70%);
    box-shadow: 0 0 8px 2px rgba(212, 160, 80, 0.2);
}

.organism.visible {
    opacity: var(--base-opacity, 0.5);
}

.organism.illuminated {
    opacity: 1 !important;
    transform: scale(1.3);
}

/* Pulsing animation */
@keyframes pulse-slow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

@keyframes pulse-medium {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.75; }
}

@keyframes pulse-fast {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.85; }
}

.organism.pulsing-slow {
    animation: pulse-slow 5s ease-in-out infinite;
}

.organism.pulsing-medium {
    animation: pulse-medium 4s ease-in-out infinite;
}

.organism.pulsing-fast {
    animation: pulse-fast 3s ease-in-out infinite;
}

/* --- Sections --- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.section-inner {
    width: 100%;
    padding: 40px 20px;
}

.content-column {
    max-width: 600px;
    margin: 0 auto;
}

/* --- Surface Break --- */
#surface-break {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#surface-break .section-inner {
    max-width: 800px;
    margin: 0 auto;
}

.wordmark {
    font-family: 'Cormorant Garamond', 'Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(42px, 8vw, 96px);
    letter-spacing: 0.05em;
    color: var(--pressure-white);
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.wordmark.visible {
    opacity: 1;
    transform: scale(1);
}

.wordmark-subtitle {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.15em;
    color: var(--noise-mauve);
    margin-top: 20px;
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

.wordmark-subtitle.visible {
    opacity: 1;
}

.label-latin {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 13px;
    color: var(--amber-glow);
    letter-spacing: 0.1em;
}

/* --- Descent Sections --- */
.descent-section {
    min-height: 60vh;
    padding: 80px 0;
}

.section-label {
    display: block;
    font-family: 'Space Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 13px;
    color: var(--amber-glow);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-label.visible {
    opacity: 0.7;
    transform: translateY(0);
}

.section-heading {
    font-family: 'Cormorant Garamond', 'Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(28px, 4.5vw, 56px);
    color: var(--pressure-white);
    line-height: 1.2;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease 0.1s, transform 0.7s ease 0.1s;
}

.section-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-body {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.9;
    color: var(--pressure-white);
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease 0.2s, transform 0.7s ease 0.2s;
}

.section-body.visible {
    opacity: 0.9;
    transform: translateY(0);
}

.illuminated-passage {
    border-left: 2px solid var(--bioluminescent-pink);
    padding: 20px 24px;
    margin: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.illuminated-passage.visible {
    opacity: 1;
    transform: translateY(0);
}

.illuminated-passage em {
    font-family: 'Cormorant Garamond', 'Garamond', 'Times New Roman', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.6;
    color: var(--bioluminescent-pink);
}

/* --- The Abyss --- */
#the-abyss .illuminated-passage {
    border-left-color: var(--amber-glow);
}

#the-abyss .illuminated-passage em {
    color: var(--amber-glow);
}

/* --- Seafloor Footer --- */
#seafloor {
    min-height: 40vh;
    text-align: center;
    padding: 80px 0;
}

.footer-text {
    font-family: 'Cormorant Garamond', 'Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(20px, 3vw, 32px);
    color: var(--pressure-white);
    opacity: 0.5;
    margin-top: 24px;
}

.footer-sub {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 13px;
    color: var(--noise-mauve);
    letter-spacing: 0.1em;
    margin-top: 12px;
    opacity: 0.4;
}

/* --- Selection Color --- */
::selection {
    background: rgba(255, 107, 157, 0.3);
    color: var(--pressure-white);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--abyss-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--noise-mauve);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bioluminescent-pink);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-inner {
        padding: 30px 16px;
    }

    .descent-section {
        padding: 60px 0;
    }

    .illuminated-passage {
        padding: 16px 20px;
    }
}
