/* The Sanctum World website. Palette and type follow graphics/README_brand_kit.txt. */
:root {
  --gold: #c9a227;
  --gold-bright: #f3dd8a;
  --gold-dim: #7c6520;
  --night: #0b1418;
  --night-2: #0f1c21;
  --ink: #12262c;
  --ink-2: #183238;
  --teal: #3e8e7e;
  --teal-bright: #6cc2ad;
  --brick: #b4453c;
  --violet: #7b5ea7;
  --parchment: #f1ebda;
  --text: #e6e0cf;
  --muted: #a3ad9f;
  --line: rgba(201, 162, 39, 0.22);
  --radius: 4px;
  --max: 1120px;
  --display: "Cinzel", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-bright); text-underline-offset: 3px; }
a:hover { color: #fff3c4; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--parchment);
  margin: 0 0 0.5em;
  letter-spacing: 0.02em;
}
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.eyebrow {
  font-family: var(--display);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.75rem;
}
.lede { font-size: 1.25rem; color: var(--text); max-width: 46rem; }
.muted { color: var(--muted); }
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 20, 24, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 1rem; min-height: 60px; }
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--parchment);
  font-family: var(--display); font-weight: 700; letter-spacing: 0.08em; font-size: 0.95rem;
  white-space: nowrap;
}
.brand img { width: 30px; height: 30px; }
.nav-links { display: flex; gap: 1.4rem; margin-left: auto; list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; }
.nav-links a {
  font-family: var(--display); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text); text-decoration: none;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--gold-bright); }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line);
  color: var(--parchment); border-radius: var(--radius); padding: 0.4rem 0.7rem;
  font-family: var(--display); font-size: 0.8rem; letter-spacing: 0.1em; cursor: pointer;
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--night); border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 0.9rem 16px; border-top: 1px solid rgba(255,255,255,0.05); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--display); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.85rem 1.4rem; border-radius: var(--radius); text-decoration: none; cursor: pointer;
  border: 2px solid var(--gold); background: var(--gold); color: var(--night);
  box-shadow: 0 4px 0 var(--gold-dim);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { color: var(--night); background: var(--gold-bright); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-dim); }
.btn.ghost { background: transparent; color: var(--gold-bright); box-shadow: none; }
.btn.ghost:hover { background: rgba(201,162,39,0.12); color: #fff3c4; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 140px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% 38%, rgba(201,162,39,0.16), transparent 70%),
    linear-gradient(#060c0f 0%, var(--night) 55%, var(--ink) 100%);
}
/* Night sky: main.js fills each depth layer with pixel stars and moves the layers for parallax. */
.sky { position: absolute; inset: 0; pointer-events: none; }
.sky-layer { position: absolute; inset: -60px -40px; will-change: transform; }
.star {
  position: absolute; width: var(--s); height: var(--s); background: var(--c);
  opacity: var(--o);
  animation: twinkle var(--d) ease-in-out var(--delay) infinite;
}
.star.glint { animation-name: twinkle, glint; }
.sky.paused .star { animation-play-state: paused; }
/* Sections that carry their own sky */
section.alt, .page-head { position: relative; overflow: hidden; }
section.alt > .wrap, .page-head > .wrap { position: relative; z-index: 1; }
/* Let the stars drift behind cards and stat tiles in sky sections */
section.alt .card, section.alt details.faq { background: rgba(18, 38, 44, 0.72); }
section.alt .stats { background: rgba(201, 162, 39, 0.22); }
section.alt .stat { background: rgba(11, 20, 24, 0.6); }
@keyframes twinkle {
  0%, 100% { opacity: var(--o); }
  50% { opacity: calc(var(--o) * 0.2); }
}
/* Brightest stars flash a pixel cross at the top of their twinkle */
@keyframes glint {
  0%, 35%, 65%, 100% { box-shadow: none; }
  50% {
    box-shadow:
      var(--s) 0 0 rgba(243,221,138,0.55), calc(var(--s) * -1) 0 0 rgba(243,221,138,0.55),
      0 var(--s) 0 rgba(243,221,138,0.55), 0 calc(var(--s) * -1) 0 rgba(243,221,138,0.55);
  }
}
.hero .hills {
  position: absolute; left: -2%; width: 104%; bottom: -1px; height: 120px;
  shape-rendering: crispEdges; pointer-events: none; will-change: transform;
}
.hero .hills.back { height: 170px; bottom: 30px; opacity: 0.9; }
@media (prefers-reduced-motion: reduce) {
  .star { animation: none; }
}
.hero-logo { width: min(460px, 84vw); margin: 0 auto 1.2rem; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5)); }
.tagline {
  font-style: italic; font-size: clamp(1.3rem, 3.4vw, 1.75rem); color: var(--parchment);
  margin: 0 auto 1.6rem; max-width: 40rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; margin-top: 1.4rem; }
.hero .wrap { position: relative; z-index: 1; }

/* ---------- Status pill ---------- */
.status {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--display); font-size: 0.85rem; letter-spacing: 0.08em;
  padding: 0.45rem 0.9rem; border-radius: 999px;
  background: rgba(18,38,44,0.85); border: 1px solid var(--line); color: var(--text);
}
.status .dot { width: 10px; height: 10px; border-radius: 2px; background: var(--muted); flex: none; }
.status.online .dot { background: #5ed39a; box-shadow: 0 0 10px #5ed39a; animation: pulse 2s infinite; }
.status.offline .dot { background: var(--brick); }
@keyframes pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .status.online .dot { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Copy address ---------- */
.address {
  display: inline-flex; align-items: stretch; max-width: 100%;
  border: 2px solid var(--gold); border-radius: var(--radius); background: rgba(11,20,24,0.7);
}
.address code {
  font-family: var(--display); font-weight: 700; letter-spacing: 0.1em; font-size: clamp(0.95rem, 3vw, 1.2rem);
  color: var(--gold-bright); padding: 0.7rem 1rem; overflow-wrap: anywhere; text-align: left;
}
.address button {
  border: 0; border-left: 2px solid var(--gold); background: var(--gold); color: var(--night);
  font-family: var(--display); font-weight: 700; letter-spacing: 0.1em; font-size: 0.8rem; text-transform: uppercase;
  padding: 0 1rem; cursor: pointer; min-width: 84px;
}
.address button:hover { background: var(--gold-bright); }

/* ---------- Banner ---------- */
.event-banner {
  background: linear-gradient(90deg, #2a1636, #3a1b1b);
  border-bottom: 1px solid rgba(180,69,60,0.4);
  font-size: 1rem;
}
.event-banner .wrap { padding-top: 0.7rem; padding-bottom: 0.7rem; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.event-banner strong { font-family: var(--display); color: #ffb36b; letter-spacing: 0.06em; }

/* ---------- Sections ---------- */
section { padding: 88px 0; }
section.alt { background: var(--night-2); border-top: 1px solid rgba(255,255,255,0.04); border-bottom: 1px solid rgba(255,255,255,0.04); }
.section-head { margin-bottom: 2.4rem; }

.grid { display: grid; gap: 1.2rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

.card {
  background: var(--ink);
  border: 1px solid rgba(255,255,255,0.06);
  border-top: 3px solid var(--accent, var(--gold));
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card h3 { color: var(--accent-text, var(--parchment)); }
.card .tag {
  display: inline-block; font-family: var(--display); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent, var(--gold)); margin-bottom: 0.4rem;
}
.card.teal { --accent: var(--teal-bright); }
.card.brick { --accent: #e06a5f; }
.card.violet { --accent: #a98bd6; }

ul.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
ul.ticks li { position: relative; padding-left: 1.4rem; margin-bottom: 0.45rem; }
ul.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; background: var(--accent, var(--gold));
}

/* ---------- Join ---------- */
.join-card .address { margin: 0.4rem 0 0.9rem; }
.join-card .field { margin-bottom: 0.4rem; font-family: var(--display); font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.steps { padding-left: 1.3rem; margin: 0 0 1em; }
.steps li { margin-bottom: 0.4rem; }

/* ---------- Stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--night); padding: 1.3rem 1rem; text-align: center; }
.stat b { display: block; font-family: var(--display); font-size: 1.9rem; color: var(--gold-bright); line-height: 1.1; }
.stat span { font-size: 0.95rem; color: var(--muted); }

/* ---------- Feature page ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.toc a {
  font-family: var(--display); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.9rem; color: var(--text);
}
.toc a:hover { border-color: var(--gold); color: var(--gold-bright); }
.feature { scroll-margin-top: 80px; }
.feature + .feature { margin-top: 3.5rem; }
.feature > h2 { display: flex; align-items: center; gap: 0.7rem; }
.feature > h2::before { content: ""; width: 14px; height: 14px; background: var(--gold); flex: none; }

table.data { width: 100%; border-collapse: collapse; font-size: 1rem; margin: 0 0 1em; }
table.data th, table.data td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid rgba(255,255,255,0.07); }
table.data th { font-family: var(--display); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* ---------- Rules ---------- */
.rule-chapter { scroll-margin-top: 80px; }
.rule-chapter + .rule-chapter { margin-top: 3rem; }
.rule-chapter .motto { font-style: italic; color: var(--muted); margin-top: -0.3rem; }
.rule { border-left: 3px solid var(--gold-dim); padding: 0.2rem 0 0.2rem 1.1rem; margin: 1.2rem 0; }
.rule h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.rule h3 .code { color: var(--gold); margin-right: 0.5rem; }

details.faq {
  background: var(--ink); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius);
  padding: 0; margin-bottom: 0.7rem;
}
details.faq summary {
  cursor: pointer; padding: 1rem 1.2rem; font-family: var(--display); font-weight: 700; color: var(--parchment);
  list-style: none; display: flex; justify-content: space-between; gap: 1rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--gold); font-size: 1.3rem; line-height: 1; }
details.faq[open] summary::after { content: "\2212"; }
details.faq .answer { padding: 0 1.2rem 1.1rem; }

/* ---------- Vote ---------- */
.vote-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0.7rem; margin-top: 1.5rem; }
.vote-list a {
  display: block; text-decoration: none; text-align: center; padding: 1rem; border-radius: var(--radius);
  background: var(--ink); border: 1px solid var(--line); color: var(--parchment); font-family: var(--display); font-weight: 700; letter-spacing: 0.04em;
}
.vote-list a:hover { border-color: var(--gold); color: var(--gold-bright); }

/* ---------- Page header (subpages) ---------- */
.page-head { padding: 64px 0 40px; background: linear-gradient(#060c0f, var(--night)); border-bottom: 1px solid var(--line); }

/* ---------- Footer ---------- */
footer { padding: 48px 0; border-top: 1px solid var(--line); font-size: 0.95rem; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
footer a { color: var(--text); }
.small { font-size: 0.9rem; }

.hidden { display: none !important; }
