/* Clan homepage and catalogue. Shared pieces (.btn, .card, .panel, .bracketed) are reused by the dashboard. */

@font-face {
  font-family: 'Bai Jamjuree';
  src: url('/fonts/bai-jamjuree-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Bai Jamjuree';
  src: url('/fonts/bai-jamjuree-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Electrolize';
  src: url('/fonts/electrolize-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0A1D29;
  --surface: #0F2C3E;
  --border: #194967;
  --text: #FFFFFF;
  --text-2: #ADD3EB;
  --accent: #54ADF7;
  --hud: #00D2FF;
  --danger: #FF8080;

  --font-body: 'Bai Jamjuree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Electrolize', 'Bai Jamjuree', system-ui, sans-serif;
  --gutter: 16px;
  --cut: 24px;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  /* Faint dot grid, fading out down the first screen. */
  background-image:
    linear-gradient(to bottom, rgba(10, 29, 41, 0) 0, var(--bg) 900px),
    radial-gradient(circle at 1px 1px, rgba(173, 211, 235, 0.16) 1px, transparent 1.5px);
  background-size: 100% 100%, 24px 24px;
  background-repeat: no-repeat, repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
  transition: color 0.2s;
}
a:hover {
  color: var(--text);
}

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

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

/* ---------- shared pieces ---------- */

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px 0 36px;
  border: 0;
  background: none;
  color: #000;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
/* The fill sits on a pseudo-element so the cut corner does not clip the focus ring. */
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: background-color 0.2s;
}
.btn:hover {
  color: #000;
}
.btn:hover::before {
  background: var(--text);
}
.btn:disabled {
  cursor: progress;
}
.btn:disabled::before {
  background: var(--text-2);
}

.card {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  transition: border-color 0.2s;
}
.card:hover {
  border-color: var(--accent);
}

.panel {
  position: relative;
  padding: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Two opposing corner brackets. */
.bracketed::before,
.bracketed::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 0 solid var(--accent);
  pointer-events: none;
}
.bracketed::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}
.bracketed::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 2px 2px 0;
}

.divider {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  height: 1px;
  overflow: visible;
}
.divider line {
  stroke: var(--border);
  stroke-width: 1;
}

/* ---------- page frame ---------- */

.hero,
main,
.footer {
  width: 100%;
  max-width: calc(1200px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.topbar {
  padding-block: 20px 16px;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
}
.nav a {
  display: inline-block;
  padding-block: 6px;
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.nav a:hover {
  color: var(--text);
}

/* ---------- hero ---------- */

.hero-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 16px;
  margin-block: 32px 24px;
  padding: 32px 24px 40px;
}

.bracket {
  position: absolute;
  width: 32px;
  height: 32px;
  overflow: visible;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  pointer-events: none;
}
.bracket-tl { top: 0; left: 0; }
.bracket-tr { top: 0; right: 0; transform: rotate(90deg); }
.bracket-br { right: 0; bottom: 0; transform: rotate(180deg); }
.bracket-bl { bottom: 0; left: 0; transform: rotate(270deg); }

.emblem {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  color: var(--accent);
}

.hero h1 {
  max-width: 100%;
  font-size: clamp(2.25rem, 1.2rem + 5.4vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.tag {
  padding: 2px 10px;
  border: 1px solid var(--hud);
  color: var(--hud);
  font-family: var(--font-display);
  font-size: 0.875rem;
  letter-spacing: 0.14em;
}

.tagline {
  max-width: 34ch;
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  line-height: 1.3;
}

.intro {
  max-width: 62ch;
  font-size: 1.0625rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.hero-body > .btn {
  margin-top: 12px;
}

@media (min-width: 800px) {
  .hero-body {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 64px;
    margin-block: 48px 40px;
    padding: 64px 64px 72px;
  }
  .hero-body > :not(.bracket) {
    grid-column: 1;
  }
  .hero-body > .emblem {
    grid-column: 2;
    grid-row: 1 / span 5;
    align-self: center;
    width: 220px;
    height: 220px;
  }
  .hero-body > svg.emblem {
    stroke-width: 1;
  }
}

/* ---------- sections ---------- */

.section {
  padding-block: 48px;
}
@media (min-width: 800px) {
  .section {
    padding-block: 56px;
  }
}

.section-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.section-head h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  letter-spacing: 0.01em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.activities .card {
  padding: 24px;
}
.activities h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}
.activities p {
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* ---------- members ---------- */

.members {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.members th {
  padding: 0 16px 10px;
  color: var(--hud);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}
.members td {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.members td:first-child {
  color: var(--text);
  font-weight: 700;
}
.members tbody tr {
  transition: background-color 0.2s;
}
.members tbody tr:hover {
  background: var(--surface);
}
.members tbody tr:last-child td {
  border-bottom: 1px solid var(--border);
}

@media (max-width: 599px) {
  .members,
  .members tbody,
  .members tr,
  .members td {
    display: block;
  }
  .members thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .members tbody tr {
    padding: 14px 0;
    border-top: 1px solid var(--border);
  }
  .members tbody tr:last-child {
    border-bottom: 1px solid var(--border);
  }
  .members td,
  .members tbody tr:last-child td {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 12px;
    padding: 2px 0;
    border: 0;
  }
  .members td::before {
    content: attr(data-label);
    color: var(--hud);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.08em;
  }
  .members tbody tr td:empty {
    display: none;
  }
}

/* ---------- gallery ---------- */

.gallery-item {
  overflow: hidden;
}
.gallery-item figure {
  position: relative;
  margin: 0;
}
.gallery-open {
  display: block;
  cursor: zoom-in;
}
.gallery-open:focus-visible {
  outline-offset: -4px;
}
.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg);
}
.gallery-item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 40px 16px 12px;
  background: linear-gradient(to top, rgba(4, 12, 18, 0.92), rgba(4, 12, 18, 0));
  color: var(--text);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
  pointer-events: none;
}
/* A long caption is cut to two lines on the card; the lightbox shows all of it. */
.gallery-item figcaption span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.lightbox {
  max-width: min(1200px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}
.lightbox::backdrop {
  background: rgba(4, 12, 18, 0.88);
}
.lightbox-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 34px);
  max-height: calc(100dvh - 34px);
}
.lightbox img {
  display: block;
  max-width: 100%;
  min-height: 0;
  flex: 0 1 auto;
  object-fit: contain;
  background: var(--bg);
}
.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 16px;
}
.lightbox-caption {
  min-width: 0;
  overflow-wrap: anywhere;
}
.lightbox-close {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
}
.lightbox-close:hover {
  border-color: var(--accent);
}

/* ---------- join ---------- */

#join-form {
  display: grid;
  gap: 20px;
  max-width: 640px;
  padding: 28px 24px 32px;
}
@media (min-width: 800px) {
  #join-form {
    padding: 40px;
  }
}

.field {
  display: grid;
  gap: 6px;
}
.field label {
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
}
.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s;
}
.field textarea {
  resize: vertical;
}
.field input:hover,
.field textarea:hover,
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
}

#join-form .btn {
  justify-self: start;
}

.status:empty {
  display: none;
}
.status[data-state='error'] {
  color: var(--danger);
}

.notice {
  max-width: 640px;
  padding: 20px 24px;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  color: var(--text-2);
}

/* ---------- catalogue ---------- */

[hidden] {
  display: none !important;
}

/* A shorter hero for pages that are not the homepage. On a phone the emblem
   sits beside the org name so the search is not pushed off the first screen. */
.hero-compact {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 12px;
  margin-block: 24px 0;
  padding: 24px 20px 28px;
}
.hero-compact > .emblem {
  width: 36px;
  height: 36px;
}
.hero-compact > h1,
.hero-compact > .intro {
  grid-column: 1 / -1;
}
.hero-compact > .intro {
  font-size: 1rem;
}
.hero-compact h1 {
  font-size: clamp(2.25rem, 1.5rem + 3.2vw, 4rem);
}
.org {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}
.org a {
  color: var(--text-2);
  text-decoration: none;
}
.org a:hover {
  color: var(--text);
}
.nav a[aria-current='page'] {
  color: var(--text);
  box-shadow: 0 2px 0 var(--accent);
}
@media (min-width: 800px) {
  .hero-compact {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px 64px;
    margin-block: 40px 8px;
    padding: 40px 48px 44px;
  }
  .hero-compact > h1,
  .hero-compact > .intro {
    grid-column: 1;
  }
  .hero-compact > .intro {
    font-size: 1.0625rem;
  }
  .hero-compact > .emblem {
    grid-row: 1 / span 3;
    width: 132px;
    height: 132px;
  }
}

.catalogue {
  padding-top: 32px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 14px 12px;
  padding: 20px;
}
.field-search,
.field-category {
  grid-column: 1 / -1;
}
.field-check {
  grid-column: 1 / -1;
}
.field-check[hidden] {
  display: none;
}
.field-check label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  cursor: pointer;
}
.field-check input {
  width: 20px;
  min-height: 20px;
  padding: 0;
  accent-color: var(--accent);
}
@media (min-width: 600px) {
  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 20px;
    padding: 24px;
  }
  .field-category {
    grid-column: auto;
  }
}
@media (min-width: 1000px) {
  .filters {
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
    padding: 28px 32px 32px;
  }
  .field-search {
    grid-column: auto;
  }
}
@media (max-width: 799px) {
  .catalogue {
    padding-top: 24px;
  }
  .results-head {
    margin-top: 28px;
  }
}

.field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 40px 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--bg);
  /* Chevron in the accent colour. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2354ADF7' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  color: var(--text);
  font: inherit;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.field select:hover,
.field select:focus {
  border-color: var(--accent);
}
.field select:disabled {
  border-color: var(--border);
  color: var(--text-2);
  opacity: 0.55;
  cursor: not-allowed;
}
.field input[type='search']::-webkit-search-cancel-button {
  cursor: pointer;
}

.catalogue > .notice {
  margin-top: 24px;
}

.results-head {
  margin: 40px 0 12px;
}
.cat-status {
  min-height: 1.6em;
  margin-bottom: 16px;
  color: var(--text-2);
}
.cat-status:empty {
  display: block;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
}
.btn-ghost.is-on {
  border-color: var(--hud);
  color: var(--hud);
}
.btn-ghost:disabled {
  border-color: var(--border);
  color: var(--text-2);
  opacity: 0.5;
  cursor: default;
}

.results {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.results th {
  padding: 0 16px 10px;
  color: var(--hud);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.results td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.results .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.results tbody tr {
  cursor: pointer;
  transition: background-color 0.2s;
}
.results tbody tr:hover {
  background: var(--surface);
}
.results tbody tr:last-child td {
  border-bottom: 1px solid var(--border);
}
.results .cell-compare {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}
.results.hide-dps .cell-dps,
.results.hide-compare .cell-compare {
  display: none;
}
.row-open {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: color 0.2s;
}
.row-open:hover,
.results tbody tr:hover .row-open {
  color: var(--accent);
}
.row-kind {
  display: block;
  margin-top: 2px;
  color: var(--hud);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dps-value {
  color: var(--text);
  font-family: var(--font-display);
}
.dps-tag {
  margin-right: 8px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-2);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

@media (max-width: 599px) {
  .results,
  .results tbody,
  .results tr,
  .results td {
    display: block;
  }
  .results thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .results tbody tr {
    padding: 14px 0 16px;
    border-top: 1px solid var(--border);
  }
  .results tbody tr:last-child {
    border-bottom: 1px solid var(--border);
  }
  .results tbody tr:hover {
    background: none;
  }
  .results td.num {
    text-align: left;
  }
  .results td,
  .results tbody tr:last-child td {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 12px;
    width: auto;
    padding: 2px 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }
  .results td::before {
    content: attr(data-label);
    color: var(--hud);
    font-family: var(--font-display);
    font-size: 0.875rem;
    letter-spacing: 0.08em;
  }
  .results td.cell-name,
  .results tbody tr:last-child td.cell-name {
    display: block;
    margin-bottom: 6px;
    font-size: 1.0625rem;
  }
  .results td.cell-compare,
  .results tbody tr:last-child td.cell-compare {
    display: block;
    margin-top: 12px;
  }
  .results td.cell-name::before,
  .results td.cell-compare::before {
    content: none;
  }
  .results td.is-empty,
  .results tbody tr:last-child td.is-empty {
    display: none;
  }
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
}
.pager-page {
  min-width: 5.5em;
  color: var(--text-2);
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-align: center;
}

.data-source {
  color: var(--text);
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

/* ---------- catalogue: item detail ---------- */

.detail {
  width: min(860px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}
.detail::backdrop {
  background: rgba(4, 12, 18, 0.88);
}
.detail-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 35px);
  max-height: calc(100dvh - 35px);
}
.detail-head {
  display: grid;
  gap: 6px;
  padding: 24px 24px 16px;
}
.detail-kind {
  color: var(--hud);
  font-family: var(--font-display);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.detail-head h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  overflow-wrap: anywhere;
}
.detail-maker {
  color: var(--text-2);
}
.detail-kind:empty,
.detail-maker:empty,
.detail-description:empty {
  display: none;
}
.detail-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.detail-body:focus-visible {
  outline-offset: -3px;
}
.detail-description {
  max-width: 68ch;
  margin-bottom: 20px;
  color: var(--text-2);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}
.figure {
  padding: 12px 14px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.figure dt {
  color: var(--hud);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
}
.figure dd {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 0.9rem + 1.6vw, 1.625rem);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
@media (max-width: 599px) {
  .figure {
    padding: 10px 12px 12px;
  }
  .detail-head {
    padding: 20px 20px 12px;
  }
  .detail-body {
    padding: 4px 20px 20px;
  }
  .detail-bar {
    padding: 10px 12px 10px 20px;
  }
}
.detail-split {
  margin-bottom: 20px;
  color: var(--text-2);
  font-size: 0.9375rem;
}
.stat-group {
  border-top: 1px solid var(--border);
}
.stat-group summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 0;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  list-style: none;
  cursor: pointer;
  transition: color 0.2s;
}
.stat-group summary::-webkit-details-marker {
  display: none;
}
.stat-group summary::before {
  content: '+';
  flex: none;
  width: 0.8em;
  color: var(--accent);
}
.stat-group[open] summary::before {
  content: '\2212';
}
.stat-group summary:hover {
  color: var(--accent);
}
.stat-count {
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  letter-spacing: 0;
}
.stat-list {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 4px 20px;
  margin: 0 0 18px;
  font-size: 0.9375rem;
}
.stat-list dt {
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.stat-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.detail-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 12px;
  padding: 12px 16px 12px 24px;
  border-top: 1px solid var(--border);
}
.detail-wiki {
  margin-right: auto;
  padding-block: 8px;
}

/* ---------- catalogue: compare tray ---------- */

.tray {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  border-top: 2px solid var(--accent);
  background: #081822;
  box-shadow: 0 -16px 40px rgba(4, 12, 18, 0.7);
}
.tray-inner {
  width: 100%;
  max-width: calc(1200px + 2 * var(--gutter));
  margin-inline: auto;
  padding: 12px var(--gutter) 14px;
}
.tray-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.tray-bar h2 {
  font-size: 1.125rem;
  letter-spacing: 0.04em;
}
.tray-count {
  color: var(--text-2);
  font-size: 0.875rem;
}
.tray-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-left: auto;
  margin-right: 8px;
  font-family: var(--font-display);
  white-space: nowrap;
}
.tray-label {
  color: var(--hud);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tray-total output {
  font-size: 1.625rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.tray-unit {
  color: var(--text-2);
  font-size: 0.875rem;
}
.tray-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 8px 16px;
  max-height: 30vh;
  margin-top: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tray-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 5px 5px 5px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}
.tray-name {
  font-size: 0.9375rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.tray-dps {
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tray-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--hud);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
}
.tray-qty input {
  width: 58px;
  height: 36px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s;
}
.tray-qty input:hover,
.tray-qty input:focus {
  border-color: var(--accent);
}
.tray-remove {
  width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 1.125rem;
}
.tray-note {
  max-width: 90ch;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 0.875rem;
}
@media (max-width: 599px) {
  .tray-list {
    grid-template-columns: minmax(0, 1fr);
    max-height: 26vh;
  }
  .tray-inner {
    padding-block: 10px 12px;
  }
  .tray-total {
    order: 3;
    width: 100%;
    margin: 0;
  }
  .tray-count {
    margin-right: auto;
  }
  .tray-item {
    gap: 8px;
    padding: 4px 4px 4px 10px;
  }
  .tray-note {
    font-size: 0.8125rem;
  }
}

/* ---------- footer ---------- */

.footer {
  display: grid;
  gap: 16px;
  margin-top: 48px;
  padding-block: 32px 56px;
  color: var(--text-2);
}
.footer::before {
  content: '';
  height: 1px;
  background: var(--border);
}
.footer p {
  max-width: 78ch;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-family: var(--font-display);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

/* ---------- motion (see js/motion-gate.js) ----------
   The "motion" class is only present when animation is wanted and its script
   is expected to run. Without it everything below is simply visible. */

.motion [data-reveal]:not(.is-in),
.motion [data-hero]:not(.is-in) {
  opacity: 0;
}
.motion .divider:not(.is-in),
.motion .bracket:not(.is-in) {
  visibility: hidden;
}

/* Printing must not lose the sections that were never scrolled into view. */
@media print {
  .motion [data-reveal],
  .motion [data-hero] {
    opacity: 1 !important;
    transform: none !important;
  }
  .motion .divider,
  .motion .bracket {
    visibility: visible !important;
  }
}
