/* Imperial: Royal Imperial design system (Update 10).
   Tokens first; every colour, size and font below reads from them. Gold is an accent, not a fill. */

/* Fonts, self-hosted from Google Fonts (SIL Open Font License 1.1; the licences sit beside the files).
   Cinzel and Golos Text are the earlier pair, kept for rollback: a browser downloads only the faces a page uses. */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("/fonts/cinzel-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Golos Text";
  src: url("/fonts/golos-text-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  /* Palette (owner brief, section 4) */
  --obsidian: #090b10;
  --charcoal: #181c24;
  --gold: #c9a45c;
  --royal: #203b68;
  --platinum: #e8e5de;

  /* Derived surfaces and lines */
  --bg: var(--obsidian);
  --surface: #10131a;
  --surface-2: var(--charcoal);
  --surface-3: #222733;
  --line: rgba(232, 229, 222, 0.09);
  --line-strong: rgba(232, 229, 222, 0.18);
  --line-gold: rgba(201, 164, 92, 0.45);
  --royal-soft: rgba(32, 59, 104, 0.35);

  /* Text */
  --text: var(--platinum);
  --text-2: #bdb9b1;
  --text-3: #918d86;
  --on-gold: #0b0d12;

  /* Status */
  --ok: #6cc08e;
  --warn: #e3ae55;
  --bad: #e2766b;
  --info: #8fb0e6;

  /* Type */
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --step-4: clamp(1.9rem, 1.4rem + 2vw, 2.75rem);
  --step-5: clamp(2.4rem, 1.4rem + 4.4vw, 4.75rem);

  /* Space, shape, motion */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;
  --s9: 6.5rem;
  --radius: 4px;
  --radius-lg: 8px;
  --container: 1200px;
  --header-h: 72px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t: 160ms var(--ease);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0)/1.65 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-color: var(--line-gold); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
p { margin: 0 0 var(--s4); }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; font-variant-numeric: lining-nums; line-height: 1.15; letter-spacing: 0.01em; color: var(--platinum); }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
strong { font-weight: 600; color: var(--platinum); }
small { font-size: var(--step--1); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--royal); color: var(--platinum); }
table { border-collapse: collapse; width: 100%; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.container--narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--s4); top: -100px; z-index: 100; background: var(--gold); color: var(--on-gold); padding: var(--s2) var(--s4); border-radius: var(--radius); font-weight: 600; }
.skip-link:focus { top: var(--s3); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hash { margin: var(--s3) 0 0; font-size: 0.75rem; }
.hash code { display: block; margin-top: 2px; font: 0.75rem/1.4 ui-monospace, Consolas, monospace; word-break: break-all; color: var(--text-3); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: var(--s4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.mt { margin-top: var(--s5); }

/* Kicker: the small gold line above titles */
.kicker {
  display: inline-flex; align-items: center; gap: var(--s3);
  margin: 0 0 var(--s3);
  font: 600 var(--step--1)/1.2 var(--font-ui);
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
}
.kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: transparent; --btn-fg: var(--platinum); --btn-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s5);
  border: 1px solid var(--btn-line); border-radius: var(--radius);
  background: var(--btn-bg); color: var(--btn-fg);
  font: 600 0.9375rem/1 var(--font-ui); letter-spacing: 0.02em; text-decoration: none;
  cursor: pointer; transition: background var(--t), border-color var(--t), color var(--t);
}
.btn:hover { color: var(--btn-fg); border-color: var(--gold); }
.btn--primary { --btn-bg: var(--gold); --btn-fg: var(--on-gold); --btn-line: var(--gold); }
.btn--primary:hover { --btn-bg: #d8b673; border-color: #d8b673; }
.btn--secondary:hover { --btn-bg: var(--royal-soft); }
.btn--royal { --btn-bg: var(--royal); --btn-line: #2c4d85; }
.btn--royal:hover { --btn-bg: #284a82; }
.btn--ghost { --btn-line: transparent; padding-inline: var(--s3); }
.btn--sm { min-height: 36px; padding: 0 var(--s4); font-size: var(--step--1); }
.btn--lg { min-height: 52px; padding: 0 var(--s6); font-size: var(--step-0); }
.btn--block { width: 100%; }
.btn[aria-disabled="true"], .btn:disabled { --btn-bg: transparent; --btn-fg: var(--text-3); --btn-line: var(--line); cursor: not-allowed; }
.btn[aria-disabled="true"]:hover, .btn:disabled:hover { border-color: var(--line); }
.btn .icon { width: 1em; height: 1em; flex: none; }
.link-arrow { display: inline-flex; gap: var(--s2); align-items: center; color: var(--gold); font-weight: 600; text-decoration: none; font-size: 0.9375rem; }
.link-arrow:hover { color: #dfc189; }
.link-arrow .icon { width: 14px; height: 14px; transition: transform var(--t); }
.link-arrow:hover .icon { transform: translateX(3px); }
.inline-form { display: inline; }

/* ---------- Chips and status ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px;
  font: 600 0.75rem/1.4 var(--font-ui); letter-spacing: 0.04em; color: var(--text-2); white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip--live { color: var(--ok); border-color: rgba(108, 192, 142, 0.35); }
.chip--pending { color: var(--warn); border-color: rgba(227, 174, 85, 0.35); }
.chip--off { color: var(--text-3); }
.chip--dev { color: var(--info); border-color: rgba(143, 176, 230, 0.35); }
.chip--bad { color: var(--bad); border-color: rgba(226, 118, 107, 0.35); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(9, 11, 16, 0.97);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; gap: var(--s5); height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--platinum); flex: none; }
.brand:hover { color: var(--platinum); }
.brand__crest { width: 44px; height: 44px; object-fit: contain; }
.brand__word { font: 600 1.25rem/1 var(--font-display); letter-spacing: 0.22em; }
.brand__word small { display: block; margin-top: 5px; font: 600 0.625rem/1 var(--font-ui); letter-spacing: 0.32em; color: var(--gold); text-transform: uppercase; }
.nav { display: none; margin-left: auto; }
.nav ul { display: flex; list-style: none; gap: var(--s1); }
.nav a {
  position: relative; display: block; padding: var(--s2) var(--s3);
  color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 0.9375rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--platinum); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: var(--s3); right: var(--s3); bottom: -1px; height: 2px; background: var(--gold); }
.header__actions { display: flex; align-items: center; gap: var(--s3); margin-left: auto; }
.account-link { display: none; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 0.9375rem; max-width: 180px; }
.account-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-link:hover, .account-link[aria-current="page"] { color: var(--platinum); }
.account-link .icon { width: 18px; height: 18px; flex: none; }
.header__play { display: none; }
.menu-button {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  background: transparent; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--platinum); cursor: pointer;
}
.menu-button .icon { width: 20px; height: 20px; }
@media (min-width: 560px) { .header__play { display: inline-flex; } }
@media (min-width: 1024px) {
  .nav { display: block; }
  .header__actions { margin-left: var(--s2); }
  .account-link { display: inline-flex; }
  .menu-button { display: none; }
}
@media (min-width: 1024px) and (max-width: 1180px) {
  .brand__word small { display: none; }
  .nav a { padding-inline: 10px; }
  .header__inner { gap: var(--s3); }
}

/* Mobile menu (native dialog) */
.mobile-menu {
  margin: 0 0 0 auto; padding: 0; border: 0; border-left: 1px solid var(--line);
  width: min(88vw, 380px); max-width: none; height: 100%; max-height: none;
  background: var(--surface); color: var(--text);
}
.mobile-menu::backdrop { background: rgba(4, 5, 8, 0.72); }
.mobile-menu__head { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s5); height: var(--header-h); border-bottom: 1px solid var(--line); }
.mobile-menu nav { padding: var(--s4) var(--s5); }
.mobile-menu ul { list-style: none; }
.mobile-menu nav a { display: flex; justify-content: space-between; padding: var(--s3) 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: var(--step-1); color: var(--text); }
.mobile-menu nav a[aria-current="page"] { color: var(--gold); }
.mobile-menu__group { margin-top: var(--s5); font: 600 0.75rem/1 var(--font-ui); letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-3); }
.mobile-menu__actions { display: grid; gap: var(--s3); padding: var(--s4) var(--s5) var(--s6); }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; min-height: min(86vh, 860px); display: flex; align-items: flex-end; overflow: hidden; }
.hero__art { position: absolute; inset: 0; z-index: -2; }
.hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 40%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(9, 11, 16, 0.92) 0%, rgba(9, 11, 16, 0.7) 34%, rgba(9, 11, 16, 0.1) 70%),
    linear-gradient(0deg, var(--obsidian) 0%, rgba(9, 11, 16, 0) 38%);
}
.hero__content { padding: var(--s9) 0 var(--s8); max-width: 640px; }
.hero__title { font-size: var(--step-5); font-weight: 700; letter-spacing: 0.01em; margin-bottom: var(--s4); }
.hero__lead { font-size: var(--step-1); color: var(--text-2); max-width: 34em; margin-bottom: var(--s6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
@media (max-width: 767px) {
  .hero { min-height: 92vh; }
  .hero__art img { object-position: 60% 30%; }
  .hero::before { background: linear-gradient(0deg, var(--obsidian) 8%, rgba(9, 11, 16, 0.82) 48%, rgba(9, 11, 16, 0.25) 100%); }
  .hero__content { padding-bottom: var(--s6); }
  .hero__actions .btn { flex: 1 1 100%; }
}

/* ---------- Live status ---------- */
.status-bar { position: relative; z-index: 2; margin-top: calc(-1 * var(--s6)); }
.status {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface-2); border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.status__item { padding: var(--s4) var(--s5); border-left: 1px solid var(--line); min-width: 0; }
.status__item:first-child { border-left: 0; }
.status__label { display: block; margin-bottom: 4px; font: 600 0.6875rem/1.2 var(--font-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.status__value { display: flex; align-items: center; gap: var(--s2); font-weight: 600; color: var(--platinum); overflow-wrap: anywhere; }
.status__note { display: block; margin-top: 2px; font-size: var(--step--1); color: var(--text-3); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--text-3); }
.dot--online { background: var(--ok); box-shadow: 0 0 0 4px rgba(108, 192, 142, 0.16); }
.dot--maintenance, .dot--stale { background: var(--warn); }
.dot--offline { background: var(--bad); }
@media (max-width: 900px) {
  .status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status__item:nth-child(3) { border-left: 0; }
  .status__item:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 420px) {
  .status { grid-template-columns: 1fr; }
  .status__item { border-left: 0; }
  .status__item + .status__item { border-top: 1px solid var(--line); }
}
.status-inline { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--step--1); color: var(--text-2); }
/* Before the beta: one notice in place of the four figures */
.status--prelaunch { grid-template-columns: 1fr; text-align: center; }
.status--prelaunch .status__item { padding: var(--s5); }
.status--prelaunch .status__value { justify-content: center; font: 600 var(--step-3)/1.15 var(--font-display); color: var(--gold); }
.prelaunch-strip { padding: 8px var(--s4); background: var(--surface-2); border-bottom: 1px solid var(--line-gold); color: var(--text-2); font-size: var(--step--1); text-align: center; }
.prelaunch-strip strong { margin-right: var(--s2); color: var(--gold); font-weight: 600; letter-spacing: 0.04em; }

/* ---------- Sections ---------- */
.section { padding: var(--s8) 0; }
.section--tight { padding: var(--s6) 0 var(--s8); }
.section--band { background: var(--surface); border-block: 1px solid var(--line); }
.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); }
* + .section__head { margin-top: var(--s8); }
.section__head h2 { font-size: var(--step-4); }
.section__head p { margin: var(--s3) 0 0; color: var(--text-2); max-width: 40em; }
.rule { display: flex; align-items: center; gap: var(--s4); color: var(--gold); margin: var(--s6) 0; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-gold), transparent); }
.rule span { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid var(--gold); }

/* ---------- Highlights ---------- */
.highlights { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s4); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: var(--s2);
  grid-column: span 4; padding: var(--s5); min-height: 190px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
  text-decoration: none; color: var(--text); overflow: hidden; transition: border-color var(--t);
}
a.tile:hover { border-color: var(--line-gold); color: var(--text); }
.tile h3 { font-size: var(--step-2); }
.tile p { margin: 0; color: var(--text-2); font-size: 0.9375rem; }
.tile .chip { align-self: flex-start; margin-top: auto; }
.tile__num { font: 600 0.75rem/1 var(--font-ui); letter-spacing: 0.2em; color: var(--gold); }
.tile--feature { grid-column: span 6; min-height: 320px; justify-content: flex-end; padding: var(--s6); }
.tile--feature .tile__media { position: absolute; inset: 0; z-index: 0; }
.tile--feature .tile__media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; transition: opacity var(--t), transform 600ms var(--ease); }
a.tile--feature:hover .tile__media img { opacity: 0.68; transform: scale(1.02); }
.tile--feature::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(0deg, rgba(9, 11, 16, 0.96) 30%, rgba(9, 11, 16, 0.3) 100%); }
.tile--feature > :not(.tile__media) { position: relative; z-index: 1; }
.tile--feature h3 { font-size: var(--step-3); }
.tile--wide { grid-column: span 12; min-height: 260px; }
@media (min-width: 768px) {
  /* the wide tile shows its picture on the right and keeps the text side dark */
  .tile--wide .tile__media { left: 45%; }
  .tile--wide::after { background: linear-gradient(90deg, var(--obsidian) 45%, rgba(9, 11, 16, 0.75) 62%, rgba(9, 11, 16, 0.15) 100%); }
  .tile--wide > p { max-width: 46ch; }
}
.tile--feature .chip { margin-top: var(--s2); }
@media (max-width: 1023px) { .tile { grid-column: span 6; } .tile--feature { grid-column: span 12; } }
@media (max-width: 600px) { .tile, .tile--feature { grid-column: span 12; } .tile { min-height: 0; } }

/* ---------- Cards and news ---------- */
.card { display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: var(--text); transition: border-color var(--t); }
a.card:hover { border-color: var(--line-gold); color: var(--text); }
.card__media { aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s5); flex: 1; }
.card__body h3 { font-size: var(--step-2); }
.card__body p { margin: 0; color: var(--text-2); font-size: 0.9375rem; }
.meta { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; font-size: var(--step--1); color: var(--text-3); }
.meta .cat { color: var(--gold); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.6875rem; }
.chronicles { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--s5); }
.chronicles__lead .card__media { aspect-ratio: 16 / 10; }
.chronicles__lead h3 { font-size: var(--step-3); }
.chronicles__list { display: grid; gap: var(--s4); align-content: start; }
.news-row { display: grid; grid-template-columns: 132px 1fr; gap: var(--s4); align-items: center; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; color: var(--text); }
.news-row:hover { border-color: var(--line-gold); color: var(--text); }
.news-row img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.news-row h3 { font-size: var(--step-1); margin-top: 4px; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
@media (max-width: 1023px) { .chronicles { grid-template-columns: 1fr; } .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .news-grid { grid-template-columns: 1fr; } .news-row { grid-template-columns: 96px 1fr; } }

/* Feature banner (Champions, Treasury) */
.showcase { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
.banner-card { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: 300px; padding: var(--s6); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: var(--text); }
.banner-card picture { position: absolute; inset: 0; z-index: -2; }
.banner-card img { width: 100%; height: 100%; object-fit: cover; }
.banner-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(9, 11, 16, 0.96) 15%, rgba(9, 11, 16, 0.35) 80%); }
.banner-card:hover { border-color: var(--line-gold); color: var(--text); }
.banner-card h3 { font-size: var(--step-3); margin-bottom: var(--s2); }
.banner-card p { color: var(--text-2); max-width: 30em; }
@media (max-width: 767px) { .showcase { grid-template-columns: 1fr; } }

/* ---------- Inner page header ---------- */
.page-head { position: relative; isolation: isolate; border-bottom: 1px solid var(--line); overflow: hidden; }
.page-head__art { position: absolute; inset: 0; z-index: -2; }
.page-head__art img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.page-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(9, 11, 16, 0.95) 0%, rgba(9, 11, 16, 0.78) 45%, rgba(9, 11, 16, 0.45) 100%); }
.page-head__inner { padding: var(--s7) 0 var(--s6); }
.page-head h1 { font-size: var(--step-4); }
.page-head__intro { margin: var(--s3) 0 0; max-width: 42em; color: var(--text-2); font-size: var(--step-1); }
.crumbs { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin-bottom: var(--s4); font-size: var(--step--1); color: var(--text-3); }
.crumbs li + li::before { content: "/"; margin-right: var(--s2); color: var(--text-3); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }

/* ---------- Layout helpers ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s6); align-items: start; }
.split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
@media (max-width: 1023px) { .split, .split--even { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Panels ---------- */
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s5); }
.panel + .panel { margin-top: var(--s5); }
.panel__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s3); margin-bottom: var(--s4); padding-bottom: var(--s3); border-bottom: 1px solid var(--line); }
.panel__head h2 { font-size: var(--step-2); }
.panel--gold { border-top: 2px solid var(--gold); }
.panel--quiet { background: var(--surface); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s5); margin: 0; }
.dl dt { color: var(--text-3); font-size: 0.9375rem; }
.dl dd { margin: 0; font-weight: 500; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); }
.stat { padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.stat__label { display: block; font: 600 0.6875rem/1.2 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.stat__value { display: block; margin-top: var(--s2); font: 600 var(--step-2)/1.2 var(--font-ui); color: var(--platinum); font-variant-numeric: tabular-nums; }
.stat__note { display: block; margin-top: 2px; font-size: var(--step--1); color: var(--text-3); }

/* ---------- Alerts and states ---------- */
.alert { display: flex; gap: var(--s3); padding: var(--s4) var(--s5); border: 1px solid var(--line-strong); border-left: 3px solid var(--info); border-radius: var(--radius); background: var(--surface); margin-bottom: var(--s5); }
.alert p { margin: 0; color: var(--text-2); }
.alert strong { display: block; margin-bottom: 2px; }
.alert--success { border-left-color: var(--ok); }
.alert--warning { border-left-color: var(--warn); }
.alert--danger { border-left-color: var(--bad); }
.alert--dev { border-left-color: var(--info); background: rgba(32, 59, 104, 0.18); }
.alert .icon { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--text-2); }
.empty { padding: var(--s7) var(--s5); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--text-2); }
.empty h3 { margin-bottom: var(--s2); }
.empty p { margin: 0 auto; max-width: 32em; }
.empty__actions { justify-content: center; margin-top: var(--s4); }
.skeleton { display: block; height: 1em; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--s4); }
.field { display: grid; gap: 6px; }
.field label, .field__label { font-weight: 600; font-size: 0.9375rem; }
.field__hint { font-size: var(--step--1); color: var(--text-3); }
.input, .select {
  width: 100%; min-height: 46px; padding: 0 var(--s4);
  background: var(--obsidian); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius);
  font: 400 var(--step-0)/1.2 var(--font-ui); transition: border-color var(--t);
}
.input:hover, .select:hover { border-color: rgba(232, 229, 222, 0.3); }
.input:focus, .select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.18); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input:disabled, .select:disabled { opacity: 0.55; cursor: not-allowed; }
.select { appearance: none; padding-right: var(--s7); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23bdb9b1' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 14px; }
.input--pin { letter-spacing: 0.6em; font-size: var(--step-2); text-align: center; font-variant-numeric: tabular-nums; }
.auth { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: var(--s7); align-items: start; }
.auth__card { background: var(--surface-2); border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: var(--radius-lg); padding: var(--s6); }
.auth__card h2 { font-size: var(--step-3); margin-bottom: var(--s2); }
.auth__aside { color: var(--text-2); }
.auth__aside h2 { font-size: var(--step-2); margin-bottom: var(--s3); }
.auth__aside ul { list-style: none; display: grid; gap: var(--s3); }
.auth__aside li { padding-left: var(--s5); position: relative; }
.auth__aside li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid var(--gold); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } }

/* ---------- Toolbar, search, filters, pagination ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; margin-bottom: var(--s5); }
.toolbar .field { flex: 1 1 180px; }
.toolbar .field--search { flex: 2 1 240px; }
.search { position: relative; }
.search .icon { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 40px; }
.tabs { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin-bottom: var(--s5); }
.tabs a { display: inline-block; padding: var(--s2) var(--s4); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text-2); font-weight: 500; font-size: 0.9375rem; }
.tabs a:hover { color: var(--platinum); border-color: var(--line-strong); }
.tabs a[aria-current="page"] { color: var(--on-gold); background: var(--gold); border-color: var(--gold); }
.pagination { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; justify-content: center; margin-top: var(--s5); list-style: none; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pagination a:hover { border-color: var(--gold); color: var(--platinum); }
.pagination [aria-current="page"] { background: var(--royal); border-color: #2c4d85; color: var(--platinum); }
.pagination .gap { border: 0; min-width: 20px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.table th, .table td { padding: 12px var(--s4); text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font: 600 0.6875rem/1.2 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(32, 59, 104, 0.16); }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table a { text-decoration: none; font-weight: 600; }
.table .rank { color: var(--text-3); width: 1%; font-variant-numeric: tabular-nums; }
.table .is-top .rank { color: var(--gold); font-weight: 700; }
.table .is-found { background: rgba(201, 164, 92, 0.1); }
.who { display: inline-flex; align-items: center; gap: var(--s2); }
.icon-sm { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; flex: none; }

/* Hiscores layout */
.boards { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.board-nav { position: sticky; top: calc(var(--header-h) + var(--s4)); max-height: calc(100vh - var(--header-h) - var(--s6)); overflow: auto; padding: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.board-nav h2 { margin: var(--s3) var(--s2) var(--s2); font: 600 0.6875rem/1.2 var(--font-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.board-nav ul { list-style: none; }
.board-nav a { display: flex; align-items: center; gap: var(--s2); padding: 7px var(--s2); border-radius: var(--radius); text-decoration: none; color: var(--text-2); font-size: 0.9375rem; }
.board-nav a:hover { background: var(--surface-2); color: var(--platinum); }
.board-nav a[aria-current="page"] { background: var(--royal); color: var(--platinum); }
.board-select { display: none; }
@media (max-width: 1023px) { .boards { grid-template-columns: minmax(0, 1fr); } .board-nav { display: none; } .board-select { display: block; } }

/* ---------- Store ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.products--fit { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } /* a few cards share the row */
.product { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.product--featured { border-color: var(--line-gold); }
.product h3 { font-size: var(--step-2); }
.price { font: 700 var(--step-3)/1 var(--font-ui); color: var(--platinum); font-variant-numeric: tabular-nums; }
.price small { font-size: var(--step--1); font-weight: 500; color: var(--text-3); margin-left: 4px; }
.product ul { list-style: none; display: grid; gap: 6px; color: var(--text-2); font-size: 0.9375rem; }
.product form { margin-top: auto; display: grid; gap: var(--s2); }
.qty { display: flex; gap: var(--s2); align-items: center; }
.qty .input { width: 90px; }
.ladder { list-style: none; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.ladder li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); background: var(--surface); }
.ladder li:last-child { border-bottom: 0; }
.ladder li.is-current { background: rgba(201, 164, 92, 0.12); }
.ladder__name { font-weight: 600; color: var(--text-2); }
.ladder li.is-reached .ladder__name, .ladder li.is-current .ladder__name { color: var(--text); }
.ladder__value { color: var(--text-2); font-variant-numeric: tabular-nums; }
.product--gold { border-top: 2px solid var(--gold); }
.product--premium { border-top: 2px solid var(--info); }
.select--sm { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.tracks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.track { position: relative; padding: var(--s5); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: var(--s3); }
.track--gold { border-top: 2px solid var(--gold); }
.track--premium { border-top: 2px solid var(--info); }
.track p { margin: 0; color: var(--text-2); }
.track form, .track__foot { margin-top: auto; }
@media (max-width: 860px) { .tracks { grid-template-columns: 1fr; } }

/* ---------- Prose ---------- */
.prose { color: var(--text-2); font-size: var(--step-1); line-height: 1.75; }
.prose h2 { margin: var(--s6) 0 var(--s3); font-size: var(--step-3); }
.prose h3 { margin: var(--s5) 0 var(--s2); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 var(--s4); }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--gold); }
.prose figure { margin: var(--s5) 0; }
.prose figure img { border-radius: var(--radius-lg); border: 1px solid var(--line); }
.prose figcaption { margin-top: var(--s2); font-size: var(--step--1); color: var(--text-3); }
.prose a { color: var(--gold); }
.article__cover { margin: 0 0 var(--s6); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
.toc { list-style: none; display: grid; gap: var(--s2); }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--gold); }
.kb-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s3); }
.kb-heading { font-size: var(--step-2); margin: var(--s7) 0 var(--s4); }
.kb-heading:first-of-type { margin-top: var(--s6); }
.kb-list a { display: block; padding: var(--s4) var(--s5); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); text-decoration: none; color: var(--text); }
.kb-list a:hover { border-color: var(--line-gold); color: var(--text); }
.kb-list span { display: block; color: var(--text-2); font-size: 0.9375rem; margin-top: 2px; }
.steps { list-style: none; counter-reset: step; display: grid; gap: var(--s4); }
.steps li { counter-increment: step; position: relative; padding-left: 52px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-gold); border-radius: 50%; color: var(--gold); font-weight: 700; }

/* ---------- Screenshots ---------- */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.shot { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.shot button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.shot img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.shot figcaption { padding: var(--s3) var(--s4); font-size: var(--step--1); color: var(--text-2); }
.lightbox { padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); max-width: min(94vw, 1300px); }
.lightbox::backdrop { background: rgba(4, 5, 8, 0.85); }
.lightbox img { max-height: 80vh; width: auto; margin: 0 auto; }
.lightbox p { margin: 0; padding: var(--s3) var(--s4); color: var(--text-2); }
.lightbox__close { position: absolute; top: var(--s2); right: var(--s2); }

/* ---------- Footer ---------- */
.footer { margin-top: var(--s8); background: var(--surface); border-top: 1px solid var(--line); }
.footer__top { display: grid; grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); gap: var(--s6); padding: var(--s7) 0 var(--s6); }
.footer__brand p { margin-top: var(--s4); color: var(--text-3); font-size: 0.9375rem; max-width: 26em; }
.footer h2 { font: 600 0.75rem/1.2 var(--font-ui); letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--s4); }
.footer ul { list-style: none; display: grid; gap: var(--s2); }
.footer li a, .footer li span { color: var(--text-2); text-decoration: none; font-size: 0.9375rem; }
.footer li a:hover { color: var(--gold); }
.footer li span { color: var(--text-3); }
.footer__bottom { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); justify-content: space-between; padding: var(--s5) 0 var(--s6); border-top: 1px solid var(--line); color: var(--text-3); font-size: var(--step--1); }
.footer__bottom p { margin: 0; max-width: 60em; }
@media (max-width: 1023px) { .footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer__brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .footer__top { grid-template-columns: 1fr; } }

/* ---------- Development only ---------- */
.dev-strip { background: var(--royal); color: var(--platinum); font-size: var(--step--1); text-align: center; padding: 6px var(--s4); }
.dev-checkout { max-width: 560px; margin: var(--s7) auto; }

/* ---------- Motion preferences and print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .header, .footer, .mobile-menu, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}
