:root {
  color-scheme: dark;
  --ink: #211f1c;
  --paper: #f3eee2;
  --muted: #bfb5a6;
  --line: rgba(255, 255, 255, 0.14);
  --panel: #322e29;
  --panel-2: #282520;
  --shadow: rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #211f1c;
  background-size: 42px 42px;
}

button,
input,
textarea,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(33, 31, 28, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
  font-size: clamp(1rem, 2vw, 1.28rem);
  font-weight: 800;
}

.brand-mark {
  width: 26px;
  height: 26px;
  background:
    linear-gradient(135deg, #f5c6a8 0 49%, transparent 50%),
    linear-gradient(315deg, #8fc7b3 0 49%, transparent 50%),
    #b66d72;
  clip-path: polygon(50% 0, 92% 28%, 78% 84%, 50% 100%, 22% 84%, 8% 28%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.header-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.header-stats span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.header-stats strong {
  color: var(--paper);
}

main {
  width: min(1640px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 36px);
}

.showcase {
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 30px);
  align-items: stretch;
}

.race-rail {
  position: sticky;
  top: 88px;
  align-self: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.rail-label,
.kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.race-buttons {
  display: grid;
  gap: 8px;
}

.race-button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--paper);
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.race-button:hover,
.race-button:focus-visible,
.race-button[aria-pressed="true"] {
  border-color: var(--race-color);
  background: color-mix(in srgb, var(--race-color) 24%, #2b2823);
  outline: none;
}

.swatch {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: var(--race-color);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.race-button span:last-child {
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.featured {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1.45fr);
  gap: clamp(18px, 3vw, 34px);
  min-height: calc(100svh - 128px);
  padding: clamp(8px, 2.2vw, 22px) 0;
}

.feature-copy {
  align-self: center;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.4rem, 7vw, 6.8rem);
  line-height: 0.92;
}

.intro {
  max-width: 58ch;
  margin: 22px 0 0;
  color: #ddd3c4;
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.58;
}

.trait-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.trait {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 9px;
  color: var(--paper);
  border: 1px solid color-mix(in srgb, var(--race-color) 55%, rgba(255, 255, 255, 0.22));
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.82rem;
  font-weight: 700;
}

.feature-media {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) minmax(168px, 0.62fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

figure {
  margin: 0;
}

.land-frame,
.character-pair figure,
.race-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: var(--panel-2);
}

.land-frame {
  display: grid;
  grid-template-rows: auto auto;
  min-width: 0;
}

.land-frame img {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
  background: var(--race-color);
  object-fit: contain;
}

figcaption {
  min-height: 42px;
  padding: 10px 12px;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.82rem;
  font-weight: 700;
}

.character-pair {
  display: grid;
  grid-template-rows: auto auto;
  gap: 14px;
  min-width: 0;
}

.character-pair figure {
  display: grid;
  grid-template-rows: auto auto;
}

.character-pair img {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
  background: var(--race-color);
  object-fit: contain;
}

.atlas {
  margin-top: clamp(28px, 5vw, 58px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.8rem);
  line-height: 1;
}

.race-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.race-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.card-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

button.card-media {
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

button.card-media:focus-visible {
  outline: 3px solid var(--race-color);
  outline-offset: -3px;
}

.card-media img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.card-media img:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.card-body {
  padding: 13px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--race-color) 20%, transparent), transparent),
    rgba(255, 255, 255, 0.04);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.card-body p {
  margin: 9px 0 0;
  color: #d2c8b8;
  font-size: 0.86rem;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .race-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .featured,
  .feature-media {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: none;
  }

  .character-pair {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-stats {
    justify-content: flex-start;
  }

  main {
    padding: 14px;
  }

  .showcase {
    grid-template-columns: 1fr;
  }

  .race-rail {
    position: static;
    padding: 10px;
  }

  .race-buttons {
    display: grid;
    grid-auto-columns: minmax(150px, 1fr);
    grid-auto-flow: column;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .race-button span:last-child {
    white-space: normal;
  }

  .featured {
    min-height: auto;
    padding: 16px;
  }

  .feature-media,
  .character-pair {
    grid-template-columns: 1fr;
  }

  .land-frame img,
  .character-pair img {
    min-height: auto;
    aspect-ratio: 1;
  }

  .race-grid {
    grid-template-columns: 1fr;
  }
}
