/* whatis.mc.danii.io — dark dithered chrome, same family as repo / gacha
   (dark variant of whois.danii.io). Dithering is decorative only: fills,
   dividers, widget chrome, heading text. Photos stay clean. */

:root {
  --bg: #000000;
  --fg: #ffffff;
  --border: 2px solid var(--fg);
  --border-thin: 1px solid var(--fg);
  --dither-checker: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect width="4" height="4" fill="black"/><rect x="0" y="0" width="1" height="1" fill="white"/><rect x="2" y="2" width="1" height="1" fill="white"/><rect x="2" y="0" width="1" height="1" fill="white"/><rect x="0" y="2" width="1" height="1" fill="white"/></svg>');
  --dither-sparse: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8"><rect width="8" height="8" fill="black"/><rect x="0" y="0" width="2" height="2" fill="white"/><rect x="4" y="4" width="2" height="2" fill="white"/></svg>');
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "Cascadia Mono",
    Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.55;
}

body { overflow-x: hidden; }

::selection {
  background: var(--fg);
  color: var(--bg);
}

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

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 96px;
  overflow-x: auto;
}

/* ---------- dither helpers ---------- */

.dither-fill {
  background-image: var(--dither-checker);
  background-size: 4px 4px;
  image-rendering: pixelated;
}

.dither-text {
  background-color: var(--fg);
  background-image: var(--dither-sparse);
  background-size: 6px 6px;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px var(--fg);
}

/* ---------- nav ---------- */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  border: var(--border);
  padding: 6px 12px;
  color: var(--fg);
  background: var(--bg);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.site-nav a:hover,
.site-nav a.current {
  background: var(--fg);
  color: var(--bg);
}

/* ---------- masthead ---------- */

header.masthead { margin-bottom: 8px; }

.mark {
  display: inline-block;
  margin: 22px 0 14px;
  padding: 4px 10px;
  border: var(--border);
  background: var(--fg);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.05;
  text-transform: uppercase;
}

.lede {
  max-width: 42rem;
  margin: 0 auto 8px;
  font-size: 0.95rem;
}

.lede a { text-underline-offset: 3px; }

header.masthead .mark,
header.masthead h1,
header.masthead .lede { text-align: center; }

header.masthead { text-align: center; }

.rules {
  position: relative;
  isolation: isolate;
  text-align: left;
  max-width: 42rem;
  margin: 22px auto;
  padding: 14px 16px;
  border: var(--border);
  background: var(--bg);
}

.rules::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--bg);
  background-size: 8px 8px;
  image-rendering: pixelated;
  opacity: 0.55;
  pointer-events: none;
}

.rules strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.rules p { margin: 0; }
.rules p + p { margin-top: 6px; }

.cta-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

a.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  appearance: none;
  border: var(--border);
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 14px;
  cursor: pointer;
}

a.btn:hover, button.btn:hover {
  background: var(--fg);
  color: var(--bg);
}

a.btn.primary, button.btn.primary {
  background: var(--fg);
  color: var(--bg);
}

a.btn.primary:hover, button.btn.primary:hover {
  background: var(--bg);
  color: var(--fg);
}

.chrome-assets {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 18px 0 0;
}

/* ---------- image slots (media stays clean once loaded) ---------- */

.asset-slot {
  margin: 14px 0 18px;
  border: 2px dashed var(--fg);
  background-color: var(--bg);
  background-image: var(--dither-sparse);
  background-size: 8px 8px;
  image-rendering: pixelated;
  overflow: hidden;
}

.asset-slot.has-image {
  border-style: solid;
  padding: 6px;
}

.asset-slot img {
  display: block;
  width: 100%;
  height: auto;
  border: var(--border);
  background: var(--bg);
  image-rendering: auto;
}

.asset-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 18px 14px;
  min-height: 5.5rem;
}

.asset-kind {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.asset-hint { font-size: 0.78rem; max-width: 36rem; opacity: 0.8; }

.asset-slot--banner .asset-ph { min-height: 11rem; }

.asset-slot--icon {
  width: 11rem;
  margin: 0;
}

.asset-slot--icon .asset-ph {
  min-height: 7rem;
  padding: 12px 10px;
}

.asset-slot--section .asset-ph { min-height: 8rem; }

.asset-slot--element { margin: 8px 0 14px; }
.asset-slot--element .asset-ph { min-height: 6.5rem; }

.asset-slot--card {
  margin: 0;
  border-width: 0 0 2px;
  border-style: dashed;
}

.asset-slot--card .asset-ph { min-height: 8.5rem; }

.asset-slot--card.has-image {
  padding: 0;
  border-bottom-style: solid;
}

.asset-slot--card.has-image img {
  border: 0;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.asset-legend {
  font-size: 0.8rem;
  text-align: center;
  margin: 8px auto 28px;
  max-width: 46rem;
  opacity: 0.85;
}

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

nav.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

nav.toc a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: var(--border-thin);
  padding: 4px 8px;
}

nav.toc a:hover {
  background: var(--fg);
  color: var(--bg);
}

h2 {
  margin: 36px 0 14px;
  padding-top: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  scroll-margin-top: 16px;
}

h2::before {
  content: "";
  display: block;
  height: 10px;
  margin-bottom: 14px;
  border: var(--border);
  background-image: var(--dither-checker);
  background-size: 4px 4px;
  image-rendering: pixelated;
}

h2 .sub {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.85;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
}

.page-intro { margin: 0 0 16px; }

.overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 16px;
  margin: 8px 0 12px;
}

.overview-card {
  border: var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.overview-card:hover {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.overview-card .card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.overview-card h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overview-card p {
  margin: 0;
  font-size: 0.85rem;
}

.overview-card a.more {
  margin-top: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.overview-card a.more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- accordions ---------- */

.feature {
  border: var(--border);
  margin: 10px 0;
  background: var(--bg);
}

.feature summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-weight: 700;
}

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

.feature summary::after {
  content: "+";
  margin-left: auto;
  font-weight: 400;
  font-size: 1.1rem;
}

.feature[open] summary {
  border-bottom: var(--border);
}

.feature[open] summary::after { content: "–"; }

.feature summary:hover {
  background: var(--fg);
  color: var(--bg);
}

.feature summary:hover .chip {
  background: var(--bg);
  color: var(--fg);
  border-color: var(--bg);
}

.feature.static .feature-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 4px;
  font-weight: 700;
}

.feature.static.no-accordion .feature-header.standalone {
  padding: 12px 14px 0;
}

.chip {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: var(--border-thin);
  padding: 2px 6px;
  background: var(--fg);
  color: var(--bg);
  flex-shrink: 0;
}

.body { padding: 4px 14px 14px; }
.body.fullwidth { padding-left: 14px; }
.body p:first-child { margin-top: 0; }
.feature-title { font-weight: 700; }
ul.feature-list { margin: 0.4rem 0; padding-left: 1.2rem; }

table {
  width: 100%;
  border-collapse: collapse;
  border: var(--border);
  font-size: 0.85rem;
  margin: 10px 0 14px;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border: var(--border-thin);
  vertical-align: top;
}

th {
  background: var(--fg);
  color: var(--bg);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

ul { margin: 0.4rem 0; padding-left: 1.2rem; }

code {
  font-family: inherit;
  font-size: 0.92em;
  border: var(--border-thin);
  padding: 0 4px;
}

th code {
  border-color: var(--bg);
  color: var(--bg);
}

.body a, .lede a, .note a, td a, .page-intro a, footer a {
  text-underline-offset: 3px;
}

.note {
  position: relative;
  isolation: isolate;
  border: var(--border);
  padding: 12px 14px;
  margin: 18px 0;
  background: var(--bg);
}

.note::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--dither-sparse);
  background-size: 8px 8px;
  image-rendering: pixelated;
  opacity: 0.45;
  pointer-events: none;
}

footer {
  margin-top: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.8rem;
}

footer p { margin: 0; }

footer::before,
footer::after {
  content: "";
  flex: 1;
  height: 8px;
  border: var(--border-thin);
  background-image: var(--dither-checker);
  background-size: 4px 4px;
  image-rendering: pixelated;
}

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

@media (max-width: 640px) {
  h1 { letter-spacing: 0.03em; }
  .overview-card:hover { outline: none; }
  footer { flex-direction: column; text-align: center; }
  footer::before, footer::after { width: 100%; flex: none; }
}
