/* =====================================================================
   scire.bar v2 — seapunk in burgundy depths
   Palette:
     #4A1A2E  Wine Dark (primary background, surface)
     #1A0A14  Abyss Deep (deep sections)
     #0A0508  Seafloor (deepest dark)
     #FF6B9D  Bioluminescent Pink
     #D4A050  Amber Glow
     #E8D8D0  Pressure White (text)
     #8B6B78  Noise Mauve
   Fonts:
     "Cormorant Garamond" — headlines (Garamond classic, italic-capable)
     "Lora"               — body
     "Space Mono"         — labels / Latin / data
   ===================================================================== */

:root {
    --c-wine: #4A1A2E;
    --c-abyss: #1A0A14;
    --c-seafloor: #0A0508;
    --c-pink: #FF6B9D;
    --c-amber: #D4A050;
    --c-text: #E8D8D0;
    --c-mauve: #8B6B78;
    --font-headline: "Cormorant Garamond", "Lora", Georgia, serif;
    --font-body: "Lora", Georgia, serif;
    --font-mono: "Space Mono", "IBM Plex Mono", "Courier New", monospace;
    --column-width: 600px;
}

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

html {
    background: var(--c-wine);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.9;
    color: var(--c-text);
    background:
        linear-gradient(
            to bottom,
            var(--c-wine)   0%,
            var(--c-wine)   18%,
            var(--c-abyss) 60%,
            var(--c-seafloor) 100%
        );
    background-attachment: fixed;
    overflow-x: hidden;
    cursor: crosshair;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* SVG noise filter source is invisible; only used by overlay */
.noise-defs {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Noise-texture deep-pressure surface, fixed across viewport, intensifies via JS */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.03;
    mix-blend-mode: overlay;
    background-color: transparent;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.545  0 0 0 0 0.420  0 0 0 0 0.471  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-size: 220px 220px;
    transition: opacity 600ms ease;
}

/* Cursor halo — diver's light */
.cursor-halo {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 320px;
    z-index: 2;
    pointer-events: none;
    transform: translate3d(-9999px, -9999px, 0);
    background: radial-gradient(
        circle at center,
        rgba(255, 107, 157, 0.18) 0%,
        rgba(212, 160, 80, 0.10) 30%,
        rgba(74, 26, 46, 0.0)    70%
    );
    mix-blend-mode: screen;
    will-change: transform;
    transition: opacity 400ms ease;
    opacity: 0;
}

.cursor-halo.is-visible {
    opacity: 1;
}

/* =====================================================================
   Main column / sections
   ===================================================================== */

#descent {
    position: relative;
    z-index: 5;
}

.surface-break,
.descent-section,
.abyss-section,
.seafloor {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.surface-break {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px 60px;
}

.descent-section {
    min-height: 60vh;
    padding: 80px 20px 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.abyss-section {
    min-height: 90vh;
    padding: 120px 20px 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(255, 107, 157, 0.045) 0%, rgba(0,0,0,0) 60%),
        linear-gradient(to bottom, transparent 0%, rgba(10, 5, 8, 0.4) 100%);
}

.seafloor {
    min-height: 60vh;
    padding: 100px 20px 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(212, 160, 80, 0.04) 0%, rgba(0,0,0,0) 70%),
        linear-gradient(to bottom, transparent 0%, var(--c-seafloor) 100%);
}

/* =====================================================================
   Surface break / wordmark
   ===================================================================== */

.surface-content {
    max-width: var(--column-width);
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.wordmark {
    font-family: var(--font-headline);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(56px, 11vw, 132px);
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--c-text);
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 1400ms ease, transform 1600ms cubic-bezier(0.2, 0.7, 0.2, 1);
    text-shadow: 0 0 32px rgba(255, 107, 157, 0.18);
}

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

.wordmark-dot {
    color: var(--c-pink);
    font-style: normal;
    text-shadow: 0 0 12px rgba(255, 107, 157, 0.7);
}

.wordmark-sub {
    margin-top: 18px;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.32em;
    text-transform: lowercase;
    color: var(--c-mauve);
    opacity: 0;
    transition: opacity 1200ms ease 600ms;
}

.wordmark-sub.is-visible {
    opacity: 1;
}

.depth-meter {
    margin-top: 56px;
    display: inline-flex;
    align-items: baseline;
    gap: 14px;
    padding: 8px 18px;
    border: 1px solid rgba(232, 216, 208, 0.18);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--c-mauve);
    opacity: 0;
    transition: opacity 1200ms ease 1100ms;
}

.depth-meter.is-visible {
    opacity: 1;
}

.depth-label {
    color: var(--c-mauve);
}

.depth-value {
    color: var(--c-amber);
    text-shadow: 0 0 10px rgba(212, 160, 80, 0.45);
    font-weight: 700;
    min-width: 5ch;
    text-align: left;
}

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 36px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 3;
    opacity: 0;
    animation: cueFade 1200ms ease 1800ms forwards,
               cueDrift 3200ms ease-in-out 3000ms infinite;
}

.scroll-cue-line {
    display: block;
    width: 1px;
    height: 56px;
    background: linear-gradient(to bottom, rgba(232, 216, 208, 0) 0%, rgba(232, 216, 208, 0.6) 100%);
}

.scroll-cue-word {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.4em;
    text-transform: lowercase;
    color: var(--c-mauve);
}

@keyframes cueFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes cueDrift {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 8px); }
}

/* =====================================================================
   Passages
   ===================================================================== */

.passage {
    max-width: var(--column-width);
    margin: 0 auto;
    position: relative;
    z-index: 3;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1200ms ease, transform 1200ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

.passage-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--c-amber);
    margin-bottom: 22px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(212, 160, 80, 0.25);
    text-shadow: 0 0 8px rgba(212, 160, 80, 0.25);
}

.passage-heading {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: clamp(28px, 4.5vw, 56px);
    line-height: 1.18;
    color: var(--c-text);
    margin-bottom: 28px;
    letter-spacing: -0.005em;
    text-wrap: balance;
}

.passage-heading em {
    font-style: italic;
    font-weight: 400;
    color: var(--c-pink);
    text-shadow: 0 0 18px rgba(255, 107, 157, 0.35);
}

.passage-body {
    font-family: var(--font-body);
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.9;
    color: var(--c-text);
    margin-bottom: 24px;
}

.passage-body em {
    font-style: italic;
    font-weight: 700;
    color: var(--c-amber);
}

.passage-aside {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--c-mauve);
    text-transform: lowercase;
    padding-left: 12px;
    border-left: 1px solid rgba(139, 107, 120, 0.45);
    font-style: normal;
}

.passage-list {
    list-style: none;
    margin: 28px 0 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid rgba(232, 216, 208, 0.08);
    border-bottom: 1px solid rgba(232, 216, 208, 0.08);
    padding: 18px 0;
}

.passage-list li {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: var(--c-text);
    padding-left: 18px;
    position: relative;
}

.passage-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.85em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--c-pink) 0%, rgba(255, 107, 157, 0) 70%);
    box-shadow: 0 0 10px rgba(255, 107, 157, 0.6);
}

.passage-list li em {
    color: var(--c-amber);
    font-style: italic;
    font-weight: 700;
    margin-right: 8px;
}

/* Abyss-specific passage */
.abyss-passage {
    text-align: left;
}

.abyss-heading em {
    color: var(--c-amber);
    text-shadow: 0 0 22px rgba(212, 160, 80, 0.4);
}

.abyss-quote {
    margin: 36px 0 28px;
    padding: 28px 24px;
    border-left: 2px solid rgba(255, 107, 157, 0.45);
    background: linear-gradient(
        to right,
        rgba(255, 107, 157, 0.04) 0%,
        rgba(255, 107, 157, 0) 100%
    );
    font-family: var(--font-headline);
    font-style: italic;
    font-size: clamp(20px, 2.4vw, 26px);
    line-height: 1.45;
    color: var(--c-text);
    position: relative;
}

.abyss-quote em {
    color: var(--c-pink);
    font-style: italic;
    text-shadow: 0 0 14px rgba(255, 107, 157, 0.35);
}

.quote-mark {
    color: var(--c-amber);
    font-family: var(--font-headline);
    font-size: 1.4em;
    line-height: 0;
    vertical-align: -0.1em;
    text-shadow: 0 0 10px rgba(212, 160, 80, 0.4);
    margin: 0 4px;
}

/* =====================================================================
   Seafloor footer
   ===================================================================== */

.seafloor-content {
    max-width: var(--column-width);
    margin: 0 auto;
    position: relative;
    z-index: 3;
    text-align: center;
}

.seafloor-mark {
    font-family: var(--font-headline);
    font-style: italic;
    font-weight: 600;
    font-size: clamp(36px, 5.5vw, 64px);
    line-height: 1;
    color: var(--c-text);
    margin-bottom: 14px;
    text-shadow: 0 0 22px rgba(255, 107, 157, 0.18);
}

.seafloor-tagline {
    font-family: var(--font-headline);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(16px, 1.8vw, 20px);
    color: var(--c-mauve);
    margin-bottom: 44px;
    letter-spacing: 0.01em;
}

.seafloor-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 440px;
    margin: 0 auto 44px;
    text-align: left;
    border-top: 1px solid rgba(232, 216, 208, 0.08);
    border-bottom: 1px solid rgba(232, 216, 208, 0.08);
    padding: 24px 0;
}

.meta-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: baseline;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
}

.meta-row dt {
    color: var(--c-amber);
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 10px;
}

.meta-row dd {
    color: var(--c-text);
    font-family: var(--font-body);
    font-style: italic;
    letter-spacing: 0;
    font-size: 13px;
}

.seafloor-fine {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: lowercase;
    color: var(--c-mauve);
    opacity: 0.72;
}

/* =====================================================================
   Star-celestial bioluminescent organisms
   ===================================================================== */

.organism-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

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

/* Pink-glow (Bioluminescent Pink) */
.organism.t-pink {
    background: radial-gradient(
        circle,
        rgba(255, 107, 157, 0.95) 0%,
        rgba(255, 107, 157, 0.55) 25%,
        rgba(255, 107, 157, 0.0) 70%
    );
    box-shadow: 0 0 12px rgba(255, 107, 157, 0.55);
}

/* Amber-glow */
.organism.t-amber {
    background: radial-gradient(
        circle,
        rgba(212, 160, 80, 0.95) 0%,
        rgba(212, 160, 80, 0.55) 25%,
        rgba(212, 160, 80, 0.0) 70%
    );
    box-shadow: 0 0 12px rgba(212, 160, 80, 0.55);
}

/* Pressure-white inner core for largest organisms */
.organism.t-bright {
    background: radial-gradient(
        circle,
        rgba(232, 216, 208, 1) 0%,
        rgba(255, 107, 157, 0.7) 18%,
        rgba(255, 107, 157, 0.0) 70%
    );
    box-shadow:
        0 0 14px rgba(255, 107, 157, 0.6),
        0 0 28px rgba(232, 216, 208, 0.18);
}

/* Pulse cycles, randomized via inline animation-delay */
.organism.pulse-a {
    animation: pulseA 4.2s ease-in-out infinite;
}
.organism.pulse-b {
    animation: pulseB 5.6s ease-in-out infinite;
}
.organism.pulse-c {
    animation: pulseC 3.4s ease-in-out infinite;
}

@keyframes pulseA {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.85; }
}

@keyframes pulseB {
    0%, 100% { opacity: 0.5; }
    40%      { opacity: 0.78; }
    60%      { opacity: 0.62; }
}

@keyframes pulseC {
    0%, 100% { opacity: 0.42; }
    33%      { opacity: 0.8; }
    67%      { opacity: 0.55; }
}

/* When cursor is near, JS applies these */
.organism.is-lit {
    filter: brightness(1.45) saturate(1.2);
    transform: translate3d(0, 0, 0) scale(1.3);
    opacity: 1 !important;
}

.organism.is-lit.t-pink {
    box-shadow: 0 0 22px rgba(255, 107, 157, 0.95),
                0 0 40px rgba(255, 107, 157, 0.45);
}

.organism.is-lit.t-amber {
    box-shadow: 0 0 22px rgba(212, 160, 80, 0.95),
                0 0 40px rgba(212, 160, 80, 0.45);
}

.organism.is-lit.t-bright {
    box-shadow:
        0 0 28px rgba(232, 216, 208, 0.65),
        0 0 50px rgba(255, 107, 157, 0.45);
}

/* =====================================================================
   Responsive tightening
   ===================================================================== */

@media (max-width: 700px) {
    body {
        cursor: default;
    }

    .descent-section { padding: 60px 22px 60px; }
    .surface-break   { padding: 30px 22px 50px; }
    .seafloor        { padding: 80px 22px 100px; }
    .abyss-section   { padding: 100px 22px 110px; }

    .meta-row {
        grid-template-columns: 70px 1fr;
        gap: 10px;
    }

    .scroll-cue { bottom: 22px; }
    .scroll-cue-line { height: 40px; }

    .cursor-halo { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .organism.pulse-a,
    .organism.pulse-b,
    .organism.pulse-c { animation: none; opacity: 0.7; }
    .scroll-cue { animation: cueFade 800ms ease 600ms forwards; }
    .wordmark, .wordmark-sub, .depth-meter, .passage {
        transition-duration: 400ms;
    }
}
