/* Self-hosted fonts only (SIL Open Font License; see FONT-NOTICES.txt, OFL-Cinzel.txt, OFL-IMFell.txt):
   Cinzel for titles and labels, IM Fell English for text. Nothing is loaded from another origin.
   Both are Basic Latin and Latin-1 subsets, so the pair is about 75 KB. */
@font-face {
  font-family: "Cinzel";
  src: url("./cinzel-latin.40fbd3a3dd96.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: "IM Fell English";
  src: url("./imfell-english.e9474ef5e4ba.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Stone, leather, parchment and dull gold: a muted, earthy palette. */
  --stone-0: #14110d;
  --stone-1: #1d1914;
  --stone-2: #2a241c;
  --mat: #2a1d12;
  --gold: #b8923a;
  --gold-hi: #dcc27a;
  --gold-lo: #6e5420;
  --gold-text: #d8bd78;
  --parch: #e3d0a0;
  --parch-hi: #f1e3bd;
  --ink: #2a1b0d;
  --ink-soft: #4d3a21;
  --blood: #7a1d12;
  --blood-btn: #8a1c12;
  --text: #e6dcc4;
  --text-dim: #b8ad96;
  --display: "Cinzel", "Trajan Pro", "Palatino Linotype", Georgia, serif;
  --body: "IM Fell English", "Palatino Linotype", Palatino, Georgia, serif;
  --gutter: clamp(1.1rem, 4vw, 4rem);
}

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

html {
  color-scheme: dark;
  font-family: var(--body);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  /* Item quality, used only as a small accent: --q for borders and icons, --qt (a lighter tint of
     the same hue) for the few text uses, because the plain colour is under 4.5:1 on dark stone. */
  --q: #0070dd; /* rare */
  --qt: #5aa9f5;
  --bw: 20px; /* frame thickness */
}

html[data-site="spellreflect"],
html[data-site="battledebrief"] {
  --q: #a335ee; /* epic */
  --qt: #c78bff;
}

body {
  margin: 0;
  min-width: 20rem;
  color: var(--text);
  font-size: 1.15rem;
  background-color: var(--stone-1);
  /* Dark flagstone: vignette, a faint course and joint grid, then the stone grain (soft-light). */
  background-image:
    radial-gradient(140% 100% at 50% 20%, transparent 50%, rgba(0, 0, 0, 0.6) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.3) 0 2px, rgba(255, 255, 255, 0.025) 2px 3px, transparent 3px 112px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 224px),
    url("grain-stone.e4225b33dd.png"),
    linear-gradient(180deg, #221c15, #15110d);
  background-blend-mode: normal, normal, normal, soft-light, normal;
  background-attachment: scroll;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

h1,
h2,
p,
ul,
ol {
  margin-block-start: 0;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.vf-label {
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.vf-skip-link {
  position: absolute;
  z-index: 10;
  inset: 0 auto auto 0;
  padding: 0.75rem 1rem;
  background: var(--gold-hi);
  color: var(--stone-0);
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  transform: translateY(-110%);
}

.vf-skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--gold-hi);
  outline-offset: 3px;
}

::selection {
  background: var(--gold);
  color: var(--stone-0);
}

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 var(--gutter);
  max-width: 84rem;
  margin: 0 auto;
}

main {
  flex: 1;
  padding-block: clamp(1.75rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 4.5rem);
}

/* ---- Frames: a dark mat with a dull-gold double rule and corner flourishes (frame.svg, 9-slice).
   Reading panels are parchment, the signup is a dark leather dialog. ---- */
.signup,
.notice,
.legal,
.report__card,
html[data-site="foreverhead"] .hero__copy {
  border: var(--bw) solid var(--mat);
  border-image: url("frame.87ada499ee.svg") 24 / var(--bw) stretch;
  background-origin: padding-box;
  background-clip: padding-box;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.6);
}

.notice,
.legal,
.report__card,
html[data-site="foreverhead"] .hero__copy {
  color: var(--ink);
  background-color: var(--parch);
  /* Aged parchment: darkened edges, paper grain (soft-light), a slight top-to-bottom stain. */
  background-image:
    radial-gradient(120% 110% at 50% 45%, transparent 55%, rgba(105, 65, 22, 0.38) 100%),
    url("grain-paper.10d7145a90.png"),
    linear-gradient(180deg, #ebdbb2, #d8c08a);
  background-blend-mode: normal, soft-light, normal;
}

.signup {
  background-color: #241b12;
  background-image: url("grain-stone.e4225b33dd.png"), linear-gradient(180deg, #30241a, #1a130c);
  background-blend-mode: soft-light, normal;
}

/* ---- Masthead ---- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem 1rem;
  border-bottom: 3px double var(--gold);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--parch-hi);
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 2px 0 #000;
  text-transform: uppercase;
}

/* An item icon: dark tile, bevel, a one-pixel-rule border in the quality colour, gold letter. */
.wordmark__mark {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--q);
  border-radius: 3px;
  background: linear-gradient(145deg, #3a2c1d, #14100b);
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(255, 235, 180, 0.3), inset 0 -2px 3px rgba(0, 0, 0, 0.6);
  color: var(--gold-hi);
  font-size: 1.35rem;
  text-shadow: 0 1px 0 #000;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  color: var(--text-dim);
}

.status__dot {
  width: 0.55rem;
  height: 0.55rem;
  background: var(--qt);
  border: 1px solid #000;
  transform: rotate(45deg);
}

/* ---- Hero ---- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(20rem, 1fr);
  gap: clamp(1.75rem, 4vw, 3.25rem);
  align-items: start;
}

.hero__kicker,
.notice__kicker {
  margin-bottom: 0.9rem;
  color: var(--gold-text);
}

.hero h1 {
  margin-bottom: 1.2rem;
  font-size: clamp(2.1rem, 4.6vw, 3.75rem);
  color: var(--parch-hi);
  text-shadow: 0 3px 0 #000;
}

.hero__sub {
  max-width: 38rem;
  margin-bottom: 0;
  font-size: 1.25rem;
  line-height: 1.5;
}

/* Foreverhead reads on a parchment scroll */
html[data-site="foreverhead"] .hero__copy {
  padding: clamp(1.1rem, 3vw, 2rem) clamp(1rem, 3vw, 2.1rem) clamp(1.2rem, 3vw, 2.2rem);
}

html[data-site="foreverhead"] .hero__kicker,
.notice__kicker,
.legal .notice__kicker {
  color: var(--blood);
}

html[data-site="foreverhead"] .hero h1 {
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 245, 210, 0.55);
}

html[data-site="foreverhead"] .hero__sub {
  color: var(--ink);
}

/* ---- Signup dialog ---- */
.signup {
  padding: clamp(1rem, 2.4vw, 1.5rem);
  scroll-margin-top: 1rem;
}

.signup__title {
  margin: 0 0 1.1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--gold-lo);
  color: var(--gold-text);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  line-height: 1.2;
  font-weight: 700;
}

.vf-field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
}

.vf-field label {
  color: var(--text-dim);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* An in-game edit box: dark, inset, thin gold rule. */
.vf-field input {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.6rem 0.85rem;
  border: 2px solid var(--gold-lo);
  border-radius: 3px;
  outline: 0;
  background: #0d0a07;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(220, 194, 122, 0.25);
  color: var(--parch-hi);
  font-size: 1.15rem;
}

.vf-field input::placeholder {
  color: #918671;
}

.vf-field input:focus {
  border-color: var(--gold-hi);
}

.vf-field input[aria-invalid="true"] {
  border-color: #e0705f;
}

.trap {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  white-space: nowrap;
}

.signup__error {
  margin: 0 0 1.2rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #b4402f;
  border-radius: 3px;
  background: rgba(122, 29, 18, 0.45);
  font-size: 1.02rem;
}

.signup__error span {
  display: inline-grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: #e0705f;
  color: var(--stone-0);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8rem;
}

/* The classic red UI button: dark red gradient, gold bevel, a pressed state. */
.button {
  display: block;
  width: 100%;
  min-height: 3.2rem;
  padding: 0.7rem 1.1rem;
  border: 2px solid #120a06;
  border-radius: 4px;
  background: linear-gradient(180deg, #a8281b 0%, #861a10 46%, #5e0f09 54%, #7a150d 100%);
  box-shadow:
    0 0 0 1px var(--gold),
    inset 0 1px 0 rgba(255, 214, 140, 0.5),
    inset 0 0 0 1px rgba(0, 0, 0, 0.3),
    0 3px 5px rgba(0, 0, 0, 0.6);
  color: #f3dc9a;
  cursor: pointer;
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-shadow: 0 1px 0 #000;
  text-transform: uppercase;
}

.button:hover {
  background: linear-gradient(180deg, #bb3425 0%, #971f14 46%, #6c130b 54%, #8a1a10 100%);
  color: #fff0c0;
}

.button:active {
  transform: translateY(1px);
  background: linear-gradient(180deg, #5a0e08 0%, #751410 46%, #861a10 54%, #96200f 100%);
  box-shadow:
    0 0 0 1px var(--gold-lo),
    inset 0 3px 6px rgba(0, 0, 0, 0.75);
}

.signup__fine {
  margin: 1rem 0 0;
  color: var(--text-dim);
  font-size: 0.98rem;
  line-height: 1.45;
}

.signup__fine a {
  color: var(--gold-text);
}

.signup--closed .signup__closed {
  margin: 0 0 1rem;
  color: var(--parch-hi);
  font-size: 1.3rem;
  line-height: 1.35;
}

/* ---- Benefits: three item tooltips ---- */
.benefits {
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.benefits__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 1.75rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.benefit {
  padding: 0.95rem 1.2rem 1.15rem;
  border: 1px solid #857d6a;
  border-radius: 4px;
  background: rgba(7, 6, 9, 0.92);
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 8px 16px rgba(0, 0, 0, 0.5);
}

.benefit__num {
  display: block;
  margin-bottom: 0.3rem;
  color: #a39679;
  font-size: 0.72rem;
}

.benefit__title {
  margin-bottom: 0.45rem;
  color: var(--qt);
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}

.benefit p {
  margin: 0;
  color: #f0e6c8;
  line-height: 1.45;
}

/* ---- Notice, privacy ---- */
.notice {
  max-width: 44rem;
  margin-top: clamp(0.5rem, 3vw, 1.5rem);
  padding: clamp(1.1rem, 3.5vw, 2.1rem);
}

.notice h1,
.legal h1 {
  margin-bottom: 1rem;
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 245, 210, 0.55);
}

.notice__lead {
  margin-bottom: 1.4rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

.notice__list {
  margin: 0 0 1.8rem;
  padding: 0 0 0 1.2rem;
}

.notice__list li {
  margin-bottom: 0.5rem;
}

.notice form {
  max-width: 24rem;
}

.notice a,
.legal a {
  color: #6b1a10;
  text-decoration-color: rgba(107, 26, 16, 0.55);
  text-underline-offset: 0.2em;
}

.textlink {
  color: var(--blood);
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-underline-offset: 0.35em;
}

.legal {
  max-width: 48rem;
  margin-top: clamp(0.5rem, 3vw, 1.5rem);
  padding: clamp(1.1rem, 3.5vw, 2.4rem);
}

.legal__meta {
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
  font-style: italic;
}

.legal h2:not(.vf-label) {
  margin: 1.9rem 0 0.4rem;
  color: var(--blood);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
}

.legal p,
.legal li {
  line-height: 1.55;
}

.summary {
  padding: 1rem 1.2rem;
  border: 1px solid rgba(90, 60, 20, 0.45);
  border-left: 5px solid var(--q);
  border-radius: 3px;
  background: rgba(80, 52, 14, 0.1);
}

.summary h2 {
  margin: 0 0 0.6rem;
  color: var(--blood);
  font-size: 0.8rem;
}

.summary ul {
  margin: 0;
  padding-left: 1.1rem;
}

.summary li {
  margin-bottom: 0.35rem;
}

/* ---- Guides ---- */
.guide-teaser {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.guide h3 {
  margin: 1.2rem 0 0.25rem;
  color: var(--ink);
  font-size: 1.05rem;
}

.guide__lead {
  font-size: 1.15rem;
  line-height: 1.5;
}

.guide ul,
.guide ol {
  padding-left: 1.3rem;
}

.guide-list {
  padding-left: 0 !important;
  list-style: none;
}

.guide-list li {
  display: grid;
  gap: 0.1rem;
  margin-bottom: 0.8rem;
}

.guide-list li > span {
  color: var(--ink-soft);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  margin: 0 0 1rem;
  padding: 0 !important;
  list-style: none;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.crumbs li {
  margin: 0;
}

.crumbs li + li::before {
  content: "\203A";
  margin-right: 0.6rem;
}

.sources li {
  overflow-wrap: anywhere;
}

.table-wrap {
  margin: 0.8rem 0 1rem;
  overflow-x: auto;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
}

.guide-table caption {
  padding-bottom: 0.4rem;
  color: var(--ink-soft);
  font-style: italic;
  text-align: left;
}

.guide-table th,
.guide-table td {
  padding: 0.45rem 0.7rem 0.45rem 0;
  border-bottom: 1px solid rgba(90, 60, 20, 0.35);
  text-align: left;
  vertical-align: top;
}

.guide-signup {
  max-width: 48rem;
  margin-top: clamp(1.25rem, 3vw, 2rem);
}

.guide-signup__lead {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  line-height: 1.5;
}

.guide-signup .signup {
  max-width: 30rem;
}

/* ---- Footer ---- */
.footer {
  display: grid;
  gap: 0.55rem;
  padding-block: 1.4rem 2rem;
  border-top: 3px double var(--gold);
}

.footer p {
  margin: 0;
}

.footer__line {
  color: var(--parch-hi);
  font-size: 1.12rem;
}

.footer__small {
  max-width: 50rem;
  color: var(--text-dim);
  font-size: 0.98rem;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.5rem;
  margin-top: 0.3rem;
}

.footer__nav a {
  display: inline-block;
  padding-block: 0.45rem;
  color: var(--gold-text);
  text-decoration-color: var(--gold-lo);
  text-underline-offset: 0.35em;
}

.footer__nav a[aria-current="page"] {
  color: var(--parch-hi);
}

/* ---- Phones and narrow windows ---- */
@media (max-width: 56rem) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .benefits__list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 30rem) {
  html {
    --bw: 14px;
  }

  .hero h1 {
    font-size: 2.15rem;
  }

  .masthead {
    flex-wrap: wrap;
  }

  .wordmark {
    font-size: 1.3rem;
  }
}
