:root {
  color-scheme: dark;
  --page: #0b0d14;
  --surface: #141826;
  --surface-hover: #1a2032;
  --line: #262d42;
  --text: #e8e4d8;
  --muted: #9aa3b5;
  --gold: #e2b65a;
  --gold-dim: #8f7436;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1rem;
}

a {
  color: var(--gold);
}

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

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

/* Banner: a night sky made of a few repeating star layers. */
.banner {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 90% at 50% 115%, rgb(226 182 90 / 0.22), transparent 70%),
    linear-gradient(180deg, #070912 0%, #111830 70%, #161b33 100%);
  text-align: center;
}

.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 31% 64%, #cfd8ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 47% 14%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 48%, #ffe9b8 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 27%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 91% 71%, #cfd8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 86%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 56% 79%, #fff 50%, transparent 51%);
  background-size: 23rem 17rem;
  opacity: 0.55;
  pointer-events: none;
}

div.banner-inner {
  position: relative;
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.crest {
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 1.2rem rgb(226 182 90 / 0.35));
}

.crest-shield {
  fill: #1a2038;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.crest-mark {
  fill: none;
  stroke: var(--gold);
  stroke-width: 4;
  stroke-linecap: round;
}

.kicker {
  margin: 0 0 0.5rem;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 7vw, 3.8rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.tagline {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
}

/* Roster */
main.wrap {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
}

.count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  --class: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  height: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--class);
  border-radius: 0.6rem;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}

a.card:hover {
  border-color: var(--class);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.portrait {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  overflow: hidden;
  border: 2px solid var(--class);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--class) 22%, var(--page));
}

.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.initial {
  color: var(--class);
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 600;
}

.card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.member-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.facts,
.note {
  color: var(--muted);
  font-size: 0.875rem;
}

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

.note {
  font-style: italic;
}

.realm {
  flex: none;
  align-self: flex-start;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.5rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 0.6rem;
  color: var(--muted);
  text-align: center;
}

.status.error {
  border-color: #a8554c;
  color: #f0a79e;
}

/* Footer */
.footer.wrap {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer p {
  margin: 0 0 0.4rem;
}

.footer p:empty {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }

  a.card:hover {
    transform: none;
  }
}
