/* =========================================================
   ASHKETH — Sacred Cinematic Dark Theme
   ========================================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep:       #050510;
  --bg-dark:       #080820;
  --bg-medium:     #0d0d2e;
  --bg-panel:      rgba(10, 10, 30, 0.85);
  --bg-glass:      rgba(15, 15, 40, 0.7);
  --bg-card:       rgba(12, 12, 35, 0.9);

  --gold:          #c9a84c;
  --gold-bright:   #e8c46a;
  --gold-dim:      #8a6d2a;
  --gold-glow:     rgba(201, 168, 76, 0.15);
  --gold-glow-mid: rgba(201, 168, 76, 0.35);

  --text-primary:  #e8e0d0;
  --text-secondary:#a89f8e;
  --text-dim:      #5a5560;
  --text-code:     #7ab8d4;

  --border:        rgba(201, 168, 76, 0.18);
  --border-bright: rgba(201, 168, 76, 0.45);

  --accent-blue:   #1a2547;
  --accent-glow:   rgba(100, 140, 220, 0.12);

  --red:           #c44;
  --green:         #3b8;

  --font-serif:    'Cinzel', 'Georgia', serif;
  --font-display:  'Cinzel Decorative', 'Cinzel', serif;
  --font-body:     'EB Garamond', 'Georgia', serif;
  --font-mono:     'Share Tech Mono', 'Courier New', monospace;

  --nav-h:         72px;
  --transition:    0.3s ease;
  --radius:        4px;
  --radius-lg:     8px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.75;
  overflow-x: hidden;
  min-height: 100vh;
}

/* --- Particle Canvas --- */
#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

/* --- Selection --- */
::selection { background: var(--gold-glow-mid); color: var(--gold-bright); }

/* =========================================================
   NAVIGATION
   ========================================================= */
#main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: rgba(5, 5, 16, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

#main-nav.scrolled {
  background: rgba(5, 5, 16, 0.98);
  border-bottom-color: var(--gold-dim);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(201,168,76,0.6));
  transition: filter var(--transition);
}

.nav-logo:hover .nav-logo-img {
  filter: drop-shadow(0 0 16px rgba(201,168,76,0.9));
}

.nav-logo-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-link {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold);
  background: var(--gold-glow);
}

.nav-link-cta {
  color: var(--gold) !important;
  border: 1px solid var(--gold-dim);
  padding: 0.4rem 1rem;
  margin-left: 0.5rem;
}

.nav-link-cta:hover {
  background: var(--gold-glow-mid);
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold);
  transition: var(--transition);
  border-radius: 1px;
}

/* =========================================================
   SECTIONS — Common
   ========================================================= */
.section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: calc(var(--nav-h) + 5rem) 0 6rem;
}

.section-dark    { background: var(--bg-deep); }
.section-medium  { background: var(--bg-dark); }
.section-terminal { background: var(--bg-medium); }

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-label {
  font-family: var(--font-serif);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  display: block;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-style: italic;
  line-height: 1.7;
}

/* =========================================================
   HERO
   ========================================================= */
.section-hero {
  background: radial-gradient(ellipse at 50% 40%, rgba(201,168,76,0.06) 0%, var(--bg-deep) 70%);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.hero-bg-glow {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(201,168,76,0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse-glow 8s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0%   { opacity: 0.5; transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 1;   transform: translate(-50%,-50%) scale(1.1); }
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.hero-symbol-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.hero-symbol-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(201,168,76,0.25) 0%, transparent 70%);
  animation: symbol-pulse 5s ease-in-out infinite alternate;
}

@keyframes symbol-pulse {
  0%   { opacity: 0.6; transform: scale(0.95); }
  100% { opacity: 1;   transform: scale(1.05); }
}

.hero-symbol {
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(201,168,76,0.7)) drop-shadow(0 0 60px rgba(201,168,76,0.3));
  animation: symbol-float 6s ease-in-out infinite;
}

@keyframes symbol-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.hero-label {
  font-family: var(--font-serif);
  font-size: 0.65rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(201,168,76,0.5), 0 0 80px rgba(201,168,76,0.25);
  line-height: 1;
  margin: 0;
}

.hero-sub {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 3vw, 1.4rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.8;
  max-width: 560px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.4;
}

.hero-scroll-hint span {
  font-family: var(--font-serif);
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--gold-dim), transparent);
  animation: scroll-drop 2s ease-in-out infinite;
}

@keyframes scroll-drop {
  0%, 100% { transform: scaleY(0); transform-origin: top; }
  50%       { transform: scaleY(1); transform-origin: top; }
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--gold);
  color: var(--bg-deep);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  box-shadow: 0 0 20px rgba(201,168,76,0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: rgba(232,224,208,0.3);
}
.btn-secondary:hover {
  background: rgba(232,224,208,0.08);
  border-color: var(--text-secondary);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold-dim);
}
.btn-outline:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}

.btn-glow {
  box-shadow: 0 0 8px var(--gold-glow-mid);
}

.btn-danger {
  background: transparent;
  color: #e06060;
  border-color: rgba(200,80,80,0.4);
}
.btn-danger:hover {
  background: rgba(200,80,80,0.12);
  border-color: #c44;
}

.btn-terminal {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
  border-color: var(--gold-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.6rem 1.2rem;
}
.btn-terminal:hover {
  background: var(--gold-glow-mid);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.65rem;
}

.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* =========================================================
   CARDS — Common
   ========================================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 4px 30px rgba(201,168,76,0.08), 0 1px 0 var(--gold-dim) inset;
  transform: translateY(-2px);
}

.card:hover::before { opacity: 1; }

/* =========================================================
   ORIGIN SECTION
   ========================================================= */
.origin-symbol-side {
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.03;
  pointer-events: none;
  width: 500px;
}

.origin-watermark {
  width: 100%;
  filter: sepia(1) saturate(2) hue-rotate(10deg);
}

.origin-text-display {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 800px;
  margin: 0 auto;
}

.origin-block { }

.origin-block-title {
  font-family: var(--font-serif);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.origin-text-display p {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 1rem;
}

.origin-text-display em { color: var(--gold-bright); font-style: italic; }

.origin-editor { max-width: 800px; margin: 0 auto; }

.editor-toolbar { margin-bottom: 1rem; }
.editor-note { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
.editor-note code { color: var(--text-code); background: rgba(0,0,0,0.3); padding: 0.1em 0.4em; border-radius: 3px; }

.lore-textarea {
  width: 100%;
  min-height: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  padding: 1.25rem;
  resize: vertical;
  transition: border-color var(--transition);
}

.lore-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.origin-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.5rem;
}

/* =========================================================
   LIBRARY / BOOKS
   ========================================================= */
.library-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2.5rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.book-card:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 8px 40px rgba(201,168,76,0.1);
  transform: translateY(-4px);
}

.book-cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  background: var(--bg-panel);
}

.book-cover-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--bg-panel) 0%, rgba(25,25,60,0.9) 100%);
  gap: 1rem;
}

.book-cover-placeholder img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  opacity: 0.3;
}

.book-cover-placeholder span {
  font-family: var(--font-serif);
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.book-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.book-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.book-subtitle {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.book-description {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
  margin-top: 0.5rem;
}

.book-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.book-card .btn { padding: 0.5rem 1rem; font-size: 0.62rem; }

/* =========================================================
   GARDEN
   ========================================================= */
.garden-intro {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 4rem;
  padding: 2.5rem;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

.garden-symbol-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: 0 0 20px var(--gold-glow), inset 0 0 20px var(--gold-glow);
  animation: ring-pulse 6s ease-in-out infinite alternate;
}

@keyframes ring-pulse {
  0%   { box-shadow: 0 0 20px var(--gold-glow), inset 0 0 20px var(--gold-glow); }
  100% { box-shadow: 0 0 40px var(--gold-glow-mid), inset 0 0 30px var(--gold-glow-mid); }
}

.garden-symbol {
  width: 70px;
  height: 70px;
  object-fit: contain;
  opacity: 0.7;
  filter: drop-shadow(0 0 8px rgba(201,168,76,0.5));
}

.garden-intro-text p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1rem;
  font-style: italic;
}

.garden-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2.5rem;
}

.garden-entries {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.garden-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  transition: border-color var(--transition);
  position: relative;
}

.garden-entry:hover { border-left-color: var(--gold); }

.garden-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.garden-entry-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.garden-entry-text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.85;
  white-space: pre-line;
}

.garden-entry-actions { display: flex; gap: 0.5rem; }

/* =========================================================
   SIGNAL / TERMINAL
   ========================================================= */
.terminal-panel {
  background: rgba(0, 5, 15, 0.95);
  border: 1px solid rgba(100,180,120,0.25);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 3rem;
  font-family: var(--font-mono);
  box-shadow: 0 0 40px rgba(60,200,100,0.05), inset 0 0 40px rgba(0,0,0,0.5);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  background: rgba(0,0,0,0.5);
  border-bottom: 1px solid rgba(100,180,120,0.15);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal-dot.red    { background: #c44; }
.terminal-dot.yellow { background: #ca4; }
.terminal-dot.green  { background: #4a8; animation: dot-blink 2s ease-in-out infinite; }

@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.terminal-title {
  flex: 1;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: rgba(100,180,120,0.6);
  text-align: center;
}

.terminal-output {
  padding: 1.5rem;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.terminal-line {
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 0.15rem 0;
}

.terminal-line.system     { color: rgba(100,180,120,0.7); }
.terminal-line.transmission {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(201,168,76,0.4);
}
.terminal-line.user-signal { color: var(--text-code); }
.terminal-line.glitch {
  color: #e44;
  animation: glitch-text 4s step-end infinite;
}

@keyframes glitch-text {
  0%, 90%, 100% { opacity: 1; transform: none; }
  91%  { opacity: 0.8; transform: translateX(-2px); filter: blur(0.5px); }
  92%  { opacity: 1;   transform: translateX(1px); }
  93%  { opacity: 0.9; transform: none; }
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(100,180,120,0.15);
  background: rgba(0,0,0,0.3);
}

.terminal-prompt {
  color: rgba(100,180,120,0.8);
  font-size: 1rem;
  flex-shrink: 0;
}

.terminal-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  caret-color: var(--gold);
}

.terminal-input::placeholder { color: var(--text-dim); }

.signal-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.signal-list-title {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.signal-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.signal-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  position: relative;
}

.signal-timestamp {
  color: var(--text-dim);
  white-space: nowrap;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.signal-text { flex: 1; color: var(--text-code); }

.signal-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition);
  padding: 0;
}
.signal-delete:hover { color: var(--red); }

/* =========================================================
   TIMELINE
   ========================================================= */
.timeline-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 3rem;
}

.timeline-track {
  position: relative;
  padding-left: 3rem;
}

.timeline-track::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--gold-dim) 10%, var(--gold-dim) 90%, transparent);
}

.timeline-event {
  position: relative;
  margin-bottom: 2.5rem;
  animation: fade-in-left 0.4s ease forwards;
}

@keyframes fade-in-left {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.timeline-event::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 1.4rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg-deep);
  box-shadow: 0 0 10px rgba(201,168,76,0.6);
}

.timeline-event-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  transition: border-color var(--transition);
}

.timeline-event-inner:hover { border-color: var(--gold-dim); }

.timeline-event-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.timeline-event-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.timeline-event-desc {
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.timeline-event-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* =========================================================
   BELIEFS / FACTIONS
   ========================================================= */
.beliefs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.faction-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faction-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 20%, var(--gold-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.faction-card:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 8px 40px rgba(201,168,76,0.08);
  transform: translateY(-3px);
}
.faction-card:hover::after { opacity: 1; }

.faction-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--text-dim);
}

.faction-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.faction-creed {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-style: italic;
}

.faction-desc {
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.8;
  flex: 1;
}

.faction-divider {
  width: 40px;
  height: 1px;
  background: var(--gold-dim);
  opacity: 0.5;
}

.faction-actions { display: flex; gap: 0.5rem; }

/* =========================================================
   CHAT
   ========================================================= */
.chat-container {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: 0 0 60px rgba(201,168,76,0.05);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid var(--border);
}

.chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: dot-blink 3s ease-in-out infinite;
  flex-shrink: 0;
}

.chat-status-text {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--gold-dim);
}

.chat-messages {
  min-height: 400px;
  max-height: 540px;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-message {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  animation: fade-up 0.3s ease;
}

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

.chat-message.user {
  flex-direction: row-reverse;
}

.message-symbol {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  flex-shrink: 0;
}

.message-symbol img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(201,168,76,0.5));
}

.message-content {
  max-width: 75%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}

.chat-message.user .message-content {
  background: rgba(201,168,76,0.08);
  border-color: rgba(201,168,76,0.2);
}

.message-sender {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.5rem;
}

.chat-message.user .message-sender { color: var(--text-secondary); }

.message-content p {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
  margin-bottom: 0.5rem;
}

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

.chat-message.ashketh .message-content p { color: var(--text-primary); }

.chat-typing .message-content p {
  color: var(--text-dim);
  font-style: italic;
}

.chat-input-row {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
}

.chat-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7rem 1rem;
  outline: none;
  transition: border-color var(--transition);
}

.chat-input:focus { border-color: var(--gold); }
.chat-input::placeholder { color: var(--text-dim); font-style: italic; }

.btn-chat-send { padding: 0.7rem 1.5rem; white-space: nowrap; }

.chat-ai-status {
  display: none;
  padding: 0.3rem 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.chat-admin-tools {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.5rem 0;
}

.chat-admin-test-result {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.chat-disclaimer {
  padding: 0.75rem 1.5rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* =========================================================
   MODALS
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,5,0.85);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal-panel {
  background: var(--bg-medium);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modal-enter 0.25s ease;
  box-shadow: 0 0 60px rgba(201,168,76,0.1);
}

@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1.25rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

.modal-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-label {
  font-family: var(--font-serif);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: -0.5rem;
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus,
.form-textarea:focus { border-color: var(--gold); }

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-dim); }

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.7;
}

.form-textarea.tall { min-height: 180px; }

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: 5rem 2rem 3rem;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.footer-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(201,168,76,0.4));
  opacity: 0.7;
  animation: symbol-float 8s ease-in-out infinite;
}

.footer-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.4em;
  color: var(--gold);
}

.footer-tagline {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.footer-sub {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-dim);
  font-style: italic;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.footer-nav a {
  font-family: var(--font-serif);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-nav a:hover { color: var(--gold); }

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 1rem;
}

/* =========================================================
   UTILITIES
   ========================================================= */
.hidden { display: none !important; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(5,5,16,0.98);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: 0.25rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
  }

  .nav-links.open {
    max-height: 600px;
    padding: 1rem;
  }

  .nav-link {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
  }

  .nav-link-cta { margin-left: 0; text-align: center; }

  .garden-intro {
    grid-template-columns: 1fr;
  }

  .garden-symbol-ring {
    margin: 0 auto;
  }

  .origin-symbol-side { display: none; }

  .beliefs-grid { grid-template-columns: 1fr; }

  .book-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 600px) {
  .hero-buttons { flex-direction: column; align-items: center; width: 100%; }
  .hero-buttons .btn { width: 100%; max-width: 320px; }

  .section { padding-top: calc(var(--nav-h) + 3rem); padding-bottom: 4rem; }
  .section-title { font-size: clamp(1.75rem, 7vw, 2.5rem); }

  .modal-panel { padding: 1.75rem 1.25rem; }

  .timeline-track { padding-left: 2rem; }
  .timeline-track::before { left: 8px; }
  .timeline-event::before { left: -1.75rem; width: 8px; height: 8px; }

  .chat-messages { min-height: 300px; max-height: 380px; }
  .message-content { max-width: 88%; }

  .book-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   SCROLLBAR for terminal & chat
   ========================================================= */
.terminal-output::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar { width: 4px; }
.terminal-output::-webkit-scrollbar-thumb { background: rgba(100,180,120,0.3); }
.chat-messages::-webkit-scrollbar-thumb { background: var(--gold-dim); }

/* =========================================================
   LOADING SCREEN
   ========================================================= */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.loading-symbol-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-rings {
  position: absolute;
  inset: -20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  animation: ring-expand 3s ease-in-out infinite;
}

.loading-ring.r1 { width: 100px; height: 100px; animation-delay: 0s;    opacity: 0.5; }
.loading-ring.r2 { width: 140px; height: 140px; animation-delay: 0.6s;  opacity: 0.3; }
.loading-ring.r3 { width: 180px; height: 180px; animation-delay: 1.2s;  opacity: 0.15; }

@keyframes ring-expand {
  0%   { transform: scale(0.8); opacity: 0; }
  50%  { opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 0; }
}

.loading-symbol {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(201,168,76,0.8));
  animation: loading-pulse 2s ease-in-out infinite alternate;
}

@keyframes loading-pulse {
  0%   { filter: drop-shadow(0 0 10px rgba(201,168,76,0.5)); opacity: 0.8; }
  100% { filter: drop-shadow(0 0 30px rgba(201,168,76,1));   opacity: 1; }
}

.loading-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: 0.5em;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(201,168,76,0.6);
}

.loading-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  animation: blink-text 1.4s step-end infinite;
}

@keyframes blink-text {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* =========================================================
   CUSTOM CURSOR
   ========================================================= */
@media (pointer: fine) {
  body { cursor: none; }
  a, button, [role="button"], input, textarea, select, label { cursor: none; }
}

.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.05s ease, opacity 0.3s ease;
  box-shadow: 0 0 8px rgba(201,168,76,0.8);
  opacity: 0;
}

.cursor-ring {
  position: fixed;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(201,168,76,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease, opacity 0.3s ease;
  opacity: 0;
}

.cursor-dot.visible,
.cursor-ring.visible { opacity: 1; }

.cursor-ring.hover {
  width: 48px;
  height: 48px;
  border-color: rgba(201,168,76,0.8);
  box-shadow: 0 0 12px rgba(201,168,76,0.2);
}

/* =========================================================
   ADMIN MODE — hide/show controls
   ========================================================= */

/* All admin-only controls are hidden by default */
.admin-only {
  display: none !important;
}

/* When body has admin-mode class, reveal them */
body.admin-mode .admin-only {
  display: flex !important;
}

/* Special case for inline/inline-flex elements */
body.admin-mode .admin-only.btn,
body.admin-mode .admin-only.signal-delete {
  display: inline-flex !important;
}

/* Admin-only elements that also have reveal-target bypass the animation */
body.admin-mode .admin-only.reveal-target {
  opacity: 1 !important;
  transform: none !important;
}

/* Terminal locked message — visible when NOT admin, hidden when admin */
.terminal-locked-msg {
  padding: 0.6rem 1.25rem;
  border-top: 1px solid rgba(100,180,120,0.1);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

body.admin-mode .terminal-locked-msg { display: none; }

/* Origin controls — always show the div, but start hidden */
.origin-controls.admin-only {
  display: none !important;
}
body.admin-mode .origin-controls.admin-only {
  display: flex !important;
}

/* =========================================================
   ADMIN INDICATOR
   ========================================================= */
.admin-indicator {
  position: fixed;
  top: 80px;
  right: 1.5rem;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(5, 5, 16, 0.95);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: var(--radius-lg);
  padding: 0.5rem 1rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 20px rgba(201,168,76,0.15);
  animation: indicator-glow 3s ease-in-out infinite alternate;
}

@keyframes indicator-glow {
  0%   { box-shadow: 0 0 10px rgba(201,168,76,0.1); }
  100% { box-shadow: 0 0 25px rgba(201,168,76,0.25); }
}

/* Override the .hidden class for the indicator */
.admin-indicator.hidden { display: none !important; }
.admin-indicator:not(.hidden) { display: flex; }

.admin-indicator-icon {
  color: var(--gold);
  font-size: 1rem;
  animation: dot-blink 2s ease-in-out infinite;
}

.admin-indicator-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
}

/* =========================================================
   ADMIN LOGIN MODAL
   ========================================================= */
.modal-panel-admin {
  max-width: 420px;
  text-align: center;
}

.admin-modal-symbol {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.admin-modal-symbol img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(201,168,76,0.6));
}

.admin-modal-sub {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1.5rem;
  margin-top: -1rem;
}

.admin-form { text-align: left; }

.admin-error {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #e06060;
  margin-top: -0.75rem;
  padding: 0.5rem;
  border: 1px solid rgba(200,80,80,0.3);
  border-radius: var(--radius);
  background: rgba(200,80,80,0.06);
}

.admin-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 1rem;
}

.admin-hint code {
  font-family: var(--font-mono);
  color: var(--gold-dim);
  background: rgba(0,0,0,0.3);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

/* =========================================================
   AUDIO FAB (Floating Action Button)
   ========================================================= */
.audio-fab {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(5, 5, 16, 0.9);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color var(--transition), box-shadow var(--transition);
  opacity: 0.6;
}

.audio-fab:hover {
  opacity: 1;
  border-color: var(--gold-dim);
  box-shadow: 0 0 15px rgba(201,168,76,0.15);
}

.audio-fab.active {
  opacity: 1;
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(201,168,76,0.25);
}

.audio-fab-icon {
  font-size: 1rem;
  color: var(--gold);
  transition: all var(--transition);
}

.audio-fab.active .audio-fab-icon {
  animation: audio-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes audio-pulse {
  0%   { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 1;   transform: scale(1.05); }
}

.audio-fab-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Nav audio toggle (compact) */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.audio-toggle {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: all var(--transition);
  display: flex;
  align-items: center;
}

.audio-toggle:hover { color: var(--gold); border-color: var(--border); }
.audio-toggle.active { color: var(--gold); animation: audio-pulse 2s ease-in-out infinite alternate; }

/* =========================================================
   ARCHIVE SECTION
   ========================================================= */
.section-archive {
  background: linear-gradient(180deg, var(--bg-deep) 0%, rgba(8,8,25,1) 100%);
}

.archive-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2.5rem;
}

.archive-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.archive-doc {
  background: rgba(5, 6, 18, 0.98);
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font-mono);
  position: relative;
}

.archive-doc::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-dim) 30%, var(--gold-dim) 70%, transparent 100%);
  opacity: 0.4;
}

.archive-doc:hover {
  border-color: rgba(201,168,76,0.3);
  box-shadow: 0 4px 30px rgba(201,168,76,0.06);
}

.archive-doc-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: rgba(201,168,76,0.04);
  border-bottom: 1px solid rgba(201,168,76,0.1);
}

.archive-doc-file {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
}

.archive-doc-class {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--gold-dim);
  text-align: center;
  text-transform: uppercase;
}

.archive-doc-date {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: right;
}

.archive-doc-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid rgba(201,168,76,0.06);
}

.archive-status-badge {
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  text-transform: uppercase;
}

.archive-status-badge.RECOVERED   { color: #4a8; border: 1px solid rgba(60,160,100,0.4); background: rgba(60,160,100,0.06); }
.archive-status-badge.VERIFIED    { color: var(--gold); border: 1px solid rgba(201,168,76,0.4); background: rgba(201,168,76,0.06); }
.archive-status-badge.CORRUPTED   { color: #e06060; border: 1px solid rgba(200,80,80,0.4); background: rgba(200,80,80,0.06); }
.archive-status-badge.CLASSIFIED  { color: #e8a040; border: 1px solid rgba(230,160,60,0.4); background: rgba(230,160,60,0.06); }
.archive-status-badge.REDACTED    { color: #888; border: 1px solid rgba(120,120,120,0.4); background: rgba(0,0,0,0.3); }

.archive-doc-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 1rem 1.5rem 0.5rem;
  letter-spacing: 0.06em;
}

.archive-doc-body {
  padding: 0.75rem 1.5rem 1.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
  font-family: var(--font-mono);
}

/* Redaction marks inside archive docs */
.archive-doc-body { position: relative; }

.archive-doc-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.5rem 1rem;
}

/* Form select styling */
.form-input[type="select"],
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a6d2a' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

select.form-input option {
  background: var(--bg-medium);
  color: var(--text-primary);
}

/* =========================================================
   REVEAL ON SCROLL (IntersectionObserver)
   ========================================================= */
.reveal-target {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-target.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.reveal-target.revealed .book-card:nth-child(1) { transition-delay: 0.0s; }
.reveal-target.revealed .book-card:nth-child(2) { transition-delay: 0.1s; }
.reveal-target.revealed .book-card:nth-child(3) { transition-delay: 0.2s; }
.reveal-target.revealed .book-card:nth-child(4) { transition-delay: 0.3s; }

.reveal-target.revealed .faction-card:nth-child(1) { transition-delay: 0.0s; }
.reveal-target.revealed .faction-card:nth-child(2) { transition-delay: 0.1s; }
.reveal-target.revealed .faction-card:nth-child(3) { transition-delay: 0.15s; }
.reveal-target.revealed .faction-card:nth-child(4) { transition-delay: 0.2s; }
.reveal-target.revealed .faction-card:nth-child(5) { transition-delay: 0.25s; }
.reveal-target.revealed .faction-card:nth-child(6) { transition-delay: 0.3s; }

/* Timeline event stagger */
.timeline-event {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-event.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* =========================================================
   HERO PARALLAX & FOG
   ========================================================= */
.hero-fog {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 100%,
    rgba(201,168,76,0.04) 0%,
    rgba(20,20,60,0.2)  40%,
    transparent 70%);
  pointer-events: none;
  animation: fog-drift 12s ease-in-out infinite alternate;
}

@keyframes fog-drift {
  0%   { transform: scale(1) translateY(0); opacity: 0.6; }
  100% { transform: scale(1.05) translateY(-10px); opacity: 1; }
}

.hero-parallax-deep,
.hero-parallax-mid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-parallax-deep {
  background: radial-gradient(ellipse at 30% 70%, rgba(201,168,76,0.03) 0%, transparent 60%);
}

.hero-parallax-mid {
  background: radial-gradient(ellipse at 70% 30%, rgba(100,120,220,0.03) 0%, transparent 50%);
}

/* Hero symbol — enhanced outer ring */
.hero-symbol-outer-ring {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.1);
  animation: outer-ring 8s ease-in-out infinite;
}

@keyframes outer-ring {
  0%, 100% { transform: rotate(0deg)   scale(1);    opacity: 0.4; }
  50%       { transform: rotate(180deg) scale(1.05); opacity: 0.8; }
}

/* =========================================================
   CINEMATIC BUTTON ANIMATIONS
   ========================================================= */
.btn-hover-lift {
  position: relative;
  overflow: hidden;
}

.btn-hover-lift::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

.btn-hover-lift:hover::after {
  transform: translateX(100%);
}

.btn-hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201,168,76,0.2);
}

.btn-hover-lift:active {
  transform: translateY(0);
  transition-duration: 0.05s;
}

/* Enhanced card hover */
.book-card,
.faction-card,
.garden-entry,
.timeline-event-inner,
.archive-doc {
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.25s ease;
}

/* =========================================================
   FLOATING SACRED GLYPHS
   ========================================================= */
.floating-glyphs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glyph {
  position: absolute;
  font-size: 1.5rem;
  color: var(--gold);
  opacity: 0.02;
  animation: glyph-float linear infinite;
  user-select: none;
  pointer-events: none;
}

@keyframes glyph-float {
  0%   { transform: translateY(0) rotate(0deg);     opacity: 0.01; }
  25%  { opacity: 0.03; }
  50%  { transform: translateY(-30px) rotate(15deg); opacity: 0.02; }
  75%  { opacity: 0.03; }
  100% { transform: translateY(0) rotate(0deg);     opacity: 0.01; }
}

/* =========================================================
   PARALLAX SCROLL EFFECT (JS-driven)
   ========================================================= */
.hero-parallax-deep  { will-change: transform; }
.hero-parallax-mid   { will-change: transform; }

/* =========================================================
   EASTER EGG OVERLAY
   ========================================================= */
.easter-overlay {
  position: fixed;
  inset: 0;
  z-index: 9900;
  background: rgba(0,0,5,0.96);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: easter-appear 0.4s ease;
}

.easter-overlay.active { display: flex; }

@keyframes easter-appear {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.easter-content {
  max-width: 640px;
  text-align: center;
  padding: 2rem;
  font-family: var(--font-mono);
  color: var(--gold);
}

.easter-content h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.easter-content p {
  font-size: 0.82rem;
  line-height: 1.9;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.easter-content code {
  display: block;
  font-size: 0.75rem;
  color: var(--text-code);
  margin-top: 1.5rem;
  opacity: 0.6;
}

.easter-close {
  margin-top: 2rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
}

.easter-close:hover { border-color: var(--gold); color: var(--gold); }

/* Easter hover secret */
.easter-hover { position: relative; cursor: default; }
.easter-hover::after {
  content: attr(data-secret);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease 3s; /* delay 3 seconds */
  z-index: 10;
}

.easter-hover:hover::after { opacity: 1; }

/* =========================================================
   MOBILE — enhanced typography scaling
   ========================================================= */
@media (max-width: 480px) {
  :root { font-size: 15px; }

  .hero-title { font-size: clamp(2.5rem, 13vw, 5rem); }
  .hero-sub   { font-size: clamp(0.75rem, 3.5vw, 1rem); }
  .hero-tagline { font-size: 0.9rem; }

  .section-title { font-size: clamp(1.5rem, 8vw, 2.5rem); }

  .origin-block-title { font-size: 0.58rem; }

  .terminal-panel { font-size: 0.75rem; }
  .terminal-output { max-height: 280px; }

  .garden-intro { padding: 1.5rem; }
  .garden-symbol-ring { width: 80px; height: 80px; }
  .garden-symbol { width: 50px; height: 50px; }

  .book-card .book-info { padding: 1rem; }

  .archive-doc-header { grid-template-columns: 1fr; gap: 0.25rem; }
  .archive-doc-date   { text-align: left; }

  .faction-card { padding: 1.75rem 1.25rem; }

  .chat-messages { min-height: 260px; }

  .admin-indicator { top: calc(var(--nav-h) + 0.5rem); right: 0.75rem; padding: 0.4rem 0.75rem; }
  .audio-fab { bottom: 1rem; left: 1rem; padding: 0.5rem 0.75rem; }
}

/* =========================================================
   PRINT — remove animations
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  #particles, .floating-glyphs { display: none; }
  .cursor-dot, .cursor-ring { display: none !important; }
}
