/* ═══════════════ THE ALMS · homepage (Thieves' Moon) ═══════════════ */

:root {
  --void: #050a07; --night: #0b1510; --timber: #101f17; --loam: #16281d;
  --moss: #2c4a38; --fern: #6f9a7d; --moonsilver: #dbe7dc; --marian: #9cc7d9;
  --gold: #e9b854; --gold-hi: #f6d98c; --brass: #8a6a2f; --torch: #f07f2e; --crimson: #a13327;

  --f-display: 'IM Fell English SC', serif;
  --f-fell: 'IM Fell English', serif;
  --f-body: 'Alegreya', Georgia, serif;
  --f-sc: 'Alegreya SC', Georgia, serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --cur-arrow: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='44'><defs><linearGradient id='s' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='%23eef4ef'/><stop offset='.45' stop-color='%2399a8a0'/><stop offset='1' stop-color='%23414f47'/></linearGradient><filter id='g' x='-40%25' y='-40%25' width='180%25' height='180%25'><feGaussianBlur stdDeviation='2'/></filter></defs><path d='M3 3 L27 11 Q19 15 15.5 15.5 Q15 19 11 27 Z' fill='%23e9b854' opacity='.7' filter='url(%23g)'/><path d='M16 16 L33.5 33.5' stroke='%23050a07' stroke-width='5' stroke-linecap='round'/><path d='M16 16 L33.5 33.5' stroke='%235d4930' stroke-width='2.6' stroke-linecap='round'/><path d='M24.2 24.2 l2 2 M27.4 27.4 l2 2' stroke='%23e9b854' stroke-width='1.1'/><circle cx='34.5' cy='34.5' r='2.6' fill='%23e9b854' stroke='%23050a07' stroke-width='1'/><path d='M3 3 L27 11 Q19 15 15.5 15.5 Q15 19 11 27 Z' fill='url(%23s)' stroke='%23050a07' stroke-width='1.6'/><path d='M3 3 L27 11 Q19 15 15.5 15.5 Q15 19 11 27 Z' fill='none' stroke='%23e9b854' stroke-width='1'/><path d='M5.5 5.5 L15 15' stroke='%23f6d98c' stroke-width='1' opacity='.9'/><path d='M13 8.4 q3.5 .8 3.8 4.2' fill='none' stroke='%23f6d98c' stroke-width='.9' opacity='.85'/><path d='M8.4 13 q.8 3.5 4.2 3.8' fill='none' stroke='%23f6d98c' stroke-width='.9' opacity='.85'/></svg>") 3 3;
  --cur-gold: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='44'><defs><linearGradient id='s' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='%23f8e3a4'/><stop offset='.5' stop-color='%23e9b854'/><stop offset='1' stop-color='%238a6a2f'/></linearGradient><filter id='g' x='-40%25' y='-40%25' width='180%25' height='180%25'><feGaussianBlur stdDeviation='2.4'/></filter></defs><path d='M3 3 L27 11 Q19 15 15.5 15.5 Q15 19 11 27 Z' fill='%23f6d98c' opacity='.9' filter='url(%23g)'/><path d='M16 16 L33.5 33.5' stroke='%23050a07' stroke-width='5' stroke-linecap='round'/><path d='M16 16 L33.5 33.5' stroke='%235d4930' stroke-width='2.6' stroke-linecap='round'/><path d='M24.2 24.2 l2 2 M27.4 27.4 l2 2' stroke='%23e9b854' stroke-width='1.1'/><circle cx='34.5' cy='34.5' r='2.6' fill='%23e9b854' stroke='%23050a07' stroke-width='1'/><path d='M3 3 L27 11 Q19 15 15.5 15.5 Q15 19 11 27 Z' fill='url(%23s)' stroke='%23050a07' stroke-width='1.6'/><path d='M3 3 L27 11 Q19 15 15.5 15.5 Q15 19 11 27 Z' fill='none' stroke='%23f6d98c' stroke-width='1'/><path d='M5.5 5.5 L15 15' stroke='%235d4930' stroke-width='1.1' opacity='.9'/><path d='M13 8.4 q3.5 .8 3.8 4.2' fill='none' stroke='%235d4930' stroke-width='1' opacity='.85'/><path d='M8.4 13 q.8 3.5 4.2 3.8' fill='none' stroke='%235d4930' stroke-width='1' opacity='.85'/></svg>") 3 3;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
html, body {
  background: var(--void);
  color: var(--moonsilver);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  cursor: var(--cur-arrow), default;
  overflow-x: hidden;
}
a, button { cursor: var(--cur-gold), pointer; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.sc { font-family: var(--f-sc); font-size: 12px; letter-spacing: 0.1em; color: var(--fern); text-transform: lowercase; }
em { color: var(--gold-hi); font-style: normal; }

/* ── backdrop ── */
#bg { position: fixed; inset: 0; z-index: 0; background: radial-gradient(120% 90% at 50% 30%, var(--night) 0%, var(--void) 78%); }
#moon { position: absolute; top: 8vh; left: 50%; width: 620px; height: 620px; transform: translateX(-52%); opacity: 0.12; filter: blur(2px) drop-shadow(0 0 120px rgba(219,231,220,0.5)); }
.canopy { position: absolute; top: 0; height: 26vh; min-height: 160px; }
.c-left { left: 0; width: 46vw; } .c-right { right: 0; width: 52vw; }
#moonbeam { position: absolute; top: -10vh; left: 14vw; width: 32vw; height: 130vh; transform: skewX(-16deg);
  background: linear-gradient(to bottom, rgba(156,199,217,0.09), rgba(156,199,217,0.03) 55%, transparent 80%); }
#vignette { position: absolute; inset: 0; background: radial-gradient(ellipse 78% 70% at 50% 40%, transparent 52%, rgba(5,10,7,0.6) 80%, rgba(5,10,7,0.97) 100%); }
#fx { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* ── header ── */
#top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px;
  background: linear-gradient(to bottom, rgba(5,10,7,0.85), transparent);
}
.brand { display: flex; align-items: baseline; gap: 6px; text-decoration: none; }
.b-the { font-family: var(--f-display); font-size: 13px; letter-spacing: 0.3em; color: var(--fern); }
.b-alms { font-family: var(--f-display); font-size: 26px; letter-spacing: 0.06em; color: var(--moonsilver); }
.cta-mini {
  font-family: var(--f-sc); font-size: 12.5px; letter-spacing: 0.12em;
  color: var(--gold); text-decoration: none;
  border: 1px solid var(--brass); border-radius: 3px;
  padding: 7px 16px;
  background: rgba(16,31,23,0.7);
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s, filter 0.2s;
}
.cta-mini.on { opacity: 1; pointer-events: auto; }
.cta-mini:hover { filter: brightness(1.3); }

/* ── layout ── */
main { position: relative; z-index: 2; }

#hero {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 90px 20px 40px;
  position: relative;
}
.wm { position: relative; display: inline-block; }
.wm-the { font-family: var(--f-display); font-size: clamp(18px, 2.6vw, 30px); letter-spacing: 0.6em; color: var(--fern); display: block; margin-left: 8px; }
.wm-alms {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(88px, 16vw, 190px);
  line-height: 0.95; letter-spacing: 0.04em;
  color: var(--moonsilver);
  text-shadow: 0 4px 0 var(--void), 0 -2px 0 rgba(219,231,220,0.22), 0 0 70px rgba(219,231,220,0.14);
}
.wm-strike { position: absolute; left: 50%; bottom: -6px; width: min(72%, 460px); height: 44px; transform: translateX(-50%) rotate(-2deg); opacity: 0.85; pointer-events: none; }
.tagline {
  font-family: var(--f-fell); font-style: italic;
  font-size: clamp(17px, 2.2vw, 24px);
  color: var(--gold);
  margin: 34px 0 14px;
  text-shadow: 0 0 20px rgba(5,10,7,1);
}
.hero-sub { font-size: clamp(13.5px, 1.5vw, 16px); color: var(--fern); max-width: 620px; }
.hero-ctas { display: flex; gap: 18px; align-items: center; margin-top: 38px; flex-wrap: wrap; justify-content: center; }

.seal-cta {
  display: inline-flex; align-items: center; gap: 12px;
  background: linear-gradient(to bottom, #1a2f22, #12221a);
  border: 1px solid var(--moss);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  padding: 13px 26px;
  font-family: var(--f-display); font-size: 20px; letter-spacing: 0.06em;
  color: var(--gold); text-decoration: none;
  transition: filter 0.2s, transform 0.2s;
}
.seal-cta:hover { filter: brightness(1.3); transform: translateY(-1px); }
.seal-cta.big { font-size: 26px; padding: 16px 36px; }
.seal-ico { width: 30px; height: 30px; }
.seal-cta.big .seal-ico { width: 38px; height: 38px; }
.ghost-cta { font-family: var(--f-sc); font-size: 13px; letter-spacing: 0.1em; color: var(--fern); text-decoration: none; transition: color 0.2s; }
.ghost-cta:hover { color: var(--moonsilver); }
.hero-scroll { position: absolute; bottom: 26px; left: 0; right: 0; text-align: center; font-family: var(--f-sc); font-size: 11.5px; letter-spacing: 0.22em; color: var(--fern); opacity: 0.8; }

/* ── chapters ── */
.chapter {
  max-width: 1060px; margin: 0 auto;
  padding: clamp(60px, 9vh, 110px) 26px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
  align-items: center;
}
.chapter.flip .ch-copy { order: 2; }
.chapter.flip .ch-art { order: 1; }
.chapter.wide { grid-template-columns: 1fr; gap: 40px; max-width: 1120px; }

.ch-num {
  font-family: var(--f-display); font-size: 15px; color: var(--brass); letter-spacing: 0.3em;
  border: 1px solid var(--brass); border-radius: 50%;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  padding-left: 4px; margin-bottom: 18px;
}
.centered .ch-num { margin: 0 auto 18px; }
.ch-copy h2 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(34px, 4.4vw, 52px);
  color: var(--moonsilver); letter-spacing: 0.04em;
  margin-bottom: 16px;
  text-shadow: 0 2px 0 var(--void);
}
.ch-copy p { font-size: clamp(15px, 1.6vw, 17.5px); color: #b9cabb; max-width: 60ch; }
.ch-copy p + p { margin-top: 12px; }
.ch-copy.centered { text-align: center; }
.ch-copy.centered p { margin-left: auto; margin-right: auto; }
.whisper { font-family: var(--f-fell); font-style: italic; color: var(--fern); }

.ch-art { display: flex; justify-content: center; }
.ch-art svg, .ch-art img { width: 100%; max-width: 380px; height: auto; filter: drop-shadow(0 14px 34px rgba(0,0,0,0.5)); }
.ch-art-wide { display: flex; justify-content: center; }
.ch-art-wide svg { width: 100%; max-width: 620px; height: auto; filter: drop-shadow(0 14px 34px rgba(0,0,0,0.5)); }

/* ── quiver tiers ── */
.tier-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tier {
  background: radial-gradient(140% 110% at 30% 0%, rgba(44,74,56,0.16), transparent 60%), var(--timber);
  border: 1px solid #23402f;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  padding: 22px 20px 20px;
  transition: transform 0.25s, border-color 0.25s;
}
.tier:hover { transform: translateY(-4px); border-color: var(--moss); }
.tier img { width: 100%; height: 40px; object-fit: contain; margin-bottom: 14px; }
.tier h3 { font-family: var(--f-display); font-weight: 400; font-size: 22px; color: var(--moonsilver); margin-bottom: 7px; }
.t-power { font-size: 14px; color: #b9cabb; margin-bottom: 10px; }
.t-flavor { font-family: var(--f-fell); font-style: italic; font-size: 13px; color: var(--fern); }

/* ── relic ── */
.relic { max-width: 640px; margin: 0 auto; text-align: center; }
.relic img { width: 100%; height: auto; animation: relic-breathe 6s ease-in-out infinite; }
@keyframes relic-breathe { 0%,100% { filter: drop-shadow(0 0 18px rgba(233,184,84,0.10)); } 50% { filter: drop-shadow(0 0 34px rgba(233,184,84,0.26)); } }
.relic-line { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding: 0 8px; }
#hoard-tick { color: var(--gold); font-size: 20px; text-shadow: 0 0 10px rgba(233,184,84,0.3); }

/* ── finale ── */
#finale { text-align: center; padding: clamp(70px, 12vh, 140px) 24px; }
.fin-h { font-family: var(--f-display); font-weight: 400; font-size: clamp(40px, 6vw, 68px); color: var(--moonsilver); text-shadow: 0 2px 0 var(--void); }
.fin-sub { font-family: var(--f-fell); font-style: italic; font-size: 17px; color: var(--fern); margin: 12px 0 34px; }

/* ── footer ── */
#ftr {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 18px 26px;
  border-top: 1px solid rgba(44,74,56,0.5);
  font-size: 12px;
}
.ftr-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.ftr-nav a {
  font-family: var(--f-sc); font-size: 11.5px; letter-spacing: 0.1em;
  color: var(--fern); text-decoration: none;
  padding: 4px 10px; border: 1px solid transparent; border-radius: 3px;
  transition: color 0.15s, border-color 0.15s;
}
.ftr-nav a:hover { color: var(--gold); border-color: #3a5a45; }
.fable { font-family: var(--f-fell); font-style: italic; color: var(--fern); }
.play-link { color: var(--gold); text-decoration: none; font-size: 12px; }
.play-link:hover { text-shadow: 0 0 8px rgba(233,184,84,0.5); }

/* ── art svg shared classes (used by home.js-built art) ── */
.g-tile { fill: #16281d; stroke: var(--moss); stroke-width: 1; rx: 6; }
.g-tile.lit { filter: drop-shadow(0 0 6px rgba(233,184,84,0.5)); }
.g-burn { fill: #1c120a; stroke: var(--torch); stroke-width: 1.4; }

/* ── the muster roll ── */
#muster {
  max-width: 860px; margin: 0 auto;
  padding: clamp(120px, 16vh, 170px) 26px 70px;
  min-height: 82svh;
}
.muster-head { margin-bottom: 40px; }
.muster-head h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(38px, 5vw, 58px); color: var(--moonsilver); letter-spacing: 0.04em; margin-bottom: 16px; text-shadow: 0 2px 0 var(--void); }

.muster-box {
  background: radial-gradient(140% 110% at 30% 0%, rgba(44,74,56,0.16), transparent 60%), var(--timber);
  border: 1px solid #23402f;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
  padding: 26px 28px 20px;
}
.muster-row { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
#addr {
  flex: 1; min-width: 260px;
  background: rgba(5,10,7,0.6);
  border: 1px solid var(--moss); border-radius: 4px;
  color: var(--gold); font-size: 15px; letter-spacing: 0.05em;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#addr:focus { border-color: var(--fern); box-shadow: 0 0 12px rgba(156,199,217,0.15); }
#addr::placeholder { color: #46604f; }
.muster-row .seal-cta { font-size: 17px; padding: 11px 22px; border: none; }
.seal-cta.busy { filter: saturate(0.6) brightness(0.8); pointer-events: none; }

.muster-status {
  margin-top: 18px;
  border-left: 3px solid var(--fern);
  background: rgba(5,10,7,0.5);
  padding: 12px 16px;
  font-size: 15px; color: #b9cabb;
  border-radius: 0 4px 4px 0;
}
.muster-status.good { border-left-color: var(--gold); }
.muster-status.good b { color: var(--gold); }
.muster-status.bad { border-left-color: var(--crimson); }
.muster-status.wait { border-left-color: var(--marian); font-style: italic; font-family: var(--f-fell); }
.held-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.held-mark {
  display: inline-flex; flex-direction: column;
  background: rgba(22,40,29,0.8);
  border: 1px solid var(--brass); border-radius: 3px;
  padding: 4px 10px;
  font-family: var(--f-sc); font-size: 12.5px; letter-spacing: 0.06em; color: var(--gold);
}
.held-mark i { font-style: normal; font-family: var(--f-mono); font-size: 9px; color: var(--fern); letter-spacing: 0.04em; }
.muster-roll { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(44,74,56,0.4); }
.roll-seal svg { width: 26px; height: 26px; opacity: 0.85; }

.muster-marks { margin-top: 54px; }
.marks-h { font-family: var(--f-display); font-weight: 400; font-size: 27px; color: var(--moonsilver); text-align: center; }
.marks-sub { font-family: var(--f-fell); font-style: italic; font-size: 14px; color: var(--fern); text-align: center; margin: 4px 0 22px; }
.marks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mark-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(16,31,23,0.75);
  border: 1px solid #1e3628; border-radius: 4px;
  padding: 11px 13px;
  transition: border-color 0.2s, transform 0.2s;
}
.mark-card:hover { border-color: var(--brass); transform: translateY(-2px); }
.mark-eye { width: 22px; height: 13px; flex: 0 0 22px; }
.mark-name { font-family: var(--f-sc); font-size: 13px; letter-spacing: 0.05em; color: var(--moonsilver); line-height: 1.2; }
.mark-net { font-family: var(--f-mono); font-size: 8.5px; color: var(--fern); letter-spacing: 0.05em; margin-left: auto; text-align: right; }

.nav-muster { font-family: var(--f-sc); font-size: 12.5px; letter-spacing: 0.12em; color: var(--fern); text-decoration: none; margin-right: 18px; transition: color 0.2s; }
.nav-muster:hover { color: var(--gold); }
.top-right { display: flex; align-items: center; gap: 14px; }
.hdr-nav { display: flex; align-items: center; gap: 4px; }
.hdr-nav a {
  font-family: var(--f-sc); font-size: 12px; letter-spacing: 0.1em;
  color: var(--fern); text-decoration: none;
  padding: 6px 11px; border-radius: 3px; border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.hdr-nav a:hover { color: var(--moonsilver); background: rgba(44,74,56,0.25); }
.hdr-nav a.on { color: var(--gold); border-color: #3a5a45; background: rgba(44,74,56,0.3); }
@media (max-width: 700px) { .hdr-nav { display: none; } }

/* ── responsive ── */
@media (max-width: 860px) {
  .muster-row .seal-cta { width: 100%; justify-content: center; }
  .marks-grid { grid-template-columns: 1fr 1fr; }
  .chapter { grid-template-columns: 1fr; gap: 34px; padding: 56px 22px; }
  .chapter.flip .ch-copy { order: 1; }
  .chapter.flip .ch-art { order: 2; }
  .tier-row { grid-template-columns: 1fr; }
  .ch-copy h2 { font-size: 34px; }
  .hero-ctas { flex-direction: column; gap: 14px; }
  #moon { width: 380px; height: 380px; }
  .wm-strike { bottom: -2px; height: 30px; }
  #ftr { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
}
