:root {
    /* Compliance vocabulary from DESIGN.md: Space Mono" (Google Fonts; IBM Plex Mono" cursor is a blinking `|` character toggling opacity every 530ms (a cursor mark); Interactions:** The primary interactive pattern is scale-hover applied to masonry specimen cards. On mouseenter; IntersectionObserver with threshold: 0.4. */
    --deep-walnut: #1E120A;
    --roasted-umber: #2B1810;
    --burnt-sienna-amber: #C17817;
    --aged-parchment: #F5E6C8;
    --faded-gold: #B8860B;
    --marble-white: #EDE3D5;
    --venetian-earth: #8B4513;
    --charcoal-vine: #3D2B1F;
    --scroll-y: 0px;
    --foyer-opacity: 1;
    --closing-opacity: .3;
}

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

html { background: var(--deep-walnut); scroll-behavior: smooth; }

body {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--deep-walnut);
    color: var(--aged-parchment);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(1.05rem, 1.2vw, 1.25rem);
    line-height: 1.85;
}

.descent { position: relative; overflow: hidden; }

.particle-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: var(--size);
    height: var(--size);
    left: 0;
    top: 0;
    border-radius: 50%;
    background: #F5E6C8;
    opacity: var(--alpha);
    box-shadow: 0 0 8px rgba(245, 230, 200, .16);
    will-change: transform;
}

.chamber {
    position: relative;
    min-height: 100vh;
    padding: clamp(3.5rem, 7vw, 7.5rem) clamp(1.2rem, 4vw, 4rem);
    isolation: isolate;
}

.chamber-i,
.chamber-iv {
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 18% 18%, rgba(193, 120, 23, .13), transparent 26rem),
        radial-gradient(circle at 72% 78%, rgba(139, 69, 19, .2), transparent 34rem),
        linear-gradient(135deg, #1E120A 0%, #2B1810 52%, #1E120A 100%);
}

.chamber-i::after,
.chamber-iv::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(115deg, transparent 0 48%, rgba(184, 134, 11, .045) 49%, transparent 50% 100%),
        radial-gradient(circle at 30% 20%, rgba(245, 230, 200, .035), transparent 2px);
    background-size: 160px 160px, 34px 34px;
    mix-blend-mode: overlay;
    z-index: -1;
}

.foyer-copy { text-align: center; max-width: 980px; z-index: 4; }

.chamber-kicker,
.label {
    display: block;
    color: #C17817;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: .76rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.chamber-kicker { margin-bottom: 1.35rem; }

h1,
h2,
h3 {
    font-family: "Space Mono", ui-monospace, monospace;
    font-weight: 700;
    letter-spacing: .06em;
}

h1 {
    color: #F5E6C8;
    font-size: clamp(2.8rem, 6vw, 5.6rem);
    line-height: 1.05;
    text-transform: uppercase;
    text-shadow: 0 0 42px rgba(193, 120, 23, .22);
}

.foyer-subtitle {
    max-width: 720px;
    margin: 1.8rem auto 0;
    color: #D4C4A8;
    font-size: clamp(1.22rem, 2vw, 1.65rem);
    opacity: 0;
    animation: subtitleFade 1800ms ease 420ms forwards;
}

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

.lens-flare {
    position: absolute;
    width: 14rem;
    height: 14rem;
    pointer-events: none;
    z-index: 2;
    will-change: transform, opacity;
    animation: flarePulse 4s ease-in-out infinite alternate;
}

.lens-flare-foyer {
    left: clamp(1rem, 6vw, 5rem);
    top: clamp(1rem, 6vw, 5rem);
    opacity: var(--foyer-opacity);
    transform: translateY(calc(var(--scroll-y) * -0.15));
}

.lens-flare-closing {
    right: clamp(1rem, 6vw, 5rem);
    bottom: clamp(1rem, 6vw, 5rem);
    opacity: var(--closing-opacity);
}

.lens-flare::before {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(193, 120, 23, .9);
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 0 1px rgba(245, 230, 200, .2),
        0 0 120px 66px rgba(193, 120, 23, .2),
        82px 82px 60px 12px rgba(245, 230, 200, .08),
        150px 24px 90px 20px rgba(245, 230, 200, .055),
        -80px 130px 76px 16px rgba(245, 230, 200, .07);
}

.lens-flare::after {
    content: "";
    position: absolute;
    left: -52vw;
    right: -52vw;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(193, 120, 23, .08), transparent);
}

.lens-flare i,
.lens-flare b,
.lens-flare em {
    position: absolute;
    display: block;
    border-radius: 50%;
    border: 1px solid rgba(245, 230, 200, .08);
    background: radial-gradient(circle, rgba(245, 230, 200, .09), transparent 62%);
}

.lens-flare i { width: 4.4rem; height: 4.4rem; left: 9.5rem; top: 2rem; }
.lens-flare b { width: 2rem; height: 2rem; left: 5.7rem; top: 8.7rem; }
.lens-flare em { width: 7rem; height: 7rem; left: 12.5rem; top: 9.2rem; }

@keyframes flarePulse { from { filter: brightness(.95); } to { filter: brightness(1.12); } }

.threshold {
    position: relative;
    height: 200px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.threshold-i-ii { background: linear-gradient(to bottom, #1E120A 0%, #1E120A 100%); }
.threshold-ii-iii { background: linear-gradient(to bottom, #1E120A 0%, #EDE3D5 100%); }
.threshold-iii-iv { background: linear-gradient(to bottom, #EDE3D5 0%, #1E120A 100%); }

.column-divider { width: min(78vw, 900px); height: 80px; opacity: .86; }
.column-divider path { fill: none; stroke: rgba(184, 134, 11, .25); stroke-width: 1.35; stroke-linecap: round; }

.chamber-ii {
    background:
        radial-gradient(circle at 8% 16%, rgba(193, 120, 23, .1), transparent 30rem),
        linear-gradient(180deg, #1E120A 0%, #2B1810 54%, #1E120A 100%);
}

.archive-intro {
    width: min(1360px, 100%);
    margin: 0 auto 3rem;
}

.archive-intro h2,
.laboratory-essay h2 {
    color: #F5E6C8;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    line-height: 1.18;
    text-transform: uppercase;
}

.masonry-cabinet {
    width: min(1360px, 100%);
    margin: 0 auto;
    column-count: 3;
    column-gap: 2.4rem;
}

.specimen-card {
    position: relative;
    display: inline-block;
    width: 100%;
    margin: 0 0 2.4rem;
    break-inside: avoid;
    padding: clamp(1.35rem, 2vw, 2rem);
    background:
        radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(193, 120, 23, .12), transparent 16rem),
        linear-gradient(145deg, rgba(43, 24, 16, .98), rgba(30, 18, 10, .96));
    border: 1px solid rgba(184, 134, 11, .3);
    box-shadow: 0 2px 8px rgba(193, 120, 23, .08);
    color: #D4C4A8;
    outline: 1px solid rgba(184, 134, 11, .17);
    outline-offset: -7px;
    transform-origin: 50% 50%;
    transition: transform 300ms cubic-bezier(.34, 1.56, .64, 1), box-shadow 300ms ease, border-color 300ms ease, outline-color 300ms ease;
}

.specimen-card:hover {
    transform: scale(1.015);
    border-color: rgba(184, 134, 11, .5);
    outline-color: rgba(184, 134, 11, .5);
    box-shadow: 0 8px 32px rgba(193, 120, 23, .2);
}

.specimen-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: conic-gradient(from 35deg at 20% 20%, transparent, rgba(184, 134, 11, .07), transparent 28%);
    opacity: .55;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.specimen-card h3 {
    margin: .95rem 0 .75rem;
    color: #F5E6C8;
    font-size: clamp(1.1rem, 1.7vw, 1.55rem);
    line-height: 1.24;
    text-transform: uppercase;
}

.specimen-card p { color: #D4C4A8; }
.specimen-card.tall { min-height: 390px; }
.specimen-card.squat { min-height: 230px; }
.specimen-card.medium { min-height: 315px; }
.specimen-card.narrow { min-height: 455px; }

.chamber-iii {
    display: block;
    background: #EDE3D5;
    color: #3D2B1F;
    overflow: hidden;
}

.marble-field {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(193, 120, 23, .18), transparent 24rem),
        radial-gradient(ellipse at 80% 70%, rgba(139, 69, 19, .13), transparent 34rem),
        conic-gradient(from 24deg at 40% 50%, transparent, rgba(184, 134, 11, .11), transparent, rgba(61, 43, 31, .06), transparent),
        #EDE3D5;
}

.marble-field::before,
.marble-field::after {
    content: "";
    position: absolute;
    inset: -12%;
    background: repeating-linear-gradient(104deg, transparent 0 80px, rgba(184, 134, 11, .12) 82px, transparent 84px 170px);
    mix-blend-mode: multiply;
    opacity: .28;
    will-change: transform;
    animation: marbleDrift 30s linear infinite;
}

.marble-field::after { transform: rotate(-9deg); opacity: .16; animation-direction: reverse; }

@keyframes marbleDrift { to { transform: translate(3rem, -2rem); } }

.laboratory-essay {
    max-width: 72ch;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem);
    background: rgba(237, 227, 213, .72);
    border-left: 1px solid rgba(184, 134, 11, .26);
    border-right: 1px solid rgba(184, 134, 11, .18);
}

.laboratory-essay .chamber-kicker { color: #C17817; }
.laboratory-essay h2 { color: #2B1810; margin-bottom: 2rem; }
.laboratory-essay p { margin: 0 0 1.65rem; color: #3D2B1F; }

.laboratory-essay blockquote {
    float: right;
    width: 38%;
    margin: .65rem 0 1.4rem 2rem;
    padding: .35rem 0 .45rem 1.25rem;
    border-left: 3px solid #B8860B;
    color: #C17817;
    font-family: "Space Mono", ui-monospace, monospace;
    font-size: 1.4em;
    font-style: normal;
    line-height: 1.45;
}

.chamber-iv { overflow: hidden; }
.chamber-iv::after { animation: backgroundBreathe 30s linear infinite; }

@keyframes backgroundBreathe { to { background-position: 160px 160px, 34px -34px; } }

.living-veins {
    position: absolute;
    inset: -6%;
    width: 112%;
    height: 112%;
    z-index: 1;
    opacity: .62;
    animation: veinsMove 30s linear infinite;
    will-change: transform;
}

.living-veins path {
    fill: none;
    stroke: rgba(184, 134, 11, .18);
    stroke-width: 1.35;
    filter: drop-shadow(0 0 6px rgba(193, 120, 23, .22));
    animation: veinPulse 4s ease-in-out infinite alternate;
}

.living-veins path:nth-child(2) { animation-delay: -1.2s; }
.living-veins path:nth-child(3) { animation-delay: -2.4s; }
.living-veins path:nth-child(4) { animation-delay: -3s; }

@keyframes veinsMove { to { transform: translate(-2rem, 1.4rem); } }
@keyframes veinPulse { to { stroke: rgba(184, 134, 11, .34); } }

.closing-panel {
    position: relative;
    z-index: 4;
    max-width: 820px;
    padding: clamp(1.5rem, 4vw, 3.4rem);
    background: rgba(30, 18, 10, .52);
    border: 1px solid rgba(184, 134, 11, .2);
    outline: 1px solid rgba(184, 134, 11, .12);
    outline-offset: -8px;
}

.closing-text {
    min-height: 17rem;
    color: #F5E6C8;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: clamp(.86rem, 1.2vw, 1rem);
    font-weight: 300;
    letter-spacing: .02em;
    line-height: 1.85;
}

.cursor {
    display: inline-block;
    color: #F5E6C8;
    animation: cursorBlink 530ms steps(1) infinite;
}

.cursor.done { animation: none; opacity: 0; }
@keyframes cursorBlink { 50% { opacity: 0; } }

@media (max-width: 1024px) {
    .masonry-cabinet { column-count: 2; }
    .laboratory-essay blockquote { width: 46%; }
}

@media (max-width: 720px) {
    .masonry-cabinet { column-count: 1; }
    .specimen-card.tall,
    .specimen-card.squat,
    .specimen-card.medium,
    .specimen-card.narrow { min-height: auto; }
    .laboratory-essay { padding: 1.5rem; }
    .laboratory-essay blockquote { float: none; width: auto; margin: 2rem 0; font-size: 1.12em; }
    .closing-text { min-height: 25rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
