/* ============================================================
   THE AXIOM VEIL — ARCHIVE INTERFACE
   "The Recovered Archive / The Quiet Frequency"
   A partial classified record. One face shown, one hidden.
   ============================================================ */

:root {
  /* Void & depth */
  --void: #050608;
  --void-2: #080a0f;
  --void-3: #0b0e14;
  --bg-panel: #0c0e13;
  --bg-elevated: #14161d;
  --border-subtle: #1d1f27;
  --border-seam: #2a2d38;

  /* Signature palette */
  --vey-gold: #cbbf9e;
  --vey-gold-bright: #e7dcb8;
  --beam-blue: #8ec5e8;
  --dominion-bronze: #b07f4f;
  --choir-violet: #9384b0;
  --architect-ghost: #9aa0a6;
  --danger: #c8604c;
  --lock-green: #6fa384;
  --bone: #ece6d6;

  /* Text */
  --text-primary: #e6e2d6;
  --text-secondary: #9b968a;
  --text-muted: #615c52;
  --text-faint: #3a382f;

  /* Type */
  --font-display: "Fraunces", "Hoefler Text", Georgia, serif;
  --font-body: "Spectral", "Iowan Old Style", Georgia, serif;
  --font-mono: "IBM Plex Mono", "SF Mono", "Cascadia Code", monospace;
  --font-heading: var(--font-display); /* back-compat alias */

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Accent (overridden per faction theme) */
  --accent-primary: var(--vey-gold);
  --accent-glow: rgba(203, 191, 158, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--void); }

body {
  background: var(--void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.72;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ── Atmosphere: vignette + film grain (html pseudo, won't clash with body/theme) ── */
html::before {
  content: ''; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(0,0,0,0.55) 100%),
    radial-gradient(140% 120% at 50% 110%, transparent 60%, rgba(0,0,0,0.5) 100%);
}
html::after {
  content: ''; position: fixed; inset: -50%; z-index: 9997; pointer-events: none;
  opacity: 0.045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--border-seam); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: rgba(203,191,158,0.28); color: var(--bone); }

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 340;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  font-optical-sizing: auto;
}
h1 {
  font-size: clamp(34px, 6vw, 76px);
  font-weight: 320;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.02;
}
h2 { font-size: clamp(24px, 3.4vw, 40px); margin-bottom: 10px; letter-spacing: 0.03em; }
h3 {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 64px 0 22px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle); color: var(--vey-gold);
  display: flex; align-items: center; gap: 12px;
}
h3::before {
  content: ''; width: 6px; height: 6px; flex: none;
  border: 1px solid var(--vey-gold); border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(203,191,158,0.08);
}
h3:first-child { margin-top: 0; }
.section-title { scroll-margin-top: 80px; }

p { margin-bottom: 14px; color: var(--text-secondary); }
em { color: var(--text-primary); font-style: italic; }
strong { color: var(--text-primary); font-weight: 600; }
a { color: var(--beam-blue); text-decoration: none; transition: color 0.18s; }
a:hover { color: var(--vey-gold-bright); }

.container { max-width: 1180px; margin: 0 auto; padding: 40px 28px 80px; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5,6,8,0.7);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 16px;
}
.logo {
  font-family: var(--font-display); font-size: 17px; font-weight: 400;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-primary); text-decoration: none;
  display: flex; align-items: center; gap: 11px; white-space: nowrap;
}
.logo::before {
  content: ''; display: inline-block; width: 13px; height: 13px;
  border: 1.5px solid var(--vey-gold); border-radius: 50%;
  position: relative;
  box-shadow: 0 0 10px rgba(203,191,158,0.35), inset 0 0 0 3px var(--void);
}
.logo:hover { color: var(--vey-gold-bright); }
.nav-links { display: flex; gap: 2px; list-style: none; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--text-secondary); font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 7px 11px; border-radius: 3px; transition: all 0.18s; white-space: nowrap;
  position: relative;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--vey-gold); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 11px; right: 11px; bottom: 0; height: 1px;
  background: var(--vey-gold); box-shadow: 0 0 8px var(--vey-gold);
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.search-box { position: relative; }
.search-box input {
  background: rgba(8,10,15,0.8); border: 1px solid var(--border-subtle); border-radius: 5px;
  padding: 7px 10px 7px 30px; color: var(--text-primary);
  font-family: var(--font-mono); font-size: 12px; width: 170px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, width 0.2s;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus { border-color: var(--vey-gold); box-shadow: 0 0 0 3px rgba(203,191,158,0.1); width: 200px; }
.search-box::before {
  content: '⌕'; position: absolute; left: 9px; top: 50%;
  transform: translateY(-50%); font-size: 15px; color: var(--text-muted);
}
.classified-toggle {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border-subtle); border-radius: 50%;
  color: var(--text-muted); cursor: pointer; transition: all 0.2s; font-size: 15px; flex: none;
}
.classified-toggle:hover, .classified-toggle.active {
  border-color: var(--choir-violet); color: var(--choir-violet);
  box-shadow: 0 0 14px rgba(147,132,176,0.3);
}

/* ── Page hero (full-bleed image banner per archive page) ── */
.archive-hero {
  position: relative; margin-bottom: 8px;
  min-height: 46vh; display: flex; align-items: flex-end;
  overflow: hidden; border-bottom: 1px solid var(--border-subtle);
}
.archive-hero-img {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0.5; transform: scale(1.04);
  animation: hero-drift 30s ease-in-out infinite alternate;
}
@keyframes hero-drift { from { transform: scale(1.04) translate(0,0);} to { transform: scale(1.1) translate(-1.5%, -1.5%);} }
.archive-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,6,8,0.5) 0%, transparent 30%, rgba(5,6,8,0.7) 78%, var(--void) 100%),
    linear-gradient(90deg, rgba(5,6,8,0.75) 0%, transparent 55%);
}
.archive-hero-inner {
  position: relative; z-index: 2;
  max-width: 1180px; width: 100%; margin: 0 auto; padding: 0 28px 44px;
}
.archive-hero .breadcrumb { margin-bottom: 14px; }
.archive-hero h1 { margin-bottom: 14px; text-shadow: 0 4px 40px rgba(0,0,0,0.6); }
.archive-hero .page-subtitle {
  font-family: var(--font-body); font-size: 18px; font-style: italic;
  color: var(--text-secondary); max-width: 620px;
}

/* ── Wiki page header (non-hero fallback) ── */
.page-header { margin-bottom: 8px; padding-bottom: 26px; border-bottom: 1px solid var(--border-subtle); }
.breadcrumb {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--vey-gold); opacity: 0.75; margin-bottom: 12px;
}
.page-header h1 { margin-bottom: 12px; }
.page-subtitle { font-size: 18px; font-style: italic; color: var(--text-secondary); max-width: 660px; }

/* ── Lore card grid (now responsive multi-column) ── */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 370px), 1fr));
  gap: 20px; align-items: start; margin-top: 8px;
}
.lore-card {
  background: linear-gradient(180deg, var(--bg-panel), var(--void-2));
  border: 1px solid var(--border-subtle); border-radius: 10px;
  padding: 26px; position: relative; overflow: hidden;
  transition: transform 0.3s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
}
.lore-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent-primary, var(--vey-gold)); opacity: 0.5; transition: opacity 0.3s;
}
.lore-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent-primary) 35%, var(--border-seam));
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.lore-card:hover::before { opacity: 1; box-shadow: 0 0 14px var(--accent-primary); }

/* Feature card spans full grid width with side-by-side layout on desktop */
.lore-card.feature { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .lore-card.feature { display: grid; grid-template-columns: minmax(280px, 0.85fr) 1.15fr; gap: 30px; padding: 0; }
  .lore-card.feature .card-image { width: 100%; height: 100%; min-height: 340px; margin: 0; aspect-ratio: auto; }
  .lore-card.feature .feature-body { padding: 30px 32px; }
}
.lore-card.feature .feature-body { padding: 26px; }

.card-image {
  width: calc(100% + 52px); height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  margin: -26px -26px 18px -26px; display: block;
  filter: saturate(1.02) contrast(1.02);
}
.card-eyebrow {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent-primary, var(--vey-gold)); opacity: 0.8; margin-bottom: 10px;
}
.card-title {
  font-family: var(--font-display); font-size: 25px; font-weight: 380;
  letter-spacing: 0.005em; line-height: 1.12; margin-bottom: 6px; color: var(--text-primary);
}
.card-meta {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 16px;
}
.card-body p { margin-bottom: 12px; line-height: 1.68; }
.card-body p:last-child { margin-bottom: 0; }
.card-body blockquote {
  margin: 18px 0; padding: 14px 18px;
  border-left: 2px solid var(--accent-primary, var(--vey-gold));
  background: rgba(255,255,255,0.015);
  font-family: var(--font-display); font-style: italic; font-size: 17px; line-height: 1.5;
  color: var(--text-primary);
}
.card-body ul { color: var(--text-secondary); padding-left: 20px; margin-bottom: 12px; }
.card-body li { margin-bottom: 5px; }
.card-tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 7px; }

.tag {
  display: inline-block; font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 10px;
  border-radius: 3px; background: rgba(255,255,255,0.02); color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.tag-vey { color: var(--vey-gold); border-color: rgba(203,191,158,0.28); }
.tag-dominion { color: var(--dominion-bronze); border-color: rgba(176,127,79,0.3); }
.tag-human { color: var(--beam-blue); border-color: rgba(142,197,232,0.25); }
.tag-choir { color: var(--choir-violet); border-color: rgba(147,132,176,0.3); }
.tag-architect { color: var(--architect-ghost); border-color: rgba(154,160,166,0.2); }
.tag-danger { color: var(--danger); border-color: rgba(200,96,76,0.28); }
.tag-lock { color: var(--lock-green); border-color: rgba(111,163,132,0.28); }

/* Blockquote attribution */
.blockquote-attribution {
  display: block; margin-top: 10px; font-style: normal; font-size: 10.5px;
  font-family: var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
}
.blockquote-attribution::before { content: '— '; }

/* ── Locked / classified-incomplete entry ── */
.locked-entry {
  border: 1px dashed var(--border-seam);
  background:
    repeating-linear-gradient(135deg, transparent, transparent 14px, rgba(203,191,158,0.018) 14px, rgba(203,191,158,0.018) 16px),
    var(--void-2);
  text-align: center; padding: 40px 28px;
}
.locked-entry::before { display: none; }
.locked-entry .lock-glyph {
  width: 40px; height: 40px; margin: 0 auto 16px; border: 1px solid var(--text-muted);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 16px;
}
.locked-entry .card-title { color: var(--text-secondary); }
.locked-entry .card-meta { color: var(--vey-gold); opacity: 0.7; }
.locked-entry p { color: var(--text-muted); font-style: italic; max-width: 460px; margin: 0 auto; }

/* ── Full-bleed cinematic band (homepage) ── */
.fullbleed {
  position: relative; min-height: 88vh; display: flex; align-items: center;
  overflow: hidden;
}
.fullbleed-img { position: absolute; inset: 0; background-size: cover; background-position: center; }
.fullbleed-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--void) 0%, transparent 22%, transparent 70%, var(--void) 100%);
}

/* ── Data tables ── */
.data-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12.5px; margin: 18px 0; }
.data-table th {
  text-align: left; padding: 11px 13px; background: var(--bg-elevated); color: var(--vey-gold);
  font-weight: 500; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border-seam);
}
.data-table td { padding: 11px 13px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); vertical-align: top; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table .row-empty td { color: var(--vey-gold); font-style: italic; opacity: 0.8; }

/* ── Eight-around-empty sigil ── */
.sigil { display: inline-block; position: relative; }
.sigil svg { display: block; }
.sigil .sig-dot { fill: var(--vey-gold); }
.sigil .sig-ring { fill: none; stroke: var(--vey-gold); stroke-width: 0.5; opacity: 0.25; }
.sigil .sig-center { fill: none; stroke: var(--vey-gold); stroke-width: 0.6; stroke-dasharray: 2 4; opacity: 0.5; }

/* Section divider with centered sigil */
.divider-sigil { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 56px 0; opacity: 0.7; }
.divider-sigil::before, .divider-sigil::after {
  content: ''; height: 1px; flex: 1; max-width: 200px;
  background: linear-gradient(90deg, transparent, var(--border-seam), transparent);
}

/* ── Cross-refs / footer ── */
.cross-refs {
  margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; color: var(--text-muted);
}
.cross-refs strong { color: var(--vey-gold); font-weight: 500; text-transform: uppercase; font-size: 11px; letter-spacing: 0.12em; }
.cross-refs a { margin-left: 14px; }
.cross-refs.container { padding-top: 24px; padding-bottom: 24px; }

.site-footer {
  border-top: 1px solid var(--border-subtle); padding: 56px 24px; text-align: center;
  color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  position: relative; z-index: 2;
}
.site-footer em { color: var(--text-secondary); font-style: italic; font-family: var(--font-body); }

/* ── Timeline ── */
.timeline { position: relative; margin: 26px 0; padding-left: 26px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(180deg, var(--beam-blue), var(--vey-gold), var(--dominion-bronze), var(--danger));
  opacity: 0.5;
}
.timeline-item { position: relative; margin-bottom: 30px; padding-left: 22px; }
.timeline-item::before {
  content: ''; position: absolute; left: -21px; top: 7px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--void); border: 1.5px solid var(--vey-gold);
}
.timeline-item.major::before { background: var(--vey-gold); box-shadow: 0 0 10px rgba(203,191,158,0.5); }
.timeline-item .time-label {
  font-family: var(--font-mono); font-size: 11px; color: var(--vey-gold); opacity: 0.75;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.timeline-item h4 {
  font-family: var(--font-display); margin: 0 0 8px; font-size: 21px; font-weight: 380;
  color: var(--text-primary); letter-spacing: 0.01em;
}
.timeline-item p { margin: 0; font-size: 15px; color: var(--text-secondary); }
.timeline-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin: 12px 0; display: block; }

/* Era cards (cosmic history) */
.era { position: relative; padding: 30px 0; border-bottom: 1px solid var(--border-subtle); display: grid; grid-template-columns: 180px 1fr; gap: 30px; align-items: start; }
.era:last-child { border-bottom: none; }
.era-marker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--vey-gold); opacity: 0.8; }
.era-marker .era-num { font-family: var(--font-display); display: block; font-size: 44px; color: var(--text-faint); line-height: 1; margin-bottom: 8px; }
.era h4 { font-family: var(--font-display); font-size: 26px; font-weight: 360; margin-bottom: 10px; }
@media (max-width: 760px){ .era { grid-template-columns: 1fr; gap: 12px; } }

/* PM dots (legacy, harmless) */
.pm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 4px; box-shadow: 0 0 6px currentColor; }
.pm-0 { background: var(--text-muted); } .pm-1 { background: var(--beam-blue); }
.pm-2 { background: var(--lock-green); } .pm-3 { background: var(--vey-gold); }
.pm-4 { background: var(--dominion-bronze); } .pm-5 { background: var(--danger); }

/* ── Quick nav ── */
.quick-nav {
  position: fixed; right: 22px; top: 88px; z-index: 90;
  background: rgba(12,14,19,0.9); backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle); border-radius: 8px; padding: 14px; width: 184px;
  opacity: 0; transform: translateX(20px); pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.quick-nav.visible { opacity: 1; transform: translateX(0); pointer-events: auto; }
.quick-nav-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-subtle); }
.quick-nav a { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-secondary); padding: 6px 7px; border-radius: 4px; transition: all 0.15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-nav a:hover, .quick-nav a.active { color: var(--text-primary); background: var(--bg-elevated); }
.quick-nav-toggle { display: none; position: fixed; right: 16px; top: 76px; z-index: 91; width: 34px; height: 34px; align-items: center; justify-content: center; background: rgba(12,14,19,0.95); border: 1px solid var(--border-subtle); border-radius: 6px; color: var(--vey-gold); cursor: pointer; font-size: 16px; backdrop-filter: blur(6px); }

/* ── Relationship matrix ── */
.relationship-web { margin: 26px 0; overflow-x: auto; }
.relation-matrix { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
.relation-matrix th { text-align: left; padding: 11px 13px; background: var(--bg-elevated); color: var(--vey-gold); font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 2px solid var(--border-seam); white-space: nowrap; }
.relation-matrix td { padding: 11px 13px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); vertical-align: top; }
.relation-matrix tr:hover td { background: rgba(255,255,255,0.02); }
.relation-matrix .relation-self { background: var(--bg-elevated); color: var(--text-muted); font-style: italic; }
.relation-matrix .relation-strong { color: var(--vey-gold); }
.relation-matrix .relation-tense { color: var(--dominion-bronze); }
.relation-matrix .relation-hostile { color: var(--danger); }
.relation-matrix .relation-trust { color: var(--beam-blue); }

/* ── Preloader ── */
#preloader { position: fixed; inset: 0; background: var(--void); z-index: 9999; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 24px; transition: opacity 0.6s ease, visibility 0.6s; }
#preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-ring { width: 60px; height: 60px; border: 1.5px solid transparent; border-top-color: var(--vey-gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Back to top ── */
.back-to-top { position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: rgba(12,14,19,0.9); border: 1px solid var(--border-subtle); border-radius: 6px; color: var(--vey-gold); cursor: pointer; opacity: 0; transform: translateY(10px); pointer-events: none; transition: all 0.25s var(--ease-out); font-size: 15px; backdrop-filter: blur(8px); }
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { border-color: var(--vey-gold); box-shadow: 0 0 14px rgba(203,191,158,0.2); }

/* ── Hover preview tooltip ── */
.hover-preview { position: fixed; z-index: 9999; background: var(--bg-panel); border: 1px solid var(--border-seam); border-radius: 8px; padding: 13px 16px; max-width: 280px; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity 0.2s, transform 0.2s; box-shadow: 0 10px 30px rgba(0,0,0,0.6); font-size: 13px; line-height: 1.5; }

/* ── Utility ── */
.highlight { background: rgba(203,191,158,0.32); padding: 0 2px; border-radius: 2px; color: var(--bone); }
.hidden { display: none !important; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .archive-hero-img { animation: none; }
}

/* ── Mobile ── */
@media (max-width: 860px) {
  body { font-size: 15.5px; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; }
  .nav-links { order: 3; width: 100%; padding-top: 6px; }
  .search-box input { width: 130px; }
  .search-box input:focus { width: 150px; }
  .archive-hero { min-height: 40vh; }
  .timeline { padding-left: 18px; }
  .quick-nav { right: 8px; top: 70px; width: 162px; padding: 11px; }
  .quick-nav-toggle { right: 8px; top: 70px; }
  .relation-matrix { font-size: 11.5px; }
}
