/* ==========================================================================
   Alchemists' Guild — shared website styles (index, crucible, codex).
   The Lair (lair.html) carries its own styles; these pages share one chamber.
   ========================================================================== */
:root {
  --void: #0A0705;
  --ash: #14100C;
  --char: #1F1712;
  --smoke: #2A1F18;
  --parchment: #E4D5B0;
  --parchment-2: #C9B78A;
  --bone: #F4E9CE;
  --gold: #C4A361;
  --gold-hot: #E8C87A;
  --gold-dim: #7D6640;
  --gold-line: #A88342;
  --ember: #E8492D;
  --ember-hot: #FF6B3A;
  --violet: #B08AD4;
  --azure: #6FA8E8;
  --verdant: #7FBF7F;
  --crimson: #E85C5C;
  --amber: #E8B85C;
  --serif: 'IM Fell English', Georgia, serif;
  --display: 'Cinzel Decorative', serif;
  --ui: 'Cinzel', serif;
  --nav-h: 72px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--void); }
/* decorative layers (glow, fog, video) may spill past the edges; never let phones scroll sideways */
html, body { overflow-x: clip; }
body {
  font-family: var(--serif);
  color: var(--parchment);
  background: var(--void);
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: var(--gold-hot); }

/* ---------- the chamber: fixed painted room behind every page ---------- */
.chamber { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.chamber-bg, .chamber-video {
  position: absolute; inset: -3%; width: 106%; height: 106%;
  object-fit: cover;
}
.chamber-video { opacity: 0; transition: opacity 1.2s; }
.chamber-video.playing { opacity: 1; }
.chamber::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, transparent 30%, rgba(5,3,2,0.75) 100%),
    linear-gradient(180deg, rgba(5,3,2,0.55), transparent 22%, transparent 60%, rgba(5,3,2,0.9));
}
.chamber.dim::after {
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(5,3,2,0.35) 20%, rgba(5,3,2,0.85) 100%),
    linear-gradient(180deg, rgba(5,3,2,0.6), rgba(5,3,2,0.55));
}
.dust { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- navigation ---------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 28px;
  background: linear-gradient(180deg, rgba(8,5,4,0.95), rgba(8,5,4,0.78));
  border-bottom: 1px solid rgba(168,131,66,0.35);
}
.site-nav .brand img { height: 52px; width: auto; filter: drop-shadow(0 0 10px rgba(232,200,122,0.25)); }
.site-nav .links { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.site-nav .links a {
  font-family: var(--ui); font-weight: 700; font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--parchment-2); text-decoration: none; padding: 9px 14px; border-radius: 3px;
  border: 1px solid transparent; transition: color .15s, border-color .15s, background .15s;
}
.site-nav .links a:hover { color: var(--gold-hot); border-color: rgba(196,163,97,0.4); }
.site-nav .links a.current { color: var(--gold-hot); border-color: var(--gold-dim); background: rgba(232,200,122,0.08); }
.site-nav .links a.play {
  color: #1a0f08; background: linear-gradient(180deg, #f2d48a, #c99a44); border-color: #f5dc9a;
  box-shadow: 0 0 18px rgba(232,200,122,0.35);
}
.site-nav .links a.play:hover { color: #1a0f08; box-shadow: 0 0 28px rgba(232,200,122,0.6); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--gold-dim); color: var(--gold-hot); font-size: 20px; width: 42px; height: 42px; border-radius: 4px; cursor: pointer; }

/* ---------- page + sections ---------- */
main { position: relative; z-index: 1; }
.section { position: relative; padding: 110px 24px; }
.section.tight { padding: 80px 24px; }
.wrap { max-width: 1160px; margin: 0 auto; }
.eyebrow {
  font-family: var(--ui); font-weight: 700; font-size: 12px; letter-spacing: 6px; text-transform: uppercase;
  color: var(--gold); text-align: center; margin-bottom: 14px;
}
.eyebrow::before, .eyebrow::after { content: '—'; margin: 0 12px; color: var(--gold-dim); }
h1, h2, h3 { font-family: var(--display); color: var(--bone); font-weight: 700; line-height: 1.15; }
h2 { font-size: clamp(30px, 4.4vw, 50px); text-align: center; margin-bottom: 16px; text-shadow: 0 2px 20px rgba(0,0,0,0.7); }
h3 { font-size: 20px; }
.lede { max-width: 700px; margin: 0 auto 50px; text-align: center; font-size: 19px; color: var(--parchment-2); }
.panel {
  background: linear-gradient(180deg, rgba(26,19,15,0.86), rgba(12,8,6,0.9));
  border: 1px solid rgba(168,131,66,0.45); border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,230,170,0.06);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--ui); font-weight: 700; font-size: 14px; letter-spacing: 3px; text-transform: uppercase;
  padding: 16px 30px; border-radius: 4px; text-decoration: none; cursor: pointer;
  border: 1px solid var(--gold-line); color: var(--gold-hot); background: rgba(10,7,5,0.7);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(232,200,122,0.25); }
.btn.primary { color: #1a0f08; background: linear-gradient(180deg, #f5d98f, #c99a44); border-color: #f7e1a6; box-shadow: 0 0 30px rgba(232,200,122,0.35); }
.btn.primary:hover { box-shadow: 0 10px 40px rgba(232,200,122,0.55); }
.btn.ember { color: var(--bone); background: linear-gradient(180deg, #ff7a45, #b8321c); border-color: #ff9a6a; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* reveal on scroll */
.reveal { opacity: 0; translate: 0 26px; transition: opacity .9s ease, translate .9s ease; }
.reveal.in { opacity: 1; translate: 0 0; }

/* ---------- keyed video actors (cauldron, alchemist) ---------- */
.keyed-source { position: fixed; width: 2px; height: 2px; opacity: 0; pointer-events: none; left: 0; top: 0; }
.actor canvas, .actor img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- gentle bob for potion cards and emblems ---------- */
@keyframes potion-bob { 50% { translate: 0 -6px; } }

/* ---------- footer ---------- */
.site-foot {
  position: relative; z-index: 1; text-align: center; padding: 50px 24px 60px;
  border-top: 1px solid rgba(168,131,66,0.3);
  background: linear-gradient(180deg, rgba(8,5,4,0.6), rgba(5,3,2,0.95));
  font-family: var(--ui); font-size: 12px; letter-spacing: 2px; color: var(--parchment-2);
}
.site-foot nav { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.site-foot a { color: var(--gold); text-decoration: none; text-transform: uppercase; }
.site-foot a:hover { color: var(--gold-hot); }
.site-foot .motto { font-family: var(--serif); font-style: italic; letter-spacing: 0; font-size: 15px; margin-top: 10px; color: var(--gold-dim); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  :root { --nav-h: 62px; }
  .site-nav { padding: 0 16px; }
  .site-nav .brand img { height: 42px; }
  .nav-toggle { display: block; }
  .site-nav .links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 10px 16px 16px;
    background: rgba(8,5,4,0.97); border-bottom: 1px solid var(--gold-dim);
  }
  .site-nav.open .links { display: flex; }
  .site-nav .links a { padding: 14px; text-align: center; }
  .section { padding: 80px 16px; }
  .lede { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; translate: none; transition: none; }
  .tier-card, .emblem { animation: none; }
  html { scroll-behavior: auto; }
}

/* wallet button in the nav (styled by chain.js); full width in the phone menu */
.site-nav .links [data-wallet-button] { margin-left: 4px; }
@media (max-width: 860px) {
  .site-nav .links [data-wallet-button] { margin: 6px 0; justify-content: center; }
}

/* the hidden attribute always wins over component display rules */
[hidden] { display: none !important; }

/* X (Twitter) logo in links */
.x-logo { vertical-align: -2px; }
