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

:root {
  --bg: #0a0e08;
  --bg-card: #12160e;
  --brass: #b87333;
  --brass-light: #cd9b4a;
  --copper: #a0522d;
  --gold: #d4a843;
  --paper: #f5e6c8;
  --paper-dark: #c9b896;
  --text: #d8dcc8;
  --text-dim: #8a9a6e;
  --iron: #4a4a3a;
  --iron-dark: #2a2a20;
  --red-glow: #8b2500;
  --green-glow: #3a7a2a;
  --moss: #2d5a1e;
  --moss-light: #4a8a32;
  --fern: #3d7a3a;
  --vine: #1e4a18;
  --leaf-bright: #5aad3a;
  --leaf-dark: #2a5a1a;
  --verdant: #3a8a2a;
  --biolum: #4aeacc;
  --biolum-dim: #2a9a8a;
  --biolum-glow: rgba(74, 234, 204, 0.3);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Spectral', Georgia, serif;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ===================== */
/* VAULT OVERLAY         */
/* ===================== */
#vault-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0e0e0a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}

#vault-overlay.opened {
  opacity: 0;
  pointer-events: none;
}

/* Background vault gears */
.vault-gear {
  position: fixed;
  color: var(--brass);
  opacity: 0.04;
  pointer-events: none;
  transition: opacity 0.5s, color 0.5s;
}
.vg1 { font-size: 300px; top: -80px; left: -80px; animation: spin 90s linear infinite; }
.vg2 { font-size: 220px; bottom: -60px; right: -60px; animation: spin 70s linear infinite reverse; }
.vg3 { font-size: 160px; top: 20%; right: 10%; animation: spin 50s linear infinite; }
.vg4 { font-size: 180px; bottom: 15%; left: 8%; animation: spin 60s linear infinite reverse; }

.vault-gear.active {
  opacity: 0.15;
  animation-duration: 3s !important;
}

/* Vault container */
.vault-container {
  text-align: center;
  position: relative;
  z-index: 2;
}

.vault-title {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  letter-spacing: 0.25em;
  color: var(--brass-light);
  text-shadow: 0 0 30px rgba(205, 155, 74, 0.15);
  margin-bottom: 0.3rem;
}

.vault-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 2rem;
}

/* Vault door frame */
.vault-door-frame {
  width: 340px;
  height: 240px;
  margin: 0 auto;
  position: relative;
  border: 3px solid var(--brass);
  background: var(--iron-dark);
  box-shadow:
    0 0 40px rgba(0,0,0,0.5),
    inset 0 0 30px rgba(0,0,0,0.8),
    0 0 2px var(--brass);
  overflow: hidden;
}

/* Vault doors */
.vault-door {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  transition: transform 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#vault-door-left {
  left: 0;
  transform-origin: left center;
}

#vault-door-right {
  right: 0;
  transform-origin: right center;
}

#vault-door-left.open {
  transform: perspective(800px) rotateY(-105deg);
}

#vault-door-right.open {
  transform: perspective(800px) rotateY(105deg);
}

.door-plate {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, #3a3a2e 0%, #2a2a1e 40%, #222218 100%);
  border: 1px solid rgba(184, 115, 51, 0.3);
  position: relative;
}

/* Rivets */
.door-rivet {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--brass-light), var(--copper));
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.r1 { top: 12px; left: 12px; }
.r2 { top: 12px; right: 12px; }
.r3 { bottom: 12px; left: 12px; }
.r4 { bottom: 12px; right: 12px; }

/* Door hinges */
.door-hinge {
  position: absolute;
  width: 6px;
  height: 30px;
  background: linear-gradient(to right, var(--brass), var(--copper));
  border-radius: 2px;
  box-shadow: 1px 0 3px rgba(0,0,0,0.4);
}

#vault-door-left .door-hinge { left: -2px; }
#vault-door-right .door-hinge { right: -2px; }

.dh1 { top: 15%; }
.dh2 { top: 42%; }
.dh3 { top: 69%; }

/* Center lock */
.vault-lock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  transition: opacity 0.3s;
}

.vault-lock.hidden {
  opacity: 0;
}

.lock-ring {
  width: 60px;
  height: 60px;
  border: 3px solid var(--brass);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--iron-dark);
  box-shadow:
    0 0 15px rgba(184, 115, 51, 0.2),
    inset 0 0 10px rgba(0,0,0,0.5);
}

.lock-gear {
  font-size: 36px;
  color: var(--brass);
  transition: color 0.3s;
}

.lock-gear.spinning {
  animation: spin 0.5s linear infinite;
  color: var(--brass-light);
}

/* Controls */
.controls {
  margin-top: 2rem;
}

.control-panel {
  display: flex;
  justify-content: center;
  gap: 3rem;
  align-items: flex-start;
}

/* Lever */
.lever-housing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.lever-label, .button-label {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.lever-track {
  width: 20px;
  height: 80px;
  background: var(--iron-dark);
  border: 2px solid var(--iron);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.6);
}

.lever {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  transition: top 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: grab;
}

.lever.pulled {
  top: 48px;
}

.lever-handle {
  width: 24px;
  height: 14px;
  background: linear-gradient(to bottom, var(--brass-light), var(--brass));
  border-radius: 3px;
  border: 1px solid var(--copper);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.lever-shaft {
  width: 4px;
  height: 16px;
  background: var(--iron);
  margin: 0 auto;
  border-radius: 0 0 2px 2px;
}

.lever-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--iron);
  transition: background 0.3s, box-shadow 0.3s;
}

.lever-indicator.off {
  background: #2a1a0a;
}

.lever-indicator.on {
  background: var(--green-glow);
  box-shadow: 0 0 8px var(--green-glow);
}

/* Engage button */
.button-housing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.button-ring {
  width: 56px;
  height: 56px;
  border: 3px solid var(--iron);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--iron-dark);
  transition: border-color 0.3s;
}

.engage-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--copper);
  background: radial-gradient(circle at 40% 40%, #5a2a1a, #3a1a0a);
  cursor: not-allowed;
  position: relative;
  transition: all 0.2s;
  outline: none;
}

.engage-btn:not(:disabled) {
  cursor: pointer;
  background: radial-gradient(circle at 40% 40%, var(--red-glow), #5a1a0a);
  border-color: var(--brass);
  box-shadow: 0 0 10px rgba(139, 37, 0, 0.4);
}

.engage-btn:not(:disabled):hover {
  box-shadow: 0 0 20px rgba(139, 37, 0, 0.6);
  transform: scale(1.05);
}

.engage-btn:not(:disabled):active {
  transform: scale(0.92);
  box-shadow: 0 0 25px rgba(139, 37, 0, 0.8);
}

.btn-inner {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 100, 50, 0.15);
  margin: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: background 0.2s;
}

.engage-btn:not(:disabled) .btn-inner {
  background: rgba(255, 100, 50, 0.4);
}

/* Status text */
.status-text {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-top: 1.5rem;
  min-height: 1.2em;
  transition: color 0.3s;
}

.status-text.active {
  color: var(--brass-light);
}

/* Steam effects */
.steam {
  position: fixed;
  bottom: 0;
  width: 120px;
  height: 0;
  pointer-events: none;
  z-index: 101;
  opacity: 0;
  transition: opacity 0.3s;
}

#steam-left { left: 15%; }
#steam-right { right: 15%; }

.steam.active {
  opacity: 1;
}

.steam.active::before,
.steam.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 100%;
  background: radial-gradient(ellipse at center bottom, rgba(200, 190, 170, 0.3), transparent 70%);
  animation: steam-rise 2s ease-out infinite;
}

.steam.active::before {
  height: 200px;
  animation-delay: 0s;
}

.steam.active::after {
  height: 160px;
  animation-delay: 0.4s;
  left: 20px;
}

@keyframes steam-rise {
  0% {
    transform: translateY(0) scaleX(1);
    opacity: 0.6;
  }
  100% {
    transform: translateY(-250px) scaleX(2);
    opacity: 0;
  }
}

/* ========================== */
/* MYCELIUM NETWORK — vault   */
/* ========================== */
.mycelium {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  animation: myc-fade-in 3s ease 0.5s forwards;
}

@keyframes myc-fade-in {
  to { opacity: 1; }
}

.myc-strand {
  fill: none;
  stroke: rgba(74, 234, 204, 0.08);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: myc-grow 4s ease forwards;
  filter: drop-shadow(0 0 3px rgba(74, 234, 204, 0.1));
}

.myc-s1 { animation-delay: 0.5s; }
.myc-s2 { animation-delay: 1.2s; stroke-width: 0.8; }
.myc-s3 { animation-delay: 1.5s; stroke-width: 0.9; }
.myc-s4 { animation-delay: 1.8s; stroke-width: 0.7; }
.myc-s5 { animation-delay: 0.8s; }
.myc-s6 { animation-delay: 1.6s; stroke-width: 0.8; }
.myc-s7 { animation-delay: 2s; stroke-width: 0.9; }
.myc-s8 { animation-delay: 2.5s; stroke-width: 0.6; }
.myc-s9 { animation-delay: 2.8s; stroke-width: 0.6; }
.myc-s10 { animation-delay: 2.2s; stroke-width: 0.5; }
.myc-s11 { animation-delay: 1s; stroke-width: 0.7; }
.myc-s12 { animation-delay: 1.4s; stroke-width: 0.7; }

@keyframes myc-grow {
  to { stroke-dashoffset: 0; }
}

.myc-node {
  fill: rgba(74, 234, 204, 0.15);
  opacity: 0;
  animation: myc-node-appear 0.8s ease forwards;
  filter: drop-shadow(0 0 4px rgba(74, 234, 204, 0.2));
}

.myc-node:nth-child(13) { animation-delay: 2s; }
.myc-node:nth-child(14) { animation-delay: 2.3s; }
.myc-node:nth-child(15) { animation-delay: 2.5s; }
.myc-node:nth-child(16) { animation-delay: 2.8s; }
.myc-node:nth-child(17) { animation-delay: 3s; }
.myc-node:nth-child(18) { animation-delay: 3.2s; }
.myc-node:nth-child(19) { animation-delay: 3.4s; }
.myc-node:nth-child(20) { animation-delay: 3s; }
.myc-node:nth-child(21) { animation-delay: 3.3s; }
.myc-node:nth-child(22) { animation-delay: 2.6s; }
.myc-node:nth-child(23) { animation-delay: 2.8s; }
.myc-node:nth-child(24) { animation-delay: 2.4s; }

@keyframes myc-node-appear {
  0% { opacity: 0; r: 0; }
  60% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Mycelium lights up when engaged */
#vault-overlay.myc-active .myc-strand {
  stroke: rgba(74, 234, 204, 0.2);
  filter: drop-shadow(0 0 6px rgba(74, 234, 204, 0.25));
  transition: stroke 0.5s, filter 0.5s;
}

#vault-overlay.myc-active .myc-node {
  fill: rgba(74, 234, 204, 0.5);
  filter: drop-shadow(0 0 8px rgba(74, 234, 204, 0.5));
  transition: fill 0.5s, filter 0.5s;
}

/* ===================================== */
/* MAIN CONTENT — OVERGROWN LABORATORY   */
/* ===================================== */
#main-content {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}

#main-content.visible {
  display: flex;
}

/* Verdant ambient glow — green-tinted laboratory atmosphere */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 80%, rgba(45, 90, 30, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(58, 122, 58, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(30, 74, 24, 0.15) 0%, transparent 40%),
    radial-gradient(ellipse at 20% 30%, rgba(184, 115, 51, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Floating gears — now with mossy patina */
.gear {
  position: fixed;
  border: 3px solid var(--brass);
  border-radius: 50%;
  opacity: 0.06;
  pointer-events: none;
}

.gear::before {
  content: '\2699';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: inherit;
  color: var(--brass);
}

/* Moss/patina on gears */
.gear::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: rgba(45, 90, 30, 0.4);
  border-left-color: rgba(45, 90, 30, 0.25);
}

.gear-1 {
  width: 200px; height: 200px;
  top: -40px; right: -40px;
  font-size: 120px;
  animation: spin 60s linear infinite;
}

.gear-2 {
  width: 150px; height: 150px;
  bottom: -30px; left: -30px;
  font-size: 90px;
  animation: spin 45s linear infinite reverse;
}

.gear-3 {
  width: 100px; height: 100px;
  top: 30%; left: 5%;
  font-size: 60px;
  animation: spin 30s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================== */
/* VINES — crawling tendrils  */
/* ========================== */
.vine {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.vine::before,
.vine::after {
  content: '';
  position: absolute;
  border-radius: 40%;
}

/* Vine 1 — top-left, curving down */
.vine-1 {
  top: 0;
  left: 5%;
  width: 3px;
  height: 45%;
  background: linear-gradient(to bottom, var(--vine), transparent);
  opacity: 0.5;
  animation: fadeUp 1.5s ease 0.5s both;
}

.vine-1::before {
  width: 30px;
  height: 18px;
  background: radial-gradient(ellipse, var(--leaf-dark) 30%, transparent 70%);
  top: 30%;
  left: -14px;
  transform: rotate(-25deg);
}

.vine-1::after {
  width: 22px;
  height: 14px;
  background: radial-gradient(ellipse, var(--fern) 30%, transparent 70%);
  top: 55%;
  left: 4px;
  transform: rotate(20deg);
}

/* Vine 2 — top-right, curving down */
.vine-2 {
  top: 0;
  right: 8%;
  width: 2px;
  height: 35%;
  background: linear-gradient(to bottom, var(--vine), transparent);
  opacity: 0.4;
  animation: fadeUp 1.5s ease 0.8s both;
}

.vine-2::before {
  width: 26px;
  height: 16px;
  background: radial-gradient(ellipse, var(--moss) 30%, transparent 70%);
  top: 40%;
  right: 4px;
  transform: rotate(30deg);
}

.vine-2::after {
  width: 20px;
  height: 12px;
  background: radial-gradient(ellipse, var(--leaf-dark) 30%, transparent 70%);
  top: 20%;
  right: -10px;
  transform: rotate(-15deg);
}

/* Vine 3 — bottom-left, creeping up */
.vine-3 {
  bottom: 0;
  left: 12%;
  width: 2px;
  height: 30%;
  background: linear-gradient(to top, var(--vine), transparent);
  opacity: 0.45;
  animation: fadeUp 1.5s ease 1s both;
}

.vine-3::before {
  width: 28px;
  height: 16px;
  background: radial-gradient(ellipse, var(--fern) 30%, transparent 70%);
  bottom: 25%;
  left: -12px;
  transform: rotate(15deg);
}

/* Vine 4 — bottom-right, creeping up */
.vine-4 {
  bottom: 0;
  right: 3%;
  width: 3px;
  height: 50%;
  background: linear-gradient(to top, var(--vine), transparent);
  opacity: 0.35;
  animation: fadeUp 1.5s ease 1.2s both;
}

.vine-4::before {
  width: 32px;
  height: 18px;
  background: radial-gradient(ellipse, var(--leaf-dark) 30%, transparent 70%);
  bottom: 40%;
  right: 4px;
  transform: rotate(-20deg);
}

.vine-4::after {
  width: 24px;
  height: 14px;
  background: radial-gradient(ellipse, var(--moss) 35%, transparent 70%);
  bottom: 60%;
  right: -8px;
  transform: rotate(25deg);
}

/* ======================== */
/* FLOATING SPORES/POLLEN   */
/* ======================== */
.spore {
  position: fixed;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 234, 204, 0.7), rgba(42, 154, 138, 0.3), transparent);
  box-shadow: 0 0 6px rgba(74, 234, 204, 0.3);
  pointer-events: none;
  z-index: 0;
  animation: spore-float 8s ease-in-out infinite;
}

.spore-1 { top: 20%; left: 15%; animation-delay: 0s; animation-duration: 9s; }
.spore-2 { top: 60%; left: 80%; animation-delay: 2s; animation-duration: 7s; width: 3px; height: 3px; }
.spore-3 { top: 40%; left: 25%; animation-delay: 4s; animation-duration: 11s; width: 5px; height: 5px; }
.spore-4 { top: 75%; left: 60%; animation-delay: 1s; animation-duration: 8s; }
.spore-5 { top: 30%; left: 70%; animation-delay: 3s; animation-duration: 10s; width: 3px; height: 3px; }
.spore-6 { top: 85%; left: 40%; animation-delay: 5s; animation-duration: 12s; width: 6px; height: 6px; opacity: 0.4; }

@keyframes spore-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.2;
    box-shadow: 0 0 4px rgba(74, 234, 204, 0.2);
  }
  25% {
    transform: translate(15px, -20px) scale(1.4);
    opacity: 0.7;
    box-shadow: 0 0 10px rgba(74, 234, 204, 0.5);
  }
  50% {
    transform: translate(-10px, -35px) scale(0.8);
    opacity: 0.15;
    box-shadow: 0 0 3px rgba(74, 234, 204, 0.15);
  }
  75% {
    transform: translate(20px, -15px) scale(1.2);
    opacity: 0.6;
    box-shadow: 0 0 8px rgba(74, 234, 204, 0.4);
  }
}

/* =================== */
/* MAIN CARD — FRAME   */
/* =================== */
main {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 560px;
  padding: 1rem;
  animation: fadeUp 1s ease 0.3s both;
}

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

.frame {
  position: relative;
  background:
    linear-gradient(135deg, rgba(18, 22, 14, 0.97), rgba(14, 18, 10, 0.97));
  border: 1px solid var(--brass);
  padding: 3rem 2.5rem;
  box-shadow:
    0 0 30px rgba(45, 90, 30, 0.1),
    0 0 60px rgba(30, 74, 24, 0.05),
    inset 0 0 60px rgba(0, 0, 0, 0.4),
    inset 0 0 120px rgba(45, 90, 30, 0.03);
  overflow: visible;
}

/* Patina stain on the card */
.frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 10% 90%, rgba(45, 90, 30, 0.08), transparent 50%),
    radial-gradient(ellipse at 90% 10%, rgba(58, 122, 58, 0.06), transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(30, 74, 24, 0.03), transparent 60%);
  pointer-events: none;
}

.frame-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--brass-light);
  border-style: solid;
  z-index: 2;
}

.frame-tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; filter: drop-shadow(0 0 3px var(--biolum-glow)); }
.frame-tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; filter: drop-shadow(0 0 3px var(--biolum-glow)); }
.frame-bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; filter: drop-shadow(0 0 3px var(--biolum-glow)); }
.frame-br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; filter: drop-shadow(0 0 3px var(--biolum-glow)); }

/* ============================== */
/* LEAVES — overgrown on frame    */
/* ============================== */
.leaf {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}

.leaf::before {
  content: '';
  position: absolute;
  border-radius: 0 70% 0 70%;
  transform-origin: bottom left;
}

.leaf::after {
  content: '';
  position: absolute;
  border-radius: 70% 0 70% 0;
  transform-origin: bottom right;
}

/* Top-left cluster */
.leaf-tl {
  top: -12px;
  left: -8px;
}

.leaf-tl::before {
  width: 28px;
  height: 16px;
  background: linear-gradient(135deg, var(--fern), var(--leaf-dark));
  transform: rotate(-30deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.leaf-tl::after {
  width: 22px;
  height: 13px;
  background: linear-gradient(135deg, var(--moss-light), var(--moss));
  top: 6px;
  left: 20px;
  transform: rotate(-5deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Top-right leaf */
.leaf-tr {
  top: -8px;
  right: 15px;
}

.leaf-tr::before {
  width: 24px;
  height: 14px;
  background: linear-gradient(135deg, var(--leaf-dark), var(--vine));
  transform: rotate(15deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Bottom-left cluster */
.leaf-bl {
  bottom: -10px;
  left: 20px;
}

.leaf-bl::before {
  width: 30px;
  height: 17px;
  background: linear-gradient(135deg, var(--moss), var(--vine));
  transform: rotate(25deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.leaf-bl::after {
  width: 18px;
  height: 11px;
  background: linear-gradient(135deg, var(--fern), var(--leaf-dark));
  bottom: 2px;
  left: 25px;
  transform: rotate(50deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Bottom-right */
.leaf-br {
  bottom: -6px;
  right: -5px;
}

.leaf-br::before {
  width: 26px;
  height: 15px;
  background: linear-gradient(135deg, var(--leaf-dark), var(--moss));
  transform: rotate(-20deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Mid-right accent leaf */
.leaf-mid-r {
  top: 45%;
  right: -14px;
}

.leaf-mid-r::before {
  width: 22px;
  height: 13px;
  background: linear-gradient(135deg, var(--fern), var(--vine));
  transform: rotate(-10deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.leaf-mid-r::after {
  width: 18px;
  height: 10px;
  background: linear-gradient(135deg, var(--moss-light), var(--leaf-dark));
  top: 14px;
  left: -6px;
  transform: rotate(15deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ============================= */
/* FRAME VINES — thin tendrils   */
/* ============================= */
.frame-vine {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.frame-vine-top {
  top: -1px;
  left: 20%;
  width: 60%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--vine), var(--fern), var(--vine), transparent);
  opacity: 0.5;
}

.frame-vine-top::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 30%;
  width: 30px;
  height: 4px;
  background: radial-gradient(ellipse, rgba(45, 90, 30, 0.4), transparent);
  border-radius: 50%;
}

.frame-vine-left {
  top: 30%;
  left: -1px;
  width: 2px;
  height: 40%;
  background: linear-gradient(to bottom, transparent, var(--vine), var(--moss), transparent);
  opacity: 0.4;
}

.frame-vine-right {
  top: 20%;
  right: -1px;
  width: 2px;
  height: 50%;
  background: linear-gradient(to bottom, transparent, var(--vine), var(--fern), var(--vine), transparent);
  opacity: 0.45;
}

.frame-vine-bottom {
  bottom: -1px;
  left: 10%;
  width: 50%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--moss), var(--vine), transparent);
  opacity: 0.5;
}

/* ==================== */
/* NAVIGATION MENU       */
/* ==================== */
.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  margin: 1.2rem 0 0.5rem;
}

.nav-item {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0;
  position: relative;
  transition: color 0.3s;
  outline: none;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--biolum-dim), var(--biolum), var(--biolum-dim), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.nav-item:hover {
  color: var(--brass-light);
}

.nav-item.active {
  color: var(--brass-light);
}

.nav-item.active::after {
  opacity: 1;
}

.nav-sep {
  color: var(--brass);
  font-size: 0.7rem;
  opacity: 0.3;
}

/* Hidden elements (URL param reveal) */
.hidden { display: none !important; }

/* Page sections */
.page {
  display: none;
}

.page.active {
  display: block;
  animation: page-fade 0.4s ease;
}

@keyframes page-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== */
/* CONTENT TYPOGRAPHY   */
/* ==================== */
header { text-align: center; margin-bottom: 1.5rem; }

h1 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--brass-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow:
    0 0 20px rgba(205, 155, 74, 0.2),
    0 2px 10px rgba(45, 90, 30, 0.1);
}

.tagline {
  font-style: italic;
  color: var(--text-dim);
  margin-top: 0.5rem;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

/* Dividers — overgrown with green tint */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--brass), transparent);
}

.divider-overgrown::before,
.divider-overgrown::after {
  background: linear-gradient(to right, transparent, var(--brass), var(--moss), var(--brass), transparent);
}

.divider-gear {
  color: var(--brass);
  font-size: 1.1rem;
  opacity: 0.6;
}

/* Gear gets bioluminescent tint */
.divider-overgrown .divider-gear {
  text-shadow: 0 0 8px rgba(74, 234, 204, 0.25), 0 0 4px rgba(45, 90, 30, 0.3);
}

.about p {
  line-height: 1.8;
  color: var(--text);
  font-size: 1rem;
  text-align: center;
}

/* ======================== */
/* WORK / FIELD NOTES       */
/* ======================== */
.work h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brass-light);
  text-align: center;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 10px rgba(205, 155, 74, 0.15);
}

.work-entry {
  margin-bottom: 1.3rem;
  padding-left: 1rem;
  border-left: 2px solid var(--vine);
  position: relative;
}

.work-entry::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, var(--biolum), var(--biolum-dim));
  box-shadow: 0 0 8px var(--biolum-glow), 0 0 16px rgba(74, 234, 204, 0.1);
  animation: biolum-pulse 3s ease-in-out infinite;
}

@keyframes biolum-pulse {
  0%, 100% { box-shadow: 0 0 6px var(--biolum-glow); }
  50% { box-shadow: 0 0 12px var(--biolum-glow), 0 0 20px rgba(74, 234, 204, 0.15); }
}

.work-entry:last-child {
  margin-bottom: 0;
}

.work-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.work-role {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--brass-light);
}

.work-place {
  font-family: 'Spectral', serif;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-dim);
}

.work-desc {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
  opacity: 0.85;
}

.work-desc strong {
  color: var(--brass-light);
  font-weight: 600;
}

.work-link {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--brass);
  transition: border-color 0.3s, color 0.3s;
}

.work-link:hover {
  color: var(--brass-light);
  border-bottom-color: var(--brass-light);
}

/* Links — brass plates with green patina hover */
.links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.link-plate {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--brass);
  background: transparent;
  transition: all 0.3s ease;
  position: relative;
}

.link-plate::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--biolum-dim), var(--biolum), var(--biolum-dim), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.link-plate:hover {
  color: var(--bg);
  background: linear-gradient(135deg, var(--brass-light), var(--brass));
  box-shadow:
    0 0 15px rgba(205, 155, 74, 0.3),
    0 0 25px rgba(74, 234, 204, 0.08);
}

.link-plate:hover::after {
  opacity: 1;
}

footer { margin-top: 2rem; text-align: center; }

.stamp {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.5;
}

/* ================================ */
/* PARSE TREE BACKGROUND ANIMATION  */
/* ================================ */
#parse-tree-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: tree-fade-in 2s ease 0.5s forwards;
}

@keyframes tree-fade-in {
  to { opacity: 1; }
}

.parse-tree-svg {
  width: 90%;
  max-width: 1200px;
  height: auto;
}

/* Default ghost state */
.tree-edge {
  stroke: rgba(74, 234, 204, 0.04);
  stroke-width: 1;
  transition: stroke 0.6s ease, filter 0.6s ease;
}

.tree-node {
  fill: rgba(74, 234, 204, 0.05);
  transition: fill 0.6s ease, filter 0.6s ease;
}

.tree-label {
  fill: rgba(74, 234, 204, 0.07);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.05em;
  transition: fill 0.6s ease, filter 0.6s ease;
}

.tree-word {
  fill: rgba(205, 155, 74, 0.05);
  font-family: 'Spectral', serif;
  font-size: 10px;
  font-style: italic;
  transition: fill 0.6s ease, filter 0.6s ease;
}

/* Active highlight — bioluminescent glow */
.tree-edge.tree-active {
  stroke: rgba(74, 234, 204, 0.3);
  filter: drop-shadow(0 0 4px rgba(74, 234, 204, 0.3));
}

.tree-node.tree-active {
  fill: rgba(74, 234, 204, 0.5);
  filter: drop-shadow(0 0 8px rgba(74, 234, 204, 0.4));
}

.tree-label.tree-active {
  fill: rgba(74, 234, 204, 0.6);
  filter: drop-shadow(0 0 6px rgba(74, 234, 204, 0.3));
}

.tree-word.tree-active {
  fill: rgba(205, 155, 74, 0.5);
  filter: drop-shadow(0 0 6px rgba(205, 155, 74, 0.2));
}

/* Responsive */
@media (max-width: 768px) {
  #parse-tree-bg { display: none; }
}

@media (max-width: 480px) {
  .vault-title { font-size: 1.4rem; }
  .vault-door-frame { width: 280px; height: 200px; }
  .control-panel { gap: 2rem; }
  .frame { padding: 2rem 1.5rem; }
  h1 { font-size: 1.8rem; }
  .tagline { font-size: 0.85rem; }
  .vine { display: none; }
  .leaf { transform: scale(0.7); }
}
