/* One stylesheet, no build step. Palette is shared with src/og.rs. */

@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/IBMPlexMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/IBMPlexMono-Bold.woff2") format("woff2");
}

:root {
  --paper: #f2ede1;
  --paper-2: #e8e1d0;
  --ink: #16130f;
  --muted: #5c564b;
  --rule: #16130f;
  --red: #b3121f;
  --amber: #8a5a00;
  --green: #1f6b3a;
  --focus: #b3121f;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15130f;
    --paper-2: #221f19;
    --ink: #ece6d8;
    --muted: #a39b8b;
    --rule: #ece6d8;
    --red: #ff5a5f;
    --amber: #e0a63a;
    --green: #5cc486;
    --focus: #ff5a5f;
  }
}

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

html {
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 100%;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: 68rem;
  padding: 0 1rem 3rem;
  background: var(--paper);
  color: var(--ink);
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.75rem; }
h2 {
  margin-top: 3rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--rule);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
h3 { font-size: 1rem; }
p { margin: 0 0 1rem; max-width: 46rem; }
time { white-space: nowrap; }

.masthead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding: 1.25rem 0 0.75rem;
  border-bottom: 4px solid var(--rule);
}
.wordmark {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
}
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.875rem; font-weight: 700; }
.nav a { text-decoration: none; text-transform: uppercase; letter-spacing: 0.06em; }
.nav a:hover { text-decoration: underline; }

.hero { padding: 3rem 0 0.5rem; }
.hero h1 { font-size: clamp(2.25rem, 9vw, 4rem); letter-spacing: -0.02em; }
.lede { font-size: 1.125rem; max-width: 40rem; }
.stats { color: var(--muted); font-size: 0.9375rem; }
.stats strong { color: var(--red); }

.case { white-space: nowrap; font-weight: 700; }

.group {
  margin: 2rem 0 0.75rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.cards, .ours {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0.75rem;
}
.card-link {
  display: grid;
  gap: 0.35rem;
  height: 100%;
  padding: 0.9rem 1rem 1rem;
  border: 2px solid var(--rule);
  background: var(--paper);
  text-decoration: none;
}
.card-link:hover { background: var(--paper-2); color: inherit; border-color: var(--red); }
.card-link:hover .card-name { color: var(--red); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.card-name { font-weight: 700; font-size: 1.125rem; line-height: 1.2; }
.card-replaces { color: var(--muted); font-size: 0.875rem; }
.card-count { font-size: 0.8125rem; font-weight: 700; margin-top: auto; }

.status {
  display: inline-block;
  padding: 0 0.4rem;
  border: 2px solid currentColor;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  vertical-align: middle;
}
.status-investigation { color: var(--amber); }
.status-raid { color: var(--red); }
.status-seized { color: var(--green); }

.ours li, .ours-one {
  padding: 1rem;
  border: 2px dashed var(--rule);
  background: var(--paper-2);
}
.ours h3, .ours-one h3 { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ours p, .ours-one p { margin-bottom: 0.25rem; }
.ours-case { font-size: 0.8125rem; color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 1.5rem 0 0.5rem; font-size: 0.875rem; }
.legend div { display: flex; gap: 0.5rem; align-items: baseline; }
.legend dd { margin: 0; color: var(--muted); }

.calculator {
  max-width: 46rem;
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 2px solid var(--rule);
  background: var(--paper-2);
}
.calculator label { display: grid; gap: 0.25rem; font-weight: 700; font-size: 0.875rem; }
.calculator-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

input, select, button {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--rule);
  border-radius: 0;
  padding: 0.55rem 0.65rem;
  min-height: 2.75rem;
  width: 100%;
}
button {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}
button:hover { background: var(--red); border-color: var(--red); }

.error { margin: 0; color: var(--red); font-weight: 700; }
.note { color: var(--muted); font-size: 0.875rem; }
.sources { font-size: 0.875rem; }
.sources summary { cursor: pointer; font-weight: 700; }
.sources ul { padding-left: 1.25rem; }

.crumb { margin: 1.5rem 0 0; font-size: 0.875rem; }
.claim, .category { padding-top: 2rem; }
.category-name { font-size: clamp(2.25rem, 9vw, 4rem); letter-spacing: -0.02em; margin: 0.5rem 0; }
.category-replaces { font-size: 1.125rem; }
.claim-case { font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin: 0; }
.claim-amount {
  font-size: clamp(2.5rem, 12vw, 5rem);
  letter-spacing: -0.03em;
  margin: 0.5rem 0 0.25rem;
  overflow-wrap: anywhere;
}
.claim-label {
  display: block;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.claim-scope { font-size: 1.125rem; }
.method { font-size: 0.9375rem; }
.method a { overflow-wrap: anywhere; }

.alternatives {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 0.75rem;
}
.alternatives li { padding: 1rem; border: 2px solid var(--rule); }
.alternatives h3 { margin-bottom: 0.25rem; }
.alternatives p { margin-bottom: 0.25rem; }
.license {
  font-size: 0.75rem;
  font-weight: 400;
  padding: 0 0.3rem;
  border: 1px solid var(--muted);
  color: var(--muted);
  white-space: nowrap;
}
.gap { color: var(--muted); font-size: 0.9375rem; }

.share-row { display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
@media (min-width: 36rem) {
  .share-row:has(button:not([hidden])) { grid-template-columns: 1fr auto auto; }
  .share-row button { width: auto; }
}

.footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 4px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (max-width: 30rem) {
  .calculator { padding: 1rem; }
  .calculator-counts { grid-template-columns: 1fr; }
}
