﻿/* ============================================================
   PERSONAL WEBSITE — style.css
   ============================================================ */

/* ── Custom font ───────────────────────────────────────────── */
@font-face {
  font-family: 'Gutter';
  src: url('/assets/fonts/Gutter-Font.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  /* Ground */
  --bg:            #f5f4f0;       /* warm off-white */
  --bg2:           #ece9e3;       /* slightly lifted panel bg */

  /* Ink tones — the mark on the page */
  --bone:          #1c1915;       /* near-black ink */
  --bone-mid:      #4a4540;       /* mid ink */
  --bone-dim:      #8a8480;       /* faded ink */

  /* Blues — the signal */
  --blue-bright:   #1e6891;       /* signal blue */
  --blue-mid:      #2a6a94;       /* mid signal */
  --blue-deep:     #e0eef6;       /* light panel wash */

  /* Moss — instinct, living */
  --moss:          #4a6e4a;       /* living accent */
  --moss-dim:      #7a9e7a;       /* moss light */

  /* Ink */
  --ink:           #f0ede8;       /* near-white ground */

  /* UI aliases */
  --text:          #2c2825;       /* warm body text */
  --text-bright:   var(--bone);
  --link:          #1e6891;
  --link-hover:    var(--bone);

  /* Fonts */
  --font-cinzel:   'Cinzel', 'Times New Roman', serif;
  --font-vt:       'Courier New', Courier, monospace;
  --font-px:       'Cinzel', 'Times New Roman', serif;
  --font-gutter:   'Gutter', 'Cinzel', serif;

  /* On-dark overrides — for footer, console, and other dark surfaces */
  --od-bone:       #e2d9c8;
  --od-mid:        #b8ad96;
  --od-dim:        #6e665a;
  --od-blue:       #6ec6f5;
  --od-moss:       #6a8f6a;

  /* Live mutations — driven by the field console */
  --hue-shift:       0deg;
  --ritual-duration: 180s;
  --orbit-duration:  8s;
  --field-width:     960px;
  --screentone-size: 4px 4px;

  /* Moon phase — set by JS on load, 0.0–1.0 cycle */
  --moon-phase:      0.5;       /* fallback: half moon */
  --moon-opacity:    0.28;      /* ritual ground base opacity */
  --moon-speed:      180s;      /* ritual spin speed */
}

/* ── Dark-surface re-bind — footer, console, expelled elements stay dark ── */
/* Re-declare key vars locally so inner rules stay legible on dark backgrounds */
.field-console,
.nav-expelled,
.section-card-expelled,
.transmission-footer,
body[data-disruption="2"] .transmission-header,
body[data-disruption="3"] .transmission-header,
body[data-disruption="4"] .transmission-header,
body[data-disruption="5"] .transmission-header,
body[data-disruption="2"] .field-nav,
body[data-disruption="3"] .field-nav,
body[data-disruption="4"] .field-nav,
body[data-disruption="5"] .field-nav {
  --bone:        var(--od-bone);
  --bone-mid:    var(--od-mid);
  --bone-dim:    var(--od-dim);
  --blue-bright: var(--od-blue);
  --blue-deep:   var(--od-blue);
  --moss:        var(--od-moss);
  --moss-dim:    #3d5e3d;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Custom cursor — hide default ───────────────────────────── */
*, a, button { cursor: none; }

/* ── Cursor rings ───────────────────────────────────────────── */
.cursor-ring {
  position: fixed;
  width: 32px; height: 32px;
  border: 1px solid var(--bone-mid);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.18s, height 0.18s, border-color 0.18s, opacity 0.18s;
  opacity: 0;
}
.cursor-dot {
  position: fixed;
  width: 4px; height: 4px;
  background: var(--moss);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  opacity: 0;
}
body:hover .cursor-ring,
body:hover .cursor-dot { opacity: 1; }

/* Large ring on hover over links/buttons */
body.cursor-hover .cursor-ring {
  width: 52px; height: 52px;
  border-color: var(--blue-bright);
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 6px; }
::-webkit-scrollbar-track        { background: var(--ink); }
::-webkit-scrollbar-thumb        { background: var(--blue-mid); }
::-webkit-scrollbar-thumb:hover  { background: var(--blue-bright); }

/* ── Body / Ground ──────────────────────────────────────────── */
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-vt);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  padding-bottom: 48px;
  overflow-x: hidden;
  transition: background-color 1.8s ease;
}

/* ── Ritual ground — fixed background SVG circle ────────────── */
.ritual-ground {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
}
.ritual-svg {
  width: min(90vw, 90vh);
  height: min(90vw, 90vh);
  stroke: var(--bone-dim);
  overflow: visible;
  animation: ritual-slow-spin var(--ritual-duration) linear infinite;
}
@keyframes ritual-slow-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Seismic tremor — fires once on load if significant quake in last hour */
@keyframes seismic-tremor {
  0%   { transform: translateX(0); }
  8%   { transform: translateX(-6px) translateY(2px); }
  16%  { transform: translateX(5px)  translateY(-2px); }
  24%  { transform: translateX(-4px) translateY(1px); }
  32%  { transform: translateX(3px)  translateY(-1px); }
  42%  { transform: translateX(-2px); }
  52%  { transform: translateX(2px); }
  64%  { transform: translateX(-1px); }
  80%  { transform: translateX(1px); }
  100% { transform: translateX(0); }
}
.ritual-ground.seismic {
  animation: seismic-tremor 0.55s ease-out forwards;
}

/* Outer ghost ring — counter-rotates, moss-tinted, barely visible */
.ritual-ground::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(97vw, 97vh);
  height: min(97vw, 97vh);
  border-radius: 50%;
  border: 1px solid rgba(106,143,106,0.22);
  animation: ritual-slow-spin 320s linear infinite reverse;
  pointer-events: none;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-gutter);
  letter-spacing: 0.12em;
  line-height: 1.4;
  margin-bottom: 1rem;
  font-weight: 400;
  text-transform: uppercase;
}
h1 { font-size: 2rem;   color: var(--bone); }
h2 { font-size: 1.25rem; color: var(--bone-mid); }
h3 { font-size: 1rem;   color: var(--bone-dim); letter-spacing: 0.18em; }
h4 { font-size: 0.85rem; color: var(--blue-mid); font-family: var(--font-px); font-size: 0.72rem; }

p  { margin-bottom: 1rem; }

a         { color: var(--link); text-decoration: none; border-bottom: 1px solid rgba(30,104,145,0.3); }
a:hover   { color: var(--link-hover); border-bottom-color: var(--bone); }
a:visited { color: var(--bone-dim); border-bottom-color: transparent; }

strong { color: var(--bone); font-weight: 700; }
em     { color: var(--moss); font-style: normal; letter-spacing: 0.05em; }

code, pre {
  font-family: var(--font-vt);
  background: rgba(224,238,246,0.6);
  color: var(--blue-bright);
  border-left: 2px solid var(--blue-mid);
  padding: 2px 8px;
  font-size: 1.05rem;
}
pre {
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  border-left: 2px solid var(--blue-mid);
}

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.3rem; }

li::marker { color: var(--bone-dim); }

blockquote {
  border-left: 3px solid var(--bone-dim);
  padding: 0.5rem 1.25rem;
  color: var(--bone-mid);
  font-style: italic;
  font-family: var(--font-cinzel);
  letter-spacing: 0.06em;
  margin: 1.5rem 0;
}

/* Ruled divider — compass-drawn line with notch marks */
hr {
  border: none;
  position: relative;
  height: 20px;
  margin: 2rem 0;
  display: flex;
  align-items: center;
}
hr::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    var(--bone-dim) 8%,
    var(--bone-mid) 50%,
    var(--bone-dim) 92%,
    transparent 100%
  );
  transform: translateY(-50%);
}
hr::after {
  content: '∴';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  color: var(--moss);
  padding: 0 0.75rem;
  font-size: 0.8rem;
  line-height: 1;
  animation: glyph-pulse 6s ease-in-out infinite;
}

/* ── Transmission header ─────────────────────────────────────── */
.transmission-header {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2.5rem 1rem 1rem;
  border-bottom: 1px solid rgba(20,18,15,0.08);
  transition: padding-left 0.6s ease, text-align 0.4s ease;
}
.header-cipher {
  font-family: var(--font-px);
  font-size: 0.65rem;
  color: var(--bone-dim);
  letter-spacing: 0.3em;
  opacity: 0.6;
  margin-bottom: 1.25rem;
  overflow: hidden;
  white-space: nowrap;
}
.header-sigil {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  border-bottom: none;
  color: var(--bone);
}
.header-sigil:hover { color: var(--bone); border-bottom: none; }
.header-sigil:visited { color: var(--bone); border-bottom: none; }

/* The animated ring orbiting the name */
.sigil-ring {
  display: inline-block;
  width: 36px; height: 36px;
  border: 1px solid var(--bone-mid);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.sigil-ring::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(20,18,15,0.3);
  border-radius: 50%;
}
.sigil-ring::after {
  content: '';
  position: absolute;
  top: -4px; left: 50%;
  width: 6px; height: 6px;
  background: var(--blue-bright);
  border-radius: 50%;
  margin-left: -3px;
  animation: sigil-orbit var(--orbit-duration) linear infinite;
  box-shadow: 0 0 6px var(--blue-bright);
}
@keyframes sigil-orbit {
  from { transform: rotate(0deg)   translateY(-22px) rotate(0deg); }
  to   { transform: rotate(360deg) translateY(-22px) rotate(-360deg); }
}

.sigil-name {
  font-family: var(--font-gutter);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone);
}
.header-tagline {
  font-family: var(--font-vt);
  font-size: 1rem;
  letter-spacing: 0.25em;
  color: var(--bone-dim);
  margin-top: 0.5rem;
  text-transform: uppercase;
}

/* ── Dark mode toggle ────────────────────────────────────────── */
.theme-toggle {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: transparent;
  border: 1px solid var(--bone-dim);
  color: var(--bone-dim);
  font-size: 1.3rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  opacity: 0.7;
  line-height: 1;
  border-radius: 3px;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}
.theme-toggle:hover {
  opacity: 1;
  color: var(--bone);
  border-color: var(--bone);
}

/* ── Field navigation ────────────────────────────────────────── */
.field-nav {
  position: relative;
  z-index: 10;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(20,18,15,0.06);
}
.field-nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: center;
  padding: 0.5rem 0;
}
.field-nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  font-family: var(--font-gutter);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--bone-dim);
  text-decoration: none;
  border-bottom: none;
  position: relative;
  text-transform: uppercase;
  transition: color 0.2s;
}
.field-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--bone-mid);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s;
}
.field-nav-link:hover       { color: var(--bone); border-bottom: none; }
.field-nav-link:hover::after { transform: scaleX(1); }
.field-nav-link:visited     { color: var(--bone-dim); border-bottom: none; }
.field-nav-item.active .field-nav-link {
  color: var(--bone);
}
.field-nav-item.active .field-nav-link::after {
  transform: scaleX(1);
  background: var(--blue-bright);
}

.nav-glyph {
  color: var(--bone-dim);
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.2s;
}
.field-nav-link:hover .nav-glyph        { color: var(--moss); }
.field-nav-item.active .nav-glyph       { color: var(--blue-bright); }

/* Nav labels: hidden at rest, ghost in on hover or active */
.nav-label {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  display: inline-block;
  transition: opacity 0.25s ease, max-width 0.3s ease;
}
.field-nav-link:hover .nav-label,
.field-nav-item.active .nav-label {
  opacity: 1;
  max-width: 8em;
}

.nav-rule {
  height: 1px;
  background: linear-gradient(to right,
    transparent, var(--bone-dim) 20%, var(--moss-dim) 50%, var(--bone-dim) 80%, transparent
  );
  opacity: 0.4;
}

/* ── Content field ───────────────────────────────────────────── */
.content-field {
  position: relative;
  z-index: 10;
  max-width: var(--field-width);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  min-height: calc(100vh - 300px);
}

/* ── Transmission footer ─────────────────────────────────────── */
.transmission-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  height: 44px;
  background: rgba(5,4,7,0.95);
  border-top: 1px solid rgba(20,18,15,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  font-family: var(--font-vt);
  font-size: 0.85rem;
  color: var(--bone-dim);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.footer-glyph { color: var(--moss); margin-right: 0.5rem; animation: glyph-pulse 4s ease-in-out 1.8s infinite; }
#status-msg   { color: var(--bone-mid); transition: opacity 0.4s; letter-spacing: 0.06em; }
.footer-hex   { color: var(--blue-deep); letter-spacing: 0.05em; font-size: 0.75rem; }
#day-count    { color: var(--blue-bright); }
.footer-reach {
  color: var(--bone-dim);
  text-decoration: none;
  font-family: var(--font-vt);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  opacity: 0.8;
  transition: opacity 0.15s, color 0.15s;
  border-bottom: none;
}
.footer-reach:hover { opacity: 1; color: var(--bone); border-bottom: none; }

/* Blinks */
.blink-slow { animation: anim-blink 2s step-end infinite; color: var(--blue-bright); }
@keyframes anim-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
@keyframes glyph-pulse {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1; }
}
@keyframes console-intro-glitch {
  /* beat 1: hard signal spike */
  0%   { opacity: 0.6;  color: var(--blue-bright); transform: none;          text-shadow: none; }
  4%   { opacity: 1;    color: var(--bone);        transform: translateX(1px);  text-shadow: none; }
  8%   { opacity: 0.15; color: var(--blue-bright); transform: none;          text-shadow: none; }
  12%  { opacity: 1;    color: var(--bone);        transform: translateX(-1px); text-shadow: none; }
  18%  { opacity: 0.6;  color: var(--blue-bright); transform: none;          text-shadow: none; }
  /* silence */
  48%  { opacity: 0.6;  color: var(--blue-bright); transform: none;          text-shadow: none; }
  /* beat 2: echo pulse with chromatic bleed */
  52%  { opacity: 1;    color: var(--bone);        transform: none; text-shadow: -1px 0 var(--moss); }
  58%  { opacity: 0.15; color: var(--blue-bright); transform: none;          text-shadow: none; }
  64%  { opacity: 1;    color: var(--bone);        transform: none; text-shadow:  1px 0 var(--moss); }
  72%  { opacity: 0.6;  color: var(--blue-bright); transform: none;          text-shadow: none; }
  100% { opacity: 0.6;  color: var(--blue-bright); transform: none;          text-shadow: none; }
}

/* ── Glitch title ────────────────────────────────────────────── */
.glitch {
  position: relative;
  display: inline-block;
  color: var(--bone);
}
.sigil-name.glitch {
  display: block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden;
}
.glitch::before {
  color: #ff55ff; /* hardcoded — glitch ghost */
  animation: glitch-slice-1 3.5s infinite linear;
}
.glitch::after {
  color: #00ffff; /* hardcoded — glitch ghost */
  animation: glitch-slice-2 2.8s infinite linear;
}
@keyframes glitch-slice-1 {
  0%   { clip-path: inset(0 0 98% 0);   transform: translateX(-3px); }
  10%  { clip-path: inset(40% 0 50% 0); transform: translateX(3px);  }
  20%  { clip-path: inset(75% 0 10% 0); transform: translateX(-2px); }
  30%  { clip-path: inset(20% 0 70% 0); transform: translateX(2px);  }
  40%  { clip-path: inset(55% 0 35% 0); transform: translateX(-3px); }
  50%  { clip-path: inset(90% 0 0 0);   transform: translateX(1px);  }
  60%  { clip-path: inset(5% 0 90% 0);  transform: translateX(-1px); }
  70%  { clip-path: inset(65% 0 20% 0); transform: translateX(3px);  }
  80%  { clip-path: inset(30% 0 65% 0); transform: translateX(-2px); }
  90%  { clip-path: inset(80% 0 15% 0); transform: translateX(2px);  }
  100% { clip-path: inset(0 0 98% 0);   transform: translateX(-3px); }
}
@keyframes glitch-slice-2 {
  0%   { clip-path: inset(60% 0 30% 0); transform: translateX(2px);  }
  15%  { clip-path: inset(15% 0 75% 0); transform: translateX(-2px); }
  30%  { clip-path: inset(85% 0 5% 0);  transform: translateX(3px);  }
  45%  { clip-path: inset(35% 0 55% 0); transform: translateX(-1px); }
  60%  { clip-path: inset(0 0 95% 0);   transform: translateX(2px);  }
  75%  { clip-path: inset(70% 0 20% 0); transform: translateX(-3px); }
  90%  { clip-path: inset(45% 0 45% 0); transform: translateX(1px);  }
  100% { clip-path: inset(60% 0 30% 0); transform: translateX(2px);  }
}

@keyframes artifact-flicker {
  0%, 100% { opacity: 1; }
  18%  { opacity: 0; }
  19%  { opacity: 1; }
  52%  { opacity: 0.06; }
  53%  { opacity: 1; }
}

/* ── Rendering failure aesthetics (body[data-disruption="N"]) ────── */

/* L1: glyphs flicker out of phase — the grid is unstable */
body[data-disruption="1"] .sc-glyph                  { animation: artifact-flicker 2.4s steps(1) infinite; }
body[data-disruption="1"] .sc-glyph:nth-child(2n+1)  { animation-delay: -1.1s; }
body[data-disruption="1"] .sc-glyph:nth-child(3n+2)  { animation-delay: -0.4s; }

/* L2: nav separator vanishes, header border stress, alternate glyphs degrade to tofu */
body[data-disruption="2"] .nav-rule                                { opacity: 0; transition: opacity 0.4s; }
body[data-disruption="2"] .transmission-header                    { border-bottom-color: rgba(200,80,60,0.25); }
body[data-disruption="2"] .field-nav-item:nth-child(even) .nav-glyph { font-family: sans-serif; opacity: 0.25; }

/* L3: body fonts fail — serif fallback appears; one card glyph becomes a broken box */
body[data-disruption="3"] .sc-desc   { font-family: "Times New Roman", serif !important; font-size: 0.78rem; }
body[data-disruption="3"] .home-about { font-family: "Times New Roman", serif !important; }
body[data-disruption="3"] .section-card:nth-child(2) .sc-glyph {
  color: transparent;
  position: relative;
}
body[data-disruption="3"] .section-card:nth-child(2) .sc-glyph::after {
  content: '\2612'; /* ☒ broken ballot box */
  color: rgba(20,18,15,0.28);
  font-family: sans-serif;
  font-size: 1.6rem;
  position: absolute;
  left: 0; top: 0;
}

/* L4: debug outlines materialise; nav links flash browser-default blue; labels lose Cinzel */
body[data-disruption="4"] .section-grid  { outline: 1px dashed rgba(255,80,60,0.3); }
body[data-disruption="4"] .content-field { outline: 1px dashed rgba(255,80,60,0.14); }
body[data-disruption="4"] .field-nav-link {
  text-decoration: underline !important;
  color: #5b9bd5 !important;
}
body[data-disruption="4"] .sc-label { font-family: monospace !important; letter-spacing: 0.04em; }

/* L5: title font collapses; glitch ghosts go haywire; ritual ring freezes */
body[data-disruption="5"] .sigil-name,
body[data-disruption="5"] h1                       { font-family: "Times New Roman", serif !important; text-shadow: none; }
body[data-disruption="5"] .glitch::before        { animation-duration: 0.22s !important; }
body[data-disruption="5"] .glitch::after         { animation-duration: 0.16s !important; }
body[data-disruption="5"] .ritual-ground::before   { animation-play-state: paused; opacity: 0.02; }
body[data-disruption="5"] .section-card:nth-child(odd) {
  background: rgba(0,0,0,0.95) !important;
  outline: 1px solid rgba(255,80,60,0.35);
}


/* ── Panels — instrument field sections ─────────────────────── */
/* Screentone halftone on panels */
.panel {
  background-color: var(--bg2);
  background-image: radial-gradient(rgba(20,18,15,0.045) 1px, transparent 1px);
  background-size: 3px 3px;
  border: 1px solid rgba(20,18,15,0.1);
}
.panel-title {
  font-family: var(--font-gutter);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-dim);
  padding: 6px 12px 5px;
  border-bottom: 1px solid rgba(20,18,15,0.08);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.panel-title::before {
  content: '∴';
  color: var(--moss);
  font-size: 0.7rem;
}
.panel-body { padding: 1rem 1.25rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--font-gutter);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-mid);
  background: transparent;
  border: 1px solid rgba(20,18,15,0.25);
  padding: 8px 18px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.btn:hover   { border-color: var(--bone); color: var(--bone); }
.btn:visited { color: var(--bone-dim); border-bottom: none; }

/* ── Tags ────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-family: var(--font-px);
  font-size: 0.60rem;
  letter-spacing: 0.06em;
  color: var(--blue-bright);
  background: rgba(224,238,246,0.5);
  border: 1px solid rgba(30,104,145,0.3);
  padding: 2px 6px;
  margin: 1px;
  text-transform: lowercase;
}

/* ── Construction notice ─────────────────────────────────────── */
.under-construction {
  display: inline-block;
  font-family: var(--font-px);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--bone-dim);
  background: transparent;
  border: 1px solid rgba(20,18,15,0.15);
  padding: 6px 12px;
}
.under-construction::before { content: '⋯ '; color: var(--blue-mid); }

/* ── Home page ───────────────────────────────────────────────── */
.home-hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
  position: relative;
  overflow: hidden;
}
/* Radial speed lines */
.home-hero::before {
  content: '';
  position: absolute;
  inset: -60%;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(20,18,15,0.025) 0deg 1.2deg,
    transparent 1.2deg 8deg
  );
  pointer-events: none;
  z-index: 0;
}
.home-hero > * { position: relative; z-index: 1; }

.home-tagline {
  font-family: var(--font-gutter);
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  color: var(--bone-dim);
  margin-top: 1rem;
  text-transform: uppercase;
}
/* ── Home arrival ────────────────────────────────────────── */
.home-field {
  min-height: calc(100vh - 12rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 1.5rem;
  gap: 0;
}
/* ── ASCII sigil ─────────────────────────────────────────────── */
/* DejaVu Sans Mono — uniform-width glyphs for arrows/math/blocks so the
   cover art doesn't "breathe" as palettes change (Courier lacks these and
   the browser substitutes a proportional fallback of a different width). */
@font-face {
  font-family: "DejaVu Sans Mono";
  src: url("/assets/fonts/DejaVuSansMono.ttf") format("truetype");
  font-display: swap;
}

/* Cover artwork — ASCII landing piece */
.cover-field {
  min-height: calc(100vh - 12rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem 1rem;
}
.cover-ascii {
  /* Art is 301 cols × 177 rows. Size to fit the smaller viewport dimension:
     width-fit ≈ 0.5vw/char-col, height-fit ≈ 0.49vh/row. min() keeps both in. */
  font-family: "DejaVu Sans Mono", "Courier New", monospace;
  font-size: min(0.5vw, 0.49vh);
  line-height: 1;
  letter-spacing: 0;
  white-space: pre;
  margin: 0;
  color: var(--bone);
  opacity: 0;
  transform: scale(0.997);
  transition: opacity 1.4s ease, transform 1.4s ease;
  user-select: none;
  pointer-events: none;
}
.cover-ascii.is-loaded {
  opacity: 0.92;
  transform: scale(1);
}

/* Primary: the transmission — arrives first, cycles */
.home-transmission {
  font-family: var(--font-vt);
  font-size: 0.88rem;
  letter-spacing: 0.13em;
  text-align: center;
  color: var(--bone-mid);
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.6s ease;
  min-height: 1.4em;
  margin: 0;
}
/* Secondary: the caption — fades in after the transmission */
.home-about {
  max-width: 480px;
  font-family: var(--font-cinzel);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-align: center;
  color: var(--bone-dim);
  line-height: 2.8;
  text-transform: lowercase;
  margin: 2.4rem 0 0;
  opacity: 0;
  animation: home-caption-in 1s ease 1.6s forwards;
}
@keyframes home-caption-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Section grid */
.section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 2.5rem;
  border: 1px solid rgba(20,18,15,0.08);
  background: rgba(20,18,15,0.04); /* gap color */
  overflow: visible;
}
.section-grid.scattered {
  min-height: 14rem;
}
a.section-card {
  display: block;
  text-decoration: none;
  border-bottom: none;
  background: var(--bg);
  color: var(--text);
  transition: background 0.15s;
  padding: 1.25rem 1.25rem 1rem;
  will-change: transform;
}
a.section-card:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text);
  border-bottom: none;
}
a.section-card:hover .sc-glyph { color: var(--moss); }
a.section-card:hover .sc-label { color: var(--bone); }
a.section-card:hover .sc-desc  { opacity: 0.8; }
a.section-card:visited { color: var(--text); border-bottom: none; }

.sc-glyph {
  font-size: 2.5rem;
  display: block;
  color: var(--bone-dim);
  margin-bottom: 0.5rem;
  line-height: 1;
  transition: color 0.2s;
}
.sc-label {
  font-family: var(--font-gutter);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-mid);
  display: block;
  transition: color 0.15s;
}
.sc-desc {
  font-size: 0.9rem;
  color: var(--bone-dim);
  margin-top: 0.3rem;
  letter-spacing: 0.04em;
  opacity: 0.25;
  transition: opacity 0.25s;
}

/* Section card expelled state (disruption L3+) */
.section-card-expelled {
  position: fixed !important;
  z-index: 48 !important;
  width: 180px;
  background: rgba(5,4,7,0.92) !important;
  border: 1px solid rgba(226,217,200,0.1);
  transition:
    top    0.9s cubic-bezier(0.4,0,0.2,1),
    left   0.9s cubic-bezier(0.4,0,0.2,1),
    right  0.9s cubic-bezier(0.4,0,0.2,1),
    bottom 0.9s cubic-bezier(0.4,0,0.2,1);
}
.section-card-expelled .sc-desc { opacity: 0.7 !important; }

/* Triad divider — separates the two groups of 3 in the section grid */
.triad-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--moss-dim), transparent);
  opacity: 0.5;
}

/* ── Blog listing ────────────────────────────────────────────── */
.blog-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-vt);
  font-size: 1.1rem;
}
.blog-table thead tr {
  border-bottom: 1px solid rgba(20,18,15,0.12);
}
.blog-table th {
  font-family: var(--font-gutter);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-dim);
  padding: 8px 12px;
  text-align: left;
  font-weight: 400;
}
.blog-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(20,18,15,0.05);
  vertical-align: top;
}
.blog-table tr:hover td { background: rgba(0,0,0,0.04); }
.blog-table .date-col {
  white-space: nowrap;
  color: var(--bone-dim);
  font-family: var(--font-px);
  font-size: 0.65rem;
  width: 130px;
  letter-spacing: 0.04em;
}
.blog-table th.date-col {
  font-family: var(--font-gutter);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
}
.blog-table .tags-col { width: 180px; }
.blog-table .title-col a {
  color: var(--bone-mid);
  border-bottom: 1px solid transparent;
  font-size: 1.15rem;
}
.blog-table .title-col a:hover { color: var(--bone); border-bottom-color: var(--bone-dim); }

/* ── Blog post ───────────────────────────────────────────────── */
.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(20,18,15,0.1);
}
.post-meta {
  font-family: var(--font-px);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--bone-dim);
  margin-top: 0.75rem;
  text-transform: uppercase;
}
.post-content { max-width: 680px; }
.post-content p { font-size: 1.15rem; color: var(--text); line-height: 1.85; }
.post-content h2 { margin-top: 2rem; }
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(20,18,15,0.1);
}

/* ── Notes stream ────────────────────────────────────────────── */
.notes-stream {
  padding-top: 1.5rem;
  padding-bottom: 5rem;
}
.note-entry { /* no extra wrapper needed — post-content handles width */ }
.note-foot {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  margin-top: 1.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(20,18,15,0.07);
}
.note-permalink {
  display: flex;
  gap: 1.4rem;
  align-items: baseline;
  text-decoration: none;
  border-bottom: none;
}
.note-permalink:hover .note-title { color: var(--bone-mid); border-bottom: none; }
.note-title {
  font-family: var(--font-gutter);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: var(--bone-dim);
  transition: color 0.15s;
}
.note-date {
  font-family: var(--font-vt);
  font-size: 0.68rem;
  color: var(--bone-dim);
  opacity: 0.55;
}
.note-sep {
  text-align: center;
  font-family: var(--font-vt);
  font-size: 1rem;
  color: var(--bone-dim);
  opacity: 0.2;
  margin: 4rem 0;
  display: block;
  letter-spacing: 0.3em;
}
/* Solo post (individual page) */
.note-entry--solo { padding-top: 1rem; }
.note-entry--solo .note-foot { justify-content: flex-start; }
.note-nav {
  margin-left: auto;
  display: flex;
  gap: 1.4rem;
  align-items: center;
}
.note-nav-link {
  font-family: var(--font-vt);
  font-size: 0.85rem;
  color: var(--bone-dim);
  text-decoration: none;
  border-bottom: none;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.note-nav-link:hover { opacity: 1; border-bottom: none; }
.note-empty { color: var(--bone-dim); font-size: 0.9rem; }

/* Signal map forms */
.note-entry--chapter {
  padding: 1.2rem 1.1rem;
  background: linear-gradient(180deg, rgba(30,104,145,0.05), rgba(30,104,145,0.015));
  border: 1px solid rgba(30,104,145,0.18);
}
.chapter-kicker {
  font-family: var(--font-vt);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--blue-mid);
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}
.chapter-title {
  margin-bottom: 1rem;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
}
.chapter-title a {
  color: var(--bone);
  border-bottom: none;
}

.note-entry--artifact .post-content p {
  font-size: 1rem;
  line-height: 1.75;
}

.note-chip {
  margin-left: auto;
  font-family: var(--font-vt);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--bone-dim);
  opacity: 0.85;
  text-transform: lowercase;
}

/* ── Links page ──────────────────────────────────────────────── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: rgba(20,18,15,0.04);
  border: 1px solid rgba(20,18,15,0.06);
}
.social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  color: var(--bone-mid);
  text-decoration: none;
  border-bottom: none;
  font-family: var(--font-gutter);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}
.social-link:hover {
  background: rgba(0,0,0,0.05);
  color: var(--bone);
  border-bottom: none;
}
.social-link:visited { color: var(--bone-dim); border-bottom: none; }
.social-icon { font-size: 1.2rem; flex-shrink: 0; opacity: 0.7; }

/* ── Media embeds ────────────────────────────────────────────── */
.embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
  margin-bottom: 1rem;
  border: 1px solid rgba(20,18,15,0.08);
}
.embed-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.audio-player { width: 100%; accent-color: var(--blue-bright); margin-bottom: 0.5rem; }

/* ── Global player bar ──────────────────────────────────────── */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: #1c1915;
  border-top: 1px solid rgba(226,217,200,0.10);
  padding: 0.55rem 1.25rem;
  font-family: var(--font-vt);
  color: var(--od-bone);
  font-size: 0.75rem;
}
.player-inner {
  max-width: var(--field-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}
.player-title {
  color: var(--od-mid);
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 18rem;
  display: block;
}
.player-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.player-btn {
  background: transparent;
  border: none;
  color: var(--od-bone);
  font-size: 1rem;
  cursor: none;
  padding: 0.2rem 0.35rem;
  opacity: 0.55;
  transition: opacity 0.15s;
  line-height: 1;
}
.player-btn:hover { opacity: 1; }
.player-play-btn { font-size: 1.2rem; opacity: 0.85; }
.player-play-btn:hover { opacity: 1; }
.player-scrub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}
.player-time,
.player-duration {
  color: var(--od-dim);
  min-width: 2.4rem;
  text-align: center;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}
.player-seek {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  max-width: 10rem;
  height: 2px;
  background: rgba(226,217,200,0.18);
  border-radius: 1px;
  accent-color: var(--od-blue);
  cursor: none;
  outline: none;
}
.player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--od-blue);
  cursor: none;
}
/* Nudge page up when bar is showing */
body.player-active { padding-bottom: 3.2rem; }

/* ── Tracklist on /music/ page ──────────────────────────────── */
.track-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(20,18,15,0.08);
  cursor: none;
  transition: background 0.12s;
}
.track-row:last-child { border-bottom: none; }
.track-row:hover { background: rgba(0,0,0,0.04); }
.track-row.track-active .track-title { color: var(--blue-bright); }
.track-row.track-active .track-num   { color: var(--blue-mid); }
.track-num {
  color: var(--bone-dim);
  min-width: 1.6rem;
  font-size: 0.68rem;
  flex-shrink: 0;
}
.track-title {
  flex: 1;
  color: var(--bone);
  font-family: var(--font-vt);
  letter-spacing: 0.04em;
}
.track-play-btn {
  background: transparent;
  border: none;
  color: var(--bone-dim);
  font-size: 0.85rem;
  cursor: none;
  padding: 0.2rem 0.4rem;
  opacity: 0;
  transition: opacity 0.12s;
  line-height: 1;
}
.track-row:hover .track-play-btn      { opacity: 0.7; }
.track-row.track-active .track-play-btn { opacity: 1; color: var(--blue-bright); }

/* ── Gallery ─────────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2px;
  margin-bottom: 1rem;
  background: rgba(20,18,15,0.04);
}
.gallery-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  filter: grayscale(0.2) contrast(1.05);
}
.gallery-img:hover {
  filter: grayscale(0) contrast(1.1);
  box-shadow: 0 0 0 1px var(--bone-dim);
}

/* ── Software / project list ─────────────────────────────────── */
.project-list { display: flex; flex-direction: column; gap: 1px; background: rgba(20,18,15,0.04); }
.project-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg);
  padding: 1.25rem;
  transition: background 0.15s;
}
.project-card:hover { background: rgba(0,0,0,0.04); }
.project-info { flex: 1; }
.project-name {
  font-family: var(--font-gutter);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-mid);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.project-name::before { content: '⬡'; color: var(--blue-mid); font-size: 0.8rem; }
.project-desc { font-size: 1.05rem; color: var(--text); margin-bottom: 0.5rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 0.5rem; }
.project-actions { flex-shrink: 0; padding-top: 0.25rem; }

/* ── Ruled divider ───────────────────────────────────────────── */
.pixel-divider {
  height: 1px;
  background: linear-gradient(to right,
    transparent, var(--bone-dim) 20%, var(--blue-deep) 50%, var(--bone-dim) 80%, transparent
  );
  margin: 2rem 0;
  opacity: 0.5;
}

/* ── Scanlines overlay (optional class) ─────────────────────── */
.scanlines { position: relative; }
.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.07) 0px,
    rgba(0,0,0,0.07) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
}

/* ── Site hue wrap ───────────────────────────────────────────── */
/* wraps header+nav+main; excludes fixed footer+console+cursor */
.site-hue-wrap {
  filter: hue-rotate(var(--hue-shift));
  transition: filter 1.5s ease;
}

/* ── Sigil canvas ────────────────────────────────────────────── */
/* lives inside .ritual-ground, overtakes the SVG on invocation */
#sigil-canvas {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 90vh);
  height: min(90vw, 90vh);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* ── Field console ───────────────────────────────────────────── */
.field-console {
  position: fixed;
  bottom: 32px; left: 0; right: 0;
  z-index: 18;
  background: rgba(5,4,7,0.97);
  border-top: 1px solid rgba(106,143,106,0.35);
  padding: 0.6rem 1.25rem 0.7rem;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-vt);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.field-console.open {
  transform: translateY(0);
}
.console-output {
  font-size: 1rem;
  min-height: 2.5rem;
  margin-bottom: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.console-output .ce {
  color: var(--moss);
  opacity: 0.5;
  font-family: var(--font-vt);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  line-height: 2;
  word-break: break-all;
}
.console-output .cr {
  color: var(--bone-mid);
  letter-spacing: 0.06em;
}
.console-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.console-prompt {
  color: var(--moss);
  font-size: 1.15rem;
  flex-shrink: 0;
  letter-spacing: 0.08em;
  user-select: none;
}
.console-field {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(106,143,106,0.3);
  color: var(--bone);
  font-family: var(--font-vt);
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  outline: none;
  padding: 3px 0 4px;
  caret-color: var(--moss);
  cursor: none;
}
.console-field::placeholder {
  color: var(--bone-dim);
  opacity: 0.35;
}
.console-toggle {
  background: transparent;
  border: 1px solid var(--blue-bright);
  color: var(--blue-bright);
  font-family: var(--font-vt);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  cursor: pointer;
  opacity: 0.85;
  border-radius: 3px;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
  animation: console-intro-glitch 3.6s steps(1) 0.5s infinite;
}
.console-toggle:hover {
  opacity: 1;
  color: var(--moss);
  border-color: var(--moss);
}

/* ── Expelled nav (disruption level 3+) ────────────────────── */
.nav-expelled {
  position: fixed !important;
  z-index: 50 !important;
  background: rgba(5,4,7,0.88);
  padding: 0.3rem 0.5rem !important;
  border: 1px solid rgba(226,217,200,0.08);
  transition:
    top    0.7s cubic-bezier(0.4,0,0.2,1),
    left   0.7s cubic-bezier(0.4,0,0.2,1),
    right  0.7s cubic-bezier(0.4,0,0.2,1),
    bottom 0.7s cubic-bezier(0.4,0,0.2,1);
}
.nav-expelled .nav-label {
  opacity: 1 !important;
  max-width: 8em !important;
}

/* ── Wikipedia injection elements ────────────────────────────── */
.wiki-ghost {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  font-family: var(--font-vt);
  font-size: 0.75rem;
  color: var(--bone);
  opacity: 0;
  line-height: 1.7;
  padding: 0.5rem 1rem;
  word-break: break-word;
  transition: opacity 1.2s ease;
}
.wiki-word-flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: transparent;
}
.wiki-word {
  font-family: var(--font-gutter);
  font-size: clamp(2rem, 8vw, 6rem);
  color: var(--bone);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.14s ease;
  text-align: center;
  max-width: 90vw;
}
/* about node — homepage floating node after recognition */
.about-node {
  width: 44px;
  height: 44px;
}
.about-node-ring {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(30,104,145,0.4);
  background: var(--bg);
  box-shadow: 0 0 12px rgba(30,104,145,0.15), inset 0 0 8px rgba(30,104,145,0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
  animation: about-node-pulse 3.6s ease-in-out infinite;
}
.about-node:hover .about-node-ring {
  border-color: rgba(30,104,145,0.8);
  box-shadow: 0 0 20px rgba(30,104,145,0.35);
}
@keyframes about-node-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(30,104,145,0.15), inset 0 0 8px rgba(30,104,145,0.05); }
  50%       { box-shadow: 0 0 22px rgba(30,104,145,0.3),  inset 0 0 10px rgba(30,104,145,0.1); }
}

.wiki-margin {
  position: fixed;
  z-index: 5;
  font-family: var(--font-vt);
  font-size: 0.65rem;
  color: var(--bone-dim);
  opacity: 0;
  max-width: 140px;
  line-height: 1.5;
  transition: opacity 1s ease;
  pointer-events: none;
}
.wiki-margin--left  { left: 0.5rem; top: 30%; transform: rotate(-1.5deg); }
.wiki-margin--right { right: 0.5rem; top: 45%; transform: rotate(1.2deg); }

/* ── I Ching symbol flash ─────────────────────────────────── */
.iching-symbol-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.iching-symbol-glyph {
  font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans", var(--font-vt), monospace;
  font-size: clamp(3rem, 12vw, 8rem);
  color: var(--bone-dim);
  opacity: 0;
  transition: opacity 0.6s ease;
  line-height: 1;
  letter-spacing: 0.3em;
}
.iching-symbol-name {
  font-family: var(--font-gutter);
  font-size: clamp(2rem, 10vw, 7rem);
  color: var(--bone);
  opacity: 0;
  transition: opacity 0.6s ease;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1;
}
.iching-symbol-judgment {
  font-family: var(--font-vt);
  font-size: clamp(0.65rem, 2vw, 1rem);
  color: var(--bone-dim);
  opacity: 0;
  transition: opacity 0.8s ease;
  max-width: 60vw;
  text-align: center;
  margin-top: 0.6rem;
  line-height: 1.5;
}

/* ── Song corruption state ────────────────────────────────── */
body[data-song] .ritual-ground::before {
  opacity: 0.7;
  border-color: rgba(20,18,15,0.35);
}
body[data-song] .sigil-name {
  transition: color 1.2s ease;
}

/* ── Disruption: Layout Metamorphosis ────────────────────────────
 *
 * As disruption escalates the entire site layout transforms:
 *  L1 — background bleeds warm; nav shows a ghost left-border
 *  L2 — header + nav collapse into a fixed left sidebar; content reflows
 *  L3-L5 — bg shifts continue; sidebar shell persists (nav items have scattered)
 *
 * Pure CSS — no JS required. All rules auto-clear when body[data-disruption]
 * attribute is removed by resetDisruption().
 * ─────────────────────────────────────────────────────────────────── */

/* L1 — the seed: barely perceptible warmth; a ghost sidebar border */
body[data-disruption="1"] {
  background-color: #ede8df;
}
body[data-disruption="1"] .field-nav {
  border-left: 2px solid rgba(20,18,15,0.07);
}

/* L2 — the structural fold: sidebar arrives */
body[data-disruption="2"],
body[data-disruption="3"],
body[data-disruption="4"],
body[data-disruption="5"] {
  background-color: #d8d0c4;
}

body[data-disruption="3"] { background-color: #6a3a22; }
body[data-disruption="4"] { background-color: #201408; }
body[data-disruption="5"] { background-color: #0e0806; }

/* Sidebar — header panel */
body[data-disruption="2"] .transmission-header,
body[data-disruption="3"] .transmission-header,
body[data-disruption="4"] .transmission-header,
body[data-disruption="5"] .transmission-header {
  position: fixed;
  left: 0;
  top: 0;
  width: 190px;
  min-height: 180px;
  padding: 1.6rem 1.2rem 1.2rem;
  text-align: left;
  border-bottom: none;
  border-right: 1px solid rgba(226,217,200,0.09);
  background: rgba(7,6,8,0.97);
  z-index: 30;
  box-sizing: border-box;
}
body[data-disruption="2"] .header-cipher,
body[data-disruption="3"] .header-cipher,
body[data-disruption="4"] .header-cipher,
body[data-disruption="5"] .header-cipher {
  font-size: 0.28rem;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
}
body[data-disruption="2"] .header-sigil,
body[data-disruption="3"] .header-sigil,
body[data-disruption="4"] .header-sigil,
body[data-disruption="5"] .header-sigil {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
body[data-disruption="2"] .sigil-name,
body[data-disruption="3"] .sigil-name,
body[data-disruption="4"] .sigil-name,
body[data-disruption="5"] .sigil-name {
  font-size: 1.05rem;
  letter-spacing: 0.14em;
}
body[data-disruption="2"] .header-tagline,
body[data-disruption="3"] .header-tagline,
body[data-disruption="4"] .header-tagline,
body[data-disruption="5"] .header-tagline {
  font-size: 0.7rem;
  margin-top: 0.35rem;
  letter-spacing: 0.15em;
}

/* Sidebar — nav panel */
body[data-disruption="2"] .field-nav,
body[data-disruption="3"] .field-nav,
body[data-disruption="4"] .field-nav,
body[data-disruption="5"] .field-nav {
  position: fixed;
  left: 0;
  top: 180px;
  width: 190px;
  height: calc(100vh - 180px);
  padding: 1.2rem 0;
  border-bottom: none;
  border-right: 1px solid rgba(226,217,200,0.09);
  background: rgba(7,6,8,0.97);
  overflow-y: auto;
  z-index: 30;
  box-sizing: border-box;
}
body[data-disruption="2"] .field-nav-list,
body[data-disruption="3"] .field-nav-list,
body[data-disruption="4"] .field-nav-list,
body[data-disruption="5"] .field-nav-list {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 0 0.5rem;
  justify-content: flex-start;
}
body[data-disruption="2"] .field-nav-link,
body[data-disruption="3"] .field-nav-link,
body[data-disruption="4"] .field-nav-link,
body[data-disruption="5"] .field-nav-link {
  padding: 0.55rem 0.8rem;
  width: 100%;
  box-sizing: border-box;
}
body[data-disruption="2"] .nav-label,
body[data-disruption="3"] .nav-label,
body[data-disruption="4"] .nav-label,
body[data-disruption="5"] .nav-label {
  opacity: 1;
  max-width: 8em;
}
body[data-disruption="2"] .nav-rule,
body[data-disruption="3"] .nav-rule,
body[data-disruption="4"] .nav-rule,
body[data-disruption="5"] .nav-rule {
  display: none;
}

/* Content field reflows right of the sidebar */
body[data-disruption="2"] .content-field,
body[data-disruption="3"] .content-field,
body[data-disruption="4"] .content-field,
body[data-disruption="5"] .content-field {
  margin-left: 200px;
  transition: margin-left 0.5s ease, transform 0.8s ease, filter 0.8s ease;
}

/* Mobile — sidebar does not apply on small screens */
@media (max-width: 680px) {
  body[data-disruption="2"] .transmission-header,
  body[data-disruption="3"] .transmission-header,
  body[data-disruption="4"] .transmission-header,
  body[data-disruption="5"] .transmission-header {
    position: static;
    width: auto;
    min-height: auto;
    padding: 1.5rem 0.75rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid rgba(20,18,15,0.08);
    border-right: none;
    background: transparent;
  }
  body[data-disruption="2"] .field-nav,
  body[data-disruption="3"] .field-nav,
  body[data-disruption="4"] .field-nav,
  body[data-disruption="5"] .field-nav {
    position: static;
    width: auto;
    height: auto;
    top: auto;
    border-right: none;
    border-bottom: 1px solid rgba(20,18,15,0.06);
    background: transparent;
    padding: 0 1.5rem;
  }
  body[data-disruption="2"] .field-nav-list,
  body[data-disruption="3"] .field-nav-list,
  body[data-disruption="4"] .field-nav-list,
  body[data-disruption="5"] .field-nav-list {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0.5rem 0;
  }
  body[data-disruption="2"] .content-field,
  body[data-disruption="3"] .content-field,
  body[data-disruption="4"] .content-field,
  body[data-disruption="5"] .content-field {
    margin-left: 0;
  }
  body[data-disruption="2"] .header-sigil,
  body[data-disruption="3"] .header-sigil,
  body[data-disruption="4"] .header-sigil,
  body[data-disruption="5"] .header-sigil {
    flex-direction: row;
    align-items: center;
  }
  body[data-disruption="2"] .sigil-name,
  body[data-disruption="3"] .sigil-name,
  body[data-disruption="4"] .sigil-name,
  body[data-disruption="5"] .sigil-name {
    font-size: 1.6rem;
    letter-spacing: 0.2em;
  }
}

/* ── Tree of Life navigation state ──────────────────────────────
 *
 * Activated on 12th console submit. The 7 nav glyphs spring from
 * their scattered positions into a 3-column sephirot geometry.
 * Content and sidebar vanish — only the structure remains.
 * Cleared on "return".
 * ───────────────────────────────────────────────────────────── */

body.tree-active {
  background-color: #06040e;
  transition: background-color 1.8s ease;
}

/* Sidebar conflict — shrink header to a corner pin, collapse nav shell */
body.tree-active .transmission-header {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  z-index: 45;
  overflow: hidden;
  text-align: left;
  box-sizing: border-box;
}
body.tree-active .header-cipher,
body.tree-active .sigil-name,
body.tree-active .header-tagline {
  display: none;
}
body.tree-active .header-sigil {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
}
body.tree-active .sigil-ring {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
body.tree-active .field-nav {
  position: static;
  width: 0;
  height: 0;
  overflow: visible;
  border: none;
  background: none;
  padding: 0;
}
body.tree-active .nav-rule { display: none; }

/* Content field fades away — the tree is the interface */
body.tree-active .content-field {
  opacity: 0;
  pointer-events: none;
  margin-left: 0;
  transition: opacity 0.8s ease, margin-left 0.5s ease;
}

/* Sephirot node base */
.nav-sephiroth {
  position: fixed !important;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(20,18,15,0.22);
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 40;
  box-sizing: border-box;
  box-shadow:
    0 0 18px rgba(110,198,245,0.10),
    inset 0 0 10px rgba(110,198,245,0.05);
  background: rgba(6,4,14,0.85);
  transform: none !important;
  transition:
    top    1.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    left   1.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.6s ease;
}
.nav-sephiroth .field-nav-link {
  width: 100%;
  height: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border: none;
  margin: 0;
}
.nav-sephiroth .nav-glyph {
  font-size: 1.55rem;
  line-height: 1;
  opacity: 1;
  color: var(--bone);
  position: static;
}
.nav-sephiroth .nav-label { display: none !important; }
.nav-sephiroth .field-nav-link::after { display: none; }

/* Node positions — offset inward by half node size (26px) so the
   center of the ring lands on the geometry point */
.ns-1 { top: calc(12vh - 26px); left: calc(50% - 26px); }  /* Kether */
.ns-2 { top: calc(28vh - 26px); left: calc(23% - 26px); }  /* Chokmah */
.ns-3 { top: calc(28vh - 26px); left: calc(77% - 26px); }  /* Binah */
.ns-4 { top: calc(47vh - 26px); left: calc(50% - 26px); }  /* Tiphareth */
.ns-5 { top: calc(64vh - 26px); left: calc(23% - 26px); }  /* Netzach */
.ns-6 { top: calc(64vh - 26px); left: calc(77% - 26px); }  /* Hod */
.ns-7 { top: calc(80vh - 26px); left: calc(50% - 26px); }  /* Yesod */

/* Tree overlay SVG */
#tree-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 35;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.8s ease;
}
#tree-overlay line {
  stroke: rgba(20,18,15,0.13);
  stroke-width: 0.5;
  fill: none;
}

/* Mobile — tree never activates on small screens; rules are moot
   but override any stray fixed positioning just in case */
@media (max-width: 680px) {
  .nav-sephiroth {
    position: static !important;
    width: auto;
    height: auto;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
  }
  body.tree-active .content-field {
    opacity: 1;
    pointer-events: auto;
    margin-left: 0;
  }
  body.tree-active .transmission-header {
    position: static;
    width: auto;
    height: auto;
  }
  body.tree-active .header-cipher,
  body.tree-active .sigil-name,
  body.tree-active .header-tagline {
    display: block;
  }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 680px) {
  body { font-size: 16px; }
  .content-field { padding: 2rem 1rem 3rem; }
  .transmission-header { padding: 1.5rem 0.75rem 0.75rem; }
  .sigil-name { font-size: 1.1rem; }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1rem; }
  .field-nav-list { gap: 0; }
  .field-nav-link { padding: 0.4rem 0.6rem; font-size: 0.5rem; }
  .nav-glyph { font-size: 0.9rem; }
  .nav-label { opacity: 1; max-width: 6em; }
  .blog-table .date-col,
  .blog-table .tags-col { display: none; }
  .project-card { flex-direction: column; }
  .post-nav { flex-direction: column; }
  .section-grid { grid-template-columns: repeat(2, 1fr); }
  .triad-divider { display: none; }
  .transmission-footer { font-size: 0.72rem; height: 38px; }
  .footer-center { display: none; }
}

.note-entry--forming {
  opacity: 0.38;
  pointer-events: none;
  user-select: none;
}
.note-permalink--muted {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  color: var(--bone-dim);
  font-family: var(--font-vt);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

/* ── Chapter map (index constellation) ──────────────────────── */
.chapter-map-page {
  position: relative;
}

.chapter-map-wrap {
  position: relative;
  width: 100%;
  border: 1px solid rgba(20,18,15,0.07);
  background: rgba(20,18,15,0.012);
  overflow: hidden;
  touch-action: none;
}

.chapter-map-canvas {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  display: block;
}

.chapter-map-stage {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

.chapter-map-loader {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.8rem 0 0.25rem;
  min-height: 0.8rem;
}

.loading-blocks {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.55rem 0 0.25rem;
  min-height: 0.8rem;
}

.chapter-map-loader[hidden] {
  display: none;
}

.loading-blocks[hidden] {
  display: none;
}

.cml-block {
  width: 0.52rem;
  height: 0.52rem;
  border: 1px solid rgba(30,104,145,0.45);
  background: rgba(224,238,246,0.35);
  animation: chapter-block-pulse 0.9s steps(1, end) infinite;
}

.loading-block {
  width: 0.52rem;
  height: 0.52rem;
  border: 1px solid rgba(30,104,145,0.45);
  background: rgba(224,238,246,0.35);
  animation: chapter-block-pulse 0.9s steps(1, end) infinite;
}

.cml-block:nth-child(2) { animation-delay: 0.12s; }
.cml-block:nth-child(3) { animation-delay: 0.24s; }
.cml-block:nth-child(4) { animation-delay: 0.36s; }
.cml-block:nth-child(5) { animation-delay: 0.48s; }

.loading-blocks .loading-block:nth-child(2) { animation-delay: 0.12s; }
.loading-blocks .loading-block:nth-child(3) { animation-delay: 0.24s; }
.loading-blocks .loading-block:nth-child(4) { animation-delay: 0.36s; }
.loading-blocks .loading-block:nth-child(5) { animation-delay: 0.48s; }

@keyframes chapter-block-pulse {
  0%, 100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

/* ── Chapter map nodes ── */
.chapter-map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  border-bottom: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 2;
}
.chapter-map-node:visited { border-bottom: none; }
.chapter-map-node:hover   { border-bottom: none; }

.cmn-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(30,104,145,0.32);
  background: var(--bg);
  color: var(--blue-mid);
  font-size: 1.3rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.chapter-map-node:not(.cmn-forming):hover .cmn-glyph,
.chapter-map-node:not(.cmn-forming):focus-visible .cmn-glyph {
  border-color: var(--blue-bright);
  background: rgba(30,104,145,0.07);
  box-shadow: 0 0 18px rgba(30,104,145,0.2);
}

.chapter-map-node.dragging .cmn-glyph {
  box-shadow: 0 0 22px rgba(30,104,145,0.28);
}

.cmn-forming .cmn-glyph {
  border-style: dashed;
  opacity: 0.32;
  color: var(--bone-dim);
}

.cmn-label {
  font-family: var(--font-vt);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--bone-dim);
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: none;
}
.cmn-forming .cmn-label { opacity: 0.32; }

.cmn-count {
  font-family: var(--font-gutter);
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  color: var(--blue-mid);
  opacity: 0.7;
  pointer-events: none;
}

/* ── Chapter map tooltip ── */
.chapter-map-tooltip {
  position: absolute;
  z-index: 10;
  width: 180px;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid rgba(30,104,145,0.2);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cmt-title {
  font-family: var(--font-vt);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--bone-mid);
  display: block;
}
.cmt-summary {
  font-size: 0.72rem;
  color: var(--text);
  line-height: 1.4;
  display: block;
  opacity: 0.75;
}
.cmt-count {
  font-family: var(--font-gutter);
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-mid);
  display: block;
  opacity: 0.65;
}

@media (max-width: 680px) {
  .cmn-glyph { width: 44px; height: 44px; font-size: 1.1rem; }
  .cmn-label { font-size: 0.54rem; max-width: 78px; }
  .chapter-map-tooltip { display: none; } /* tooltip impractical on touch */
}

/* ── Chapter web (full-viewport canvas layout) ───────────────── */
.chapter-web-page {
  display: flex; flex-direction: column; gap: 0;
}
.chapter-web-header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.5rem 0 0.75rem;
}
.chapter-web-title {
  font-family: var(--font-vt); font-size: 0.85rem;
  letter-spacing: 0.06em; color: var(--bone-mid);
}
.chapter-web-meta {
  display: flex; gap: 0.65rem; align-items: center;
}
.chapter-web-loader-wrap {
  margin: 0.55rem 0 0.2rem;
}
.chapter-web-field {
  position: relative; width: 100%;
  height: calc(100svh - 160px); min-height: 420px;
  overflow: hidden; touch-action: none;
  border: 1px solid rgba(20,18,15,0.07);
  background: rgba(20,18,15,0.012);
}
.chapter-web-canvas {
  position: absolute; top: 0; left: 0;
  pointer-events: none; display: block;
}
.chapter-web-stage {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
}

/* Text card node */
.cw-text-card {
  position: absolute; z-index: 2;
  background: var(--bg);
  border: 1px solid rgba(20,18,15,0.12);
  max-height: 62%; overflow-y: auto;
  cursor: grab; user-select: none;
}
.cw-text-card:active,
.cw-text-card.dragging { cursor: grabbing; }
.cw-card-handle {
  display: flex; justify-content: flex-end;
  padding: 0.3rem 0.55rem 0;
  font-size: 0.6rem; letter-spacing: 0.2em;
  color: var(--bone-dim); opacity: 0.45;
  pointer-events: none; user-select: none;
}
.cw-card-body {
  padding: 0.6rem 1.1rem 1rem;
  font-size: 0.88rem; line-height: 1.65;
  color: var(--bone);
}
.cw-card-body > *:first-child { margin-top: 0; }
.cw-card-body > *:last-child  { margin-bottom: 0; }
.cw-card-body a { pointer-events: all; cursor: pointer; }

/* Preview card (anchored near artifact node) */
.cw-preview {
  position: absolute; z-index: 5;
  background: var(--bg);
  border: 1px solid rgba(30,104,145,0.22);
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 0.75rem;
}
.cp-close {
  position: absolute; top: 0.4rem; right: 0.5rem;
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--bone-dim); line-height: 1;
  padding: 0 0.15rem;
}
.cp-close:hover { color: var(--bone); }
.cp-inner { margin-top: 0.5rem; }
.cp-video {
  position: relative; width: 100%;
  padding-top: 56.25%; /* 16:9 */
}
.cp-video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.cp-link {
  font-size: 0.82rem; color: var(--link);
  word-break: break-word;
}
.cp-meta {
  font-size: 0.72rem; color: var(--bone-dim);
  letter-spacing: 0.04em; margin: 0;
}
.cw-preview--reading { width: 340px; }
.cp-reader {
  max-height: 320px; overflow-y: auto;
  font-size: 0.85rem; line-height: 1.65;
  color: var(--bone);
  padding-right: 0.25rem;
}
.cp-reader > *:first-child { margin-top: 0; }
.cp-reader > *:last-child  { margin-bottom: 0; }
.cp-reader--tumblr {
  max-height: 62vh;
  overflow: auto;
  padding-right: 0.2rem;
}
.cp-tumblr-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}
.cp-zoom-btn {
  border: 1px solid rgba(30,104,145,0.35);
  background: rgba(224,238,246,0.35);
  color: var(--blue-bright);
  font-family: var(--font-gutter);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.38rem;
  cursor: pointer;
}
.cp-zoom-btn:hover { border-color: var(--blue-mid); }
.cp-zoom-label {
  font-family: var(--font-px);
  font-size: 0.6rem;
  color: var(--bone-dim);
}
.cp-reader--tumblr img,
.cp-reader--tumblr video,
.cp-reader--tumblr iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 50vh;
  object-fit: contain;
  margin: 0.35rem auto;
}
.cp-reader--tumblr figure {
  margin: 0.35rem 0;
}
.cp-reader--tumblr audio {
  width: 100%;
  margin: 0.35rem 0;
}
.cp-github { display: flex; flex-direction: column; gap: 0.35rem; }
.cp-gh-preview {
  width: 100%; height: 200px; object-fit: cover;
  border-radius: 3px; border: 1px solid rgba(20,18,15,0.1);
  margin-bottom: 0.25rem;
}
.cp-gh-name {
  font-family: var(--font-vt); font-size: 0.88rem;
  letter-spacing: 0.04em; word-break: break-all;
}
.cp-gh-desc { font-size: 0.82rem; color: var(--bone); margin: 0; line-height: 1.5; }
.cp-gh-meta { font-size: 0.72rem; color: var(--bone-dim); margin: 0; letter-spacing: 0.04em; }
.constellation-node[data-platform="github"] { --node-accent: #4a6741; }

/* ── Chapter page (legacy, kept for possible reuse) ─────────── */
.chapter-page { display: flex; flex-direction: column; gap: 2rem; }
.chapter-header { display: flex; flex-direction: column; gap: 0.35rem; }
.chapter-heading {
  font-family: var(--font-vt);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--bone-mid);
  font-weight: normal;
}
.chapter-header-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.chapter-narrative { padding-bottom: 0.5rem; }
.chapter-empty {
  font-family: var(--font-vt);
  font-size: 0.78rem;
  color: var(--bone-dim);
  opacity: 0.7;
}

/* ── Constellation canvas ─────────────────────────────────────── */
.constellation-section { display: flex; flex-direction: column; gap: 0.75rem; }
.constellation-kicker {
  font-family: var(--font-gutter);
  font-size: 0.52rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-dim);
  opacity: 0.65;
  margin: 0;
}

.constellation-wrap {
  position: relative;
  width: 100%;
  border: 1px solid rgba(20,18,15,0.08);
  background: rgba(20,18,15,0.015);
  overflow: hidden;
  touch-action: none; /* prevent scroll interference during drag */
}

.constellation-canvas {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  display: block;
}

.constellation-stage {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}

/* ── Constellation node buttons ── */
.constellation-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 2;
}

.cn-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(30,104,145,0.35);
  background: var(--bg);
  color: var(--blue-mid);
  font-size: 1.15rem;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.constellation-node:hover .cn-glyph,
.constellation-node:focus-visible .cn-glyph {
  border-color: var(--blue-bright);
  background: rgba(30,104,145,0.07);
  box-shadow: 0 0 12px rgba(30,104,145,0.18);
}

.constellation-node.dragging .cn-glyph {
  border-color: var(--blue-bright);
  box-shadow: 0 0 18px rgba(30,104,145,0.28);
  cursor: none;
}

/* oracle node — transient, chapter-signature reading */
.oracle-glyph {
  border-style: dashed;
  border-color: rgba(30,104,145,0.25);
  background: transparent;
  color: var(--bone-dim);
  font-size: 1.3rem;
  animation: oracle-pulse 4.8s ease-in-out infinite;
}
.oracle-node:hover .oracle-glyph {
  border-color: rgba(30,104,145,0.6);
  color: var(--bone);
}
.oracle-label {
  opacity: 0.45;
  font-style: italic;
}
@keyframes oracle-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(30,104,145,0.08); }
  50%       { box-shadow: 0 0 18px rgba(30,104,145,0.22); }
}

.cn-label {
  font-family: var(--font-vt);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: var(--bone-dim);
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: none;
}

/* ── Constellation preview window ── */
.constellation-preview {
  position: relative;
  border: 1px solid rgba(30,104,145,0.22);
  background: var(--bg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cp-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--bone-dim);
  font-size: 1.1rem;
  cursor: none;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  opacity: 0.6;
  transition: opacity 0.12s;
}
.cp-close:hover { opacity: 1; }

.cp-inner iframe { display: block; }

.cp-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.cp-video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.cp-link {
  font-family: var(--font-vt);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(20,18,15,0.15);
  display: inline-block;
  padding: 0.4rem 0;
}
.cp-link:hover { color: var(--blue-bright); border-bottom-color: var(--blue-mid); }

.cp-meta {
  font-family: var(--font-gutter);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-dim);
  opacity: 0.6;
  margin: 0;
}

.constellation-fallback {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: var(--font-vt);
  font-size: 0.82rem;
}
.constellation-fallback li a { color: var(--text); }

@media (max-width: 680px) {
  .cn-label { max-width: 70px; font-size: 0.52rem; }
  .cn-glyph { width: 38px; height: 38px; font-size: 1rem; }
}

/* ── LAB page ────────────────────────────────────────────────── */
.lab-stream {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lab-entry {
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(20,18,15,0.07);
}
.lab-entry:last-child { border-bottom: none; }

.lab-entry--chapter {
  border-left: 2px solid var(--blue-mid);
  padding-left: 1rem;
  margin-left: -1rem;
}

.lab-artifact-inner { display: flex; flex-direction: column; gap: 0.75rem; }

.lab-embed {
  width: 100%;
  border: 1px solid rgba(20,18,15,0.09);
  background: rgba(20,18,15,0.02);
}

.lab-embed--video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.lab-embed--video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.lab-preview-link {
  padding: 0.6rem 0;
  font-family: var(--font-vt);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.lab-preview-link a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(20,18,15,0.15);
}
.lab-preview-link a:hover { color: var(--blue-bright); border-bottom-color: var(--blue-mid); }

.lab-platform-label {
  font-family: var(--font-gutter);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  opacity: 0.8;
.lab-tumblr-preview {
  border: 1px solid rgba(30,104,145,0.18);
  background: rgba(224,238,246,0.18);
  padding: 0.65rem;
  max-height: 58vh;
  overflow: auto;
}
.lab-tumblr-preview img,
.lab-tumblr-preview video,
.lab-tumblr-preview iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 46vh;
  object-fit: contain;
  margin: 0.4rem auto;
}
.lab-tumblr-preview audio {
  width: 100%;
  margin: 0.4rem 0;
}
.lab-tumblr-preview figure {
  margin: 0.4rem 0;
}
}

.lab-notes-preview {
  border: 1px solid rgba(20,18,15,0.09);
  background: rgba(20,18,15,0.02);
  padding: 0.75rem;
}
.lab-notes-snippet {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--bone);
}

.lab-github-preview {
  border: 1px solid rgba(30,104,145,0.18);
  background: rgba(224,238,246,0.18);
  padding: 0.65rem;
  line-height: 0;
}
.lab-github-img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  border-radius: 2px;
  background: rgba(20,18,15,0.03);
}

@media (max-width: 680px) {
  .lab-github-img { max-height: 160px; }
  .lab-entry--chapter { margin-left: -0.5rem; padding-left: 0.5rem; }
}

/* ── STEMS page ──────────────────────────────────────────────── */
.stems-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stems-tracklist {
  display: flex;
  flex-direction: column;
}

.stems-mixer {
  min-height: 120px;
}

.stems-placeholder {
  padding: 1rem 0;
}

.stems-active {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stems-song-title {
  font-family: var(--font-gutter);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 0.25rem;
}

.stems-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stem-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(20,18,15,0.06);
  font-family: var(--font-vt);
  font-size: 0.82rem;
  min-height: 2rem;
  transition: opacity 0.3s;
}
.stem-row[data-error="true"] { opacity: 0.5; }
.stem-row[data-loaded="false"]:not([data-error="true"]) { opacity: 0.6; }

.stem-color {
  flex: 0 0 1rem;
  font-size: 0.7rem;
  line-height: 1;
}

.stem-name {
  flex: 0 0 5rem;
  color: var(--bone);
  letter-spacing: 0.04em;
}

.stem-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(20,18,15,0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  min-width: 40px;
}
.stem-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bone);
  border: none;
  cursor: pointer;
}
.stem-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bone);
  border: none;
  cursor: pointer;
}
.stem-slider--master {
  accent-color: var(--blue-bright);
}
.stem-slider--master::-webkit-slider-thumb {
  background: var(--blue-bright);
}
.stem-slider--master::-moz-range-thumb {
  background: var(--blue-bright);
}

.stem-progress-wrap {
  flex: 1;
  height: 4px;
  background: rgba(20,18,15,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.stem-progress {
  height: 100%;
  width: 0%;
  background: var(--blue-bright);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.stem-ctl {
  flex: 0 0 1.6rem;
  height: 1.4rem;
  background: none;
  border: 1px solid rgba(20,18,15,0.15);
  color: var(--bone-dim);
  font-family: var(--font-vt);
  font-size: 0.65rem;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stem-ctl:hover { border-color: var(--bone-mid); color: var(--bone); }
.stem-ctl--active {
  background: var(--moss);
  color: var(--ink);
  border-color: var(--moss);
}
.stem-ctl--mute.stem-ctl--active { background: var(--bone); color: var(--ink); border-color: var(--bone); }

.stem-retry {
  flex: 0 0 auto;
  background: none;
  border: 1px solid rgba(30,104,145,0.3);
  color: var(--blue-bright);
  font-family: var(--font-vt);
  font-size: 0.65rem;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  letter-spacing: 0.06em;
  transition: background 0.2s;
}
.stem-retry:hover { background: rgba(30,104,145,0.1); }
.stem-retry--hidden { display: none; }

.stems-master {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(20,18,15,0.09);
  margin-top: 0.5rem;
}

.stem-master-label {
  font-family: var(--font-vt);
  font-size: 0.7rem;
  color: var(--bone-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex: 0 0 5rem;
}

.stems-transport {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stems-time,
.stems-duration {
  font-family: var(--font-vt);
  font-size: 0.78rem;
  color: var(--bone-dim);
  flex: 0 0 auto;
  min-width: 3rem;
}

.stems-seek {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(20,18,15,0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  min-width: 60px;
}
.stems-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue-bright);
  border: none;
  cursor: pointer;
}
.stems-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue-bright);
  border: none;
  cursor: pointer;
}
.stems-seek:disabled { opacity: 0.3; pointer-events: none; }

.stems-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.stem-btn {
  background: none;
  border: 1px solid var(--blue-bright);
  color: var(--blue-bright);
  font-family: var(--font-gutter);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stem-btn:hover { background: var(--blue-bright); color: var(--ink); }
.stem-btn--disabled {
  border-color: var(--bone-dim);
  color: var(--bone-dim);
  cursor: default;
  pointer-events: none;
  opacity: 0.4;
}
.stem-btn--play { font-size: 0.85rem; min-width: 2.5rem; }
.stem-btn--reset { border-color: rgba(20,18,15,0.18); color: var(--bone-dim); }
.stem-btn--reset:hover { background: rgba(20,18,15,0.06); color: var(--bone); border-color: var(--bone-mid); }

@media (max-width: 680px) {
  .stem-name { flex-basis: 3.5rem; font-size: 0.75rem; }
  .stem-ctl { flex-basis: 1.4rem; height: 1.3rem; font-size: 0.6rem; }
  .stem-slider { min-width: 30px; }
}

/* ══════════════════════════════════════════════════════════════
   DARK MODE — html[data-theme="dark"]
   Re-declares all changed custom properties and overrides the
   handful of hardcoded rgba() values that can't use variables.
   ══════════════════════════════════════════════════════════════ */

html[data-theme="dark"] {
  --bg:          #070608;
  --bg2:         #0c0a0b;
  --bone:        #e2d9c8;
  --bone-mid:    #b8ad96;
  --bone-dim:    #6e665a;
  --blue-bright: #6ec6f5;
  --blue-mid:    #3a8cc4;
  --blue-deep:   #0d2a4a;
  --moss:        #6a8f6a;
  --moss-dim:    #3d5e3d;
  --ink:         #050407;
  --text:        #a09880;
  --link:        #7aadcc;
}

/* Screentones */
html[data-theme="dark"] body {
  background-image: radial-gradient(rgba(226,217,200,0.055) 1px, transparent 1px);
  background-size: var(--screentone-size);
}
html[data-theme="dark"] .panel {
  background-image: radial-gradient(rgba(226,217,200,0.045) 1px, transparent 1px);
  border-color: rgba(226,217,200,0.1);
}

/* Borders that were converted from bone-white to dark ink */
html[data-theme="dark"] .transmission-header { border-bottom-color: rgba(226,217,200,0.08); }
html[data-theme="dark"] .field-nav           { border-bottom-color: rgba(226,217,200,0.06); }
html[data-theme="dark"] .transmission-footer { border-top-color:    rgba(226,217,200,0.1);  }
html[data-theme="dark"] .panel-title         { border-bottom-color: rgba(226,217,200,0.08); }
html[data-theme="dark"] .btn                 { border-color:        rgba(226,217,200,0.25); }
html[data-theme="dark"] .under-construction  { border-color:        rgba(226,217,200,0.15); }
html[data-theme="dark"] .sigil-ring::before  { border-color:        rgba(226,217,200,0.3);  }
html[data-theme="dark"] .embed-wrap          { border-color:        rgba(226,217,200,0.08); }
html[data-theme="dark"] .post-header         { border-bottom-color: rgba(226,217,200,0.1);  }
html[data-theme="dark"] .post-nav            { border-top-color:    rgba(226,217,200,0.1);  }
html[data-theme="dark"] .blog-table thead tr { border-bottom-color: rgba(226,217,200,0.12); }
html[data-theme="dark"] .blog-table td       { border-bottom-color: rgba(226,217,200,0.05); }
html[data-theme="dark"] .footer-hex   { color: var(--blue-mid); }

/* Link underline */
html[data-theme="dark"] a { border-bottom-color: rgba(122,173,204,0.3); }

/* Code blocks */
html[data-theme="dark"] code,
html[data-theme="dark"] pre {
  background: rgba(13,42,74,0.6);
  border-left-color: var(--blue-deep);
}

/* Tags */
html[data-theme="dark"] .tag {
  background: rgba(13,42,74,0.5);
  border-color: rgba(58,140,196,0.3);
}

/* Grid gaps and list backgrounds */
html[data-theme="dark"] .links-grid   { background: rgba(226,217,200,0.04); border-color: rgba(226,217,200,0.06); }
html[data-theme="dark"] .gallery-grid { background: rgba(226,217,200,0.04); }
html[data-theme="dark"] .project-list { background: rgba(226,217,200,0.04); }

/* Hover states */
html[data-theme="dark"] a.section-card:hover          { background: rgba(13,42,74,0.4);  }
html[data-theme="dark"] .blog-table tr:hover td        { background: rgba(13,42,74,0.2);  }
html[data-theme="dark"] .project-card:hover            { background: rgba(13,42,74,0.25); }
html[data-theme="dark"] .social-link:hover             { background: rgba(13,42,74,0.4);  }

/* Speed lines (home hero) — restore light version */
html[data-theme="dark"] .home-hero::before {
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(226,217,200,0.025) 0deg 1.2deg,
    transparent 1.2deg 8deg
  );
}

/* Ritual/background animation visibility in dark mode */
html[data-theme="dark"] .ritual-ground {
  opacity: 0.42;
}
html[data-theme="dark"] .ritual-svg {
  stroke: rgba(255,255,255,0.62);
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.08));
}
html[data-theme="dark"] .ritual-ground::before {
  border-color: rgba(255,255,255,0.24);
}

/* Disruption backgrounds — original dark escalation */
html[data-theme="dark"] body[data-disruption="1"] { background-color: #0c0608; }
html[data-theme="dark"] body[data-disruption="2"],
html[data-theme="dark"] body[data-disruption="3"],
html[data-theme="dark"] body[data-disruption="4"],
html[data-theme="dark"] body[data-disruption="5"] { background-color: #06070e; }
html[data-theme="dark"] body[data-disruption="3"] { background-color: #0f0a04; }
html[data-theme="dark"] body[data-disruption="4"] { background-color: #040b0b; }
html[data-theme="dark"] body[data-disruption="5"] { background-color: #180c0f; }

/* Disruption L1 ghost sidebar border */
html[data-theme="dark"] body[data-disruption="1"] .field-nav {
  border-left-color: rgba(226,217,200,0.07);
}
/* Disruption L3 broken glyph */
html[data-theme="dark"] body[data-disruption="3"] .section-card:nth-child(2) .sc-glyph::after {
  color: rgba(226,217,200,0.28);
}


