/* ---------------------------------------------------------------------------
   PoxRoga — site styles

   The palette is NOT invented here. Every neutral, gold, parchment and faction
   value is lifted from the game's own UiPalette.cs, which is the single source
   for every colour in the client. If a colour changes there it changes here.

     neutrals   Neutral000..900   (a violet-biased ramp, dark -> light)
     parchment  StockParchment*   (the card stock a champion is printed on)
     gold       SignalSelect / StoneNumberOnDark / StoneGoldInk
     nora       SignalNora        (the currency, and the logo's orbs)
     factions   Base / Light / Dark per faction

   The page commits to ONE theme on purpose. The game is a dark fantasy client
   with a gold-on-midnight logo; a light mode would be a different product.
   Everything is painted explicitly so nothing is inherited from the browser.
--------------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* Neutrals — UiPalette.Neutral000..900. Dark to light; 100 is near-black. */
  --ink-000: #0a0a0c;
  --ink-100: #1b1a21;
  --ink-200: #26242e;
  --ink-300: #33303c;
  --ink-400: #454150;
  --ink-500: #635d72;
  --ink-600: #8b8499;
  --ink-700: #b3adbf;
  --ink-800: #d8d4e0;
  --ink-900: #f4f2ee;

  /* Gold — the logo's lettering and the client's selection signal. */
  --gold: #ffd76e;
  --gold-deep: #d4a52a;
  --gold-dark: #8e6800;
  --gold-ink: #2a2418;

  /* Card stock. Used wherever the page quotes something printed on a card. */
  --parchment: #d7ccb5;
  --parchment-light: #e8e0d0;
  --parchment-shade: #bfb09c;
  --parchment-ink: #3a342c;

  /* Signals. */
  --nora: #56d9e0;
  --mult: #ffe03a;
  --damage: #e05a4a;
  --heal: #4fa8ff;

  /* The hero sits in the logo's own world: a navy wash over the violet ground. */
  --midnight: #0b1020;

  --page: var(--ink-000);
  --panel: var(--ink-100);
  --panel-high: var(--ink-200);
  --line: #2b2834;
  --text: var(--ink-800);
  --text-dim: var(--ink-600);
  --text-bright: var(--ink-900);

  /* Type */
  --display: "Alegreya Sans SC", "Trebuchet MS", "Gill Sans", sans-serif;
  --body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --measure: 68ch;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 4px;
}

/* Faction accents — UiPalette.FactionLight / Base / Dark. */
.f-ironfist    { --f: #a3907c; --f-base: #605146; --f-dark: #3a3029; }
.f-kthir       { --f: #3fa04f; --f-base: #0d5717; --f-dark: #07330d; }
.f-forsaken    { --f: #a34fb3; --f-base: #4a0054; --f-dark: #2b0031; }
.f-underdepths { --f: #d94a3d; --f-base: #920000; --f-dark: #560000; }
.f-forglar     { --f: #3fb5dd; --f-base: #007fad; --f-dark: #004a66; }

/* --------------------------------------------------------------- reset --- */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ⚠ `height: auto` is load-bearing, not tidying. An <img> with width/height
   attributes has them applied as PRESENTATIONAL HINTS, so sizing only `width`
   in CSS leaves the height hint standing and the image renders at the new
   width by the OLD height — the hero logo came out 560x478 against a natural
   2.3:1, squashed to half its proper width. Setting height here means every
   image keeps its aspect ratio while still carrying the attributes that
   reserve layout space and stop the page jumping as it loads. */
img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); text-decoration-color: color-mix(in srgb, var(--gold) 40%, transparent); }
a:hover { text-decoration-color: var(--gold); }

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

/* ---------------------------------------------------------------- type --- */

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-wrap: balance;
  color: var(--text-bright);
  margin: 0;
}

.eyebrow {
  font-family: var(--display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.18em;
  color: var(--gold-deep);
  margin: 0 0 14px;
}

.lede {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--ink-700);
  max-width: var(--measure);
  margin: 0;
}

p { max-width: var(--measure); }

.tnum { font-variant-numeric: tabular-nums; }

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

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { padding-block: clamp(56px, 7.5vw, 96px); }

.section-head { margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(34px, 5.5vw, 56px); }
.section-head .lede { margin-top: 18px; }

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
}

/* ------------------------------------------------------------- navbar --- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ink-000) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-in {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 60px;
  flex-wrap: wrap;
  padding-block: 8px;
}

.nav-mark {
  font-family: var(--display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-decoration: none;
  margin-right: auto;
}

.nav a:not(.nav-mark) {
  font-family: var(--display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--ink-700);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:not(.nav-mark):hover { color: var(--gold); border-bottom-color: var(--gold-deep); }

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

.hero {
  position: relative;
  padding-block: clamp(48px, 9vw, 104px) clamp(56px, 9vw, 112px);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

/* The logo's own glow, extended into the page so it does not sit on a seam. */
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto;
  height: 160%;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 34%, color-mix(in srgb, var(--midnight) 92%, transparent), transparent 70%),
    radial-gradient(32% 26% at 50% 30%, color-mix(in srgb, #1d4ea8 26%, transparent), transparent 70%);
  pointer-events: none;
}

/* Wider than it looks it needs to be: the source carries a generous transparent
   glow margin, so the lettering is about 80% of the box. */
.hero-logo {
  width: min(700px, 88vw);
  margin: 0 auto clamp(18px, 2.5vw, 28px);
}

.hero h1 {
  font-size: clamp(27px, 4.6vw, 46px);
  max-width: 19ch;
  margin-inline: auto;
}
.hero h1 em { font-style: normal; color: var(--gold); }

.hero .lede {
  margin: 20px auto 0;
  max-width: 56ch;
}

.cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: clamp(28px, 4vw, 40px);
}

.btn {
  font-family: var(--display);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.1em;
  padding: 13px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid var(--ink-400);
  color: var(--ink-800);
  background: var(--ink-200);
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--ink-300); border-color: var(--ink-500); transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  border-color: var(--gold);
  color: var(--gold-ink);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #ffe49a 0%, var(--gold) 100%);
  border-color: #ffe49a;
}

@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

/* Hero stat strip */
.hero-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(18px, 5vw, 56px);
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px solid var(--line);
}
.hero-stats div { text-align: center; }
.hero-stats b {
  display: block;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(26px, 4vw, 36px);
  color: var(--gold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero-stats span {
  font-family: var(--display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

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

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 30px);
}
.card h3 { font-size: 23px; margin-bottom: 10px; }
.card p { color: var(--ink-700); margin: 0; font-size: 16px; }

.card-num {
  font-family: var(--display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--gold-deep);
  display: block;
  margin-bottom: 12px;
}

/* ------------------------------------------------------------ spinner --- */

.spinner { position: relative; }

.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink-100);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
  display: grid;
  place-items: center;
}
.slide.is-active { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } }

.slide img, .slide video { width: 100%; height: 100%; object-fit: cover; }

/* The empty state, until real screenshots land in /media. */
.slide-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, color-mix(in srgb, var(--ink-300) 40%, transparent) 14px 15px),
    var(--ink-100);
}
.slide-placeholder b {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(20px, 3vw, 30px);
  letter-spacing: 0.06em;
  color: var(--ink-600);
}
.slide-placeholder span { font-size: 14px; color: var(--ink-500); max-width: 42ch; }

.slide-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 44px 20px 16px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--ink-000) 92%, transparent));
  font-size: 15px;
  color: var(--ink-800);
  text-align: left;
}

.spin-btn {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--ink-000) 72%, transparent);
  border: 1px solid var(--ink-400);
  color: var(--ink-800);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  z-index: 2;
}
.spin-btn:hover { background: var(--ink-300); color: var(--gold); border-color: var(--gold-deep); }
.spin-prev { left: 12px; }
.spin-next { right: 12px; }

.spin-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.dots { display: flex; gap: 9px; }
.dot {
  width: 9px; height: 9px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--ink-500);
  background: transparent;
  cursor: pointer;
}
.dot[aria-current="true"] { background: var(--gold); border-color: var(--gold); }

.spin-pause {
  font-family: var(--display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.12em;
  background: none;
  border: 1px solid var(--ink-400);
  color: var(--ink-700);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
}
.spin-pause:hover { color: var(--gold); border-color: var(--gold-deep); }

/* --------------------------------------------------------------- loop --- */

.loop {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  counter-reset: step;
}

.loop-step {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold-dark);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.loop-step::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--gold-deep);
  display: block;
  margin-bottom: 10px;
}
.loop-step h3 { font-size: 21px; margin-bottom: 8px; }
.loop-step p { font-size: 15.5px; color: var(--ink-700); margin: 0; }

/* -------------------------------------------------------------- hands --- */

.hands-wrap { overflow-x: auto; }

table.hands {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table.hands th, table.hands td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
table.hands tr:last-child td { border-bottom: 0; }

table.hands th {
  font-family: var(--display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  background: var(--ink-200);
}

.hand-name {
  font-family: var(--display);
  font-weight: 900;
  font-size: 20px;
  color: var(--text-bright);
  white-space: nowrap;
}
.hand-shape { color: var(--ink-700); font-size: 15.5px; }

.hand-mult {
  font-family: var(--display);
  font-weight: 900;
  font-size: 21px;
  color: var(--mult);
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The pip row that shows a hand's shape, as the client's HANDS window does. */
.pips { display: flex; gap: 4px; }
.pip {
  width: 21px; height: 27px;
  border-radius: 2px;
  background: var(--parchment);
  color: var(--parchment-ink);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 1px solid var(--parchment-shade);
  font-variant-numeric: tabular-nums;
}
.pip.one-faction { background: var(--gold); border-color: var(--gold-deep); color: var(--gold-ink); }
.pip.alt { background: var(--parchment-shade); }

/* On a phone the pips are the column to lose, not the sentence: "3 of one rank"
   says more at this size than five small squares, and dropping it is what lets
   the table fit instead of being cut off mid-column inside a scroller. */
@media (max-width: 660px) {
  table.hands { min-width: 0; }
  table.hands th:nth-child(2), table.hands td:nth-child(2) { display: none; }
  table.hands th, table.hands td { padding: 11px 12px; }
  .hand-name { font-size: 17px; }
  .hand-shape { font-size: 14.5px; }
  .hand-mult { font-size: 18px; }
  .pip-note { display: none; }   /* the pips it explains are hidden here */
}

/* ----------------------------------------------------------- factions --- */

/* Five cards into a three-wide grid leaves two orphans hugging the left edge.
   Flex with a shared basis lets the short last row CENTRE instead, which reads
   as a deliberate 3 + 2 rather than a layout that ran out. */
.factions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.faction {
  flex: 1 1 290px;
  max-width: 420px;
  position: relative;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--f-dark) 55%, transparent), transparent 42%),
    var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--f);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  overflow: hidden;
}

/* The champion's board sprite, ghosted into the corner. Pixel art: never smoothed. */
.faction-sprite {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 98px;
  opacity: 0.3;
  image-rendering: pixelated;   /* board art is pixel art — never smooth it */
  pointer-events: none;
}

.faction-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.faction-top img { width: 54px; height: 54px; flex: none; }

.faction-camp {
  font-family: var(--display);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--f);
}
.faction h3 { font-size: 22px; line-height: 1.1; }
.faction-theme { font-size: 14.5px; color: var(--ink-600); margin: 0 0 14px; font-style: italic; }
.faction-play { font-size: 15.5px; color: var(--ink-700); margin: 0 0 18px; max-width: 34ch; }

.keywords { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.kw {
  font-family: var(--display);
  font-weight: 900;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--f) 45%, transparent);
  background: color-mix(in srgb, var(--f) 12%, transparent);
  color: var(--f);
}

/* Kept clear of the sprite watermark in the corner. */
.bars { display: grid; gap: 7px; max-width: 190px; position: relative; }
.bar { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 10px; }
.bar span {
  font-family: var(--display);
  font-weight: 900;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.bar i { display: flex; gap: 4px; }
.bar i b {
  width: 100%;
  height: 7px;
  border-radius: 1px;
  background: var(--ink-300);
}
.bar i b.on { background: var(--f); }

/* --------------------------------------------------------------- misc --- */

.note {
  background: var(--ink-100);
  border-left: 2px solid var(--gold-dark);
  padding: 18px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 16px;
  color: var(--ink-700);
}
.note p { margin: 0; }
.note strong { color: var(--text-bright); }

/* A quoted rules line, printed as it is on a card. */
.stock {
  background: linear-gradient(180deg, var(--parchment-light), var(--parchment));
  color: var(--parchment-ink);
  border: 1px solid var(--parchment-shade);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 16.5px;
  max-width: var(--measure);
}
.stock b { font-family: var(--display); font-weight: 900; letter-spacing: 0.04em; }

.nora { color: var(--nora); font-weight: 600; }

.two-col {
  display: grid;
  gap: clamp(28px, 5vw, 56px);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}

dl.facts { margin: 0; display: grid; gap: 0; }
dl.facts > div {
  display: grid;
  grid-template-columns: minmax(96px, 150px) 1fr;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
dl.facts dt {
  font-family: var(--display);
  font-weight: 900;
  font-size: 13.5px;
  letter-spacing: 0.12em;
  color: var(--gold-deep);
  padding-top: 2px;
}
dl.facts dd { margin: 0; font-size: 16px; color: var(--ink-700); }

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

.footer {
  border-top: 1px solid var(--line);
  padding-block: 48px;
  color: var(--ink-500);
  font-size: 14.5px;
}
.footer-in { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; }
.footer a { color: var(--ink-700); }
.footer a:hover { color: var(--gold); }

/* ---------------------------------------------------------- utilities --- */

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

.alt-bg { background: linear-gradient(180deg, transparent, var(--ink-100) 18%, var(--ink-100) 82%, transparent); }
