:root {
  color-scheme: dark;
  --bg: #11100e;
  --surface: #191713;
  --panel: #1f1b16;
  --line: #393127;
  --text: #f5eee1;
  --muted: #c1b4a2;
  --gold: #e7b46f;
  --gold-light: #ffcf87;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.6 var(--sans); }
a { color: var(--gold-light); text-underline-offset: .2em; }
a:hover { color: #ffe0aa; }
button, input, select { font: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }
[hidden] { display: none !important; }
.shell { width: min(calc(100% - 4rem), 75rem); margin-inline: auto; }

.skip-link {
  position: absolute;
  z-index: 10;
  inset: .5rem auto auto .5rem;
  padding: .7rem 1rem;
  transform: translateY(-200%);
  background: var(--gold-light);
  color: #1f160e;
}
.skip-link:focus { transform: translateY(0); }

.site-header { background: #12100e; border-bottom: 1px solid #2f2921; }
.header-inner { min-height: 5rem; display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none; white-space: nowrap; font: 700 1.23rem/1 var(--serif); }
.brand-mark { width: 2.5rem; color: var(--gold); flex: 0 0 auto; }
.brand strong { color: var(--gold-light); }
.brand small { display: block; margin-top: .42rem; color: var(--muted); font: 600 .65rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: clamp(.8rem, 3vw, 2.2rem); }
.main-nav a { display: inline-flex; min-height: 2.75rem; align-items: center; color: var(--text); font-size: .87rem; font-weight: 650; text-decoration: none; }
.main-nav a:hover { color: var(--gold-light); }

.hero {
  isolation: isolate;
  position: relative;
  min-height: 36rem;
  display: grid;
  align-items: center;
  background: #18140f;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, #110f0cf7 1%, #110f0cdb 28%, #110f0c55 65%, #110f0c15 100%),
    linear-gradient(0deg, #100e0ddc, transparent 36%),
    url("assets/hero.webp") 65% center / cover no-repeat;
}
.hero-inner { padding-block: 5.9rem 6.1rem; }
.eyebrow { color: var(--gold-light); font-size: .73rem; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
.hero-kicker { display: flex; align-items: center; gap: .85rem; }
.hero-kicker span { display: inline-block; width: 1.7rem; height: 1px; background: var(--gold-light); }
.hero h1 { max-width: 56rem; margin-block: .95rem 1rem; font: 500 clamp(3.2rem, 8.5vw, 7rem)/.96 var(--serif); letter-spacing: -.055em; text-wrap: balance; }
.hero h1 em { color: var(--gold-light); font-weight: 400; }
.hero-lead { max-width: 33rem; color: #efe4d1; font-size: clamp(1rem, 2vw, 1.21rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 1.2rem; min-height: 3rem; padding: .72rem 1rem; border: 1px solid transparent; text-decoration: none; font-size: .9rem; font-weight: 750; }
.button-primary { background: var(--gold-light); color: #20170d; }
.button-primary:hover { background: #ffdfad; color: #20170d; }
.button-secondary { background: #1b1610d9; border-color: #aa8254; color: #fff0d5; }
.button-secondary:hover { border-color: var(--gold-light); }

.game-strip { background: #1a1611; border-block: 1px solid #443528; }
.strip-inner { min-height: 3.45rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem clamp(1rem, 4vw, 3rem); padding-block: .65rem; }
.strip-inner span { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.strip-inner span + span::before { content: "◆"; color: var(--gold); font-size: .55em; margin-right: clamp(.9rem, 3vw, 2.5rem); vertical-align: .15em; }
.strip-inner b { color: var(--gold-light); }

.page-section { padding-block: clamp(3.1rem, 7vw, 6rem); }
.section-heading { max-width: 43rem; margin-bottom: 1.8rem; }
.section-heading .eyebrow span { margin-right: .55rem; color: var(--gold); }
.section-heading h2 { margin-block: .3rem .5rem; font: 500 clamp(2.1rem, 5vw, 3.65rem)/1.04 var(--serif); letter-spacing: -.045em; }
.section-heading > p:last-child { color: var(--muted); }
.section-band { border-block: 1px solid #2c251c; background: radial-gradient(ellipse at top left, #211a13 0, #171410 55%, #151310 100%); }

.class-grid, .guide-grid, .source-grid { display: grid; gap: .85rem; }
.class-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.guide-grid, .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-grid .route-card { grid-column: 1 / -1; }
.class-grid > *, .guide-grid > *, .source-grid > * {
  min-width: 0;
  padding: clamp(1rem, 2.7vw, 1.55rem);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #221d17, #181613 85%);
}
.class-grid > * { border-top: 2px solid var(--accent, #8e693f); }
.class-grid > *:hover, .guide-grid > *:hover, .source-grid > *:hover { border-color: #806747; }
.class-grid h3, .guide-grid h3{ margin-bottom: .45rem; color: var(--text); font: 550 clamp(1.28rem, 2.6vw, 1.75rem)/1.18 var(--serif); }
.class-grid p, .guide-grid p, .source-grid p { color: var(--muted); }
.class-grid p + p, .guide-grid p + p, .source-grid p + p { margin-top: .6rem; }
.class-grid a, .guide-grid a, .source-grid a { overflow-wrap: anywhere; }
.class-grid svg, .guide-grid svg{ max-width: 3rem; max-height: 3rem; color: var(--accent, var(--gold)); }
.guide-grid h4{ margin-top: 1rem; color: var(--gold-light); }
.guide-grid ul, .guide-grid ol{ padding-left: 1.3rem; margin-block: .45rem .8rem; color: var(--muted); }
.guide-grid li + li{ margin-top: .35rem; }
.guide-grid details{ margin-top: .9rem; }
.guide-grid summary{ cursor: pointer; color: var(--gold-light); font-weight: 700; }
.guide-grid strong{ color: var(--text); }
.source-grid { padding: 0; margin: 0; list-style: none; }
.source-grid a { font-weight: 700; }
.no-script { padding-block: 1rem; color: var(--gold-light); }
.site-footer { background: #100e0c; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.75rem; }
.footer-inner strong { font: 650 1.12rem var(--serif); }
.footer-inner p, .footer-inner a { color: var(--muted); font-size: .84rem; }

@media (max-width: 52rem) {
  .shell { width: min(calc(100% - 2.5rem), 75rem); }
  .hero { min-height: 32rem; }
  .hero-inner { padding-block: 5rem; }
  .hero::before { background-position: center, center, 63% center; }
  .class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 36rem) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 0; padding-top: .85rem; }
  .main-nav { width: 100%; justify-content: space-between; gap: .5rem; }
  .hero { min-height: 30rem; align-items: end; }
  .hero-inner { padding-block: 4.25rem 3.1rem; }
  .hero::before {
    background:
      linear-gradient(90deg, #110f0cf0, #110f0c84 70%, #110f0c35),
      linear-gradient(0deg, #110f0cf5 8%, transparent 84%),
      url("assets/hero.webp") 61% center / cover no-repeat;
  }
  .hero h1 { font-size: clamp(2.75rem, 12vw, 4.3rem); }
  .hero-actions .button { gap: .6rem; }
  .strip-inner span + span::before { margin-right: .55rem; }
  .class-grid, .guide-grid, .source-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}

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

.atlas-controls { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.atlas-controls label { flex: 1 1 13rem; max-width: 22rem; display: grid; gap: .35rem; font-weight: 650; }
.atlas-controls select { width: 100%; min-height: 2.8rem; padding: .55rem; border: 1px solid #806747; background: #181410; color: var(--text); font: inherit; color-scheme: dark; }
.atlas-current { margin-bottom: 1rem; }
.atlas-current h3 { margin-block: .35rem; font: 550 clamp(1.45rem, 4vw, 2.25rem) var(--serif); }
.atlas-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.atlas-card { min-width: 0; padding: 1.2rem; background: #1d1915; border: 1px solid var(--line); }
.atlas-card h4 { margin: 0 0 .7rem; color: var(--gold-light); font-size: 1.1rem; }
.atlas-card p + p, .atlas-card li + li { margin-top: .65rem; }
.atlas-card ul { margin: .8rem 0; padding-left: 1.15rem; }
.atlas-note { margin-top: 1rem; color: var(--muted); font-size: .9rem; }
.race-table table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.race-table caption { text-align: left; color: var(--muted); margin-bottom: .65rem; }
.race-table th, .race-table td { text-align: left; vertical-align: top; padding: .75rem .65rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.race-table thead th { color: var(--gold-light); background: #211a13; }
.race-table thead th:first-child { width: 30%; }
.race-table thead th:nth-child(2) { width: 17%; }
@media (max-width: 52rem) { .atlas-cards { grid-template-columns: 1fr; } }
@media (max-width: 36rem) {
  .main-nav { flex-wrap: wrap; }
  .race-table th, .race-table td { padding: .55rem .3rem; font-size: .8rem; }
}
.class-card, .guide-card{ position: relative; }
.class-card, .guide-card{ border-top: 2px solid var(--accent, #8e693f); }
.class-card > a, .guide-card > a {
  display: inline-block;
  margin-top: .8rem;
  color: var(--gold-light);
  font-weight: 700;
  font-size: .85rem;
}
.class-icon, .guide-icon {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: .8rem;
  border: 1px solid currentColor;
  border-radius: .3rem;
  background: #151310;
  color: var(--accent, var(--gold));
  font: 1.45rem/1 var(--serif);
}
.class-card .class-role, .guide-card .guide-label{
  margin: 0 0 .35rem;
  color: var(--gold-light);
  font-size: .69rem;
  font-weight: 740;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.guide-card .guide-steps { margin-top: 1.1rem; }
.guide-steps li::marker { color: var(--accent, var(--gold-light)); font-weight: 750; }
.guide-steps li > p { margin-top: .12rem; }
.source-card a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .75rem; text-decoration: none; }
.source-card a strong { grid-column: 1; text-decoration: underline; text-decoration-color: #8d623e; text-underline-offset: .2em; }
.source-card a span:first-of-type { grid-column: 1; color: var(--muted); font-weight: 500; font-size: .88rem; }
.source-card a span:last-of-type { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

.field-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .65rem; margin-block: 1rem; }
.field-index a { display: grid; gap: .25rem; padding: .8rem 1rem; background: #201912; border: 1px solid var(--line); border-inline-start: 2px solid var(--gold); color: var(--gold-light); text-decoration: none; }
.field-index a:hover, .field-index a:focus-visible { background: #32251a; }
.field-index span { color: var(--muted); font-size: .85rem; }
