/* =====================================================================
   gamelicen.se — den boreala antechamber
   surreal Nordic dreamscape · seven cabinets · sju skåp
   ===================================================================== */

:root {
    /* the boreal antechamber palette */
    --bg-pearl: #EFEAE0;
    --bg-pearl-cool: #E6E4DC;
    --bg-shadow: #1F2433;
    --ink-primary: #2A2620;
    --ink-faint: #8B8275;
    --seal-wax: #8C2330;
    --lingon: #B85042;
    --moss: #5C6A4F;
    --frost: #C9D4D0;
    --candle: #E8C97D;

    /* live luminance shift (driven by JS) */
    --lum-shift: 0;

    /* easing */
    --ease-entry: cubic-bezier(.22, .61, .36, 1);
    --ease-drift: cubic-bezier(.45, .05, .55, .95);
}

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

html {
    scroll-behavior: auto;
    background: var(--bg-pearl);
}

body {
    font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
    color: var(--ink-primary);
    background: var(--bg-pearl);
    line-height: 1.74;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    cursor: default;
    /* slow tonal shift driven by JS via --lum-shift */
    background-color: hsl(40, calc((22 + var(--lum-shift) * 0) * 1%), calc((90 + var(--lum-shift)) * 1%));
    transition: background-color 1.4s var(--ease-drift);
}

::selection {
    background: var(--candle);
    color: var(--ink-primary);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------------------
   noise / paper grain
   --------------------------------------------------------------------- */
.noise-svg {
    position: fixed;
    width: 0;
    height: 0;
    pointer-events: none;
}

.paper-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.14  0 0 0 0 0.12  0 0 0 0.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    animation: grain-breathe 11s ease-in-out infinite;
}

@keyframes grain-breathe {
    0%, 100% { opacity: 0.035; }
    50%      { opacity: 0.06; }
}

/* ---------------------------------------------------------------------
   spine: vertical roman numerals
   --------------------------------------------------------------------- */
.spine {
    position: fixed;
    top: 0;
    left: 0;
    width: 56px;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 28px 0;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.spine-domain {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-style: italic;
    font-weight: 300;
    color: var(--ink-faint);
    letter-spacing: 0.06em;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-orientation: mixed;
}

.spine-domain em {
    color: var(--seal-wax);
    font-style: normal;
}

.spine-numerals {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 22px;
    align-items: center;
}

.spine-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-style: italic;
    font-weight: 300;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
    opacity: 0.42;
    transition: opacity 1.6s var(--ease-drift), color 1.6s var(--ease-drift), transform 1.6s var(--ease-drift);
    writing-mode: vertical-rl;
    transform: rotate(180deg) scale(1);
}

.spine-num.is-active {
    opacity: 1;
    color: var(--ink-primary);
    transform: rotate(180deg) scale(1.08);
}

.spine-foot {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-style: italic;
    color: var(--ink-faint);
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    opacity: 0.5;
}

/* spine inverse on shadow cabinets */
.cabinet--shadow + .cabinet--shadow,
body:has(.cabinet--shadow.is-active) .spine-num,
body:has(.cabinet--shadow.is-active) .spine-domain,
body:has(.cabinet--shadow.is-active) .spine-foot { /* fallback handled in JS */ }

body.spine-inverse .spine-num {
    color: var(--frost);
}
body.spine-inverse .spine-num.is-active {
    color: var(--bg-pearl);
}
body.spine-inverse .spine-domain,
body.spine-inverse .spine-foot {
    color: var(--frost);
}
body.spine-inverse .spine-domain em {
    color: var(--lingon);
}

/* ---------------------------------------------------------------------
   procession + cabinet shells
   --------------------------------------------------------------------- */
.procession {
    position: relative;
    width: 100%;
    padding-left: 56px;
}

.cabinet {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: clamp(60px, 9vh, 120px) clamp(40px, 7vw, 120px);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.cabinet-inner {
    position: relative;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

.cabinet--pearl {
    background: var(--bg-pearl);
    color: var(--ink-primary);
}

.cabinet--pearl-cool {
    background: var(--bg-pearl-cool);
    color: var(--ink-primary);
}

.cabinet--shadow {
    background: var(--bg-shadow);
    color: var(--bg-pearl);
}

/* head */
.cabinet-head {
    margin-bottom: clamp(48px, 8vh, 100px);
    max-width: 90%;
}

.cabinet-head--hero {
    margin-bottom: clamp(32px, 5vh, 60px);
}

.cabinet-head--right {
    text-align: right;
    margin-left: auto;
    max-width: 70%;
}

.cabinet-meta {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    font-style: italic;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: var(--ink-faint);
    margin-bottom: 18px;
}

.cabinet-meta--inverse {
    color: var(--frost);
    opacity: 0.7;
}

.cabinet-title {
    font-family: 'Cormorant Unicase', 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.6rem, 6.4vw, 5.4rem);
    letter-spacing: -0.012em;
    line-height: 1.0;
    color: var(--ink-primary);
    font-feature-settings: "ss01" 1, "dlig" 1;
    margin: 0 0 22px;
    overflow: visible;
}

.cabinet-title--inverse {
    color: var(--bg-pearl);
}

.title-svg {
    width: 100%;
    max-width: 900px;
    height: auto;
    overflow: visible;
    display: block;
}

.title-stroke {
    font-family: 'Cormorant Unicase', 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 88px;
    letter-spacing: -0.012em;
    fill: none;
    stroke: var(--ink-primary);
    stroke-width: 1.1;
    stroke-linejoin: round;
    stroke-linecap: round;
    paint-order: stroke;
}

.cabinet-title--inverse .title-stroke {
    stroke: var(--bg-pearl);
}

/* path-draw animation: applied when in view */
.cabinet-title--draw .title-stroke {
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    transition: stroke-dashoffset 1.8s var(--ease-entry);
}

.cabinet.is-in .cabinet-title--draw .title-stroke {
    stroke-dashoffset: 0;
}

/* solid fill fade-in after path completes */
.cabinet-title--draw .title-stroke {
    fill: transparent;
    transition: stroke-dashoffset 1.8s var(--ease-entry), fill 1.4s var(--ease-drift) 1.6s;
}
.cabinet.is-in .cabinet-title--draw .title-stroke {
    fill: var(--ink-primary);
}
.cabinet.is-in .cabinet-title--inverse .title-stroke {
    fill: var(--bg-pearl);
}

.cabinet-sub {
    font-family: 'EB Garamond', 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.06rem;
    color: var(--ink-faint);
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 1.6s var(--ease-drift) 2.0s, transform 1.6s var(--ease-drift) 2.0s;
}

.cabinet.is-in .cabinet-sub {
    opacity: 1;
    transform: translateY(0);
}

.cabinet-sub--inverse {
    color: var(--frost);
    opacity: 0;
}
.cabinet.is-in .cabinet-sub--inverse {
    opacity: 0.74;
}

.sv-italic {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    color: var(--ink-faint);
    font-size: 0.96em;
}

.cabinet--shadow .sv-italic {
    color: var(--frost);
    opacity: 0.85;
}

.seal-verb {
    text-decoration: none;
    border-bottom: 1px solid var(--seal-wax);
    padding-bottom: 1px;
}

/* footnotes */
.footnote {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-style: italic;
    font-weight: 300;
    font-size: 0.78rem;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
    max-width: 280px;
}

.footnote--tilt-pos {
    bottom: 8%;
    right: 8%;
    transform: rotate(4deg);
}

.cabinet--shadow .footnote {
    color: var(--frost);
    opacity: 0.6;
}

.fn-mark {
    color: var(--seal-wax);
    margin-right: 6px;
}

.cabinet--shadow .fn-mark {
    color: var(--lingon);
}

/* ---------------------------------------------------------------------
   CABINET I — hero stage
   --------------------------------------------------------------------- */
.hero-stage {
    position: relative;
    min-height: 56vh;
    display: grid;
    place-items: center;
}

.sigil-hex {
    position: absolute;
    width: clamp(360px, 46vw, 640px);
    height: clamp(360px, 46vw, 640px);
    inset: 0;
    margin: auto;
    opacity: 0.86;
}

.sigil-rotor {
    transform-origin: center;
    animation: sigil-rotate 64s linear infinite;
}

@keyframes sigil-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.sigil-hex-outer,
.sigil-hex-inner {
    fill: none;
    stroke: var(--bg-pearl);
    stroke-width: 0.9;
    opacity: 0.7;
}

.sigil-hex-inner {
    stroke-width: 0.8;
    opacity: 0.5;
}

.sigil-star {
    fill: none;
    stroke: var(--bg-pearl);
    stroke-width: 0.8;
    stroke-linejoin: round;
    opacity: 0.85;
}

.sigil-dot {
    fill: var(--candle);
    opacity: 0.9;
}

.sigil-marks line {
    stroke: var(--bg-pearl);
    stroke-width: 0.6;
    opacity: 0.5;
}

.hero-line {
    position: absolute;
    top: 38%;
    left: 56%;
    transform: translate(-50%, -50%);
    width: min(640px, 70%);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    line-height: 1.5;
    color: var(--bg-pearl);
    text-align: left;
}

.hero-line .seal-verb {
    border-bottom-color: var(--lingon);
}

.hero-foot {
    position: absolute;
    bottom: 8%;
    left: 56%;
    transform: translateX(-50%);
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 0.96rem;
    color: var(--frost);
    opacity: 0.66;
}

/* ---------------------------------------------------------------------
   CABINET II — anatomy
   --------------------------------------------------------------------- */
.anatomy-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: clamp(40px, 5vw, 96px);
    align-items: start;
}

.anatomy-figure {
    position: relative;
    margin-top: 12px;
}

.anatomy-svg {
    width: 100%;
    max-width: 520px;
    height: auto;
    overflow: visible;
}

.botanical {
    fill: none;
    stroke: var(--ink-primary);
    stroke-width: 0.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bot-stem {
    stroke-width: 1.0;
}

.bot-petals path {
    stroke-width: 0.8;
    fill: none;
}

.bot-veins path {
    stroke-width: 0.5;
    opacity: 0.55;
}

.bot-roots path {
    stroke-width: 0.7;
    opacity: 0.78;
}

.bot-pin line {
    stroke-width: 0.8;
}

.bot-pin circle {
    fill: var(--seal-wax);
    stroke: var(--seal-wax);
}

.bot-seal-core {
    fill: var(--seal-wax);
    stroke: var(--seal-wax);
}

.bot-seal-halo {
    fill: none;
    stroke: var(--seal-wax);
    stroke-width: 0.5;
    opacity: 0.5;
}

.bot-anno line {
    stroke-width: 0.4;
    stroke-dasharray: 2 3;
    opacity: 0.6;
}

/* path-draw on entry */
.botanical {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    transition: stroke-dashoffset 3.6s var(--ease-entry) 0.4s;
}
.cabinet.is-in .botanical {
    stroke-dashoffset: 0;
}

.anatomy-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
    font-family: 'JetBrains Mono', monospace;
    font-style: italic;
    font-weight: 300;
    font-size: 0.72rem;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
}

.anatomy-labels .lbl {
    position: absolute;
    opacity: 0;
    transition: opacity 1.4s var(--ease-drift);
}
.cabinet.is-in .anatomy-labels .lbl {
    opacity: 0.85;
}
.cabinet.is-in .anatomy-labels .lbl-1 { transition-delay: 2.4s; }
.cabinet.is-in .anatomy-labels .lbl-2 { transition-delay: 2.7s; }
.cabinet.is-in .anatomy-labels .lbl-3 { transition-delay: 3.0s; }
.cabinet.is-in .anatomy-labels .lbl-4 { transition-delay: 3.3s; }
.cabinet.is-in .anatomy-labels .lbl-5 { transition-delay: 3.6s; }

.lbl-1 { top: 8%; left: -4%; transform: rotate(-3deg); }
.lbl-2 { top: 36%; right: -2%; }
.lbl-3 { top: 52%; left: -8%; transform: rotate(2deg); }
.lbl-4 { bottom: 6%; right: -2%; }
.lbl-5 { top: 0%; left: 22%; }

.lbl i {
    color: var(--ink-faint);
}

.anatomy-prose p {
    margin-bottom: 1.4em;
    font-size: 1.18rem;
    line-height: 1.74;
    color: var(--ink-primary);
}

.dropcap {
    font-family: 'Major Mono Display', monospace;
    font-size: 4.2em;
    line-height: 0.86;
    float: left;
    margin: 0.06em 0.14em -0.02em 0;
    color: var(--ink-primary);
    letter-spacing: -0.04em;
}

.dropcap--lingon {
    color: var(--lingon);
}

/* ---------------------------------------------------------------------
   CABINET III — constellation
   --------------------------------------------------------------------- */
.cabinet--pearl-cool .cabinet-inner {
    position: relative;
}

.constellation-stage {
    position: relative;
    width: 100%;
    min-height: 70vh;
}

.constellation-svg {
    width: 100%;
    height: auto;
    overflow: visible;
    max-height: 78vh;
}

.cluster-lines line {
    stroke: var(--frost);
    stroke-width: 0.7;
    fill: none;
    opacity: 0;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: opacity 1.6s var(--ease-drift), stroke-dashoffset 2.6s var(--ease-entry);
}

.cabinet.is-in .cluster-lines line {
    opacity: 0.65;
    stroke-dashoffset: 0;
}

.cabinet.is-in .cluster-lines line:nth-child(1)  { transition-delay: 0.6s; }
.cabinet.is-in .cluster-lines line:nth-child(2)  { transition-delay: 0.8s; }
.cabinet.is-in .cluster-lines line:nth-child(3)  { transition-delay: 1.0s; }
.cabinet.is-in .cluster-lines line:nth-child(4)  { transition-delay: 1.2s; }
.cabinet.is-in .cluster-lines line:nth-child(5)  { transition-delay: 1.4s; }
.cabinet.is-in .cluster-lines line:nth-child(6)  { transition-delay: 1.6s; }
.cabinet.is-in .cluster-lines line:nth-child(7)  { transition-delay: 1.8s; }
.cabinet.is-in .cluster-lines line:nth-child(8)  { transition-delay: 2.0s; }
.cabinet.is-in .cluster-lines line:nth-child(9)  { transition-delay: 2.2s; }
.cabinet.is-in .cluster-lines line:nth-child(10) { transition-delay: 2.4s; }
.cabinet.is-in .cluster-lines line:nth-child(11) { transition-delay: 2.6s; }
.cabinet.is-in .cluster-lines line:nth-child(12) { transition-delay: 2.8s; }

.game-obj {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'><path d='M2,16 L10,4 L14,8 L6,16 Z M10,4 L13,2 L16,5 L14,8 Z' fill='none' stroke='%232A2620' stroke-width='1.0' stroke-linejoin='round'/></svg>") 2 16, pointer;
    transition: transform 1.4s var(--ease-drift), filter 1.4s var(--ease-drift);
    transform-box: fill-box;
    transform-origin: center;
}

.obj-halo {
    fill: var(--bg-pearl-cool);
    stroke: var(--frost);
    stroke-width: 0.5;
    opacity: 0.0;
    transition: opacity 1.4s var(--ease-drift);
}

.obj-halo--aspic {
    fill: rgba(184, 80, 66, 0.10);
    stroke: var(--lingon);
    stroke-width: 0.6;
    opacity: 0.6;
}

.obj-glyph {
    fill: none;
    stroke: var(--ink-primary);
    stroke-width: 0.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.obj-glyph--die {
    stroke: var(--ink-primary);
    stroke-width: 0.8;
}

.die-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    font-weight: 300;
    fill: var(--ink-primary);
    text-anchor: middle;
    stroke: none;
}

.die-glint {
    fill: var(--candle);
    stroke: none;
}

.obj-name {
    font-family: 'JetBrains Mono', monospace;
    font-style: italic;
    font-size: 8px;
    font-weight: 300;
    fill: var(--ink-faint);
    text-anchor: middle;
    stroke: none;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 1.6s var(--ease-drift);
}

.cabinet.is-in .obj-name { opacity: 0.78; transition-delay: 3.2s; }

.game-obj:hover {
    transform: rotate(0.5deg) translate(0, -2px);
}

.game-obj:hover .obj-halo {
    opacity: 0.5;
}

.game-obj:hover .obj-glyph {
    filter: drop-shadow(0 6px 6px rgba(31, 36, 51, 0.18));
}

.game-obj.is-dim {
    opacity: 0.42;
    transition: opacity 1.0s var(--ease-drift);
}

.game-obj.is-dim .obj-name {
    opacity: 0.32;
}

.cluster-lines line.is-dim {
    opacity: 0.28;
    transition: opacity 1.0s var(--ease-drift);
}

/* lingonberry die — slow rotation */
.game-obj--lingon .obj-glyph--die {
    transform-origin: center;
    transform-box: fill-box;
    animation: die-drift 11s var(--ease-drift) infinite;
}

@keyframes die-drift {
    0%   { transform: rotate(-1.2deg); }
    50%  { transform: rotate(1.2deg); }
    100% { transform: rotate(-1.2deg); }
}

.card-mark {
    font-family: 'Cormorant Garamond', serif;
    font-size: 8px;
    font-weight: 500;
    fill: var(--ink-primary);
    stroke: none;
    text-anchor: middle;
}

.constellation-marginalia {
    position: absolute;
    top: 12%;
    right: 4%;
    max-width: 220px;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-style: italic;
    font-weight: 300;
    font-size: 0.78rem;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
    line-height: 1.7;
    transform: rotate(-2deg);
    opacity: 0;
    transition: opacity 1.6s var(--ease-drift) 3.4s;
}

.cabinet.is-in .constellation-marginalia {
    opacity: 0.85;
}

.constellation-marginalia em {
    color: var(--ink-faint);
    font-style: italic;
}

/* ---------------------------------------------------------------------
   CABINET IV — triptych dreams
   --------------------------------------------------------------------- */
.triptych {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: clamp(32px, 4vw, 72px);
    align-items: stretch;
    margin-bottom: 80px;
}

.dream {
    position: relative;
    background: rgba(255, 252, 244, 0.6);
    padding: 38px 32px 44px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.08rem;
    line-height: 1.74;
    box-shadow:
        0 1px 0 rgba(42, 38, 32, 0.06),
        0 14px 28px -22px rgba(31, 36, 51, 0.18);
    /* deckle-edge mask */
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 600' preserveAspectRatio='none'><path d='M0,4 C40,2 60,6 100,3 C140,0 200,5 240,2 C280,1 340,4 380,3 L398,6 L398,594 C360,597 320,592 260,596 C200,599 140,594 80,597 C50,598 20,596 2,598 Z' fill='black'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 600' preserveAspectRatio='none'><path d='M0,4 C40,2 60,6 100,3 C140,0 200,5 240,2 C280,1 340,4 380,3 L398,6 L398,594 C360,597 320,592 260,596 C200,599 140,594 80,597 C50,598 20,596 2,598 Z' fill='black'/></svg>");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.dream--left   { transform: rotate(-2deg); }
.dream--center { transform: rotate(0deg); }
.dream--right  { transform: rotate(1.5deg); }

.dream-corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 0.6px solid var(--ink-faint);
    opacity: 0.4;
}

.dream-corner--tl {
    top: 14px; left: 14px;
    border-right: none;
    border-bottom: none;
}

.dream-corner--br {
    bottom: 14px; right: 14px;
    border-left: none;
    border-top: none;
}

.dream-no {
    font-family: 'JetBrains Mono', monospace;
    font-style: italic;
    font-weight: 300;
    font-size: 0.78rem;
    color: var(--seal-wax);
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.dream p {
    margin-bottom: 1.0em;
}

.dream-sign {
    margin-top: 18px;
    color: var(--ink-faint);
    font-size: 0.96em;
    text-align: right;
}

/* rune-break */
.rune-break {
    display: flex;
    justify-content: center;
    margin-top: 60px;
    opacity: 0.85;
}

.rune-svg {
    width: 220px;
    height: 60px;
    overflow: visible;
}

.rune-needle {
    fill: none;
    stroke: var(--moss);
    stroke-width: 0.8;
    stroke-linecap: round;
}

.rune-tufts line {
    stroke: var(--moss);
    stroke-width: 0.6;
    stroke-linecap: round;
    opacity: 0.7;
}

.rune-glyph line {
    stroke: var(--seal-wax);
    stroke-width: 0.9;
    stroke-linecap: round;
}

/* ---------------------------------------------------------------------
   CABINET V — witnesses row
   --------------------------------------------------------------------- */
.witnesses-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(20px, 2.4vw, 48px);
    align-items: start;
}

.witness {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.witness-svg {
    width: 100%;
    max-width: 180px;
    height: auto;
    margin-bottom: 22px;
}

.indigo-line {
    fill: none;
    stroke: var(--bg-shadow);
    stroke-width: 0.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.86;
}

.witness--reindeer .indigo-line {
    stroke-width: 0.7;
    opacity: 0.78;
}

.witness--reindeer .indigo-line path:first-of-type {
    fill: rgba(31, 36, 51, 0.06);
}

.witness-cap {
    max-width: 220px;
    text-align: center;
}

.witness-name {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: 1.12rem;
    color: var(--ink-primary);
    letter-spacing: 0.01em;
    margin-bottom: 4px;
}

.witness-sv {
    display: block;
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--ink-faint);
    margin-bottom: 14px;
}

.witness-quote {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--ink-primary);
    opacity: 0.86;
}

/* ---------------------------------------------------------------------
   CABINET VI — procedure / contour map
   --------------------------------------------------------------------- */
#cabinet-6 {
    position: relative;
}

.contour-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.contour-lines path {
    fill: none;
    stroke: var(--moss);
    stroke-width: 0.7;
    opacity: 0.18;
}

#cabinet-6 .cabinet-inner {
    position: relative;
    z-index: 2;
}

.procedure {
    list-style: none;
    counter-reset: proc;
    position: relative;
    max-width: 760px;
    margin: 40px 0 0 clamp(20px, 4vw, 80px);
    padding-left: 60px;
}

.procedure::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 18px;
    left: 12px;
    width: 0.6px;
    background: linear-gradient(to bottom, transparent, var(--ink-faint) 12%, var(--ink-faint) 88%, transparent);
    opacity: 0.4;
}

.proc-step {
    position: relative;
    margin-bottom: 40px;
    counter-increment: proc;
    padding-left: 16px;
}

.proc-marker {
    position: absolute;
    left: -54px;
    top: 8px;
    width: 22px;
    height: 22px;
    display: block;
    border-radius: 50%;
    border: 0.8px solid var(--ink-primary);
    background: var(--bg-pearl);
}

.proc-marker::after {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--ink-faint);
    opacity: 0.35;
}

.proc-step--a .proc-marker::after { background: var(--moss); opacity: 0.6; }
.proc-step--c .proc-marker::after { background: var(--frost); opacity: 0.9; }
.proc-step--e .proc-marker::after { background: var(--candle); opacity: 0.9; }
.proc-step--f .proc-marker::after { background: var(--seal-wax); opacity: 0.9; }

.proc-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--ink-primary);
    font-style: italic;
}

.proc-step .seal-verb {
    border-bottom-color: var(--seal-wax);
}

/* ---------------------------------------------------------------------
   CABINET VII — final seal envelope
   --------------------------------------------------------------------- */
.envelope-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 56vh;
    margin-top: 40px;
}

.envelope-svg {
    width: clamp(380px, 44vw, 620px);
    height: auto;
    overflow: visible;
}

.envelope {
    fill: none;
    stroke: var(--frost);
    stroke-width: 0.9;
    stroke-linejoin: round;
}

.env-body {
    fill: rgba(201, 212, 208, 0.06);
    stroke: var(--frost);
}

.env-flap {
    fill: rgba(201, 212, 208, 0.04);
    stroke: var(--frost);
    stroke-width: 0.9;
}

.env-letter {
    fill: rgba(239, 234, 224, 0.94);
    stroke: var(--frost);
    stroke-width: 0.6;
}

.env-letter-rule {
    stroke: var(--ink-faint);
    stroke-width: 0.4;
    opacity: 0.55;
}

.wax-seal {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: seal-breathe 7s var(--ease-drift) infinite;
}

@keyframes seal-breathe {
    0%, 100% { transform: scale(1.0); }
    50%      { transform: scale(1.018); }
}

.wax-blob {
    fill: var(--seal-wax);
    stroke: #5a161e;
    stroke-width: 0.8;
}

.wax-rim {
    fill: none;
    stroke: #6b1a23;
    stroke-width: 0.5;
    opacity: 0.6;
}

.wax-sigil {
    fill: rgba(0, 0, 0, 0.18);
    stroke: rgba(0, 0, 0, 0.32);
    stroke-width: 0.5;
}

.wax-sigil polygon {
    stroke-linejoin: round;
}

.wax-catch {
    fill: var(--candle);
    opacity: 0.45;
    stroke: none;
}

.seald-line {
    margin-top: 36px;
    display: flex;
    gap: 22px;
    align-items: baseline;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.18rem;
    color: var(--frost);
    letter-spacing: 0.06em;
}

.seald-en {
    font-style: italic;
}

.seald-oe {
    font-family: 'EB Garamond', serif;
    color: var(--lingon);
}

/* finis */
.finis {
    margin-top: 70px;
    text-align: center;
    color: var(--frost);
}

.finis-line {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.96rem;
    text-transform: lowercase;
    letter-spacing: 0.18em;
    color: var(--frost);
    opacity: 0.86;
}

.finis-mail {
    color: var(--candle);
    text-decoration: none;
    border-bottom: 0.6px solid rgba(232, 201, 125, 0.5);
    padding-bottom: 1px;
    transition: border-color 1.2s var(--ease-drift), color 1.2s var(--ease-drift);
}

.finis-mail:hover {
    color: var(--bg-pearl);
    border-bottom-color: var(--bg-pearl);
}

.finis-sub {
    margin-top: 14px;
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 0.86rem;
    color: var(--frost);
    opacity: 0.5;
}

/* ---------------------------------------------------------------------
   responsive
   --------------------------------------------------------------------- */
@media (max-width: 960px) {
    .anatomy-grid { grid-template-columns: 1fr; }
    .triptych { grid-template-columns: 1fr; gap: 48px; }
    .witnesses-row { grid-template-columns: repeat(2, 1fr); gap: 40px 20px; }
    .cabinet-head--right { max-width: 100%; text-align: left; }
    .hero-line { left: 50%; width: min(640px, 88%); }
    .hero-foot { left: 50%; }
    .constellation-marginalia { position: relative; right: auto; top: auto; max-width: 100%; text-align: left; transform: none; margin-bottom: 24px; }
    .footnote--tilt-pos { right: 4%; bottom: 4%; }
}

@media (max-width: 640px) {
    .spine { width: 36px; padding: 16px 0; }
    .procession { padding-left: 36px; }
    .cabinet { padding: 60px 24px; }
    .witnesses-row { grid-template-columns: 1fr; }
    .title-stroke { font-size: 64px; stroke-width: 1.0; }
    .anatomy-labels { display: none; }
    .seald-line { flex-direction: column; gap: 6px; }
}
