/* The Dungeon Games campaign skin: Direction A, the Illuminated Registry.
   Loaded after /theme.css on every campaign page (the campaign page, intake, lines and veils).
   It redefines the shared tokens to a light imperial-document palette and adds the ornaments
   those pages share: a gilt masthead rule, a registry seal, document rules, and panels.
   Crisp document geometry, no torn-paper scroll, near-zero motion. */

:root {
  color-scheme: light;

  --bg: #f4efe4;            /* bone */
  --surface: #fbf7ee;       /* card and input surface */
  --surface-2: #efe7d6;     /* inset / striping */
  --ink: #231c13;           /* warm ink */
  --muted: #5c5344;         /* passes AA on bone */
  --line: #ddd1b8;          /* warm rule */
  --accent: #8e2b22;        /* seal crimson, primary actions */
  --on-accent: #f7f1e3;
  --accent-soft: #a23a2f;
  --gilt: #9a7628;          /* decorative rules, the seal, and large display numerals only */
  --gilt-ink: #785b1c;      /* darker gilt that passes AA for small text */
  --indigo: #2e3a54;        /* district indigo, links and wayfinding */
  --focus: #8e2b22;

  --font-display: "Marcellus", Georgia, "Times New Roman", serif;
  --font-body: "Spectral", Georgia, "Times New Roman", serif;
}

body { font-feature-settings: "onum" 1; }      /* old-style numerals suit the ledger */

a { color: var(--indigo); }                      /* links indigo, actions crimson */

/* Masthead reads as the head of an official record. */
.masthead {
  border-bottom: 1px solid var(--gilt);
  text-align: center;
}
.masthead .kicker {
  color: var(--gilt-ink);
  font-family: var(--font-display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.masthead .lede { margin-inline: auto; font-style: italic; color: var(--muted); }

/* The registry seal: original inline SVG, decorative. */
.seal { display: block; width: 76px; height: 76px; margin: 0 auto 0.9rem; color: var(--gilt); }
.seal svg { width: 100%; height: 100%; }

/* Document divider: a gilt hairline with a centred lozenge. */
.rule {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2.5rem 0;
  position: relative;
  overflow: visible;
}
.rule::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 7px; height: 7px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--gilt);
}

/* A framed aside: the pitch, the safety note, the anonymity statement. */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gilt);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

/* Section heading with a short gilt underline, instead of a tracked all-caps eyebrow. */
.section-head { margin: 0 0 1rem; }
.section-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  font-weight: 400;
  letter-spacing: 0.005em;
}
.section-head .count { color: var(--muted); font-size: 0.95rem; font-family: var(--font-body); }
.section-head::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin-top: 0.6rem;
  background: var(--gilt);
}

/* Primary action on bone: crimson with a thin gilt keyline and the display face. */
.btn {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  border-color: color-mix(in srgb, var(--gilt) 55%, transparent);
}
.btn--ghost { color: var(--indigo); border-color: var(--line); background: transparent; }
.btn--full { display: flex; width: 100%; min-height: 48px; }

/* Shared chrome for the tool pages (the intake, lines-and-veils, and invite forms). */
.hp { position: absolute; left: -9999px; width: 1px; height: 0; overflow: hidden; }
.turnstile-box { margin: 1.4rem 0 0; min-height: 65px; }
#errors { color: var(--accent); font-weight: 600; min-height: 1.4em; margin: 1rem 0 0; }
#done { margin-top: 1.5rem; }
#done h2 { font-family: var(--font-display); font-weight: 400; margin-top: 0; }

/* Persistent sticky section nav across the campaign pages. */
.campnav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: 1px solid var(--gilt);
}
.campnav ul {
  display: flex;
  gap: 0.15rem;
  list-style: none;
  margin: 0 auto;
  padding: 0 8px;
  max-width: var(--measure);
  overflow-x: auto;
  scrollbar-width: none;
}
.campnav ul::-webkit-scrollbar { display: none; }
.campnav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.8rem;
  color: var(--indigo);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 0.98rem;
  border-bottom: 2px solid transparent;
}
.campnav a:hover { color: var(--accent); }
.campnav a[aria-current="page"],
.campnav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--gilt); }

/* Anchor targets clear the sticky nav when scrolled to. */
:target { scroll-margin-top: 4rem; }

/* Compact header for inner pages (the forms and the content pages that are not the overview). */
.pagehead { max-width: var(--measure); margin-inline: auto; padding: 1.5rem 16px 0.5rem; }
.pagehead .kicker {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gilt-ink);
}
.pagehead h1 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 6vw, 2.5rem); line-height: 1.08; }
.pagehead .lede { margin: 0.6rem 0 0; max-width: 60ch; color: var(--muted); font-style: italic; }

/* Button loading state: an absolutely positioned spinner, so the label and width do not move. */
.btn[aria-busy="true"] { position: relative; cursor: wait; }
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  right: 0.9rem;
  top: 50%;
  width: 1em;
  height: 1em;
  margin-top: -0.5em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn[aria-busy="true"]::after { animation: none; } }

/* Inline invalid feedback: a border change only, so no layout shift. */
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
