:root {
  color-scheme: dark;
  --page: #0d0e19;
  --panel: #151725;
  --panel-light: #1b1e30;
  --ink: #faf3e8;
  --muted: #bcb9cc;
  --gold: #efc77e;
  --line: #353447;
  --max-width: 1180px;
  --heading: Georgia, 'Times New Roman', serif;
  --mono: 'Cascadia Mono', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--page); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font: 1rem/1.65 'Segoe UI', system-ui, sans-serif; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 110px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
::selection { background: #e8b96f; color: #171321; }

.wrap { width: min(var(--max-width), calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 5; top: 8px; left: 12px; padding: .5rem 1rem; color: #19131a; background: var(--gold); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 3;
  top: 0;
  background: var(--page);
  border-bottom: 1px solid #3e3849;
}
.site-header::before { content: ''; display: block; height: 2px; background: linear-gradient(90deg, #ad6696, #edbe71, #76c6d9, #9572bc); }
.header-inner {
  width: min(1312px, calc(100% - 64px));
  min-height: 68px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); font: 700 1.13rem var(--heading); text-decoration: none; white-space: nowrap; }
.brand img { flex: none; image-rendering: pixelated; }
.site-nav { display: flex; align-items: center; gap: clamp(.9rem, 3vw, 2.5rem); }
.site-nav a { font-size: .89rem; font-weight: 650; color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-nav .nav-download { padding: .42rem .85rem; color: var(--gold); border: 1px solid #6a533a; border-radius: 5px; white-space: nowrap; }
.nav-download span { margin-left: .2rem; }

.hero {
  background: radial-gradient(ellipse at 78% 0%, #292747, transparent 76%), linear-gradient(#171a30, var(--page));
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.38fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.75rem);
  padding-block: clamp(48px, 7vw, 100px) clamp(36px, 6vw, 80px);
}
.hero-scene { margin: 0; }
.hero-scene img {
  width: 100%;
  height: auto;
  border: 1px solid #615375;
  border-radius: 8px;
  box-shadow: 0 16px 36px #08091470;
  image-rendering: pixelated;
}
.eyebrow { margin: 0 0 .75rem; color: var(--gold); font: 700 .74rem/1.4 var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.sigil { display: inline-block; width: .58rem; height: .58rem; margin-right: .54rem; border: 1px solid currentColor; transform: rotate(45deg); vertical-align: .04em; }
.hero h1 { margin: 0; font: 700 clamp(2.75rem, 7vw, 6.4rem)/.97 var(--heading); letter-spacing: -.06em; }
.hero h1 em { color: #f5d69e; font-weight: inherit; }
.hero-copy { max-width: 455px; margin: 1.35rem 0 0; color: #f0eafa; font-size: clamp(1rem, 1.6vw, 1.15rem); }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.65rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 46px;
  padding: .55rem 1rem;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: .92rem;
  font-weight: 750;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease;
}
.button-primary { color: #231913; background: #efc681; border-color: #f5d9a5; box-shadow: inset 0 -2px #b78650; }
.button-primary:hover { background: #fbe0ac; }
.button-quiet { background: #111422b8; border-color: #c2a87870; color: var(--ink); }
.button-quiet:hover { background: #282339; border-color: var(--gold); }
.edition { margin-top: .9rem; font: .77rem var(--mono); color: #dbd1e3; }
.edition span { margin-inline: .25rem; }
.scene-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; margin-top: .75rem; padding-left: .65rem; border-left: 1px solid var(--gold); color: var(--muted); font-size: .82rem; }
.scene-label span { color: var(--gold); font: 700 .68rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: .12em; }

.section { padding-block: clamp(52px, 8vw, 110px); }
.section-heading { max-width: 675px; margin-bottom: 1.8rem; }
h2, h3 { margin: 0; font-family: var(--heading); font-weight: 700; line-height: 1.12; overflow-wrap: anywhere; }
h2 { font-size: clamp(2.05rem, 5vw, 4rem); letter-spacing: -.055em; text-wrap: balance; }
h3 { font-size: clamp(1.65rem, 4vw, 2.8rem); letter-spacing: -.04em; }
.section-heading > p:last-child:not(.eyebrow), .download-panel p:not(.eyebrow) { max-width: 55ch; color: var(--muted); margin-block: .9rem 0; }
.lore-section { padding-top: clamp(38px, 5vw, 76px); }

.region-picker { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.region-tab, .class-tab { cursor: pointer; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 5px; }
.region-tab { min-height: 44px; padding: .45rem 1.2rem; font-weight: 650; }
.region-tab:hover, .class-tab:hover { color: var(--ink); border-color: #837695; }
.region-tab[aria-selected="true"], .class-tab[aria-selected="true"] { color: var(--ink); background: #292131; border-color: #bd925f; box-shadow: inset 0 0 0 1px #b88a4d24; }
.region-panel, .class-panel, .mode-card, .download-panel { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.region-panel { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; background: var(--panel); }
.region-panel > img { width: 100%; height: auto; }
.region-copy { align-self: center; padding: clamp(24px, 4vw, 46px); }
.panel-subtitle { margin: .65rem 0 0; color: #ecd0a1; font-style: italic; }
#region-description, .class-copy > p:not(.eyebrow), .mode-copy > p:last-child { margin-block: .85rem 0; color: var(--muted); }

.classes-section { background: radial-gradient(ellipse at 76% 13%, #1e2039 0, #10121f 51%); border-block: 1px solid #242539; }
.class-layout { display: grid; grid-template-columns: minmax(290px, .9fr) minmax(0, 1.8fr); gap: .85rem; align-items: stretch; }
.class-picker[hidden] + .class-panel { grid-column: 1 / -1; }
.class-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .42rem; }
.class-tab { display: flex; align-items: center; gap: .45rem; min-height: 55px; padding: .25rem .55rem; font-size: .82rem; line-height: 1.25; text-align: left; overflow-wrap: anywhere; }
.class-tab img { flex: none; width: 39px; height: 39px; object-fit: contain; image-rendering: pixelated; }
.class-panel { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1fr); background: var(--panel); }
.class-stage {
  position: relative;
  display: grid;
  isolation: isolate;
  min-height: 300px;
  place-items: center;
  background: radial-gradient(ellipse at 50% 62%, #63558575, transparent 65%), linear-gradient(150deg, #24223d, #121527);
  border-right: 1px solid var(--line);
}
.class-rune {
  z-index: -1;
  position: absolute;
  width: min(48%, 124px);
  aspect-ratio: 1;
  border: 1px solid #bfa66d6b;
  outline: 1px solid #a391d240;
  outline-offset: 9px;
  transform: rotate(45deg);
}
.class-stage img { width: min(88%, 265px); height: auto; image-rendering: pixelated; filter: drop-shadow(0 10px 8px #05050eb0); }
.class-number { position: absolute; bottom: .8rem; left: 1rem; color: #cfc4db; font: .7rem var(--mono); letter-spacing: .1em; }
.class-copy { align-self: center; padding: clamp(20px, 3vw, 34px); }
.class-copy h3 { text-wrap: balance; }
.ability-list { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.ability-list li { padding: .25rem .5rem; border-radius: 4px; background: #262135; border: 1px solid #4e4059; color: #eed8b1; font-size: .77rem; line-height: 1.45; }

.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.mode-card { background: var(--panel); }
.mode-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.mode-copy { padding: 1.25rem; }
.mode-copy h3 { font-size: 1.95rem; }

.download-section { padding-top: 0; }
.download-panel { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(1.2rem, 5vw, 4rem); align-items: center; padding: clamp(24px, 5vw, 60px); background: linear-gradient(128deg, #201a2a, #151825 64%); border-color: #574356; }
.download-panel h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
.download-notes { padding: .85rem 1.05rem; border: 1px solid var(--line); border-radius: 5px; background: #111421; }
.service-status { display: flex; align-items: center; gap: .6rem; padding-block: .35rem .75rem; font-size: .88rem; }
.service-status a { color: var(--gold); text-underline-offset: .2em; }
.status-dot { flex: none; width: .62rem; height: .62rem; border-radius: 50%; background: #9292a6; }
.status-dot.online { background: #90e0b8; box-shadow: 0 0 10px #74d49e55; }
.download-notes details { border-top: 1px solid var(--line); }
.download-notes summary { min-height: 42px; padding-block: .55rem; font-weight: 650; cursor: pointer; }
.download-panel .download-notes details p { font-size: .88rem; margin-block: 0 .8rem; }

.site-footer { border-top: 1px solid var(--line); background: #10111d; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.5rem; padding-block: 1.2rem; color: var(--muted); font-size: .84rem; }
.footer-inner > a:last-child { text-underline-offset: .22em; }

@media (max-width: 900px) {
  .class-layout { grid-template-columns: 1fr; }
  .class-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .class-panel { min-height: 300px; }
}

@media (max-width: 760px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: clamp(2.75rem, 11vw, 4.5rem); }
  .region-panel { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 660px) {
  [id] { scroll-margin-top: 120px; }
  .wrap, .header-inner { width: calc(100% - 32px); }
  .header-inner { flex-wrap: wrap; gap: .2rem .7rem; padding-block: .35rem .55rem; }
  .site-nav { justify-content: space-between; width: 100%; gap: .5rem; }
  .site-nav a { display: inline-flex; align-items: center; min-height: 40px; }
  .site-nav .nav-download { padding-block: .2rem; }
  .hero-inner { padding-block: 36px 32px; }
  .download-panel { grid-template-columns: minmax(0, 1fr); }
  .class-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .class-stage { min-height: 205px; }
  .class-copy { padding: .85rem; }
  .class-copy h3 { font-size: 1.4rem; }
  .class-copy > p:not(.eyebrow) { font-size: .88rem; line-height: 1.45; }
  .class-copy .eyebrow { font-size: .65rem; }
  .mode-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .class-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-tab img { width: 32px; height: 32px; }
  .class-panel { grid-template-columns: 1fr; }
  .class-stage { min-height: 165px; border: 0; border-bottom: 1px solid var(--line); }
  .class-stage img { width: 154px; }
  .class-rune { width: 94px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
