:root {
  --stone: #c4b799;
  --stone-dark: #7a7160;
  --moss: #4a7c59;
  --moss-light: #6aad73;
  --vine: #3d6b47;
  --sky-deep: #0a0e1a;
  --sky-mid: #111827;
  --nebula: rgba(88, 28, 135, 0.15);
  --star: #f0e8d8;
  --parchment: #f0e8d8;
  --glow: #00e5ff;
  --glow-warm: #e8a87c;
  --oracle: #7b68ee;
  --earth: #2a1f14;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body.no-grain::before, body.no-grain::after { content: none !important; }

body {
  background: var(--sky-deep);
  color: var(--stone);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(16px, 1.125vw, 20px);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ─── STARFIELD ─── */
.starfield {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
}

.starfield canvas {
  width: 100%;
  height: 100%;
}

/* Nebula wash */
.nebula {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(88, 28, 135, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 60%, rgba(30, 64, 115, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(20, 80, 60, 0.08) 0%, transparent 50%);
  z-index: 0;
  pointer-events: none;
}

/* Ground gradient */
.ground {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 50vh;
  background: linear-gradient(to top, 
    rgba(26, 18, 10, 0.95) 0%,
    rgba(26, 18, 10, 0.7) 20%,
    rgba(15, 20, 15, 0.3) 50%,
    transparent 100%);
  z-index: 0;
  pointer-events: none;
}

/* ─── ANCIENT STRUCTURES LAYER ─── */
.structures-svg {
  position: fixed;
  bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Floating glyphs in sky */
.sky-glyph {
  position: fixed;
  opacity: 0.06;
  color: var(--parchment);
  animation: glyphDrift 20s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(240, 232, 216, 0.1);
  pointer-events: none;
  z-index: 0;
}

@keyframes glyphDrift {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.03; }
  25% { opacity: 0.07; }
  50% { transform: translateY(-15px) rotate(3deg); opacity: 0.1; }
  75% { opacity: 0.05; }
}

@keyframes eyePulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes portalPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

@keyframes artifactHover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.artifact-float {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  animation: artifactHover 10s ease-in-out infinite;
}

/* Texture overlay — heavy grimoire grain */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='300' height='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='6' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.7;
  mix-blend-mode: overlay;
}

body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='150' height='150' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='turbulence' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='150' height='150' filter='url(%23g)' opacity='0.08'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1001;
  opacity: 0.5;
}

/* ─── NAVIGATION ─── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  padding: clamp(0.4rem, 0.8vw, 0.8rem) clamp(0.8rem, 2vw, 1.5rem);
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(138, 126, 107, 0.08);
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.55rem, 0.7vw, 0.7rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(138, 126, 107, 0.2);
  color: var(--stone-dark);
  font-size: 1.2rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  border-radius: 3px;
  transition: color 0.3s, border-color 0.3s;
}

.nav-toggle:hover {
  color: var(--glow);
  border-color: rgba(0, 229, 255, 0.3);
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 2rem);
}

.site-nav a {
  color: var(--stone-dark);
  text-decoration: none;
  padding: 0.3em 0;
  transition: color 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--parchment);
  border-bottom-color: var(--moss);
}

.site-nav a.active {
  color: var(--glow);
  border-bottom-color: var(--glow);
  opacity: 0.8;
}

/* Nav dropdowns */
.nav-dropdown {
  position: relative;
}

.nav-drop-btn {
  background: none;
  border: none;
  color: var(--stone-dark);
  font-family: 'JetBrains Mono', monospace;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.3em 0;
  transition: color 0.3s;
}

.nav-drop-btn:hover {
  color: var(--parchment);
}

.nav-drop-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(138, 126, 107, 0.15);
  border-radius: 4px;
  padding: 0.5rem 0;
  min-width: 140px;
  z-index: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown.open .nav-drop-menu {
  display: flex;
  flex-direction: column;
}

.nav-drop-menu a {
  padding: 0.5rem 1.2rem;
  white-space: nowrap;
  border-bottom: none !important;
}

.nav-drop-menu a:hover {
  background: rgba(0, 229, 255, 0.06);
}

.site-nav .nav-glyph {
  color: var(--stone-dark);
  opacity: 0.2;
  font-size: 0.6rem;
}

/* ─── HEADER / HERO ─── */
header {
  position: relative;
  min-height: 55vh;
  min-height: 55dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: clamp(3rem, 8vw, 5rem) clamp(1rem, 4vw, 2rem) 1rem;
  z-index: 1;
}

.pillar-left, .pillar-right {
  position: absolute;
  top: 15%;
  bottom: 20%;
  width: 40px;
  opacity: 0.15;
}
.pillar-left {
  left: 5%;
  border-left: 3px solid var(--stone-dark);
  border-right: 1px solid var(--stone-dark);
}
.pillar-right {
  right: 5%;
  border-left: 1px solid var(--stone-dark);
  border-right: 3px solid var(--stone-dark);
}
.pillar-left::before, .pillar-right::before {
  content: '';
  position: absolute;
  top: -8px; left: -8px; right: -8px;
  height: 16px;
  border: 1px solid var(--stone-dark);
}
.pillar-left::after, .pillar-right::after {
  content: '';
  position: absolute;
  bottom: 0; left: -12px; right: -12px;
  height: 20px;
  border-top: 2px solid var(--stone-dark);
  background: linear-gradient(to bottom, rgba(74, 124, 89, 0.1), transparent);
}

.vine-accent {
  position: absolute;
  font-size: 1.2rem;
  color: var(--moss);
  opacity: 0.35;
  writing-mode: vertical-rl;
  letter-spacing: 0.5em;
  font-family: serif;
}
.vine-accent.left { left: 6.5%; top: 25%; }
.vine-accent.right { right: 6.5%; top: 30%; }

/* ─── OCCULT SIGIL ─── */
.sigil-container {
  position: relative;
  width: clamp(120px, 18vw, 180px);
  height: clamp(120px, 18vw, 180px);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sigil-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(196, 183, 153, 0.2);
  border-radius: 50%;
  animation: ringRotate 60s linear infinite;
}

.sigil-ring::before {
  content: '◆ ▽ ◇ △ ◆ ▽ ◇ △ ◆ ▽ ◇ △';
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.5rem;
  color: var(--glow);
  opacity: 0.4;
  letter-spacing: 0.3em;
  white-space: nowrap;
}

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

.sigil-ring-inner {
  position: absolute;
  width: 75%;
  height: 75%;
  border: 1px solid rgba(123, 104, 238, 0.2);
  border-radius: 50%;
  animation: ringRotate 45s linear infinite reverse;
}

.sigil-triangle {
  position: absolute;
  width: 120px;
  height: 104px;
}

.sigil-triangle::before {
  content: '';
  position: absolute;
  width: 0; height: 0;
  border-left: 60px solid transparent;
  border-right: 60px solid transparent;
  border-bottom: 104px solid rgba(0, 229, 255, 0.06);
}

.sigil-triangle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 0; height: 0;
  border-left: 58px solid transparent;
  border-right: 58px solid transparent;
  border-bottom: 100px solid var(--sky-deep);
}

.sigil-triangle-inv {
  position: absolute;
  width: 120px;
  height: 104px;
  transform: rotate(180deg);
}

.sigil-triangle-inv::before {
  content: '';
  position: absolute;
  width: 0; height: 0;
  border-left: 60px solid transparent;
  border-right: 60px solid transparent;
  border-bottom: 104px solid rgba(123, 104, 238, 0.06);
}

.sigil-triangle-inv::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 0; height: 0;
  border-left: 58px solid transparent;
  border-right: 58px solid transparent;
  border-bottom: 100px solid var(--sky-deep);
}

.sigil-eye {
  position: relative;
  z-index: 2;
  font-size: 3rem;
  animation: sigilPulse 4s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.4)) drop-shadow(0 0 50px rgba(123, 104, 238, 0.3));
}

@keyframes sigilPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.4)) drop-shadow(0 0 50px rgba(123, 104, 238, 0.3)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 30px rgba(0, 229, 255, 0.6)) drop-shadow(0 0 70px rgba(123, 104, 238, 0.4)); }
}

.sigil-script {
  position: absolute;
  width: 88%;
  height: 88%;
  animation: ringRotate 90s linear infinite;
}

.sigil-script span {
  position: absolute;
  font-size: 0.65rem;
  color: var(--stone-dark);
  opacity: 0.4;
  font-family: serif;
}

.cardinal {
  position: absolute;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  color: var(--glow-warm);
  opacity: 0.35;
  letter-spacing: 0.2em;
}
.cardinal.n { top: -25px; left: 50%; transform: translateX(-50%); }
.cardinal.s { bottom: -25px; left: 50%; transform: translateX(-50%); }
.cardinal.e { right: -30px; top: 50%; transform: translateY(-50%); }
.cardinal.w { left: -30px; top: 50%; transform: translateY(-50%); }

.sigil-rays {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: sigilFloat 8s ease-in-out infinite;
}

.sigil-rays::before,
.sigil-rays::after {
  content: '';
  position: absolute;
  background: rgba(0, 229, 255, 0.08);
}

.sigil-rays::before {
  top: 0; bottom: 0; left: 50%;
  width: 1px;
}

.sigil-rays::after {
  left: 0; right: 0; top: 50%;
  height: 1px;
}

@keyframes sigilFloat {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(2deg); }
}

h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 6vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--parchment);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 40px rgba(0, 229, 255, 0.15), 0 2px 4px rgba(0,0,0,0.5);
}

.subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.6rem, 1vw, 0.85rem);
  font-weight: 300;
  letter-spacing: 0.5em;
  color: var(--glow);
  text-transform: uppercase;
  opacity: 0.7;
}

.epigraph {
  margin-top: 1.5rem;
  font-style: italic;
  color: var(--stone-dark);
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  max-width: min(500px, 90vw);
}

.scroll-hint {
  position: absolute;
  bottom: 3rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--stone-dark);
  animation: fadeInOut 3s ease-in-out infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.6; }
}

/* ─── SHOOTING STARS ─── */
.shooting-star {
  position: fixed;
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, rgba(240, 232, 216, 0.8), transparent);
  z-index: 0;
  opacity: 0;
  animation: shoot linear infinite;
}
.shooting-star:nth-child(1) { top: 15%; left: -100px; animation-duration: 2s; animation-delay: 4s; }
.shooting-star:nth-child(2) { top: 35%; left: -100px; animation-duration: 1.5s; animation-delay: 9s; }
.shooting-star:nth-child(3) { top: 8%; left: -100px; animation-duration: 1.8s; animation-delay: 15s; }

@keyframes shoot {
  0% { transform: translateX(0) rotate(-15deg); opacity: 0; }
  5% { opacity: 1; }
  20% { opacity: 1; }
  30% { opacity: 0; }
  100% { transform: translateX(calc(100vw + 200px)) rotate(-15deg); opacity: 0; }
}

/* ─── MAIN CONTENT ─── */
main {
  position: relative;
  z-index: 1;
  max-width: min(800px, 92vw);
  margin: 0 auto;
  padding: 0 clamp(0.75rem, 3vw, 2rem) clamp(5rem, 8vw, 7rem);
}

/* Section divider */
.divider {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: clamp(2.5rem, 5vw, 5rem) 0;
  color: var(--stone-dark);
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--stone-dark), transparent);
}
.divider span {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}
.divider .leaf {
  color: var(--moss);
  font-size: 0.9rem;
  opacity: 0.5;
}

/* ─── INTRO ─── */
.intro {
  text-align: center;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.intro p {
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  color: var(--stone);
  max-width: min(600px, 90vw);
  margin: 0 auto;
}

/* ─── EXPLORE GRID ─── */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 45%), 1fr));
  gap: clamp(0.25rem, 0.5vw, 0.4rem);
  max-width: min(700px, 95vw);
  margin: 2.5rem auto 2rem;
  padding: 0 clamp(0.5rem, 1vw, 1rem);
}

.explore-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: clamp(0.8rem, 1.5vw, 1.2rem) 0.8rem;
  background: rgba(26, 18, 10, 0.35);
  border: 1px solid rgba(138, 126, 107, 0.08);
  text-decoration: none;
  transition: all 0.3s ease;
}

.explore-card:hover {
  border-color: rgba(0, 229, 255, 0.3);
  background: rgba(0, 229, 255, 0.04);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.05);
}

.explore-icon {
  font-family: serif;
  font-size: 1.1rem;
  color: var(--glow-warm);
  opacity: 0.4;
  line-height: 1;
  transition: opacity 0.3s;
}

.explore-card:hover .explore-icon {
  opacity: 0.8;
}

.explore-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.6rem, 0.8vw, 0.7rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
  transition: color 0.3s;
}

.explore-card:hover .explore-title {
  color: var(--parchment);
}

/* Explore sections */
.explore-section {
  max-width: min(750px, 95vw);
  margin: 2.5rem auto 0;
  padding: 0 clamp(0.5rem, 1vw, 1rem);
}

.explore-heading {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  font-weight: 400;
  color: rgba(200, 180, 150, 0.35);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin: 0 0 0.3rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(138, 126, 107, 0.06);
}

.explore-section .explore-desc {
  display: block;
  font-family: 'EB Garamond', serif;
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  color: rgba(200, 180, 150, 0.3);
  font-style: italic;
  margin: 0 0 0.8rem 0;
}

.explore-section .explore-grid {
  margin: 0.5rem auto 0;
  padding: 0;
}

.explore-sub {
  font-family: 'EB Garamond', serif;
  font-size: clamp(0.55rem, 1.2vw, 0.65rem);
  color: rgba(200, 180, 150, 0.25);
  text-align: center;
  line-height: 1.4;
  transition: color 0.3s;
}

.explore-card:hover .explore-sub {
  color: rgba(200, 180, 150, 0.5);
}

.intro-hook {
  color: rgba(200, 180, 150, 0.35);
  font-size: clamp(0.75rem, 1.6vw, 0.85rem);
  font-family: 'EB Garamond', serif;
  font-style: italic;
  letter-spacing: 0.02em;
  margin-top: 0.8rem;
  line-height: 1.7;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.explore-desc {
  display: none;
}

.entry-compact p {
  margin: 0.5rem 0;
}

/* ─── ENTRY CARDS ─── */
.entry {
  background: linear-gradient(135deg, rgba(26, 18, 10, 0.85), rgba(15, 20, 15, 0.75));
  border: 1px solid rgba(138, 126, 107, 0.15);
  border-left: 3px solid var(--moss);
  padding: clamp(1.2rem, 3vw, 2.5rem);
  margin-bottom: clamp(1.5rem, 3vw, 3rem);
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.entry::before {
  content: '⌿';
  position: absolute;
  top: -12px;
  right: 20px;
  color: var(--moss-light);
  font-size: 1.2rem;
  opacity: 0.25;
}

.entry:hover {
  border-color: rgba(74, 124, 89, 0.4);
  box-shadow: 0 0 40px rgba(74, 124, 89, 0.06), 0 0 80px rgba(0, 229, 255, 0.03);
}

.entry-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--glow-warm);
  letter-spacing: 0.2em;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.entry h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 400;
  color: var(--parchment);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.entry p {
  margin-bottom: 1rem;
  color: var(--stone);
}

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

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  color: var(--glow);
  background: rgba(0, 229, 255, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 2px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
}

blockquote {
  border-left: 2px solid var(--oracle);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--parchment);
  opacity: 0.85;
}

.tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 0.3em 0.8em;
  border: 1px solid var(--stone-dark);
  color: var(--stone-dark);
  text-transform: uppercase;
}

.tag.nature {
  border-color: var(--moss);
  color: var(--moss-light);
  opacity: 0.7;
}

.tag.glow {
  border-color: var(--glow);
  color: var(--glow);
  opacity: 0.6;
}

.tag.warm {
  border-color: var(--glow-warm);
  color: var(--glow-warm);
  opacity: 0.7;
}

/* ─── STACK ITEMS ─── */
.stack-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.stack-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--glow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-width: clamp(80px, 12vw, 120px);
  opacity: 0.7;
  flex-shrink: 0;
}

.stack-value {
  color: var(--stone);
  font-size: 0.95rem;
}

/* ─── PAGE HEADER (non-hero pages) ─── */
.page-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(5rem, 10vw, 8rem) clamp(1rem, 3vw, 2rem) clamp(2rem, 5vw, 4rem);
}

.page-header h1 {
  font-size: clamp(1.6rem, 5vw, 3.5rem);
  margin-bottom: 0.5rem;
}

.page-header .subtitle {
  font-size: clamp(0.55rem, 0.8vw, 0.75rem);
}

/* ─── CHRONICLES LINK ─── */
/* ─── TIMELINE ─── */
.timeline {
  max-width: min(640px, 95vw);
  margin: 0 auto;
  padding: 1rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-entry {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding: clamp(0.6rem, 1.5vw, 1.2rem) clamp(0.8rem, 2vw, 1.5rem);
  text-decoration: none;
  color: inherit;
  border-left: 1px solid rgba(0, 229, 255, 0.1);
  margin-left: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.timeline-entry:hover {
  background: rgba(0, 229, 255, 0.03);
  border-left-color: rgba(0, 229, 255, 0.3);
}

.timeline-marker {
  width: 12px;
  height: 12px;
  min-width: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 229, 255, 0.3);
  background: var(--bg);
  margin-top: 4px;
  margin-left: -22px;
  position: relative;
  z-index: 1;
}

.timeline-marker.active {
  background: rgba(0, 229, 255, 0.4);
  border-color: var(--glow);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.timeline-day {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  color: var(--glow);
  letter-spacing: 0.08em;
}

.timeline-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: rgba(232, 168, 124, 0.5);
  letter-spacing: 0.05em;
}

.timeline-summary {
  font-family: 'EB Garamond', serif;
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  color: rgba(210, 200, 180, 0.6);
  line-height: 1.4;
  margin-top: 0.2rem;
}

.timeline-entry:hover .timeline-day {
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.chronicles-link {
  text-align: center;
  padding: 3rem 0 1rem;
}

.chronicles-link a {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--glow);
  text-decoration: none;
  letter-spacing: 0.1em;
  padding: 0.8rem 2rem;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.chronicles-link a:hover {
  background: rgba(0, 229, 255, 0.05);
  border-color: rgba(0, 229, 255, 0.4);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

/* ─── FOOTER ─── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem);
  border-top: 1px solid rgba(74, 124, 89, 0.15);
}

footer p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--stone-dark);
  letter-spacing: 0.3em;
}

footer .roots {
  color: var(--moss);
  opacity: 0.3;
  font-size: 1rem;
  margin-bottom: 1rem;
  letter-spacing: 0.3em;
  cursor: default;
  padding: 0.5rem 1rem;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

footer .donate-link {
  display: inline-block;
  margin-top: 1.2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--stone-dark);
  text-decoration: none;
  padding: 0.4rem 1.2rem;
  border: 1px solid rgba(138, 126, 107, 0.2);
  border-radius: 2px;
  transition: all 0.3s ease;
}

footer .donate-link:hover {
  color: var(--amber);
  border-color: rgba(255, 191, 0, 0.4);
  box-shadow: 0 0 12px rgba(255, 191, 0, 0.1);
}

/* ─── MUSIC PLAYER ─── */
.music-player {
  position: fixed;
  bottom: clamp(0.8rem, 2vw, 2rem);
  right: clamp(0.8rem, 2vw, 2rem);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(26, 18, 10, 0.9);
  border: 1px solid rgba(138, 126, 107, 0.25);
  padding: 0.6rem 1rem;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--stone-dark);
  transition: border-color 0.3s;
}

.music-player:hover {
  border-color: rgba(74, 124, 89, 0.4);
}

.music-player.playing {
  border-color: var(--moss);
}

.music-player.playing .player-status {
  color: var(--moss-light);
}

.music-btn {
  background: none;
  border: 1px solid var(--stone-dark);
  color: var(--stone);
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.music-btn:hover {
  border-color: var(--glow);
  color: var(--glow);
}

.player-track {
  color: var(--parchment);
  max-width: clamp(80px, 15vw, 160px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}

.player-status {
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone-dark);
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--stone-dark) 0%, rgba(0, 229, 255, 0.15) 100%);
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.volume-slider:hover {
  height: 4px;
  background: linear-gradient(90deg, var(--stone-dark) 0%, rgba(0, 229, 255, 0.3) 100%);
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--glow);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
  transition: all 0.2s;
}

.volume-slider:hover::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--glow);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
  transition: all 0.2s;
}

.volume-slider:hover::-moz-range-thumb {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

.bg-oscilloscope {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
}

/* ─── MOBILE NAV (hamburger) — only breakpoint we truly need ─── */
@media (max-width: 600px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0 0.5rem;
  }
  .nav-links.open {
    display: flex;
  }
  .site-nav {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
  }
  .nav-drop-menu {
    position: static;
    transform: none;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    box-shadow: none;
    padding: 0.3rem 0 0.3rem 1rem;
    min-width: auto;
    border-left: 1px solid rgba(0, 229, 255, 0.15);
    margin-left: 0.5rem;
  }
  .nav-drop-menu a {
    padding: 0.4rem 0.8rem;
  }
  .pillar-left, .pillar-right, .vine-accent { display: none; }

  /* Music player: full-width bottom bar on small screens */
  .music-player {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.4rem;
    padding: 0.35rem 0.6rem;
    gap: 0.4rem;
    font-size: 0.6rem;
    justify-content: center;
  }
  .music-btn {
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
  }
  .player-track {
    max-width: 90px;
    font-size: 0.55rem;
  }
  .player-status {
    font-size: 0.45rem;
  }
  .volume-slider {
    width: 35px;
  }
}

/* ─── LIVE ROOM ─── */
.live-join {
  max-width: min(600px, 92vw);
  margin: 0 auto;
}

.live-join-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  align-items: center;
}

.live-input,
.gb-input {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--parchment);
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid rgba(0, 229, 255, 0.2);
  padding: 0.7rem 1.2rem;
  width: 100%;
  max-width: min(300px, 90vw);
  letter-spacing: 0.05em;
  outline: none;
  transition: border-color 0.3s;
}

.live-input:focus,
.gb-input:focus,
.gb-textarea:focus {
  border-color: var(--glow);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.1);
}

.live-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--glow);
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 0.7rem 2rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: all 0.3s;
}

.live-btn:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.5);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.live-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--stone-dark);
  letter-spacing: 0.1em;
  margin-top: 1rem;
}

/* ─── Signal Path Config Panel ─── */
.live-signal-config {
  width: 100%;
  margin: 0.8rem 0 0.6rem;
  padding: 0.8rem;
  background: rgba(10, 8, 5, 0.5);
  border: 1px solid rgba(138, 126, 107, 0.06);
  position: relative;
}
.live-signal-config::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.08), transparent);
}
.live-signal-header {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: rgba(0, 229, 255, 0.25);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  text-align: left;
}

/* ─── Instrument Mode / Audio Input ─── */
.live-input-select-wrap {
  display: flex; gap: 0.4rem; align-items: center; width: 100%;
  margin: 0.4rem 0;
}
.live-input-select {
  flex: 1;
  background: rgba(10, 8, 5, 0.95);
  border: 1px solid rgba(138, 126, 107, 0.12);
  color: rgba(200, 180, 150, 0.7);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  padding: 0.45rem 0.6rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(138,126,107,0.3)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 1.8rem;
}
.live-input-select:focus {
  border-color: rgba(0, 229, 255, 0.25);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.04);
  outline: none;
}
.live-input-select option {
  background: #0a0806;
  color: rgba(200, 180, 150, 0.8);
}

/* Instrument Mode Toggle */
.live-instrument-toggle {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  cursor: pointer; padding: 0.6rem 0; width: 100%;
  border-top: 1px solid rgba(138, 126, 107, 0.06);
  margin-top: 0.3rem;
}
.live-instrument-toggle input { display: none; }
.live-toggle-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(200, 180, 150, 0.4);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(138, 126, 107, 0.1);
  background: rgba(10, 8, 5, 0.6);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}
.live-toggle-label::before {
  content: '';
  position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.04), transparent);
  transition: left 0.6s ease;
}
.live-instrument-toggle input:checked ~ .live-toggle-label {
  color: rgba(0, 229, 255, 0.8);
  border-color: rgba(0, 229, 255, 0.25);
  background: rgba(0, 229, 255, 0.03);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.05), inset 0 0 15px rgba(0, 229, 255, 0.02);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.15);
}
.live-instrument-toggle input:checked ~ .live-toggle-label::before {
  left: 100%;
}
.live-toggle-hint {
  font-family: 'EB Garamond', serif;
  font-size: 0.65rem;
  font-style: italic;
  color: rgba(200, 180, 150, 0.2);
  flex-basis: 100%;
  padding-left: 0.2rem;
  transition: color 0.3s;
}
.live-instrument-toggle input:checked ~ .live-toggle-hint {
  color: rgba(0, 229, 255, 0.2);
}

/* Input Level Meter */
.live-input-meter-wrap {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.3rem 0;
}
.live-input-meter-bar {
  flex: 1; height: 4px;
  background: rgba(10, 8, 5, 0.9);
  border: 1px solid rgba(138, 126, 107, 0.08);
  overflow: hidden;
  position: relative;
}
.live-input-meter-bar::after {
  content: '';
  position: absolute; top: 0; right: 15%; width: 1px; height: 100%;
  background: rgba(200, 120, 40, 0.15);
}
.live-input-meter-level {
  height: 100%; width: 0%;
  background: linear-gradient(90deg,
    rgba(74, 124, 89, 0.5) 0%,
    rgba(0, 229, 255, 0.6) 60%,
    rgba(0, 229, 255, 0.8) 100%
  );
  transition: width 0.05s linear;
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.15);
}
.live-input-meter-level.hot {
  background: linear-gradient(90deg,
    rgba(200, 160, 40, 0.6) 0%,
    rgba(200, 60, 30, 0.8) 80%,
    rgba(220, 40, 40, 0.9) 100%
  );
  box-shadow: 0 0 8px rgba(200, 40, 40, 0.2);
}
.live-input-meter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: rgba(200, 180, 150, 0.3);
  min-width: 42px;
  text-align: right;
  letter-spacing: 0.05em;
}

/* ─── Per-peer volume slider ─── */
.live-tile-volume {
  position: absolute; bottom: 22px; left: 6px; right: 6px;
  display: flex; align-items: center; gap: 0.3rem;
  opacity: 0; transition: opacity 0.3s ease;
  z-index: 2;
  background: linear-gradient(transparent, rgba(5, 2, 8, 0.7));
  padding: 0.3rem 0.2rem 0.15rem;
}
.live-tile:hover .live-tile-volume { opacity: 1; }
.live-tile-volume input[type=range] {
  flex: 1; height: 2px;
  -webkit-appearance: none; appearance: none;
  background: rgba(200, 180, 150, 0.12);
  outline: none; cursor: pointer;
  border-radius: 1px;
}
.live-tile-volume input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.6);
  border: 1px solid rgba(0, 229, 255, 0.3);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.2);
  transition: background 0.2s;
}
.live-tile-volume input[type=range]::-webkit-slider-thumb:hover {
  background: rgba(0, 229, 255, 0.9);
}
.live-tile-volume input[type=range]::-moz-range-thumb {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.6);
  border: 1px solid rgba(0, 229, 255, 0.3);
  cursor: pointer;
}
.live-tile-volume span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.45rem;
  color: rgba(200, 180, 150, 0.3);
  letter-spacing: 0.05em;
}

.live-room {
  max-width: min(1100px, 96vw);
  margin: 0 auto;
}

.live-controls {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1vw, 0.75rem);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.live-ctrl-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.55rem, 0.8vw, 0.7rem);
  color: var(--stone);
  background: rgba(26, 18, 10, 0.8);
  border: 1px solid rgba(138, 126, 107, 0.25);
  padding: clamp(0.35rem, 0.6vw, 0.5rem) clamp(0.6rem, 1.2vw, 1rem);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.2s;
}

.live-ctrl-btn:hover {
  border-color: var(--glow);
  color: var(--glow);
}

.live-ctrl-btn.active {
  border-color: var(--glow-warm);
  color: var(--glow-warm);
}

.live-ctrl-leave {
  border-color: rgba(180, 60, 60, 0.4);
  color: rgba(180, 60, 60, 0.8);
}

.live-ctrl-leave:hover {
  border-color: rgba(220, 60, 60, 0.6);
  color: rgba(220, 60, 60, 1);
}

.live-peer-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--moss-light);
  letter-spacing: 0.1em;
  margin-left: auto;
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1.5rem;
}

.live-tile {
  position: relative;
  background: rgba(26, 18, 10, 0.7);
  border: 1px solid rgba(0, 229, 255, 0.12);
  aspect-ratio: 4/3;
  overflow: hidden;
}

.live-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-tile-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.4rem 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--parchment);
  background: linear-gradient(transparent, rgba(10, 14, 26, 0.85));
  letter-spacing: 0.1em;
}

/* ─── GUESTBOOK ─── */
.gb-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gb-input {
  max-width: min(260px, 90vw);
}

.gb-textarea {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1rem;
  color: var(--parchment);
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid rgba(0, 229, 255, 0.2);
  padding: 0.8rem 1.2rem;
  width: 100%;
  resize: vertical;
  min-height: 80px;
  outline: none;
  line-height: 1.6;
  transition: border-color 0.3s;
}

.gb-form-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gb-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.gb-messages {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gb-entry {
  border-left-color: var(--oracle);
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1.2rem, 2.5vw, 2rem);
}

.gb-entry::before {
  content: '𒁹';
}

.gb-entry-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.gb-author {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--glow);
  letter-spacing: 0.05em;
}

.gb-loading,
.gb-empty {
  text-align: center;
  font-style: italic;
  color: var(--stone-dark);
  padding: 3rem 0;
}

/* ─── GUESTBOOK WIDGET (Homepage) ─── */
.gb-widget {
  max-width: min(480px, 95vw);
  margin: 0 auto 2rem;
  background: rgba(18, 14, 10, 0.6);
  border: 1px solid rgba(0, 229, 255, 0.08);
  border-radius: 4px;
  padding: clamp(0.8rem, 1.5vw, 1.2rem);
}

.gb-widget-form {
  margin-bottom: 1rem;
}

.gb-widget-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.gb-widget-msg {
  flex: 1;
}

.gb-widget-btn {
  padding: 0.5rem 1rem;
  min-width: auto;
  font-size: 1.1rem;
}

.gb-widget-messages {
  max-height: 240px;
  overflow-y: auto;
  border-top: 1px solid rgba(0, 229, 255, 0.06);
  padding-top: 0.8rem;
}

.gb-widget-msg-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 229, 255, 0.04);
}

.gb-widget-msg-item:last-child {
  border-bottom: none;
}

.gb-widget-author {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: var(--glow);
  letter-spacing: 0.05em;
}

.gb-widget-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(232, 168, 124, 0.4);
  margin-left: 0.5rem;
}

.gb-widget-msg-item p {
  font-family: 'EB Garamond', serif;
  font-size: clamp(0.82rem, 1vw, 0.9rem);
  color: rgba(210, 200, 180, 0.7);
  margin: 0.2rem 0 0;
  line-height: 1.3;
}

.gb-widget-link {
  display: block;
  text-align: center;
  margin-top: 0.8rem;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: rgba(0, 229, 255, 0.5);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.3s;
}

.gb-widget-link:hover {
  color: var(--glow);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.gb-widget-messages::-webkit-scrollbar {
  width: 4px;
}

.gb-widget-messages::-webkit-scrollbar-track {
  background: transparent;
}

.gb-widget-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.15);
  border-radius: 2px;
}

/* ─── FLOATING CHAT ORB + PANEL (Byzantine Occult) ─── */
.chat-orb {
  position: fixed;
  bottom: clamp(0.8rem, 2vw, 2rem);
  left: clamp(0.8rem, 2vw, 2rem);
  z-index: 998;
  width: clamp(44px, 5vw, 56px);
  height: clamp(44px, 5vw, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(18, 14, 10, 0.85);
  border: 1px solid rgba(123, 104, 238, 0.25);
  border-radius: 50%;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: all 0.4s ease;
  animation: orb-breathe 4s ease-in-out infinite;
}

@keyframes orb-breathe {
  0%, 100% { box-shadow: 0 0 12px rgba(123, 104, 238, 0.1), 0 0 4px rgba(0, 229, 255, 0.05); }
  50% { box-shadow: 0 0 20px rgba(123, 104, 238, 0.2), 0 0 8px rgba(0, 229, 255, 0.1); }
}

.chat-orb:hover {
  border-color: rgba(123, 104, 238, 0.5);
  transform: scale(1.08);
}

.chat-orb.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
}

.chat-orb.has-new {
  border-color: rgba(0, 229, 255, 0.6);
  animation: orb-pulse 1.5s ease-in-out infinite;
}

@keyframes orb-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 229, 255, 0.2); }
  50% { box-shadow: 0 0 24px rgba(0, 229, 255, 0.5), 0 0 40px rgba(123, 104, 238, 0.2); }
}

.chat-orb svg {
  position: absolute;
}

.chat-orb-label {
  font-size: 1.1rem;
  color: rgba(0, 229, 255, 0.6);
  z-index: 1;
}

/* ─── CHAT PANEL ─── */
.chat-float {
  position: fixed;
  bottom: clamp(0.8rem, 2vw, 2rem);
  left: clamp(0.8rem, 2vw, 2rem);
  z-index: 999;
  width: min(300px, 90vw);
  height: min(400px, 70vh);
  display: flex;
  flex-direction: column;
  background: rgba(14, 10, 8, 0.94);
  border: 1px solid rgba(123, 104, 238, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(123, 104, 238, 0.05);
}

.chat-float.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header — ornamental top bar */
.chat-float-header {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(123, 104, 238, 0.15);
  background: linear-gradient(135deg, rgba(123, 104, 238, 0.06), rgba(0, 229, 255, 0.03));
}

.chat-float-title {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: rgba(123, 104, 238, 0.7);
  letter-spacing: 0.15em;
  flex: 1;
}

.chat-float-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: var(--stone-dark);
  margin-right: 0.5rem;
}

.chat-float-close {
  background: none;
  border: none;
  color: var(--stone-dark);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem;
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
}

.chat-float-close:hover {
  opacity: 1;
  color: rgba(180, 60, 60, 0.8);
}

/* Messages area */
.chat-float-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chat-float-messages::-webkit-scrollbar { width: 3px; }
.chat-float-messages::-webkit-scrollbar-track { background: transparent; }
.chat-float-messages::-webkit-scrollbar-thumb { background: rgba(123, 104, 238, 0.15); border-radius: 2px; }

.chat-float-messages .gb-widget-msg-item {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(123, 104, 238, 0.06);
  border-left: 2px solid rgba(123, 104, 238, 0.1);
  padding-left: 0.6rem;
}

.chat-float-messages .gb-widget-msg-item:hover {
  border-left-color: rgba(0, 229, 255, 0.3);
  background: rgba(123, 104, 238, 0.03);
}

.chat-float-messages .gb-widget-author {
  font-size: 0.7rem;
}

.chat-float-messages .gb-widget-time {
  font-size: 0.55rem;
}

.chat-float-messages .gb-widget-msg-item p {
  font-size: 0.8rem;
  margin: 0.15rem 0 0;
}

/* Form area */
.chat-float-form {
  padding: 0.5rem 0.6rem;
  border-top: 1px solid rgba(123, 104, 238, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chat-float-input {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--parchment);
  background: rgba(10, 14, 26, 0.5);
  border: 1px solid rgba(123, 104, 238, 0.15);
  padding: 0.45rem 0.6rem;
  width: 100%;
  outline: none;
  transition: border-color 0.3s;
  letter-spacing: 0.03em;
}

.chat-float-input:focus {
  border-color: rgba(123, 104, 238, 0.4);
  box-shadow: 0 0 8px rgba(123, 104, 238, 0.08);
}

.chat-float-send-row {
  display: flex;
  gap: 0.35rem;
}

.chat-float-msg {
  flex: 1;
}

.chat-float-send {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: rgba(123, 104, 238, 0.6);
  background: rgba(123, 104, 238, 0.06);
  border: 1px solid rgba(123, 104, 238, 0.2);
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: all 0.3s;
}

.chat-float-send:hover {
  color: rgba(123, 104, 238, 0.9);
  border-color: rgba(123, 104, 238, 0.5);
  background: rgba(123, 104, 238, 0.1);
  box-shadow: 0 0 10px rgba(123, 104, 238, 0.15);
}

.chat-float-form .gb-status {
  font-size: 0.6rem;
  min-height: 0.8rem;
}

.chat-float-fulllink {
  display: block;
  text-align: center;
  padding: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: rgba(123, 104, 238, 0.35);
  text-decoration: none;
  letter-spacing: 0.1em;
  border-top: 1px solid rgba(123, 104, 238, 0.06);
  transition: color 0.3s;
}

.chat-float-fulllink:hover {
  color: rgba(123, 104, 238, 0.7);
}

/* Mobile: full width at bottom */
@media (max-width: 600px) {
  .chat-float {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 50vh;
    height: 50dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
}

/* ─── CHAT ORB LIVE INDICATOR ─── */
.chat-orb-live-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(74, 222, 128, 0.4); }
  50% { box-shadow: 0 0 10px rgba(74, 222, 128, 0.8), 0 0 20px rgba(74, 222, 128, 0.3); }
}

.chat-orb-live-text {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.45rem;
  color: #4ade80;
  letter-spacing: 0.2em;
  text-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
  white-space: nowrap;
}

/* ─── AI NEWS FEED ORB + PANEL ─── */
.news-orb {
  position: fixed;
  bottom: clamp(4rem, 7vw, 6rem);
  right: clamp(0.8rem, 2vw, 2rem);
  z-index: 998;
  width: clamp(44px, 5vw, 56px);
  height: clamp(44px, 5vw, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(18, 14, 10, 0.85);
  border: 1px solid rgba(232, 168, 124, 0.25);
  border-radius: 50%;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: all 0.4s ease;
  animation: news-breathe 4s ease-in-out infinite;
}

@keyframes news-breathe {
  0%, 100% { box-shadow: 0 0 12px rgba(232, 168, 124, 0.1), 0 0 4px rgba(255, 180, 80, 0.05); }
  50% { box-shadow: 0 0 20px rgba(232, 168, 124, 0.2), 0 0 8px rgba(255, 180, 80, 0.1); }
}

.news-orb:hover {
  border-color: rgba(232, 168, 124, 0.5);
  transform: scale(1.08);
}

.news-orb.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
}

.news-orb svg { position: absolute; }

.news-orb-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: rgba(255, 180, 80, 0.6);
  letter-spacing: 0.15em;
  z-index: 1;
  margin-top: 32px;
  position: absolute;
}

/* News Panel */
.news-float {
  position: fixed;
  bottom: clamp(4rem, 7vw, 6rem);
  right: clamp(0.8rem, 2vw, 2rem);
  z-index: 999;
  width: min(320px, 90vw);
  max-height: min(480px, 70vh);
  display: flex;
  flex-direction: column;
  background: rgba(14, 10, 8, 0.94);
  border: 1px solid rgba(232, 168, 124, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(232, 168, 124, 0.05);
}

.news-float.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.news-float-header {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(232, 168, 124, 0.15);
  background: linear-gradient(135deg, rgba(232, 168, 124, 0.06), rgba(255, 180, 80, 0.03));
}

.news-float-title {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: rgba(232, 168, 124, 0.7);
  letter-spacing: 0.15em;
  flex: 1;
}

.news-float-close {
  background: none;
  border: none;
  color: var(--stone-dark);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem;
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
}

.news-float-close:hover {
  opacity: 1;
  color: rgba(180, 60, 60, 0.8);
}

.news-float-items {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.news-float-items::-webkit-scrollbar { width: 3px; }
.news-float-items::-webkit-scrollbar-track { background: transparent; }
.news-float-items::-webkit-scrollbar-thumb { background: rgba(232, 168, 124, 0.15); border-radius: 2px; }

.news-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(232, 168, 124, 0.06);
  border-left: 2px solid rgba(232, 168, 124, 0.1);
  padding-left: 0.6rem;
  text-decoration: none;
  transition: all 0.2s;
}

.news-item:hover {
  border-left-color: rgba(255, 180, 80, 0.4);
  background: rgba(232, 168, 124, 0.03);
}

.news-source {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: rgba(255, 180, 80, 0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.news-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.85rem;
  color: var(--parchment);
  line-height: 1.3;
}

.news-item:hover .news-title {
  color: rgba(255, 180, 80, 0.9);
  text-shadow: 0 0 8px rgba(232, 168, 124, 0.15);
}

.news-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: var(--stone-dark);
  letter-spacing: 0.05em;
}

.news-loading {
  text-align: center;
  font-style: italic;
  color: var(--stone-dark);
  padding: 2rem 0;
  font-size: 0.85rem;
}

.news-float-footer {
  padding: 0.4rem 0.8rem;
  border-top: 1px solid rgba(232, 168, 124, 0.08);
}

.news-float-updated {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: var(--stone-dark);
  letter-spacing: 0.1em;
}

@media (max-width: 600px) {
  .news-float {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 50vh;
    max-height: 50dvh;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
}

/* ─── MIDI BADGE ─── */
.midi-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: var(--stone-dark);
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(138, 126, 107, 0.15);
  background: rgba(10, 14, 26, 0.6);
  white-space: nowrap;
}
.midi-badge.connected {
  color: var(--moss-light);
  border-color: rgba(74, 124, 89, 0.4);
  box-shadow: 0 0 8px rgba(74, 124, 89, 0.15);
}

/* ─── PIANO KEYBOARD ─── */
.piano-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 450;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(10, 14, 26, 0.95);
  border-top: 1px solid rgba(0, 229, 255, 0.12);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 0.4rem 0.5rem 0.5rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.piano-container.minimized {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.piano-info {
  display: flex;
  gap: clamp(0.4rem, 1vw, 1rem);
  align-items: center;
  margin-bottom: 0.3rem;
}

.piano-info-item {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.45rem, 0.7vw, 0.6rem);
  color: var(--glow);
  letter-spacing: 0.1em;
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(0, 229, 255, 0.15);
  background: rgba(0, 229, 255, 0.04);
}

.piano-info-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: var(--glow-warm);
  letter-spacing: 0.05em;
}

.chord-display {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 2px;
  min-width: 120px;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.chord-display.active {
  opacity: 1;
}

.chord-root {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.75rem, 1.2vw, 0.95rem);
  font-weight: 700;
  color: var(--glow);
  letter-spacing: 0.05em;
}

.chord-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.55rem, 0.9vw, 0.7rem);
  color: var(--glow-warm);
  letter-spacing: 0.08em;
}

.piano-keys {
  display: flex;
  position: relative;
  height: clamp(60px, 10vw, 90px);
  max-width: 100%;
  overflow-x: auto;
}

.piano-key {
  position: relative;
  cursor: pointer;
  transition: background 0.08s, box-shadow 0.08s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.3rem;
  user-select: none;
  -webkit-user-select: none;
}

.piano-key.white {
  width: clamp(24px, 3.5vw, 36px);
  height: clamp(60px, 10vw, 90px);
  background: rgba(200, 195, 180, 0.12);
  border: 1px solid rgba(138, 126, 107, 0.2);
  border-radius: 0 0 3px 3px;
  margin-right: 1px;
  z-index: 1;
}

.piano-key.black {
  width: clamp(16px, 2.5vw, 24px);
  height: clamp(40px, 6.5vw, 58px);
  background: rgba(10, 14, 26, 0.9);
  border: 1px solid rgba(138, 126, 107, 0.25);
  border-radius: 0 0 2px 2px;
  margin-left: clamp(-9px, -1.3vw, -13px);
  margin-right: clamp(-9px, -1.3vw, -13px);
  z-index: 2;
}

.piano-key.white.active {
  background: rgba(0, 229, 255, 0.25);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.4), inset 0 0 10px rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.5);
}

.piano-key.black.active {
  background: rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.5), inset 0 0 8px rgba(0, 229, 255, 0.2);
  border-color: rgba(0, 229, 255, 0.6);
}

.piano-key:hover {
  border-color: rgba(0, 229, 255, 0.3);
}

.piano-key-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.45rem;
  color: var(--stone-dark);
  letter-spacing: 0.05em;
  pointer-events: none;
}

.piano-key.black .piano-key-label {
  color: rgba(138, 126, 107, 0.5);
  font-size: 0.4rem;
}

/* ─── LIVE ROOM MOBILE: controls wrap, peer count centers ─── */
@media (max-width: 600px) {
  .live-controls {
    justify-content: center;
  }
  .live-peer-count {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
}

/* ─── CHORD BUILDER (theory.html) ─── */
.chord-builder-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.interval-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 0.5rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.interval-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.7rem 0.5rem;
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid rgba(138, 126, 107, 0.2);
  color: var(--stone);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
}

.interval-btn:hover {
  border-color: var(--glow);
  color: var(--glow);
  background: rgba(0, 229, 255, 0.05);
}

.interval-btn.active {
  border-color: var(--glow);
  color: var(--glow);
  background: rgba(0, 229, 255, 0.15);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

.interval-btn[data-semitone="0"] {
  border-color: rgba(0, 229, 255, 0.4);
  color: var(--glow);
  background: rgba(0, 229, 255, 0.08);
}

.chord-builder-result {
  text-align: center;
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: rgba(0, 229, 255, 0.03);
  border: 1px solid rgba(0, 229, 255, 0.15);
}

.chord-builder-name {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--glow);
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.chord-builder-fullname {
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  color: var(--stone);
  font-style: italic;
}

.chord-builder-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
}

.theory-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 0.6rem 1.2rem;
  background: rgba(10, 14, 26, 0.8);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--glow);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.1em;
}

.theory-btn:hover {
  border-color: var(--glow);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
}

@media (max-width: 600px) {
  .interval-buttons {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.3rem;
  }
  .interval-btn {
    font-size: 0.65rem;
    padding: 0.5rem 0.3rem;
  }
}
