/* -------------------------------------------------------
   Threshold Studio — Canonical Styles
   Palette: soil, dusk, shimmer, accent
   Typography: Playfair Display + Source Code Pro
   ------------------------------------------------------- */

:root {
  --soil: #2e2a26;
  --dusk: #f5f1eb;
  --shimmer: #c2b8a3;
  --accent: #8c7b6a;

  --node-drift: #7a8085;
  --node-collapse: #8b6f6a;
  --node-anchor: #a89c7a;
  --node-pressure: #9a7f6b;
  --node-resonance: #7f6d8a;
  --node-orbit: #6f8a82;
  --node-capture: #748a6f;
  --node-threshold: #d8d8d8;

  --card-bg: #fdfaf6;
  --card-border: #d6cfc2;
  --card-text: #6e5c4f;

  --radius: 12px;
  --shadow-soft: 0 2px 6px rgba(0,0,0,0.05);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
}

/* -------------------------------------------------------
   Global
   ------------------------------------------------------- */

body {
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  color: #000000;
  font-family: 'Playfair Display', serif;
  letter-spacing: 0.2px;
  line-height: 1.65;
  --harmony-glow: 0.1;
  --harmony-saturate: 1;
  --harmony-breath-duration: 12s;
  filter: saturate(var(--harmony-saturate));
}

#return-home {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 10px 20px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(4px);
  z-index: 999;
  border-radius: 6px;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  color: var(--soil);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.2rem;
}

section {
  margin: 3rem auto;
  padding: 2rem;
  max-width: 800px;
}

.page-content > section {
  margin: 80px auto;
  max-width: 900px;
  padding: 0 20px;
}

.page-content > section:not(.fade-test) {
  opacity: 0;
  animation: fadeIn 1.2s ease forwards;
}

.page-enter {
  opacity: 0;
  animation: pageEnter 0.9s ease forwards;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 1.4s ease forwards;
}

.fade-test {
  opacity: 0;
  animation: fadeTest 1.2s ease forwards;
}

.shimmer-pulse {
  animation: shimmerPulse 2.4s ease-in-out infinite;
}

.ethos-line {
  opacity: 0.85;
  animation: shimmerPulse 6s ease-in-out infinite;
}

.seasonal-background {
  min-height: 100vh;
  animation: none;
  background: #ffffff;
  background-size: auto;
}

.seasonal-background.is-season-synced {
  animation: none;
  transition: none;
  background: #ffffff;
}

.seasonal-background.is-season-synced[data-season="fog"] {
  background: #ffffff;
}

.seasonal-background.is-season-synced[data-season="shimmer"] {
  background: #ffffff;
}

.seasonal-background.is-season-synced[data-season="storm"] {
  background: #ffffff;
}

.seasonal-background.is-season-synced[data-season="soil"] {
  background: #ffffff;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageEnter {
  from {
    opacity: 0;
    filter: blur(4px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes fadeTest {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes shimmerPulse {
  0% {
    opacity: 0.85;
    filter: brightness(1);
  }
  50% {
    opacity: 1;
    filter: brightness(1.25);
  }
  100% {
    opacity: 0.85;
    filter: brightness(1);
  }
}

@keyframes seasonCycle {
  0% {
    background: linear-gradient(135deg, #dfe7ea 0%, #cfd8dd 100%);
  }
  25% {
    background: linear-gradient(135deg, #f6f0ff 0%, #e8dfff 100%);
  }
  50% {
    background: linear-gradient(135deg, #2c3e50 0%, #4b5b6b 100%);
  }
  75% {
    background: linear-gradient(135deg, #5a4632 0%, #3b2e22 100%);
  }
  100% {
    background: linear-gradient(135deg, #dfe7ea 0%, #cfd8dd 100%);
  }
}

/* -------------------------------------------------------
   Threshold Identity Model
   ------------------------------------------------------- */

body.home-page,
body.ethos-page,
body.glyphs-page,
body.wheel-page,
body.ledger-page,
body.dialogues-page,
body.mythology-page,
body.housegarden-page,
body.invitation-page,
body.thankyou-page,
body.contact-page {
  --room-accent: var(--accent);
  --room-accent-2: var(--shimmer);
  --room-accent-3: var(--soil);
  --room-surface: rgba(255, 255, 255, 0.78);
  --room-surface-strong: rgba(255, 255, 255, 0.92);
  --room-border: rgba(140, 123, 106, 0.24);
  --room-shadow: 0 24px 60px -44px rgba(28, 19, 12, 0.2);
  --room-text: var(--soil);
  --room-muted: #6e5c4f;
  --room-motif-opacity: 0.12;
  --room-motif-size: 220px;
  --room-motif-speed: 28s;
  --room-header-weight: 600;
  --room-body-weight: 400;
  --room-radius: 18px;
  background-color: #ffffff;
  background-image: var(--room-bg-layer-1, none), var(--room-bg-layer-2, none);
  background-attachment: fixed;
}

body.home-page {
  --room-accent: #8c7b6a;
  --room-accent-2: #c2b8a3;
  --room-surface: rgba(255, 251, 245, 0.82);
  --room-bg-layer-1: radial-gradient(circle at 18% 14%, rgba(194, 184, 163, 0.15), transparent 32%);
  --room-bg-layer-2: radial-gradient(circle at 84% 80%, rgba(140, 123, 106, 0.1), transparent 28%);
}

body.ethos-page {
  --room-accent: #8c7b6a;
  --room-accent-2: #6e5c4f;
  --room-surface: rgba(251, 248, 244, 0.9);
  --room-bg-layer-1: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 241, 235, 0.76));
  --room-bg-layer-2: radial-gradient(circle at 50% 0%, rgba(140, 123, 106, 0.08), transparent 36%);
}

body.glyphs-page {
  --room-accent: #6a6157;
  --room-accent-2: #9a7f6b;
  --room-surface: rgba(250, 247, 242, 0.88);
  --room-bg-layer-1: linear-gradient(135deg, rgba(250, 247, 242, 0.98), rgba(240, 235, 228, 0.9));
  --room-bg-layer-2: repeating-linear-gradient(135deg, rgba(46, 42, 38, 0.035) 0 1px, transparent 1px 18px);
}

body.wheel-page {
  --room-accent: #8c7b6a;
  --room-accent-2: #c2b8a3;
  --room-surface: rgba(248, 244, 238, 0.9);
  --room-bg-layer-1: radial-gradient(circle at 50% 50%, rgba(194, 184, 163, 0.14), transparent 42%);
  --room-bg-layer-2: conic-gradient(from 180deg at 50% 50%, rgba(140, 123, 106, 0.08), rgba(194, 184, 163, 0.04), rgba(140, 123, 106, 0.08));
}

body.ledger-page {
  --room-accent: #6e5c4f;
  --room-accent-2: #8c7b6a;
  --room-surface: rgba(246, 248, 250, 0.95);
  --room-bg-layer-1: linear-gradient(180deg, rgba(244, 246, 248, 0.98), rgba(236, 239, 243, 0.9));
  --room-bg-layer-2: repeating-linear-gradient(0deg, rgba(46, 42, 38, 0.03) 0 1px, transparent 1px 28px), repeating-linear-gradient(90deg, rgba(46, 42, 38, 0.02) 0 1px, transparent 1px 112px);
}

body.dialogues-page {
  --room-accent: #53657a;
  --room-accent-2: #7c6d8a;
  --room-surface: rgba(242, 245, 248, 0.9);
  --room-bg-layer-1: linear-gradient(180deg, rgba(243, 247, 250, 0.98), rgba(232, 239, 245, 0.88));
  --room-bg-layer-2: radial-gradient(circle at 50% 100%, rgba(83, 101, 122, 0.08), transparent 34%);
}

body.mythology-page {
  --room-accent: #4b3a57;
  --room-accent-2: #7f6d8a;
  --room-surface: rgba(248, 244, 250, 0.92);
  --room-bg-layer-1: linear-gradient(135deg, rgba(32, 27, 44, 0.96), rgba(60, 49, 71, 0.92));
  --room-bg-layer-2: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.08), transparent 28%), radial-gradient(circle at 82% 74%, rgba(127, 109, 138, 0.16), transparent 34%);
  --room-text: #f5f1eb;
  --room-muted: rgba(245, 241, 235, 0.78);
  --room-border: rgba(245, 241, 235, 0.2);
}

body.housegarden-page {
  --room-accent: #7b8b6b;
  --room-accent-2: #9a7f6b;
  --room-surface: rgba(248, 247, 241, 0.92);
  --room-bg-layer-1: linear-gradient(180deg, rgba(250, 248, 242, 0.98), rgba(238, 232, 220, 0.9));
  --room-bg-layer-2: radial-gradient(circle at 18% 82%, rgba(123, 139, 107, 0.12), transparent 30%), radial-gradient(circle at 84% 16%, rgba(154, 127, 107, 0.08), transparent 24%);
}

body.invitation-page {
  --room-accent: #8ea0b4;
  --room-accent-2: #d9e2ea;
  --room-surface: rgba(255, 255, 255, 0.88);
  --room-bg-layer-1: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 246, 250, 0.9));
  --room-bg-layer-2: radial-gradient(circle at 70% 18%, rgba(142, 160, 180, 0.08), transparent 26%), radial-gradient(circle at 18% 82%, rgba(217, 226, 234, 0.12), transparent 30%);
}

body.contact-page {
  --room-accent: #8c7b6a;
  --room-accent-2: #c2b8a3;
  --room-surface: rgba(250, 248, 245, 0.9);
  --room-bg-layer-1: linear-gradient(180deg, rgba(250, 248, 245, 0.98), rgba(242, 238, 232, 0.9));
  --room-bg-layer-2: radial-gradient(circle at 50% 12%, rgba(140, 123, 106, 0.08), transparent 28%);
}

body.thankyou-page {
  --room-accent: #6e5c4f;
  --room-accent-2: #c2b8a3;
  --room-surface: rgba(248, 246, 242, 0.92);
  --room-bg-layer-1: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 241, 235, 0.88));
  --room-bg-layer-2: radial-gradient(circle at 50% 50%, rgba(194, 184, 163, 0.08), transparent 40%);
}

body[class$="-page"] nav,
body.home-page nav {
  background: var(--room-surface);
  border-bottom-color: var(--room-border);
  box-shadow: 0 0 calc(20px * var(--harmony-glow)) rgba(140, 123, 106, 0.18);
}

body[class$="-page"] footer,
body.home-page footer {
  color: var(--room-text);
}

body[class$="-page"] h1,
body[class$="-page"] h2,
body[class$="-page"] h3,
body.home-page h1,
body.home-page h2,
body.home-page h3 {
  color: var(--room-text);
  font-weight: var(--room-header-weight);
}

body[class$="-page"] p,
body[class$="-page"] li,
body.home-page p,
body.home-page li {
  color: var(--room-text);
}

body[class$="-page"] nav a,
body.home-page nav a,
body[class$="-page"] .button,
body.home-page .button {
  color: var(--room-text);
  border-color: var(--room-border);
  background: var(--room-surface);
}

body[class$="-page"] nav a:hover,
body.home-page nav a:hover,
body[class$="-page"] .button:hover,
body.home-page .button:hover {
  border-color: rgba(140, 123, 106, 0.35);
  box-shadow: 0 10px 24px -18px rgba(46, 42, 38, 0.3);
}

body[class$="-page"] .page-content > section,
body.home-page .page-content > section,
body[class$="-page"] .shell,
body.home-page .shell,
body[class$="-page"] .dialogue-box,
body[class$="-page"] .block,
body[class$="-page"] .surface-card,
body[class$="-page"] .fib-flower-panel,
body[class$="-page"] .fib-flower-inspector,
body[class$="-page"] .project-chamber-inspector,
body[class$="-page"] .world-state,
body[class$="-page"] .hub-lore,
body.home-page .preview-content {
  border-radius: var(--room-radius);
  border-color: var(--room-border);
}

body.dialogues-page .dialogue-box {
  box-shadow: 0 18px 48px -36px rgba(48, 44, 70, 0.3);
}

body.ledger-page .block,
body.ledger-page .shell {
  font-family: 'Source Code Pro', monospace;
}

body.glyphs-page .page-content,
body.glyphs-page .shell {
  letter-spacing: 0.03em;
}

body.wheel-page .page-content,
body.wheel-page .shell {
  font-variation-settings: "wght" 500;
}

body.mythology-page .page-content,
body.mythology-page .shell {
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.18);
}

/* -------------------------------------------------------
   Navigation
   ------------------------------------------------------- */

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--shimmer);
  background-color: var(--dusk);
  box-shadow: 0 0 calc(20px * var(--harmony-glow)) rgba(194, 184, 163, 0.25);
}

.threshold-nav-logo {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  padding: 0.3rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(194, 184, 163, 0.5);
  background: radial-gradient(circle at 30% 30%, rgba(245, 241, 235, 0.95), rgba(194, 184, 163, 0.55) 45%, rgba(46, 42, 38, 0.78) 100%);
}

.threshold-nav-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(245, 241, 235, 0.45));
}

nav a {
  font-family: 'Source Code Pro', monospace;
  text-decoration: none;
  color: var(--soil);
  border: 1px solid var(--shimmer);
  background: #f7f4ef;
  padding: 0.62rem 1.15rem;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

nav a:hover {
  background: #e8e4dd;
  color: var(--soil);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -14px rgba(46, 42, 38, 0.42);
}

nav a.threshold-nav-logo {
  background: radial-gradient(circle at 30% 30%, rgba(245, 241, 235, 0.95), rgba(194, 184, 163, 0.55) 45%, rgba(46, 42, 38, 0.78) 100%);
  padding: 0.3rem;
}

nav a.threshold-nav-logo:hover {
  background: radial-gradient(circle at 30% 30%, rgba(245, 241, 235, 0.98), rgba(194, 184, 163, 0.62) 45%, rgba(46, 42, 38, 0.84) 100%);
  transform: scale(1.03);
}

.dialogue-box {
  background: #0e1a2b;
  color: rgba(236, 233, 228, 0.94);
  padding: 24px 28px;
  border-radius: 12px;
  border: 1px solid rgba(214, 207, 194, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dialogue-box h2,
.dialogue-box h3 {
  color: rgba(250, 245, 236, 0.96);
}

.dialogue-box p,
.dialogue-box summary {
  color: rgba(235, 231, 223, 0.9);
}

.dialogue-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.soft-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 24px 0;
}

.branch-pulse {
  animation: branchPulse 0.8s ease;
}

[data-branch] {
  transition: opacity 420ms ease, transform 420ms ease, filter 420ms ease;
}

.branch-altered {
  filter: saturate(1.12) brightness(1.04);
  transform: translateY(-1px);
}

@keyframes branchPulse {
  0% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
  45% {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.12);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

.glyph {
  display: inline-block;
  margin: 4px;
  opacity: 0.85;
  animation: glyphDrift 6s ease-in-out infinite alternate;
}

@keyframes glyphDrift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-6px);
  }
}

.season-fog {
  color: #9fb4cb;
}

.season-shimmer {
  color: #e7c572;
}

.season-storm {
  color: #95a9cf;
}

.season-soil {
  color: #cfaa88;
}

/* -------------------------------------------------------
   Hero
   ------------------------------------------------------- */

header {
  text-align: center;
  padding: 4rem 2rem;
}

.tagline {
  font-style: italic;
  color: var(--accent);
  margin-top: 0.5rem;
}

/* -------------------------------------------------------
   Buttons
   ------------------------------------------------------- */

.button {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--shimmer);
  border-radius: 4px;
  text-decoration: none;
  font-family: 'Source Code Pro', monospace;
  color: var(--soil);
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 calc(14px * var(--harmony-glow)) rgba(194, 184, 163, 0.2);
}

.button:hover {
  background: var(--soil);
  color: var(--dusk);
}

/* -------------------------------------------------------
   Glyph Grid + Cards
   ------------------------------------------------------- */

.glyph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.glyph-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: var(--card-text);
  text-align: center;
  cursor: pointer;
}

.glyph-card:hover {
  transform: scale(1.03) rotate(-0.5deg);
  box-shadow: var(--shadow-hover);
  background: #f7f3ec;
}

.glyph-shimmer {
  color: gold;
}

.archive-intro {
  margin-bottom: 1.25rem;
}

#archive {
  --archive-breath-duration: 8.8s;
  --archive-cave-brightness: 1;
  --archive-cave-saturate: 1;
  --archive-cave-scale: 1;
  --archive-cave-left-x: -8%;
  --archive-cave-left-rot: 8deg;
  --archive-cave-right-x: 8%;
  --archive-cave-right-rot: -8deg;
  --archive-cave-roof-y: -10%;
  --archive-cave-floor-y: 0%;
  --archive-cave-aperture-scale: 1;
  --archive-cave-aperture-opacity: 0.34;
  --archive-stairs-shift: 0px;
  --archive-stairs-tilt: 0deg;
  --archive-stairs-float-y: 0px;
  --archive-stairs-sway: 0deg;
  --archive-chamber-glow: 0.15;
  --archive-path-glow: rgba(194, 184, 163, 0.26);
  --archive-particle-opacity: 0.45;
  --archive-weather-strength: 1;
  --archive-weather-shift: 1;
  position: relative;
  overflow: hidden;
  max-width: 1020px;
  min-height: 74vh;
  margin: 0 auto 3.5rem;
  padding: 2rem 2rem 2.4rem;
  border-radius: 28px;
  border: 1px solid rgba(140, 123, 106, 0.26);
  background:
    radial-gradient(circle at top, rgba(249, 244, 235, 0.74), transparent 38%),
    linear-gradient(180deg, rgba(26, 22, 18, 0.98) 0%, rgba(20, 16, 14, 0.98) 54%, rgba(36, 29, 24, 0.98) 100%);
  box-shadow: 0 34px 80px -48px rgba(14, 11, 9, 0.92);
}

#archiveDriftField {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

#weather-fog,
#weather-shimmer,
#weather-storm,
#weather-soil,
#spirit-animal,
#legacy-character {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#weather-fog,
#weather-shimmer,
#weather-storm,
#weather-soil {
  opacity: 0;
  transition: opacity 900ms ease;
}

#spirit-animal,
#legacy-character {
  z-index: 1;
  opacity: 0;
  transition: opacity 900ms ease, transform 900ms ease;
}

#spirit-animal::before,
#legacy-character::before {
  content: attr(data-label);
  position: absolute;
  display: grid;
  place-items: center;
  font-family: 'Playfair Display', serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#spirit-animal::before {
  left: 12%;
  top: 22%;
  width: 30%;
  height: 44%;
  border-radius: 48% 52% 46% 54%;
  color: rgba(245, 237, 223, 0.82);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  background: radial-gradient(circle at 50% 50%, rgba(245, 236, 220, 0.28), rgba(245, 236, 220, 0.04) 58%, transparent 72%);
  text-shadow: 0 0 18px rgba(245, 236, 220, 0.36);
}

#legacy-character::before {
  right: 10%;
  bottom: 12%;
  width: 34%;
  height: 54%;
  border-radius: 46% 46% 26% 26%;
  color: rgba(244, 233, 216, 0.74);
  font-size: clamp(1rem, 1.4vw, 1.3rem);
  background: linear-gradient(180deg, rgba(244, 233, 216, 0.1), rgba(244, 233, 216, 0.02) 44%, transparent 88%);
  text-shadow: 0 0 20px rgba(244, 233, 216, 0.24);
}

#spirit-animal.is-visible {
  opacity: 0.94;
  transform: translateY(0);
}

#legacy-character.is-visible {
  opacity: 0.88;
  transform: translateY(0);
}

#spirit-animal[data-spirit="deer"]::before {
  clip-path: polygon(26% 76%, 34% 28%, 44% 18%, 54% 12%, 62% 20%, 72% 14%, 66% 26%, 74% 32%, 64% 40%, 62% 74%, 52% 88%, 42% 88%, 34% 82%);
}

#spirit-animal[data-spirit="whale"]::before {
  clip-path: ellipse(40% 26% at 50% 56%);
}

#spirit-animal[data-spirit="wolf"]::before {
  clip-path: polygon(24% 80%, 30% 30%, 46% 18%, 58% 12%, 76% 30%, 68% 46%, 72% 74%, 58% 86%, 42% 88%, 30% 82%);
}

#spirit-animal[data-spirit="bear"]::before {
  clip-path: ellipse(34% 40% at 50% 54%);
}

#legacy-character[data-legacy="architect"]::before {
  clip-path: polygon(42% 0, 58% 0, 70% 12%, 74% 24%, 66% 32%, 68% 48%, 76% 70%, 64% 100%, 36% 100%, 24% 70%, 32% 48%, 34% 32%, 26% 24%, 30% 12%);
}

#legacy-character[data-legacy="lumen"]::before {
  clip-path: polygon(50% 0, 68% 8%, 74% 24%, 70% 42%, 80% 68%, 64% 100%, 36% 100%, 20% 68%, 30% 42%, 26% 24%, 32% 8%);
}

#legacy-character[data-legacy="whisperer"]::before {
  clip-path: polygon(44% 0, 58% 4%, 66% 18%, 62% 30%, 70% 48%, 64% 100%, 34% 100%, 28% 48%, 36% 30%, 32% 18%);
}

#legacy-character[data-legacy="archivist"]::before {
  clip-path: polygon(40% 0, 60% 0, 72% 18%, 70% 44%, 78% 82%, 62% 100%, 38% 100%, 22% 82%, 30% 44%, 28% 18%);
}

#weather-fog {
  z-index: 0;
  background:
    radial-gradient(circle at 18% 30%, rgba(224, 233, 241, 0.22), transparent 18%),
    radial-gradient(circle at 52% 42%, rgba(236, 242, 248, 0.16), transparent 22%),
    radial-gradient(circle at 78% 62%, rgba(214, 225, 236, 0.18), transparent 20%),
    linear-gradient(90deg, rgba(202, 215, 227, 0.08), rgba(228, 236, 244, 0.14), rgba(202, 215, 227, 0.08));
  filter: blur(10px);
  animation: archiveFogMove calc(20s / var(--archive-weather-shift)) linear infinite;
}

#weather-shimmer {
  z-index: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 248, 229, 0.28), transparent 24%),
    radial-gradient(circle at 24% 64%, rgba(189, 239, 240, 0.16), transparent 18%),
    radial-gradient(circle at 74% 28%, rgba(255, 255, 255, 0.18), transparent 16%);
  mix-blend-mode: screen;
  animation: archiveShimmerPulse calc(4.2s / var(--archive-weather-shift)) ease-in-out infinite;
}

#weather-storm {
  z-index: 0;
  background:
    linear-gradient(118deg, transparent 41%, rgba(255, 243, 228, 0.12) 42%, transparent 43%),
    linear-gradient(62deg, transparent 48%, rgba(247, 225, 198, 0.1) 49%, transparent 50%),
    radial-gradient(circle at 52% 24%, rgba(255, 249, 234, 0.12), transparent 16%),
    radial-gradient(circle at 50% 50%, rgba(97, 57, 57, 0.14), transparent 42%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  animation: archiveStormFlash calc(6s / var(--archive-weather-shift)) ease-in-out infinite;
}

#weather-soil {
  z-index: 0;
  background:
    radial-gradient(circle at 22% 72%, rgba(205, 170, 121, 0.14), transparent 16%),
    radial-gradient(circle at 54% 62%, rgba(180, 146, 102, 0.16), transparent 14%),
    radial-gradient(circle at 80% 78%, rgba(219, 191, 151, 0.12), transparent 18%),
    linear-gradient(180deg, rgba(88, 62, 34, 0.04), rgba(168, 133, 89, 0.12));
  filter: blur(1px);
  animation: archiveSoilDrift calc(15s / var(--archive-weather-shift)) linear infinite;
}

#archive[data-weather="fog"] #weather-fog,
#archive[data-weather="expand"] #weather-shimmer,
#archive[data-weather="collapse"] #weather-storm,
#archive[data-weather="soil"] #weather-soil {
  opacity: 1;
}

#archive[data-node="dead-end"] #weather-storm {
  opacity: 0.56;
}

#archive[data-node="return"] #weather-fog,
#archive[data-node="return"] #weather-shimmer {
  opacity: 0.34;
}

#archive[data-node="hidden-exit"] #weather-shimmer,
#archive[data-node="hidden-exit"] #weather-fog {
  opacity: 0.48;
}

#archive[data-rewrite-sealed="true"] {
  --archive-cave-left-x: -20%;
  --archive-cave-right-x: 20%;
  --archive-cave-aperture-scale: 0.7;
  --archive-cave-aperture-opacity: 0.16;
  --archive-path-glow: rgba(164, 102, 96, 0.42);
}

#archive[data-rewrite-luminous="true"] {
  --archive-cave-aperture-scale: 1.22;
  --archive-cave-aperture-opacity: 0.52;
  --archive-chamber-glow: 0.24;
  --archive-path-glow: rgba(196, 234, 231, 0.48);
}

.archive-drift-glyph {
  position: absolute;
  left: 50%;
  top: 52%;
  color: var(--particle-color, rgba(242, 231, 208, var(--archive-particle-opacity)));
  font-size: clamp(0.9rem, 1vw, 1.1rem);
  text-shadow: 0 0 14px rgba(244, 235, 219, 0.22);
  opacity: 0;
  filter: blur(var(--particle-blur, 0px));
  transform: translate(-50%, -50%);
  animation: archiveGlyphDrift var(--dur, 9s) linear forwards;
}

#archive::before {
  content: "";
  position: absolute;
  inset: 1.5rem;
  border-radius: 24px;
  pointer-events: none;
  box-shadow: inset 0 0 calc(90px * var(--archive-chamber-glow)) rgba(232, 223, 208, 0.18);
}

#cave {
  position: relative;
  width: 100%;
  height: 38vh;
  border-radius: 22px 22px 30px 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at center 38%, rgba(78, 72, 64, 0.2), transparent 18%),
    radial-gradient(circle at center, #1d1916 0%, #090807 72%, #030303 100%);
  filter: brightness(var(--archive-cave-brightness)) saturate(var(--archive-cave-saturate));
  transform: scale(var(--archive-cave-scale));
  animation: archiveCaveBreath var(--archive-breath-duration) ease-in-out infinite;
}

#cave::before,
#cave::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cave-geometry {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cave-wall,
.cave-roof,
.cave-floor-line,
.cave-aperture {
  position: absolute;
  pointer-events: none;
  transition: transform 700ms ease, opacity 700ms ease, filter 700ms ease, clip-path 700ms ease;
}

.cave-wall {
  top: -8%;
  width: 32%;
  height: 124%;
  background: linear-gradient(180deg, rgba(63, 55, 49, 0.7), rgba(7, 6, 6, 0.96));
  filter: blur(1px);
}

.cave-wall-left {
  left: -4%;
  clip-path: polygon(0 0, 82% 7%, 100% 100%, 0 100%);
  transform: translateX(var(--archive-cave-left-x)) rotate(var(--archive-cave-left-rot));
}

.cave-wall-right {
  right: -4%;
  clip-path: polygon(18% 7%, 100% 0, 100% 100%, 0 100%);
  transform: translateX(var(--archive-cave-right-x)) rotate(var(--archive-cave-right-rot));
}

.cave-roof {
  left: 9%;
  top: 0;
  width: 82%;
  height: 38%;
  border-radius: 50% 50% 36% 36% / 70% 70% 28% 28%;
  background: radial-gradient(circle at 50% 40%, rgba(92, 86, 77, 0.18), rgba(0, 0, 0, 0.86) 72%);
  transform: translateY(var(--archive-cave-roof-y));
}

.cave-floor-line {
  left: 18%;
  bottom: 4%;
  width: 64%;
  height: 18%;
  border-radius: 50%;
  border-top: 1px solid rgba(232, 219, 197, 0.12);
  background: radial-gradient(circle at 50% 10%, rgba(245, 233, 206, 0.08), transparent 58%);
  transform: translateY(var(--archive-cave-floor-y));
}

.cave-aperture {
  left: 36%;
  top: 22%;
  width: 28%;
  height: 34%;
  border-radius: 50% 50% 46% 46%;
  background: radial-gradient(circle at 50% 50%, rgba(240, 231, 212, 0.34), rgba(24, 22, 21, 0.04) 62%, transparent 72%);
  opacity: var(--archive-cave-aperture-opacity);
  transform: scale(var(--archive-cave-aperture-scale));
  mix-blend-mode: screen;
}

#cave::before {
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.06), transparent 18%),
    radial-gradient(circle at 74% 30%, rgba(255, 255, 255, 0.05), transparent 22%),
    radial-gradient(circle at 52% 72%, rgba(215, 194, 160, 0.1), transparent 28%);
  mix-blend-mode: screen;
}

#cave::after {
  background:
    linear-gradient(90deg, rgba(2, 2, 2, 0.84), transparent 22%, transparent 78%, rgba(2, 2, 2, 0.84)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 20%, rgba(0, 0, 0, 0.38) 100%);
}

.cave-fossils {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.2rem 1.4rem;
  color: rgba(226, 214, 190, 0.45);
  font-size: clamp(1rem, 1.4vw, 1.35rem);
  letter-spacing: 0.18em;
}

.cave-fossils span {
  animation: archiveFossilDrift calc(var(--archive-breath-duration) * 1.3) ease-in-out infinite;
}

.cave-fossils span:nth-child(2n) {
  align-self: center;
}

.cave-fossils span:nth-child(3n) {
  align-self: flex-end;
}

#stairs {
  position: relative;
  display: grid;
  gap: 0.65rem;
  width: min(72%, 640px);
  margin: -2.8rem auto 0;
  padding: 1.4rem 0 0.5rem;
  transform: translateY(calc(var(--archive-stairs-shift) + var(--archive-stairs-float-y))) rotate(calc(var(--archive-stairs-tilt) + var(--archive-stairs-sway)));
  transition: transform 1.4s ease, filter 1.4s ease;
  z-index: 1;
}

.stair-riser {
  display: block;
  height: 1.35rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(68, 60, 53, 0.95), rgba(116, 103, 92, 0.95), rgba(48, 43, 38, 0.95));
  box-shadow: 0 8px 16px -14px rgba(255, 243, 226, 0.24), 0 12px 20px -14px rgba(0, 0, 0, 0.8);
}

.stair-riser:nth-child(1) { width: 46%; margin-left: 27%; }
.stair-riser:nth-child(2) { width: 54%; margin-left: 23%; }
.stair-riser:nth-child(3) { width: 62%; margin-left: 19%; }
.stair-riser:nth-child(4) { width: 70%; margin-left: 15%; }
.stair-riser:nth-child(5) { width: 78%; margin-left: 11%; }
.stair-riser:nth-child(6) { width: 86%; margin-left: 7%; }

#paths {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.7rem auto 1rem;
  flex-wrap: wrap;
}

.path {
  min-width: 180px;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(221, 208, 182, 0.36);
  background: rgba(252, 248, 239, 0.08);
  color: #f2e5d2;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.96rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 240ms ease, background-color 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
  box-shadow: 0 0 0 1px transparent, 0 0 32px -24px var(--archive-path-glow);
}

.path:hover,
.path[aria-pressed="true"] {
  transform: translateY(-2px);
  background: rgba(252, 248, 239, 0.16);
  border-color: rgba(240, 226, 196, 0.7);
  box-shadow: 0 0 0 1px rgba(240, 226, 196, 0.2), 0 0 40px -22px rgba(240, 226, 196, 0.36);
}

.archive-status {
  position: relative;
  z-index: 1;
  margin: 0.8rem auto 1.6rem;
  max-width: 720px;
  text-align: center;
  color: rgba(239, 231, 215, 0.84);
  font-style: italic;
}

.archive-trail {
  position: relative;
  z-index: 1;
  margin: -0.8rem auto 1.4rem;
  max-width: 720px;
  text-align: center;
  color: rgba(226, 214, 190, 0.72);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#chamber {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  opacity: 1;
  transition: opacity 320ms ease, transform 320ms ease;
  transform: translateY(0);
}

#chamber.is-transitioning {
  opacity: 0;
  transform: translateY(10px);
}

.archive-chamber-shell {
  display: grid;
  gap: 1rem;
}

.archive-chamber {
  padding: 1.6rem;
  border-radius: 22px;
  border: 1px solid rgba(224, 207, 181, 0.18);
  color: #f4ebdb;
  background: rgba(248, 242, 231, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 22px 44px -34px rgba(0, 0, 0, 0.82);
}

.archive-chamber h2,
.archive-chamber h3 {
  color: #f6ecdc;
}

.archive-chamber p {
  color: rgba(244, 235, 219, 0.8);
}

.archive-chamber.threshold {
  background: linear-gradient(180deg, rgba(248, 242, 231, 0.08), rgba(127, 111, 94, 0.1));
}

.archive-chamber.collapse {
  background: linear-gradient(180deg, rgba(83, 44, 44, 0.36), rgba(26, 12, 12, 0.84));
}

.archive-chamber.expand {
  background: linear-gradient(180deg, rgba(28, 82, 83, 0.34), rgba(7, 27, 32, 0.86));
}

.archive-chamber.fog {
  background: linear-gradient(180deg, rgba(96, 108, 124, 0.3), rgba(18, 22, 31, 0.88));
}

.archive-chamber.soil {
  background: linear-gradient(180deg, rgba(92, 76, 52, 0.32), rgba(22, 15, 8, 0.9));
}

.archive-chamber.rare {
  border-color: rgba(237, 224, 197, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 28px 58px -38px rgba(0, 0, 0, 0.88), 0 0 48px -28px rgba(232, 223, 208, 0.28);
}

.archive-meta {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 1rem 0 1.4rem;
}

.archive-pill {
  border-radius: 999px;
  border: 1px solid rgba(232, 218, 194, 0.18);
  padding: 0.3rem 0.75rem;
  color: rgba(244, 235, 219, 0.84);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.archive-chamber .glyph-grid {
  margin-top: 1.4rem;
}

.archive-chamber .glyph-card {
  background: rgba(255, 251, 244, 0.92);
}

.archive-vault-lore {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(232, 218, 194, 0.14);
}

.archive-vault-lore[hidden] {
  display: none;
}

.archive-vault-title {
  margin: 0 0 0.7rem;
  color: rgba(246, 236, 220, 0.92);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-vault-entry {
  margin-bottom: 0.75rem;
}

.archive-vault-entry strong {
  color: rgba(247, 239, 225, 0.92);
}

.archive-vault-entry p {
  margin: 0.3rem 0 0;
  color: rgba(244, 235, 219, 0.72);
}

.archive-vault-image {
  display: block;
  width: min(100%, 220px);
  margin: 0.55rem 0 0;
  border-radius: 14px;
  border: 1px solid rgba(232, 218, 194, 0.14);
  box-shadow: 0 16px 28px -22px rgba(0, 0, 0, 0.72);
}

.archive-vault-path {
  display: inline-block;
  margin-top: 0.35rem;
  color: rgba(226, 214, 190, 0.7);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.76rem;
}

.archive-rare-flag {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(240, 227, 203, 0.32);
  color: rgba(247, 239, 225, 0.92);
  background: rgba(245, 235, 214, 0.08);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-floor {
  position: relative;
  padding: 1rem 1.2rem 1.2rem;
  border-radius: 18px;
  border: 1px solid rgba(222, 207, 183, 0.14);
  background: linear-gradient(180deg, rgba(255, 248, 236, 0.04), rgba(255, 248, 236, 0.08));
}

.archive-floor p {
  margin: 0 0 0.8rem;
  color: rgba(244, 235, 219, 0.76);
}

.archive-exits {
  display: grid;
  gap: 0.8rem;
}

.archive-exits[hidden] {
  display: none;
}

.archive-exit-title {
  margin: 0;
  color: rgba(246, 236, 220, 0.9);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.archive-exit-list {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.archive-exit-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(236, 223, 199, 0.24);
  background: rgba(250, 244, 232, 0.07);
  color: #f6ecdc;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.82rem;
  text-decoration: none;
  transition: transform 220ms ease, background-color 220ms ease, border-color 220ms ease;
}

.archive-exit-link:hover,
.archive-exit-link:focus-visible {
  transform: translateY(-2px);
  background: rgba(250, 244, 232, 0.14);
  border-color: rgba(236, 223, 199, 0.42);
  outline: none;
}

.archive-node-flag {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(233, 218, 192, 0.22);
  background: rgba(245, 235, 214, 0.06);
  color: rgba(247, 239, 225, 0.86);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-hub-threshold {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 52px;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(194, 184, 163, 0.28);
  background: radial-gradient(circle at 30% 30%, rgba(245, 241, 235, 0.8), rgba(140, 123, 106, 0.24) 60%, rgba(46, 42, 38, 0.78) 100%);
  color: #f5f1eb;
  text-decoration: none;
  opacity: 0.18;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 380ms ease, transform 380ms ease, box-shadow 380ms ease;
  box-shadow: 0 0 0 1px rgba(194, 184, 163, 0.16), 0 0 28px rgba(194, 184, 163, 0.12);
}

.archive-hub-threshold.is-revealed {
  opacity: 0.92;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  box-shadow: 0 0 0 1px rgba(245, 241, 235, 0.26), 0 0 34px rgba(194, 184, 163, 0.26);
}

.archive-hub-core {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(245, 241, 235, 0.88);
  box-shadow: 0 0 12px rgba(245, 241, 235, 0.4);
}

.archive-hub-sigil {
  font-family: 'Source Code Pro', monospace;
  letter-spacing: 0.08em;
}

#archive[data-choice="collapse"] {
  --archive-cave-brightness: 0.72;
  --archive-cave-saturate: 0.9;
  --archive-cave-scale: 1.02;
  --archive-cave-left-x: -18%;
  --archive-cave-left-rot: 16deg;
  --archive-cave-right-x: 12%;
  --archive-cave-right-rot: -10deg;
  --archive-cave-roof-y: -2%;
  --archive-cave-floor-y: 6%;
  --archive-cave-aperture-scale: 0.82;
  --archive-cave-aperture-opacity: 0.18;
  --archive-stairs-shift: 22px;
  --archive-stairs-tilt: 2deg;
  --archive-chamber-glow: 0.08;
  --archive-path-glow: rgba(146, 78, 73, 0.4);
}

#archive[data-choice="expand"] {
  --archive-cave-brightness: 1.16;
  --archive-cave-saturate: 1.08;
  --archive-cave-scale: 1.03;
  --archive-cave-left-x: -2%;
  --archive-cave-left-rot: 4deg;
  --archive-cave-right-x: 2%;
  --archive-cave-right-rot: -4deg;
  --archive-cave-roof-y: -12%;
  --archive-cave-floor-y: -3%;
  --archive-cave-aperture-scale: 1.28;
  --archive-cave-aperture-opacity: 0.52;
  --archive-stairs-shift: -22px;
  --archive-stairs-tilt: -2deg;
  --archive-chamber-glow: 0.22;
  --archive-path-glow: rgba(76, 141, 146, 0.44);
}

#archive[data-choice="fog"] {
  --archive-cave-brightness: 0.92;
  --archive-cave-saturate: 0.84;
  --archive-cave-scale: 1.015;
  --archive-cave-left-x: -10%;
  --archive-cave-left-rot: 9deg;
  --archive-cave-right-x: 10%;
  --archive-cave-right-rot: -9deg;
  --archive-cave-roof-y: -6%;
  --archive-cave-floor-y: 1%;
  --archive-cave-aperture-scale: 1.06;
  --archive-cave-aperture-opacity: 0.3;
  --archive-stairs-shift: -8px;
  --archive-stairs-tilt: -0.8deg;
  --archive-chamber-glow: 0.18;
  --archive-path-glow: rgba(151, 168, 190, 0.44);
}

#archive[data-choice="soil"] {
  --archive-cave-brightness: 0.84;
  --archive-cave-saturate: 0.96;
  --archive-cave-scale: 1.024;
  --archive-cave-left-x: -14%;
  --archive-cave-left-rot: 12deg;
  --archive-cave-right-x: 14%;
  --archive-cave-right-rot: -12deg;
  --archive-cave-roof-y: -1%;
  --archive-cave-floor-y: 8%;
  --archive-cave-aperture-scale: 0.9;
  --archive-cave-aperture-opacity: 0.24;
  --archive-stairs-shift: 14px;
  --archive-stairs-tilt: 1deg;
  --archive-chamber-glow: 0.14;
  --archive-path-glow: rgba(158, 125, 82, 0.42);
}

#archive[data-node="dead-end"] {
  --archive-cave-left-x: -24%;
  --archive-cave-left-rot: 20deg;
  --archive-cave-right-x: 24%;
  --archive-cave-right-rot: -20deg;
  --archive-cave-roof-y: 4%;
  --archive-cave-floor-y: 11%;
  --archive-cave-aperture-scale: 0.48;
  --archive-cave-aperture-opacity: 0.08;
}

#archive[data-node="return"] {
  --archive-cave-left-x: -6%;
  --archive-cave-left-rot: 5deg;
  --archive-cave-right-x: 6%;
  --archive-cave-right-rot: -5deg;
  --archive-cave-roof-y: -8%;
  --archive-cave-floor-y: -2%;
  --archive-cave-aperture-scale: 1.18;
  --archive-cave-aperture-opacity: 0.46;
}

#archive[data-node="hidden-exit"] {
  --archive-cave-left-x: -1%;
  --archive-cave-left-rot: 2deg;
  --archive-cave-right-x: 1%;
  --archive-cave-right-rot: -2deg;
  --archive-cave-roof-y: -14%;
  --archive-cave-floor-y: -6%;
  --archive-cave-aperture-scale: 1.36;
  --archive-cave-aperture-opacity: 0.58;
}

@keyframes archiveCaveBreath {
  0% {
    transform: scale(var(--archive-cave-scale));
  }
  50% {
    transform: scale(calc(var(--archive-cave-scale) + 0.026));
  }
  100% {
    transform: scale(var(--archive-cave-scale));
  }
}

@keyframes archiveFossilDrift {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.42;
  }
  50% {
    transform: translateY(-6px) rotate(3deg);
    opacity: 0.72;
  }
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.42;
  }
}

@keyframes archiveFogMove {
  0% {
    transform: translateX(0) translateY(0);
  }
  50% {
    transform: translateX(-34px) translateY(12px);
  }
  100% {
    transform: translateX(-68px) translateY(0);
  }
}

@keyframes archiveShimmerPulse {
  0% {
    opacity: 0.08;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.03);
  }
  100% {
    opacity: 0.08;
    transform: scale(0.98);
  }
}

@keyframes archiveStormFlash {
  0% {
    opacity: 0.12;
    filter: brightness(1);
  }
  8% {
    opacity: 0.46;
    filter: brightness(1.8);
  }
  16% {
    opacity: 0.16;
    filter: brightness(1);
  }
  100% {
    opacity: 0.12;
    filter: brightness(1);
  }
}

@keyframes archiveSoilDrift {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(40px);
  }
}

@keyframes archiveGlyphDrift {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate3d(var(--x0, 0px), var(--y0, 0px), 0) scale(var(--particle-scale-start, 0.82));
  }
  12% {
    opacity: var(--archive-particle-opacity);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate3d(var(--x1, 0px), var(--y1, -120px), 0) scale(var(--particle-scale-end, 1.08));
  }
}

@media (max-width: 720px) {
  #archive {
    padding: 1.2rem 1rem 1.5rem;
    min-height: auto;
  }

  #cave {
    height: 32vh;
  }

  #stairs {
    width: 90%;
    margin-top: -2rem;
  }

  .path {
    width: 100%;
  }
}

/* -------------------------------------------------------
   Modal
   ------------------------------------------------------- */

.modal {
  position: fixed;
  z-index: 1001;
  inset: 0;
  background-color: rgba(46, 42, 38, 0.8);
}

.modal[hidden] {
  display: none;
}

.modal:not([hidden]) {
  display: block;
}

.modal-content {
  background-color: var(--card-bg);
  margin: 10% auto;
  padding: 2rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  max-width: 600px;
  color: var(--card-text);
  text-align: center;
}

.close-button {
  float: right;
  font-size: 1.5rem;
  font-weight: bold;
  color: #4b3f36;
  cursor: pointer;
}

/* -------------------------------------------------------
   Footer
   ------------------------------------------------------- */

footer {
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--shimmer);
  font-size: 0.9rem;
  color: var(--accent);
  box-shadow: 0 0 calc(18px * var(--harmony-glow)) rgba(194, 184, 163, 0.18);
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

footer:hover {
  opacity: 1;
}

body[data-harmony-phase="seed"] nav,
body[data-harmony-phase="seed"] footer {
  opacity: 0.95;
}

body[data-harmony-phase="bloom"] nav,
body[data-harmony-phase="bloom"] footer {
  opacity: 1;
}

body[data-harmony-coherence="harmonic"] .tagline,
body[data-harmony-coherence="harmonic"] .ethos-subline,
body[data-harmony-coherence="harmonic"] .quote {
  animation-duration: var(--harmony-breath-duration);
}

/* -------------------------------------------------------
   Hub Mode
   ------------------------------------------------------- */

body {
  transition: background-color 800ms ease, color 800ms ease;
}

body.hub-active {
  background-color: #000000;
  color: #f6f7fb;
  transition: background 1.4s ease-in-out, color 1.4s ease-in-out;
}

body.hub-active.hub-path-collapse {
  background: #000000;
  color: #f6f7fb;
}

body.hub-active.hub-path-drift {
  background: #000000;
  color: #f6f7fb;
}

body.hub-active main,
body.hub-active h1,
body.hub-active h2,
body.hub-active h3,
body.hub-active p,
body.hub-active li,
body.hub-active span,
body.hub-active .tagline,
body.hub-active .ethos-line,
body.hub-active .quote {
  color: #f6f7fb;
}

body.hub-active nav,
body.hub-active footer,
body.hub-active .preview-content,
body.hub-active .hero-content,
body.hub-active .fib-flower-panel,
body.hub-active .world-state,
body.hub-active #hub-root {
  background-color: rgba(255, 255, 255, 0.06);
  color: #f6f7fb;
  border-color: rgba(246, 247, 251, 0.34);
}

body.hub-active nav a,
body.hub-active .button {
  color: #f6f7fb;
  border-color: rgba(246, 247, 251, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

body.hub-active nav a:hover,
body.hub-active .button:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

#root-machine-container {
  background: transparent;
  transition: background 1.2s ease-in-out;
  border-radius: 14px;
}

#root-machine-container.hub-active {
  background: rgba(255, 255, 255, 0.12);
}

#threshold-node {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
}

.node-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  background: #000;
  border-radius: 50%;
  animation: orbit 4s linear infinite;
  pointer-events: none;
  opacity: 0.78;
}

body.hub-active .node-orbit {
  background: #f6f7fb;
}

@keyframes orbit {
  from { transform: rotate(0deg) translateX(60px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(60px) rotate(-360deg); }
}

.page-content {
  transition: opacity 700ms ease;
}

.hero-content,
.preview-content,
nav,
footer {
  transition: opacity 700ms ease;
}

body.hub-active .hero-content {
  opacity: 0.2;
}

body.hub-active .preview-content {
  opacity: 0.1;
}

body.hub-active nav,
body.hub-active footer {
  opacity: 0.6;
}

.hub {
  position: fixed;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(194, 184, 163, 0.45);
  background: radial-gradient(circle at 30% 30%, rgba(245, 241, 235, 0.72), rgba(140, 123, 106, 0.24) 65%, rgba(46, 42, 38, 0.82) 100%);
  color: var(--dusk);
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 999999;
  opacity: 0.72;
  box-shadow: 0 0 0 1px rgba(194, 184, 163, 0.2), 0 0 22px rgba(194, 184, 163, 0.2);
  transition: transform 450ms ease, opacity 450ms ease, box-shadow 450ms ease, background 450ms ease;
}

.hub.activated {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.68);
  color: #0b0b10;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4), 0 0 34px rgba(255, 255, 255, 0.42);
}

.hub.activated .hub-sigil {
  color: #0b0b10;
}

.hub-bottom-right { bottom: 20px; right: 20px; }
.hub-top-right { top: 20px; right: 20px; }

#hubB {
  width: 48px;
  height: 48px;
}

#root-machine {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  transition: transform 1.2s ease-in-out, filter 1.4s ease-in-out;
}

#root-machine.inverted {
  filter: invert(1);
}

.spin-once {
  animation: rootSpinOnce 2.4s ease-in-out forwards;
}

@keyframes rootSpinOnce {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#threshold-logo {
  width: 70%;
  height: 70%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(245, 241, 235, 0.42));
  animation: logoBreath 5.2s ease-in-out infinite;
  transition: transform 0.3s ease, filter 0.3s ease;
}

#threshold-logo:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.35));
}

.hub:hover,
.hub:focus-visible {
  opacity: inherit;
  transform: none;
  outline: none;
}

.hub.activated:hover,
.hub.activated:focus-visible,
body.hub-active .hub:hover,
body.hub-active .hub:focus-visible {
  opacity: 1;
  transform: scale(1.08);
  outline: none;
}

.hub .hub-core {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(245, 241, 235, 0.85);
  filter: blur(0.3px);
}

.hub .hub-sigil {
  position: relative;
  font-size: 0.85rem;
  transform: translateY(-1px);
  color: rgba(46, 42, 38, 0.85);
}

#hubB .hub-sigil {
  font-size: 1rem;
  color: rgba(245, 241, 235, 0.92);
}

body.hub-active .hub {
  opacity: 1;
  transform: scale(1.08);
  box-shadow: 0 0 0 1px rgba(245, 241, 235, 0.3), 0 0 36px rgba(245, 241, 235, 0.35), 0 0 62px rgba(194, 184, 163, 0.25);
  animation: hubPulse 2.8s ease-in-out infinite;
}

@keyframes hubPulse {
  0%, 100% { transform: scale(1.06); }
  50% { transform: scale(1.11); }
}

@keyframes logoBreath {
  0%, 100% { transform: scale(0.96); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; }
}

#hubField,
#particle-field {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 99998;
  pointer-events: none;
}

#hub-root {
  position: fixed;
  left: 2rem;
  bottom: 2rem;
  z-index: 1001;
  max-width: min(640px, calc(100vw - 7rem));
  padding: 0.82rem 0.96rem;
  border-radius: 12px;
  border: 1px solid rgba(194, 184, 163, 0.38);
  background: rgba(25, 21, 19, 0.7);
  box-shadow: 0 0 0 1px rgba(194, 184, 163, 0.2), 0 0 28px rgba(194, 184, 163, 0.18);
  color: rgba(245, 241, 235, 0.92);
  backdrop-filter: blur(3px);
}

#activation-overlay,
#hub-fade-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s ease-in-out;
  z-index: 99999;
}

#activation-overlay.active,
#hub-fade-overlay.active {
  opacity: 1;
}

.hub-title {
  font-size: 0.94rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.24rem;
}

.hub-sub {
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(245, 241, 235, 0.82);
}

body.hub-active #hubField,
body.hub-active #particle-field {
  pointer-events: none;
}

.drift-glyph {
  position: absolute;
  width: var(--glyph-size, 24px);
  height: var(--glyph-size, 24px);
  border-radius: 50%;
  border: 1px solid rgba(194, 184, 163, 0.45);
  color: rgba(245, 241, 235, 0.84);
  display: grid;
  place-items: center;
  font-size: clamp(11px, 0.85vw, 16px);
  line-height: 1;
  text-shadow: 0 0 7px rgba(245, 241, 235, 0.35);
  background: rgba(46, 42, 38, 0.2);
  backdrop-filter: blur(1.2px);
  opacity: 0;
  pointer-events: auto;
  user-select: none;
  transform: translate(-50%, -50%);
  transition: box-shadow 180ms ease, transform 180ms ease, filter 180ms ease;
}

.drift-glyph-char {
  display: block;
  will-change: transform;
  pointer-events: none;
}

.drift-glyph-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.glyph-particle {
  opacity: 0.9;
}

.glyph-tail {
  filter: blur(2px);
  opacity: 0.6;
}

.glyph-longtail {
  filter: blur(4px);
  opacity: 0.4;
  transform: skewY(10deg);
}

.drift-glyph.has-side-drift .drift-glyph-char {
  animation: glyphSideDrift var(--drift-duration, 8s) ease-in-out infinite alternate;
}

.drift-glyph.is-near {
  box-shadow: 0 0 18px rgba(245, 241, 235, 0.55);
  filter: brightness(1.25);
}

.drift-glyph.is-bright {
  box-shadow: 0 0 22px rgba(245, 241, 235, 0.75), 0 0 38px rgba(194, 184, 163, 0.45);
}

.drift-glyph.is-pulsing {
  animation: glyphPulse 320ms ease;
}

.drift-glyph.has-trail::after {
  content: "";
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  border: 1px dashed rgba(245, 241, 235, 0.33);
  transform: scale(1.35);
  opacity: 0.7;
}

.drift-glyph.is-rare {
  border-style: dashed;
}

@keyframes glyphPulse {
  0% { transform: translate(-50%, -50%) scale(1); }
  60% { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes glyphSideDrift {
  from { transform: translateX(0); }
  to { transform: translateX(var(--drift-distance, 0px)); }
}

.particle {
  position: absolute;
  font-size: 24px;
  color: #cfd2d6;
  opacity: 0.9;
  animation-name: fall;
  animation-duration: 6s;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.shape {
  will-change: left, filter, opacity;
}

.shape-pocket-react {
  text-shadow: 0 0 8px currentColor;
}

.shape-node-react {
  letter-spacing: 0.04em;
}

.vapor {
  filter: blur(6px);
  opacity: 0.4;
}

@keyframes particleFall {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100vh); opacity: 0; }
}

/* Normal fall */
@keyframes fall {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100vh); opacity: 0; }
}

/* Drifting sideways */
@keyframes driftSide {
  from { transform: translate(0,0); opacity: 1; }
  to { transform: translate(120px, 100vh); opacity: 0; }
}

/* Drifting left (scared) */
@keyframes driftLeftFast {
  from { transform: translate(0,0); opacity: 1; }
  to { transform: translate(-240px, 100vh); opacity: 0; }
}

/* Wobble fall */
@keyframes wobbleFall {
  0% { transform: translate(0,0) rotate(0deg); }
  25% { transform: translate(20px, 25vh) rotate(6deg); }
  50% { transform: translate(-10px, 50vh) rotate(-4deg); }
  75% { transform: translate(15px, 75vh) rotate(8deg); }
  100% { transform: translate(-5px, 100vh) rotate(-6deg); opacity: 0; }
}

/* Spiral fall */
@keyframes spiralFall {
  from { transform: translateY(0) rotate(0deg); opacity: 1; }
  to { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

@keyframes fastFall {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100vh); opacity: 0; }
}

@keyframes slowFall {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100vh); opacity: 0; }
}

@keyframes jitterFall {
  0% { transform: translate(0, 0); opacity: 1; }
  20% { transform: translate(6px, 20vh); }
  40% { transform: translate(-8px, 42vh); }
  60% { transform: translate(5px, 66vh); }
  80% { transform: translate(-6px, 84vh); }
  100% { transform: translate(0, 100vh); opacity: 0; }
}

@keyframes sideDrift {
  from { transform: translate(0, 0); opacity: 1; }
  to { transform: translate(120px, 100vh); opacity: 0; }
}

@keyframes inwardFall {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(0, 100vh) scale(0.65); opacity: 0; }
}

@keyframes calmFall {
  from { transform: translateY(0); opacity: 0.82; }
  to { transform: translateY(100vh); opacity: 0; }
}

#root-machine.spin-cw,
.rotate-cw {
  animation: spinCW 6s linear infinite;
}

#root-machine.spin-ccw,
.rotate-ccw {
  animation: spinCCW 6s linear infinite;
}

@keyframes spinCW {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinCCW {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.hub-lore {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  width: min(320px, calc(100vw - 2.4rem));
  padding: 0.9rem 1rem;
  border: 1px solid rgba(194, 184, 163, 0.45);
  border-radius: 10px;
  background: rgba(15, 13, 12, 0.88);
  color: var(--dusk);
  z-index: 1100;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}

.hub-lore h3 {
  margin: 0 0 0.4rem;
  color: var(--dusk);
  font-size: 1rem;
}

.hub-lore p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.world-state {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  width: min(320px, calc(100vw - 2rem));
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(194, 184, 163, 0.45);
  border-radius: 10px;
  background: rgba(15, 13, 12, 0.72);
  color: var(--dusk);
  z-index: 1100;
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
  opacity: 0.42;
  transition: opacity 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.world-state h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: var(--dusk);
}

.world-state p {
  margin: 0.15rem 0;
  font-size: 0.84rem;
  font-family: 'Source Code Pro', monospace;
  line-height: 1.35;
}

body.hub-active .world-state {
  opacity: 0.95;
  border-color: rgba(245, 241, 235, 0.55);
  box-shadow: 0 10px 28px rgba(0,0,0,0.4), 0 0 20px rgba(194, 184, 163, 0.22);
}

#hub-debug-overlay {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 12px 16px;
  font-size: 12px;
  border-radius: 8px;
  z-index: 999999;
  pointer-events: none;
  font-family: 'Source Code Pro', monospace;
  line-height: 1.45;
  white-space: pre-line;
}

#hub-log {
  position: fixed;
  top: 20px;
  right: 20px;
  width: min(360px, calc(100vw - 40px));
  max-height: min(45vh, 300px);
  overflow: hidden;
  background: #111111;
  color: #00ff66;
  padding: 10px 14px;
  font-family: 'Source Code Pro', monospace;
  font-size: 12px;
  border-radius: 6px;
  z-index: 999999;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

#hub-log .line {
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.click-dot {
  position: fixed;
  width: 12px;
  height: 12px;
  background: #ff3b30;
  border-radius: 50%;
  opacity: 0.8;
  pointer-events: none;
  z-index: 999999;
  transform: translate(-50%, -50%);
  animation: fadeDot 1s forwards;
}

@keyframes fadeDot {
  from {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(3);
  }
}

@media (max-width: 900px) {
  .hub {
    right: 1rem;
    bottom: 1rem;
    width: 52px;
    height: 52px;
  }

  #hubB {
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }

  .world-state {
    left: 0.7rem;
    bottom: 0.7rem;
    width: min(280px, calc(100vw - 1.4rem));
  }

  nav {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-enter,
  .fade-in,
  .fade-test,
  .shimmer-pulse,
  .seasonal-background,
  .glyph,
  #threshold-logo,
    width: min(180px, 70%);
    height: auto;
    display: block;
    margin: 0 auto;
    transition: none !important;
  }
}

.fib-flower-panel {
  max-width: 1020px;
  border: 1px solid rgba(140, 123, 106, 0.24);
  border-radius: 20px;
  background:
    radial-gradient(circle at 10% 8%, rgba(215, 198, 169, 0.3), transparent 38%),
    radial-gradient(circle at 86% 76%, rgba(174, 204, 188, 0.2), transparent 36%),
    rgba(255, 251, 245, 0.78);
  box-shadow: 0 24px 60px -44px rgba(28, 19, 12, 0.62);
}

.fib-flower-header {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.3rem;
}

.fib-flower-header h2 {
  margin: 0;
}

.fib-flower-header p {
  margin: 0;
  color: #6e5c4f;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.94rem;
}

.fib-flower-stage {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
  align-items: stretch;
}

#fibFlowerSvg {
  width: 100%;
  min-height: 420px;
  border-radius: 16px;
  border: 1px solid rgba(140, 123, 106, 0.2);
  background:
    linear-gradient(180deg, rgba(46, 42, 38, 0.95) 0%, rgba(59, 50, 43, 0.94) 100%);
}

.fib-orbit {
  fill: none;
  stroke: rgba(205, 188, 160, 0.18);
  stroke-width: 1.2;
}

.fib-edge {
  stroke: rgba(228, 215, 192, 0.46);
  stroke-width: 1.35;
}

.fib-node {
  cursor: pointer;
  transition: filter 240ms ease, transform 240ms ease;
}

.node.activated {
  text-shadow: 0 0 12px currentColor;
}

.node.awakened,
.fib-node.awakened,
.fib-label.awakened {
  filter: hue-rotate(24deg) brightness(1.16);
}

.node.pulse,
.fib-node.pulse,
.fib-label.pulse {
  animation: nodePulse 1s ease-out;
}

@keyframes nodePulse {
  0% { transform: scale(1); text-shadow: 0 0 0 currentColor; }
  50% { transform: scale(1.18); text-shadow: 0 0 12px currentColor; }
  100% { transform: scale(1); text-shadow: 0 0 0 currentColor; }
}

.fib-node.pulse,
.node-orbit-shape.pulse {
  transform-box: fill-box;
  transform-origin: center;
}

.fib-node.activated {
  filter: drop-shadow(0 0 12px currentColor);
}

.fib-label.activated {
  text-shadow: 0 0 12px currentColor;
}

.fib-node:focus,
.fib-node:hover {
  filter: brightness(1.18);
  outline: none;
}

.fib-core {
  fill: #ffffff;
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 1.6;
}

.fib-petal {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.25;
}

.fib-label {
  fill: currentColor;
  font-family: 'Source Code Pro', monospace;
  font-size: 12px;
  text-anchor: middle;
  letter-spacing: 0.04em;
}

.fib-label-core {
  fill: currentColor;
  font-weight: 700;
}

.node-orbit-shape {
  fill: currentColor;
  color: var(--node-threshold);
  font-size: 14px;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: var(--orbit-cx, 0px) var(--orbit-cy, 0px);
  animation: orbitNodeShape 4s linear infinite;
  animation-delay: var(--orbit-delay, 0s);
}

@keyframes orbitNodeShape {
  from { transform: rotate(0deg) translateX(var(--orbit-radius, 40px)) rotate(0deg); }
  to { transform: rotate(360deg) translateX(var(--orbit-radius, 40px)) rotate(-360deg); }
}

#drift,
.fib-label[data-id="drift"] {
  color: var(--node-drift);
}

#collapse,
.fib-label[data-id="collapse"] {
  color: var(--node-collapse);
}

#anchor,
.fib-label[data-id="anchor"] {
  color: var(--node-anchor);
}

#pressure,
.fib-label[data-id="pressure"] {
  color: var(--node-pressure);
}

#resonance,
.fib-label[data-id="resonance"] {
  color: var(--node-resonance);
}

#orbit,
.fib-label[data-id="orbit"] {
  color: var(--node-orbit);
}

#capture,
.fib-label[data-id="capture"] {
  color: var(--node-capture);
}

#threshold,
.fib-label[data-id="threshold"] {
  color: var(--node-threshold);
}

.fib-flower-inspector {
  border-radius: 16px;
  border: 1px solid rgba(140, 123, 106, 0.2);
  background: rgba(255, 252, 246, 0.8);
  padding: 0.95rem;
  color: #4a3f35;
}

.fib-flower-inspector h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 1.06rem;
}

.fib-flower-inspector p {
  margin: 0.45rem 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .fib-flower-stage {
    grid-template-columns: 1fr;
  }

  #fibFlowerSvg {
    min-height: 340px;
  }
}

.project-chamber-inspector {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(360px, calc(100vw - 2rem));
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 235, 209, 0.32);
  background: rgba(14, 12, 11, 0.82);
  color: #f7efe2;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
  z-index: 1250;
  backdrop-filter: blur(5px);
}

.project-chamber-title {
  margin: 0 0 0.45rem;
  font-size: 0.98rem;
  color: #f8ecd8;
}

.project-chamber-line {
  margin: 0.22rem 0;
  font-size: 0.82rem;
  line-height: 1.34;
  font-family: 'Source Code Pro', monospace;
}

.project-chamber-path {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: rgba(247, 239, 226, 0.75);
  line-height: 1.28;
  word-break: break-word;
  font-family: 'Source Code Pro', monospace;
}

.project-chamber-inspector[data-channel="collapse"] {
  border-color: rgba(240, 159, 145, 0.55);
}

.project-chamber-inspector[data-channel="expand"] {
  border-color: rgba(167, 232, 221, 0.52);
}

.project-chamber-inspector[data-channel="fog"] {
  border-color: rgba(194, 214, 238, 0.52);
}

.project-chamber-inspector[data-channel="soil"] {
  border-color: rgba(210, 184, 151, 0.55);
}

@media (max-width: 900px) {
  .project-chamber-inspector {
    right: 0.7rem;
    bottom: 0.7rem;
    width: min(320px, calc(100vw - 1.4rem));
  }
}

