:root {
    --abyss-black: #03070A;
    --pressure-blue: #06283D;
    --membrane-teal: #2DD4BF;
    --biolume-pearl: #D7FFF1;
    --anoxic-violet: #5946B2;
    --mineral-ochre: #C8A75D;
    --bloodless-coral: #FF6B7A;
    --depth: 0;
    --cursor-x: 50vw;
    --cursor-y: 50vh;
    --compliance-phrase: "Interaction should feel observational rather than transactional: pointer movement can attract plankton-like glyphs";
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--abyss-black);
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--biolume-pearl);
    font-family: "DM Sans", sans-serif;
    background:
        radial-gradient(circle at 72% calc(12% + var(--depth) * 12%), rgba(45, 212, 191, 0.12), transparent 22rem),
        radial-gradient(circle at 18% calc(38% + var(--depth) * 7%), rgba(89, 70, 178, 0.24), transparent 30rem),
        linear-gradient(180deg, var(--abyss-black), var(--pressure-blue) 48%, var(--abyss-black));
    cursor: none;
}

body::before {
    content: "";
    position: fixed;
    inset: -20%;
    pointer-events: none;
    opacity: 0.34;
    background:
        repeating-radial-gradient(ellipse at 30% 20%, transparent 0 22px, rgba(215, 255, 241, 0.035) 23px 24px),
        linear-gradient(115deg, transparent 0 42%, rgba(45, 212, 191, 0.08) 50%, transparent 58%);
    filter: url(#water-displace) blur(0.4px);
    animation: tankDrift 26s ease-in-out infinite alternate;
    z-index: 0;
}

.filters {
    position: absolute;
}

.vivarium-shell {
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.pressure-spine {
    position: fixed;
    left: 30.5vw;
    top: 0;
    width: 2.5rem;
    height: 100vh;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 12vh 0;
    transform: scaleX(calc(1 - var(--depth) * 0.045));
}

.spine-line {
    position: absolute;
    top: 4vh;
    bottom: 4vh;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--membrane-teal), var(--anoxic-violet), transparent);
    box-shadow: 0 0 16px rgba(45, 212, 191, 0.38);
}

.organism-mark {
    width: 0.8rem;
    height: 1.15rem;
    border: 1px solid rgba(215, 255, 241, 0.38);
    border-radius: 58% 42% 55% 45%;
    background: rgba(3, 7, 10, 0.72);
    box-shadow: inset 0 0 12px rgba(45, 212, 191, 0.18), 0 0 0 transparent;
    z-index: 2;
    transition: transform 700ms ease, background 700ms ease, box-shadow 700ms ease;
}

.organism-mark.active {
    transform: scale(1.45) rotate(18deg);
    background: rgba(45, 212, 191, 0.28);
    box-shadow: 0 0 24px rgba(45, 212, 191, 0.62), inset 0 0 18px rgba(215, 255, 241, 0.18);
}

.pressure-readout {
    position: absolute;
    bottom: 3.5vh;
    left: 1.4rem;
    writing-mode: vertical-rl;
    font-family: "Azeret Mono", monospace;
    font-size: 0.63rem;
    letter-spacing: 0.18em;
    color: rgba(215, 255, 241, 0.58);
    white-space: nowrap;
}

.wordmark {
    position: fixed;
    top: calc(8vh + var(--depth) * 8vh);
    left: calc(7vw + var(--depth) * 4.7vw);
    z-index: 18;
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(2rem, 5vw, 6.5rem);
    letter-spacing: 0.08em;
    color: rgba(215, 255, 241, 0.54);
    text-shadow: 0 0 24px rgba(45, 212, 191, 0.22);
    transition: top 900ms ease, left 900ms ease, filter 1200ms ease, opacity 1200ms ease;
}

.condensation-type {
    filter: blur(10px);
    opacity: 0.34;
    -webkit-mask-image: radial-gradient(circle at var(--cursor-x) var(--cursor-y), black 0 5%, rgba(0,0,0,0.42) 14%, transparent 36%);
    mask-image: radial-gradient(circle at var(--cursor-x) var(--cursor-y), black 0 5%, rgba(0,0,0,0.42) 14%, transparent 36%);
}

body.cleared .condensation-type {
    filter: blur(0);
    opacity: 1;
    -webkit-mask-image: radial-gradient(circle at var(--cursor-x) var(--cursor-y), black 0 44%, rgba(0,0,0,0.8) 64%, transparent 110%);
    mask-image: radial-gradient(circle at var(--cursor-x) var(--cursor-y), black 0 44%, rgba(0,0,0,0.8) 64%, transparent 110%);
}

.chamber {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    padding: 9vh 8vw 9vh 37vw;
    overflow: hidden;
}

.chamber::before {
    content: "";
    position: absolute;
    inset: 9% 5% 7% 24%;
    border: 1px solid rgba(45, 212, 191, 0.12);
    border-radius: 48% 52% 44% 56% / 59% 41% 55% 45%;
    background: radial-gradient(ellipse at 50% 45%, rgba(215, 255, 241, 0.03), transparent 58%);
    filter: url(#water-displace);
    animation: membraneBreathe 11s ease-in-out infinite alternate;
}

.membrane-window {
    position: relative;
    max-width: 43rem;
    min-height: 28rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 5vw, 5.8rem);
    clip-path: ellipse(49% 43% at 50% 50%);
    background:
        radial-gradient(ellipse at 35% 25%, rgba(215, 255, 241, 0.14), transparent 34%),
        radial-gradient(ellipse at 72% 71%, rgba(89, 70, 178, 0.19), transparent 42%),
        rgba(6, 40, 61, 0.24);
    border: 1px solid rgba(45, 212, 191, 0.2);
    box-shadow: inset 0 0 70px rgba(45, 212, 191, 0.06), 0 0 80px rgba(3, 7, 10, 0.85);
    filter: url(#water-displace);
    transform: translateY(2rem) scale(0.96);
    opacity: 0.68;
    transition: transform 1000ms cubic-bezier(.2,.8,.2,1), opacity 1000ms ease, clip-path 1200ms ease;
}

.chamber.in-view .membrane-window {
    transform: translateY(0) scale(1);
    opacity: 1;
    clip-path: ellipse(53% 46% at 50% 50%);
}

.tank-id {
    font-family: "Azeret Mono", monospace;
    color: var(--mineral-ochre);
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    margin-bottom: 1.2rem;
}

h1, h2 {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
    font-weight: 500;
    line-height: 0.92;
    color: var(--biolume-pearl);
    text-shadow: 0 0 34px rgba(45, 212, 191, 0.24);
}

h1 {
    font-size: clamp(4.1rem, 11vw, 11rem);
    max-width: 10ch;
}

h2 {
    font-size: clamp(3.3rem, 8vw, 8rem);
    max-width: 9ch;
}

p {
    max-width: 31rem;
    margin: 1.6rem 0 0;
    color: rgba(215, 255, 241, 0.78);
    font-size: clamp(1rem, 1.45vw, 1.3rem);
    line-height: 1.85;
    letter-spacing: 0.015em;
}

.specimen-tag {
    position: absolute;
    left: 14vw;
    top: 68vh;
    padding: 0.68rem 0.9rem;
    border: 1px solid rgba(200, 167, 93, 0.4);
    border-radius: 999px;
    background: rgba(3, 7, 10, 0.72);
    color: var(--mineral-ochre);
    font-family: "Azeret Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    box-shadow: 0 0 18px rgba(200, 167, 93, 0.1);
    transition: color 450ms ease, border-color 450ms ease, transform 450ms ease;
}

.specimen-tag::before,
.specimen-tag::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    top: 50%;
    border-radius: 50%;
    background: var(--mineral-ochre);
    transform: translateY(-50%);
}

.specimen-tag::before { left: -0.28rem; }
.specimen-tag::after { right: -0.28rem; }

.specimen-tag:hover {
    color: var(--bloodless-coral);
    border-color: rgba(255, 107, 122, 0.55);
    transform: scale(1.05) rotate(-1deg);
}

.specimen-tag:hover {
    font-size: 0;
}

.specimen-tag:hover::after {
    content: attr(data-alt);
    position: static;
    display: inline;
    width: auto;
    height: auto;
    background: none;
    font-size: 0.72rem;
    transform: none;
}

.tag-right { left: auto; right: 10vw; top: 22vh; }
.tag-low { left: 41vw; top: 74vh; }
.final-tag { left: 12vw; top: 21vh; }

.biolume-glyph {
    position: absolute;
    color: var(--membrane-teal);
    font-family: "Azeret Mono", monospace;
    font-style: normal;
    text-shadow: 0 0 18px var(--membrane-teal);
    animation: moteDrift 8s ease-in-out infinite alternate;
}

.glyph-1 { right: 18vw; top: 24vh; }
.glyph-2 { right: 10vw; bottom: 16vh; color: var(--bloodless-coral); text-shadow: 0 0 18px var(--bloodless-coral); }
.glyph-3 { left: 23vw; top: 34vh; color: var(--mineral-ochre); text-shadow: 0 0 18px var(--mineral-ochre); }

.anoxic-current {
    position: fixed;
    inset: -10%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.28;
    filter: blur(22px);
    background: linear-gradient(105deg, transparent 12%, rgba(89, 70, 178, 0.18), transparent 58%, rgba(45, 212, 191, 0.12), transparent 86%);
    animation: currentFlow 32s linear infinite;
}

.current-b {
    animation-duration: 45s;
    animation-direction: reverse;
    opacity: 0.18;
}

.mineral-bloom {
    position: absolute;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    background: repeating-radial-gradient(circle, rgba(200, 167, 93, 0.17) 0 1px, transparent 2px 18px);
    opacity: 0.34;
    filter: blur(0.5px);
    transform: scale(0.72);
    transition: transform 1200ms ease, opacity 1200ms ease;
}

.chamber.in-view .mineral-bloom {
    transform: scale(1.05);
    opacity: 0.58;
}

.bloom-a { right: 4vw; top: 8vh; }
.bloom-b { left: 36vw; top: 8vh; }

.vein {
    position: absolute;
    right: 14vw;
    bottom: 14vh;
    width: 22rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--membrane-teal), transparent);
    box-shadow: 0 0 18px rgba(45, 212, 191, 0.5);
    transform: rotate(-22deg);
}

.plankton-field span {
    position: absolute;
    color: rgba(215, 255, 241, 0.7);
    font-family: "Azeret Mono", monospace;
    text-shadow: 0 0 14px rgba(45, 212, 191, 0.8);
    transition: transform 800ms ease, color 800ms ease;
}

.plankton-field span:nth-child(1) { left: 12vw; top: 28vh; }
.plankton-field span:nth-child(2) { left: 78vw; top: 21vh; }
.plankton-field span:nth-child(3) { left: 66vw; top: 76vh; }
.plankton-field span:nth-child(4) { left: 43vw; top: 16vh; }
.plankton-field span:nth-child(5) { left: 88vw; top: 52vh; }
.plankton-field span:nth-child(6) { left: 21vw; top: 83vh; }
.plankton-field span:nth-child(7) { left: 55vw; top: 35vh; }
.plankton-field span:nth-child(8) { left: 10vw; top: 58vh; }

.whisper {
    position: absolute;
    right: 8vw;
    bottom: 12vh;
    max-width: 18rem;
    font-family: "Nanum Myeongjo", serif;
    color: rgba(215, 255, 241, 0.58);
}

.bloom-rings span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(9rem + var(--i, 0) * 5rem);
    height: calc(9rem + var(--i, 0) * 5rem);
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 45px rgba(45, 212, 191, 0.12), inset 0 0 30px rgba(89, 70, 178, 0.12);
    animation: ringPulse 7s ease-in-out infinite alternate;
}

.bloom-rings span:nth-child(1) { --i: 1; }
.bloom-rings span:nth-child(2) { --i: 2; animation-delay: -1s; }
.bloom-rings span:nth-child(3) { --i: 3; animation-delay: -2s; }
.bloom-rings span:nth-child(4) { --i: 4; animation-delay: -3s; }
.bloom-rings span:nth-child(5) { --i: 5; animation-delay: -4s; border-color: rgba(255, 107, 122, 0.16); }

.cursor-aura {
    position: fixed;
    left: 0;
    top: 0;
    width: 2.1rem;
    height: 2.7rem;
    border-radius: 58% 42% 62% 38% / 52% 48% 61% 39%;
    background: radial-gradient(circle at 35% 28%, rgba(215, 255, 241, 0.9), rgba(45, 212, 191, 0.35) 38%, rgba(89, 70, 178, 0.05) 70%);
    box-shadow: 0 0 24px rgba(45, 212, 191, 0.48);
    transform: translate(-50%, -50%);
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 100;
}

.chamber-surface { background: radial-gradient(ellipse at 64% 44%, rgba(45, 212, 191, 0.08), transparent 42%); }
.chamber-membrane { background: radial-gradient(ellipse at 70% 35%, rgba(89, 70, 178, 0.17), transparent 48%); }
.chamber-current { background: radial-gradient(ellipse at 45% 50%, rgba(6, 40, 61, 0.7), transparent 54%); }
.chamber-mineral { background: radial-gradient(ellipse at 66% 48%, rgba(200, 167, 93, 0.08), transparent 38%); }
.chamber-bloom { background: radial-gradient(ellipse at 55% 52%, rgba(45, 212, 191, 0.16), transparent 48%), radial-gradient(ellipse at 80% 20%, rgba(255, 107, 122, 0.08), transparent 22%); }

@keyframes tankDrift {
    from { transform: translate3d(-2%, -1%, 0) rotate(-1deg); }
    to { transform: translate3d(2%, 1%, 0) rotate(1deg); }
}

@keyframes membraneBreathe {
    from { transform: scaleX(0.96) scaleY(1.04) rotate(-1deg); opacity: 0.42; }
    to { transform: scaleX(1.04) scaleY(0.96) rotate(1deg); opacity: 0.78; }
}

@keyframes moteDrift {
    from { transform: translateY(-1rem) rotate(-8deg); }
    to { transform: translateY(1.8rem) rotate(11deg); }
}

@keyframes currentFlow {
    from { transform: translateX(-12%) translateY(-4%) rotate(0deg); }
    to { transform: translateX(12%) translateY(4%) rotate(360deg); }
}

@keyframes ringPulse {
    from { transform: translate(-50%, -50%) scale(0.92) rotate(0deg); opacity: 0.26; }
    to { transform: translate(-50%, -50%) scale(1.08) rotate(12deg); opacity: 0.7; }
}

@media (max-width: 760px) {
    body { cursor: auto; }
    .cursor-aura { display: none; }
    .pressure-spine { left: 1.4rem; }
    .wordmark { left: 4.5rem; font-size: 2.4rem; }
    .chamber { padding: 8vh 1rem 8vh 4.5rem; }
    .membrane-window { min-height: 24rem; padding: 2rem; clip-path: ellipse(58% 47% at 50% 50%); }
    h1 { font-size: 4rem; }
    h2 { font-size: 3.2rem; }
    .specimen-tag { left: 4.5rem; right: auto; }
}
