/* New Game Plus — shared site styles.
   Palette and type ported verbatim from src/ui/theme.ts ("Tavern Runestone":
   candle-lit wood, carved stone, gold trim, arcane mana through the cracks).
   Fonts are self-hosted from site/fonts/ — the site makes zero third-party
   requests, which is the same promise the app makes. */

/* ---------------------------------------------------------------- fonts -- */

@font-face {
  font-family: 'Cinzel';
  src: url('fonts/Cinzel_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Alegreya';
  src: url('fonts/Alegreya_500Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Alegreya';
  src: url('fonts/Alegreya_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- tokens -- */

:root {
  --bg: #161009;
  --bg-top: #241812;
  --bg-bottom: #0d0804;
  --panel: #241a10;
  --panel-2: #46331f;
  --card-top: #2b1f12;
  --card-bottom: #211708;
  --text: #f0e6cf;
  --body: #d5c7ab;
  --dim: #a6957a;
  --accent: #e3b04b;
  --accent-2: #9c742a;
  --gold: #f4cd66;
  --gold-edge: #6b4c17;
  --on-gold: #241703;
  --mana: #5fc8e8;
  --mana-core: #bfeaff;
  --ember: #ffb45e;
  --good: #8fbf6a;

  --head: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --text-font: 'Alegreya', Georgia, 'Times New Roman', serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --wrap: 1080px;
  --prose: 720px;
}

/* ---------------------------------------------------------------- base -- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 500 18px/1.7 var(--text-font);
  overflow-x: hidden;
}

/* The TavernBackground recreated without canvas: a lantern-warmed radial
   vignette, a soft-light wood grain (the same feTurbulence the app uses), and
   two blurred ember pools where the lantern light hits the wall. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 95% at 50% 22%, var(--bg-top) 0%, var(--bg) 45%, var(--bg-bottom) 100%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.06 0.004' numOctaves='2'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------- layout -- */

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

.prose {
  max-width: var(--prose);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 76px 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--on-gold);
  padding: 10px 18px;
  border-radius: var(--r-md);
  z-index: 100;
  font-family: var(--head);
}
.skip:focus {
  left: 12px;
  top: 12px;
}

/* ------------------------------------------------------------ typography -- */

h1,
h2,
h3,
.wordmark,
.eyebrow {
  font-family: var(--head);
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: clamp(34px, 6.2vw, 62px);
  letter-spacing: 0.03em;
}
h2 {
  font-size: clamp(22px, 3.4vw, 30px);
  color: var(--gold);
}
h3 {
  font-size: 17px;
  letter-spacing: 0.11em;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--dim);
  margin-bottom: 14px;
}

p {
  margin: 0 0 18px;
}

a {
  color: var(--accent);
  text-decoration-color: rgba(227, 176, 75, 0.4);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--gold);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--mana);
  outline-offset: 3px;
  border-radius: 4px;
}

.lede {
  font-size: clamp(18px, 2.3vw, 21px);
  color: var(--body);
}

.muted {
  color: var(--dim);
  font-size: 15px;
}

strong,
b {
  font-weight: 700;
  color: var(--text);
}

/* -------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--head);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: var(--r-md);
  border: 1px solid var(--gold-edge);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.btn:active {
  transform: translateY(0);
}

.btn-gold {
  background: linear-gradient(180deg, #f0c25d, var(--accent-2));
  color: var(--on-gold);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 244, 214, 0.35);
}
.btn-gold:hover {
  color: var(--on-gold);
}

.btn-ghost {
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border-color: var(--panel-2);
  color: var(--text);
}
.btn-ghost:hover {
  color: var(--gold);
  border-color: var(--gold-edge);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ---------------------------------------------------------------- cards -- */

.card {
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--panel-2);
  border-radius: var(--r-lg);
  padding: 26px;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ---------------------------------------------------------------- icons -- */

/* The inline sprite. `hidden` alone won't do it: the UA stylesheet's [hidden]
   rule sits under an XHTML default namespace, so it never matches an <svg>
   root and the sprite reserves a 300×150 box. */
.sprite {
  display: none;
}

.ico {
  width: 26px;
  height: 26px;
  color: var(--gold);
  flex: none;
}

.ico-lg {
  width: 34px;
  height: 34px;
}

/* --------------------------------------------------------------- header -- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(22, 16, 9, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(70, 51, 31, 0.7);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 66px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  letter-spacing: 0.13em;
  color: var(--gold);
  text-decoration: none;
  margin-right: auto;
}
.wordmark img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--gold-edge);
}

.site-nav {
  display: flex;
  gap: 24px;
  font-family: var(--head);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-nav a {
  color: var(--dim);
  text-decoration: none;
}
.site-nav a:hover {
  color: var(--gold);
}

/* --------------------------------------------------------------- footer -- */

.site-foot {
  border-top: 1px solid var(--panel-2);
  padding: 44px 0 60px;
  font-size: 15px;
  color: var(--dim);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-family: var(--head);
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.attrib {
  font-size: 13px;
  line-height: 1.65;
  color: #8b7c65;
  max-width: 760px;
}

/* ----------------------------------------------------------- prose pages -- */

/* Vertical only — a `padding` shorthand here would wipe out the horizontal
   padding .prose/.wrap set, and the text would run to the screen edge. */
.doc {
  padding-top: 56px;
  padding-bottom: 88px;
}
.doc h1 {
  font-size: clamp(26px, 4.4vw, 36px);
  margin-bottom: 6px;
}
.doc h2 {
  font-size: 20px;
  margin: 40px 0 12px;
  padding-top: 6px;
  border-top: 1px solid rgba(70, 51, 31, 0.6);
}
.doc h2:first-of-type {
  border-top: none;
}
.doc h3 {
  margin: 26px 0 8px;
  color: var(--accent);
}
.doc ul,
.doc ol {
  padding-left: 22px;
  margin: 0 0 18px;
}
.doc li {
  margin-bottom: 9px;
}
.doc .date {
  font-family: var(--head);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 30px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 16px;
}
.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(70, 51, 31, 0.6);
}
.doc th {
  font-family: var(--head);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold);
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* FAQ accordions — <details>/<summary>, no script. */
.faq details {
  border: 1px solid var(--panel-2);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 46px 16px 20px;
  position: relative;
  font-family: var(--head);
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--text);
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 20px;
  line-height: 1;
}
.faq details[open] summary::after {
  content: '−';
}
.faq summary:hover {
  color: var(--gold);
}
.faq .body {
  padding: 0 20px 6px;
  font-size: 16px;
}
.faq .body p:last-child,
.faq .body ul:last-child {
  margin-bottom: 18px;
}

.callout {
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--panel-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 18px 22px;
  margin: 0 0 26px;
}
.callout p:last-child {
  margin-bottom: 0;
}

/* -------------------------------------------------------------- utility -- */

.center {
  text-align: center;
}
.center .btn-row {
  justify-content: center;
}

.tag {
  display: inline-block;
  font-family: var(--head);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mana-core);
  background: rgba(95, 200, 232, 0.12);
  border: 1px solid rgba(95, 200, 232, 0.35);
  border-radius: 999px;
  padding: 3px 9px;
  vertical-align: 2px;
}

hr {
  border: none;
  border-top: 1px solid var(--panel-2);
  margin: 38px 0;
}

@media (max-width: 640px) {
  body {
    font-size: 17px;
  }
  section {
    padding: 54px 0;
  }
  .site-nav {
    display: none;
  }
  .card {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
