/* ==========================================================================
   Pax Autocratica Compendium
   Palette pulled from the game itself: concrete greys, rust-red state banners,
   amber HUD, and the teal/green/red the in-game UI uses for trait polarity.
   ========================================================================== */

:root {
  --bg: #0c0a09;
  --bg-2: #100d0b;
  --surface: #17120f;
  --surface-2: #1e1815;
  --surface-3: #241d19;
  --line: #2e2620;
  --line-2: #3d332b;

  --text: #ece5db;
  --text-2: #b8ada1;
  --muted: #8b8079;

  --red: #e03e2d;
  --red-dark: #a82a1c;
  --red-glow: rgba(224, 62, 45, 0.18);
  --amber: #f0b429;
  --amber-dim: #b3831b;
  --teal: #2fc7a4;
  --green: #7bd35b;
  --purple: #b06cf0;
  --blue: #5aa9e6;

  --radius: 3px;
  --wrap: 1160px;
  --measure: 74ch;

  --ff-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --ff-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 18px 40px -24px rgba(0, 0, 0, 0.9);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 15% -10%, rgba(224, 62, 45, .09), transparent 60%),
    radial-gradient(700px 420px at 92% 4%, rgba(240, 180, 41, .06), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--ff-sans);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--amber); text-decoration-color: rgba(240, 180, 41, .35); text-underline-offset: 3px; }
a:hover { color: #ffd166; text-decoration-color: currentColor; }
code { font-family: var(--ff-mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); padding: .1em .38em; border-radius: var(--radius); color: var(--amber); }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--amber); color: #14100c; padding: .6rem 1rem; font-weight: 700;
}
.skip:focus { left: 0; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* ---------- Header ---------------------------------------------------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 10, 9, .93);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head::after {
  content: ""; display: block; height: 2px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-dark) 32%, transparent 32%, transparent 100%);
}
.head-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 62px; }

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); margin-right: auto; }
.brand-mark {
  width: 30px; height: 30px; flex: none; margin-right: .1rem;
  filter: drop-shadow(0 0 16px var(--red-glow));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-size: .84rem; letter-spacing: .16em; font-weight: 800; }
.brand-text i { font-style: normal; font-size: .64rem; letter-spacing: .28em; color: var(--muted); text-transform: uppercase; }

.site-nav { display: flex; align-items: center; gap: 1.4rem; }
.site-nav ul { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  color: var(--text-2); text-decoration: none; font-size: .8rem;
  letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
  padding: .35rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); border-bottom-color: var(--red); }
.lang-switch {
  border: 1px solid var(--line-2); padding: .28rem .6rem !important; border-radius: var(--radius);
  color: var(--amber) !important; border-bottom-width: 1px !important;
}
.lang-switch:hover { background: var(--surface-2); border-color: var(--amber) !important; }

.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); border-radius: var(--radius); width: 40px; height: 34px; padding: 8px 9px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--text); margin-bottom: 4px; }
.nav-toggle span:last-child { margin-bottom: 0; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; inset: 62px 0 auto; display: none; flex-direction: column;
    align-items: stretch; gap: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .lang-switch { margin-top: .8rem; align-self: flex-start; }
}

/* ---------- Page head ------------------------------------------------- */

.page-head { padding: 2.6rem 0 1.4rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0 0 1rem; padding: 0; font-size: .78rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: .45rem; color: var(--line-2); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--amber); }
.crumbs [aria-current] { color: var(--text-2); }

h1 {
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem);
  line-height: 1.06; letter-spacing: -.02em; font-weight: 800;
  margin: 0 0 .7rem; max-width: 20ch; text-wrap: balance;
}
.standfirst { font-size: 1.14rem; color: var(--text-2); max-width: var(--measure); margin: 0 0 1.1rem; }
.standfirst strong { color: var(--text); }

.updated { font-size: .78rem; color: var(--muted); margin: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.updated .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); flex: none; }
.updated code { font-size: .75rem; }

/* ---------- Sections & prose ------------------------------------------ */

.sect { padding: 2.2rem 0 .4rem; }
.sect > h2, .prose h2 {
  font-size: clamp(1.35rem, 1.1rem + .8vw, 1.85rem); font-weight: 800; letter-spacing: -.015em;
  margin: 0 0 1rem; padding-left: .85rem; position: relative; text-wrap: balance;
}
.sect > h2::before, .prose h2::before {
  content: ""; position: absolute; left: 0; top: .18em; bottom: .18em; width: 4px; background: var(--red);
}
.kicker { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--red); font-weight: 800; margin: 0 0 .5rem; }

.prose { max-width: var(--measure); }
.prose h3 { font-size: 1.1rem; letter-spacing: -.01em; margin: 2rem 0 .6rem; color: var(--text); }
.prose h4 { font-size: .95rem; margin: 1.5rem 0 .4rem; color: var(--amber); letter-spacing: .02em; }
.prose p, .sect p { margin: 0 0 1.05rem; max-width: var(--measure); }
.prose ul, .prose ol, .sect ul, .sect ol { max-width: var(--measure); padding-left: 1.25rem; margin: 0 0 1.15rem; }
.prose li, .sect li { margin-bottom: .5rem; }
.prose li::marker, .sect li::marker { color: var(--red); }
.prose strong { color: #fff; }
blockquote { margin: 1.4rem 0; padding: .2rem 0 .2rem 1.1rem; border-left: 3px solid var(--line-2); color: var(--text-2); font-style: italic; }

.lede { font-size: 1.08rem; color: var(--text-2); }

/* ---------- Tables ---------------------------------------------------- */

.tblwrap { overflow-x: auto; margin: 0 0 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 460px; }
thead th {
  text-align: left; font-size: .7rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--amber); background: var(--surface-2); padding: .7rem .85rem; border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
tbody th, tbody td { padding: .68rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody th { text-align: left; font-weight: 700; color: var(--text); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .017); }
td small, th small { color: var(--muted); display: block; font-size: .8em; font-weight: 400; }

.yes { color: var(--teal); font-weight: 700; }
.no { color: var(--red); font-weight: 700; }
.maybe { color: var(--amber); font-weight: 700; }

/* rarity pills */
.pill { display: inline-block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; padding: .12rem .45rem; border-radius: 2px; border: 1px solid; }
.pill.green { color: var(--green); border-color: rgba(123, 211, 91, .4); background: rgba(123, 211, 91, .09); }
.pill.purple { color: var(--purple); border-color: rgba(176, 108, 240, .4); background: rgba(176, 108, 240, .09); }
.pill.red { color: var(--red); border-color: rgba(224, 62, 45, .45); background: rgba(224, 62, 45, .1); }
.pill.amber { color: var(--amber); border-color: rgba(240, 180, 41, .4); background: rgba(240, 180, 41, .09); }
.pill.teal { color: var(--teal); border-color: rgba(47, 199, 164, .4); background: rgba(47, 199, 164, .09); }

/* ---------- Callouts -------------------------------------------------- */

.callout {
  margin: 1.6rem 0; padding: 1rem 1.1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-2);
  max-width: var(--measure);
}
.callout .ct { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; margin: 0 0 .45rem; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--red); background: linear-gradient(90deg, rgba(224, 62, 45, .07), transparent 60%); }
.callout.warn .ct { color: var(--red); }
.callout.tip { border-left-color: var(--teal); }
.callout.tip .ct { color: var(--teal); }
.callout.note { border-left-color: var(--amber); }
.callout.note .ct { color: var(--amber); }
.callout.unverified { border-left-color: var(--muted); background: repeating-linear-gradient(45deg, rgba(255,255,255,.014) 0 8px, transparent 8px 16px); }
.callout.unverified .ct { color: var(--muted); }

.verdict {
  margin: 1.8rem 0; padding: 1.2rem 1.3rem; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow); max-width: var(--measure);
}
.verdict .vt { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--red); font-weight: 800; margin: 0 0 .5rem; }
.verdict p:last-child { margin-bottom: 0; }

/* ---------- Figures --------------------------------------------------- */

.shot { margin: 1.8rem 0; max-width: var(--measure); }
.shot.wide { max-width: 100%; }
.shot img { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.shot figcaption { font-size: .8rem; color: var(--muted); margin-top: .55rem; line-height: 1.5; }
.shot .credit { display: block; font-size: .72rem; color: #6d635c; margin-top: .15rem; }

/* ---------- Cards ----------------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 1rem; margin: 0 0 1.6rem; }
.card {
  display: block; padding: 1.1rem 1.15rem; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  position: relative; overflow: hidden; transition: border-color .16s, transform .16s, background .16s;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--red); opacity: .0; transition: opacity .16s; }
.card:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-2px); }
.card:hover::before { opacity: 1; }
.card h3 { margin: 0 0 .35rem; font-size: 1.02rem; color: var(--text); letter-spacing: -.01em; }
.card p { margin: 0; font-size: .88rem; color: var(--text-2); line-height: 1.55; }
.ctag { display: inline-block; font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--red); font-weight: 800; margin-bottom: .4rem; }
.cmeta { display: block; margin-top: .6rem; font-size: .74rem; color: var(--muted); }

/* ---------- Stats ----------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 1px; margin: 0 0 1.7rem; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: .95rem 1rem; }
.stat dt { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.stat dd { margin: 0; font-size: 1.14rem; font-weight: 800; color: var(--text); letter-spacing: -.01em; line-height: 1.25; }
.stat dd span { display: block; font-size: .74rem; font-weight: 400; color: var(--text-2); letter-spacing: 0; margin-top: .18rem; }

/* ---------- FAQ ------------------------------------------------------- */

.faq { max-width: var(--measure); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.6rem; }
.faq details { border-bottom: 1px solid var(--line); background: var(--surface); }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; padding: .95rem 1.05rem; font-weight: 700; list-style: none; display: flex; gap: .8rem; align-items: baseline; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--red); font-weight: 800; font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { background: var(--surface-2); }
.faq .fa { padding: 0 1.05rem 1.05rem; color: var(--text-2); }
.faq .fa p:last-child { margin-bottom: 0; }

/* ---------- TOC ------------------------------------------------------- */

.toc { max-width: var(--measure); margin: 0 0 2rem; padding: 1rem 1.15rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toc p { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 .55rem; font-weight: 800; }
.toc ol { margin: 0; padding-left: 1.1rem; columns: 2; column-gap: 2rem; }
.toc li { margin-bottom: .3rem; font-size: .89rem; break-inside: avoid; }
@media (max-width: 640px) { .toc ol { columns: 1; } }

/* ---------- Next up / sources ----------------------------------------- */

.nextup { margin: 2.6rem 0 1rem; padding: 1.3rem 1.4rem; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: var(--radius); background: var(--surface); max-width: var(--measure); }
.nextup h2 { font-size: .74rem !important; letter-spacing: .2em; text-transform: uppercase; color: var(--amber); margin: 0 0 .7rem !important; padding: 0 !important; }
.nextup h2::before { display: none !important; }
.nextup ul { margin: 0; padding-left: 1.1rem; }
.nextup li { font-size: .92rem; margin-bottom: .4rem; color: var(--text-2); }

.sources { margin: 2.4rem 0 3rem; padding-top: 1.4rem; border-top: 1px solid var(--line); max-width: var(--measure); }
.sources h2 { font-size: .72rem !important; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem !important; padding: 0 !important; }
.sources h2::before { display: none !important; }
.sources ul { margin: 0; padding-left: 1.1rem; }
.sources li { font-size: .82rem; margin-bottom: .3rem; color: var(--muted); }
.sources a { color: var(--text-2); }

/* ---------- Buy bar --------------------------------------------------- */

.buybar {
  display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; justify-content: space-between;
  margin: 2rem 0; padding: 1.1rem 1.3rem; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(224, 62, 45, .1), var(--surface) 55%);
}
.bb-price { margin: 0; font-size: 1.05rem; }
.bb-price b { font-size: 1.55rem; letter-spacing: -.02em; }
.bb-price s { color: var(--muted); font-size: .95rem; margin-left: .35rem; }
.bb-price span { color: var(--teal); font-weight: 800; font-size: .85rem; margin-left: .35rem; }
.bb-note { margin: .15rem 0 0; font-size: .78rem; color: var(--muted); }
.bb-links { display: flex; gap: .6rem; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: .62rem 1.15rem; border-radius: var(--radius); text-decoration: none;
  font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; border: 1px solid transparent;
}
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: #f04b39; color: #fff; }
.btn.ghost { border-color: var(--line-2); color: var(--text); }
.btn.ghost:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- Home hero ------------------------------------------------- */

.hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-img { position: absolute; inset: 0; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; opacity: .3; }
.hero-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,10,9,.55) 0%, rgba(12,10,9,.82) 55%, var(--bg) 100%); }
.hero-inner { position: relative; padding: 3.6rem 0 2.4rem; }
.hero h1 { max-width: 16ch; }
.hero .standfirst { font-size: 1.2rem; max-width: 62ch; }
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 800; color: var(--red); margin: 0 0 .9rem; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--red); }

.factbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1.8rem 0 0; }
.factbar a, .factbar div { background: var(--surface); padding: .85rem .95rem; text-decoration: none; color: inherit; display: block; transition: background .15s; }
.factbar a:hover { background: var(--surface-2); }
.factbar .fk { display: block; font-size: .66rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-bottom: .25rem; }
.factbar .fv { display: block; font-size: 1rem; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.factbar a .fv { color: var(--amber); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.gallery figure { margin: 0; }
.gallery img { border: 1px solid var(--line); border-radius: var(--radius); }
.gallery figcaption { font-size: .78rem; color: var(--muted); margin-top: .45rem; }

/* trait polarity */
.tpos { color: var(--teal); font-weight: 700; }
.tneg { color: var(--red); font-weight: 700; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }

/* ---------- Footer ---------------------------------------------------- */

.site-foot { margin-top: 4rem; border-top: 1px solid var(--line); background: var(--bg-2); padding: 2.6rem 0 2rem; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 2rem; }
.fcol h3 { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--amber); margin: 0 0 .7rem; }
.fcol ul { list-style: none; margin: 0; padding: 0; }
.fcol li { margin-bottom: .42rem; }
.fcol a { color: var(--text-2); text-decoration: none; font-size: .86rem; }
.fcol a:hover { color: var(--amber); }
.fbar { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.fdisc { font-size: .78rem; color: var(--muted); max-width: 82ch; margin: 0 0 .7rem; }
.fdisc strong { color: var(--text-2); }
.fmeta { font-size: .78rem; color: var(--muted); margin: 0; }
.fmeta a { color: var(--muted); }

/* ---------- 404 ------------------------------------------------------- */
.nf { text-align: center; padding: 5rem 0 3rem; }
.nf h1 { max-width: none; }
.nf h2 { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 2.6rem 0 1rem; padding: 0; }
.nf h2::before { display: none; }
.nf .cards { text-align: left; }
