:root {
  --bg: #110e0b;
  --lift: #1b1612;
  --ink: #f6f1e8;
  --muted: #b5a89a;
  --line: rgba(246, 241, 232, 0.14);
  --orange: #f7931a;
  --orange-ink: #1a1006;
  --serif: Fraunces, Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    linear-gradient(#f7931a, #f7931a) top / 100% 3px no-repeat,
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 400;
}

img { max-width: 100%; height: auto; }

button, input { font: inherit; color: inherit; }

::selection { background: var(--orange); color: var(--orange-ink); }

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

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--lift);
  color: var(--ink);
  padding: 6px 10px;
  z-index: 40;
}

.skip:focus { top: 8px; }

.top, main, .colophon { padding-left: 32px; padding-right: 32px; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px 32px;
  padding-top: 22px;
  padding-bottom: 14px;
  flex-wrap: wrap;
  background: rgba(17, 14, 11, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(247, 147, 26, 0.28);
}

.mark {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 0.9;
  max-width: 9ch;
}

.mark a { color: inherit; text-decoration: none; }

.btc {
  color: var(--orange);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.42em;
  letter-spacing: 0;
  margin-right: 0.12em;
  vertical-align: 0.55em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 6px;
}

.nav a {
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: color 180ms ease, border-color 180ms ease;
}

.nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav a[aria-current="page"] { color: var(--orange); border-bottom-color: var(--orange); }

main { padding-top: 28px; padding-bottom: 80px; }

.line {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 2.15rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  max-width: 18em;
  margin: 8px 0 14px;
  color: var(--ink);
}

.quiet, .tally, .empty { color: var(--muted); font-size: 0.95rem; }

.quiet a { color: var(--orange); }

.prose p { max-width: 62ch; }

.index {
  list-style: none;
  padding: 0;
  margin: 28px 0 8px;
  max-width: 40rem;
}

.index li { border-top: 1px solid var(--line); }
.index li:last-child { border-bottom: 1px solid var(--line); }

.index a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
  transition: color 180ms ease, padding-left 180ms ease;
}

.index a span { color: var(--muted); font-size: 0.92rem; }

.index a:hover { color: var(--orange); padding-left: 6px; }
.index a:hover span { color: var(--ink); }

.tools, .kinds, .lookup, .controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 18px 0 10px;
}

button, .lookup input, a.text-btn {
  background: transparent;
  border: 1px solid rgba(247, 147, 26, 0.55);
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.lookup input {
  cursor: text;
  min-width: min(100%, 16rem);
  background: var(--lift);
}

button:hover, a.text-btn:hover {
  background: var(--orange);
  color: var(--orange-ink);
  border-color: var(--orange);
}

button[aria-pressed="true"] {
  background: var(--orange);
  color: var(--orange-ink);
  border-color: var(--orange);
}

button:disabled { opacity: 0.55; cursor: wait; }

.floor, .trait-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 32px 18px;
  margin-top: 18px;
}

.card, .trait-card { position: relative; z-index: 1; margin: 0; }

button.shot, button.card-open, a.trait-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

button.shot:hover, button.card-open:hover, a.trait-card:hover {
  background: transparent;
  color: inherit;
  border-color: transparent;
}

.card img, .shot img, .trait-card img, .strip img, .check-shot img {
  display: block;
  width: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0c0c0c;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 320ms ease, opacity 320ms ease, filter 320ms ease;
}

.card figcaption {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
  font-size: 0.86rem;
  line-height: 1.35;
}

.card .no {
  color: var(--muted);
  font-weight: 500;
}

.who {
  display: block;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.type-line {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-weight: 600;
  vertical-align: -0.12em;
}

.wear, .ground { color: var(--muted); }

.seal {
  display: inline-flex;
  width: 1.08em;
  height: 1.08em;
  flex: 0 0 auto;
  vertical-align: middle;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.seal svg { display: block; width: 100%; height: 100%; }
.seal .badge { fill: var(--seal, #e6ddd2); }
.seal .shine { fill: #fff; opacity: 0.42; }
.seal path {
  fill: none;
  stroke: #1a120c;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.seal-human { --seal: #f7931a; }
.seal-undead { --seal: #39ff14; }
.seal-primate { --seal: #d4af37; }
.seal-mech { --seal: #c5cdd6; }
.seal-elders { --seal: #00e5ff; }
.veil-cap .seal, table .seal, .trait-list .seal { width: 18px; height: 18px; }

@media (hover: hover) and (pointer: fine) {
  .floor:has(.card:hover) .card:not(:hover) img,
  .trait-grid:has(.trait-card:hover) .trait-card:not(:hover) img {
    opacity: 0.45;
    transform: scale(0.96);
    filter: saturate(0.7);
  }

  .card:hover, .card:focus-within,
  .trait-card:hover, .trait-card:focus-within {
    z-index: 6;
  }

  .card:hover img, .card:focus-within img,
  .trait-card:hover img, .trait-card:focus-within img {
    transform: scale(1.62);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(247, 147, 26, 0.55);
    opacity: 1;
    filter: none;
  }
}

.shot.is-down img { transform: scale(0.975); }

.press {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(247, 147, 26, 0.45);
  pointer-events: none;
  opacity: 0;
  z-index: 2;
}

.press.is-on { animation: felt 460ms ease-out; }

@keyframes felt {
  0% { opacity: 1; transform: scale(0.2); }
  100% { opacity: 0; transform: scale(2.4); }
}

.group { margin-top: 32px; }

.group h2, h2.page, h3 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
}

.group h2 {
  margin: 0 0 12px;
  font-size: 1.55rem;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.trait-card strong, .trait-card em { display: block; }

.trait-card strong {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 560;
  color: var(--ink);
}

.trait-card em {
  font-style: normal;
  font-size: 0.82rem;
  color: var(--muted);
}

.empty-face {
  display: grid;
  place-items: end start;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  padding: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.empty { border-top: 3px solid var(--orange); padding-top: 8px; }

h2.page {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.02;
}

.table-wrap { overflow-x: auto; margin: 0 0 1.6rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th { border-bottom-color: rgba(247, 147, 26, 0.45); font-weight: 600; }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.swatch {
  display: inline-block;
  width: 46px;
  height: 22px;
  border: 1px solid rgba(246, 241, 232, 0.4);
  vertical-align: middle;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(8, 6, 4, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
}

.veil[hidden] { display: none; }

.veil-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--bg);
  border: 1px solid rgba(247, 147, 26, 0.4);
  border-radius: 12px;
  padding: 14px;
  animation: rise 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.veil-card .shot { display: flex; justify-content: center; }
.veil-card .shot img { width: min(100%, 380px); }

.veil-cap { margin: 12px 0 0; font-family: var(--serif); font-size: 1.45rem; font-weight: 560; }

.trait-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 4px;
}

.trait-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.trait-list .k { color: var(--muted); }
.trait-list .v { text-align: right; font-weight: 500; }

.check-face {
  display: grid;
  grid-template-columns: minmax(180px, 320px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 22px;
}

.check-shot {
  border: 1px solid rgba(247, 147, 26, 0.45);
  border-radius: 12px;
  overflow: hidden;
}

.check-name {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 560;
  letter-spacing: -0.03em;
}

.wallet {
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  max-width: 62ch;
}

.wallet h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 560;
}

.colophon {
  padding-bottom: 32px;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav a.faq-mark {
  align-self: center;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(247, 147, 26, 0.7);
  border-radius: 50%;
  border-bottom-color: rgba(247, 147, 26, 0.7);
  background: transparent;
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  transition: background 180ms ease, color 180ms ease;
}

.nav a.faq-mark:hover,
.nav a.faq-mark[aria-current="page"] {
  background: var(--orange);
  color: var(--orange-ink);
  border-bottom-color: var(--orange);
}

.faq-list { max-width: 40rem; margin-top: 8px; }

.qa {
  border-top: 1px solid var(--line);
}

.qa:last-child { border-bottom: 1px solid var(--line); }

.qa summary {
  cursor: pointer;
  padding: 13px 4px;
  font-weight: 500;
  list-style: none;
}

.qa summary::-webkit-details-marker { display: none; }

.qa summary::before {
  content: "+";
  color: var(--orange);
  display: inline-block;
  width: 1.25em;
}

.qa[open] summary::before { content: "–"; }

.qa p {
  margin: 0 0 14px;
  padding-left: 1.25em;
  max-width: 62ch;
  color: var(--muted);
}

.faq-list h2 {
  margin: 28px 0 8px;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 560;
}

.strip {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.strip a { color: inherit; text-decoration: none; }
.strip span { display: block; margin-top: 6px; font-size: 0.82rem; color: var(--muted); }

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

body.held { overflow: hidden; }

@media (max-width: 720px) {
  .top, main, .colophon { padding-left: 16px; padding-right: 16px; }
  .top { align-items: flex-start; }
  .mark { max-width: none; font-size: 2.4rem; }
  .floor, .trait-grid, .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index a { flex-direction: column; gap: 2px; }
  .check-face { grid-template-columns: 1fr; }
}

@media (hover: hover) and (pointer: fine) and (max-width: 720px) {
  .card:hover img, .card:focus-within img,
  .trait-card:hover img, .trait-card:focus-within img {
    transform: scale(1.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card img, .shot img, .trait-card img, .index a, button, .nav a { transition: none; }
  .veil-card { animation: none; }
  .shot.is-down img { transform: none; }
  .press.is-on { animation: felt-still 500ms ease-out; }
  .floor:has(.card:hover) .card:not(:hover) img,
  .trait-grid:has(.trait-card:hover) .trait-card:not(:hover) img,
  .card:hover img, .card:focus-within img,
  .trait-card:hover img, .trait-card:focus-within img {
    transform: none;
    filter: none;
  }
  .card:hover img, .trait-card:hover img { box-shadow: 0 0 0 2px var(--orange); opacity: 1; }
}

@keyframes felt-still {
  0% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: none; }
}
