/*
 * Future Losses.
 *
 * Calm, plain, high contrast, fast. Someone may be reading this at 2am in bad
 * shape, on a phone, with one hand. So: generous type, big tap targets, nothing
 * that moves, nothing that interrupts, and no image anywhere of a card, a chip,
 * a reel or a dice. Those are cues, and the reader is here to stop responding
 * to cues.
 *
 * The palette is deliberately not gambling's palette: no casino red, no felt
 * green, no gold. Slate and a muted sage, which is what you would paint a room
 * you wanted someone to think clearly in. Amber appears in exactly one place,
 * on a fact we could not confirm, so it means something when you see it.
 *
 * System fonts only. A font from another origin would put a record of this
 * visit on someone else's server, and some readers are hiding this.
 */

:root {
  --bg: #0e1116;
  --bg-soft: #141922;
  --surface: #171d27;
  --surface-2: #1d242f;
  --line: #273040;
  --line-soft: #1f2733;

  --ink: #eef2f7;
  --ink-dim: #c6cedb;
  --muted: #94a0b2;

  --accent: #86c6ad;        /* sage: used for actions and links */
  --accent-ink: #0e1116;
  --accent-soft: #1d3730;
  --warn: #e8b876;          /* only ever "not confirmed" */

  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --measure: 36rem;
  --wide: 52rem;
  --radius: 14px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fcfbf9;
    --bg-soft: #f5f4f1;
    --surface: #ffffff;
    --surface-2: #f4f3f0;
    --line: #ddd9d2;
    --line-soft: #e8e5df;

    --ink: #151a21;
    --ink-dim: #333c48;
    --muted: #5a6472;

    --accent: #1f6b53;
    --accent-ink: #ffffff;
    --accent-soft: #e4efe9;
    --warn: #8a5600;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.7 var(--sans);
  letter-spacing: 0.005em;
}

/* A quiet band of colour at the very top, so the page has an edge without
   needing an image anywhere. */
body::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft) 70%, transparent);
}

.skip {
  position: absolute;
  left: -9999px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 20; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ chrome */

/*
 * One column edge for everything. The page is as wide as its widest thing (the
 * fact tables), and prose inside it is held to a readable measure separately.
 * Letting main be wider than the header put the crisis card and the heading on
 * different left edges, which looked like a mistake because it was one.
 */
header.site, footer.site, main, .crisis {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Text stays narrow for reading; tables and the state grid may use the width. */
main > p,
main > h1,
main > h2,
main > h3,
main > ul,
main > ol,
main > .lede,
main > .admission,
main > .checked-line,
main > .do,
main > .next,
main > .filter,
main > .no-match {
  max-width: var(--measure);
}

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.6rem 1rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.wordmark:hover { color: var(--accent); }

header.site nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}
header.site nav a {
  text-decoration: none;
  color: var(--muted);
  padding-block: 0.4rem;
}
header.site nav a:hover { color: var(--accent); }

/* ------------------------------------------------------------------ crisis */

/*
 * On every page, above the content. Not a modal, not dismissible, not a
 * floating button: those are the patterns this audience is escaping. Quiet
 * enough to live on every page without shouting, prominent enough to find at
 * 2am without looking.
 */
.crisis {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.05rem 1.2rem;
  margin-block: 0.25rem 2.25rem;
}

.crisis-lead {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.crisis-list { margin: 0; padding: 0; list-style: none; }
.crisis-list li + li {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line-soft);
}
.crisis-list a {
  display: inline-block;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding-block: 0.3rem;
  min-height: 2.5rem;
}
.crisis-list a:hover { text-decoration: underline; }
.crisis-note {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

/* -------------------------------------------------------------- typography */

main { padding-bottom: 4rem; }

h1 {
  font-family: var(--serif);
  font-size: clamp(1.85rem, 6vw, 2.6rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0.2rem 0 1.1rem;
  text-wrap: balance;
}

h2 {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 4.2vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 2.8rem 0 0.7rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.08rem;
  font-weight: 650;
  margin: 1.8rem 0 0.4rem;
}

p { margin: 0 0 1.15rem; }
p, li { overflow-wrap: break-word; }

strong { font-weight: 650; color: var(--ink); }

.lede {
  font-family: var(--serif);
  font-size: clamp(1.18rem, 3.6vw, 1.35rem);
  line-height: 1.5;
  color: var(--ink-dim);
  margin-bottom: 1.6rem;
}

main ul, main ol { padding-left: 1.3rem; margin: 0 0 1.3rem; }
main li { margin-bottom: 0.5rem; }

.admission {
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: var(--ink-dim);
  font-size: 0.97rem;
}

.checked-line {
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ------------------------------------------------------------------- facts */

.facts {
  margin: 1.8rem 0 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.fact-row { padding: 1rem 1.15rem; }
.fact-row + .fact-row { border-top: 1px solid var(--line-soft); }
.fact-row:nth-child(even) { background: var(--surface-2); }

.fact-row dt {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.fact-row dd { margin: 0; }

.fact { display: block; }
.fact-value { display: block; color: var(--ink); }

.fact-unverified { display: block; color: var(--warn); }
.fact-unverified strong { color: var(--warn); letter-spacing: 0.01em; }
.fact-ask { color: var(--muted); }

.fact-note {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.6;
}

.fact-source {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.fact-source a { color: var(--muted); text-decoration-color: var(--line); }
.fact-source a:hover { color: var(--accent); }
.fact-archived { font-style: italic; }

/* On a wider screen the label sits beside the answer, which reads faster. */
@media (min-width: 46rem) {
  .fact-row {
    display: grid;
    grid-template-columns: 12rem 1fr;
    gap: 1.5rem;
    align-items: baseline;
  }
  .fact-row dt { margin-bottom: 0; padding-top: 0.15rem; }
}

/* ------------------------------------------------------------------ states */

.filter { margin: 1.75rem 0 1.25rem; }
.filter label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
.filter input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  padding: 0.8rem 0.95rem;
  min-height: 2.9rem;
}
.filter input::placeholder { color: var(--muted); }

ul.states {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
@media (min-width: 34rem) { ul.states { grid-template-columns: 1fr 1fr; } }
@media (min-width: 52rem) { ul.states { grid-template-columns: 1fr 1fr 1fr; } }

ul.states li { margin: 0; }

ul.states a {
  display: block;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  text-decoration: none;
  color: var(--ink);
}
ul.states a:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.state-name {
  display: block;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.state-note {
  display: block;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.5;
}
.state-note .fact-unverified { display: inline; }

.no-match {
  color: var(--muted);
  padding: 1rem 0;
}

/* ----------------------------------------------------------------- actions */

a.action {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
  padding: 0.95rem 1.5rem;
  border-radius: 12px;
  min-height: 2.9rem;
  letter-spacing: 0.01em;
}
a.action:hover { filter: brightness(1.08); }

.do { margin: 2rem 0; }
.next {
  color: var(--muted);
  font-size: 0.97rem;
}

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

footer.site {
  margin-top: 2rem;
  border-top: 1px solid var(--line-soft);
  padding-block: 2rem 4rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}
footer.site p { margin: 0 0 0.9rem; }
footer.site strong { color: var(--ink-dim); }
footer.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
}
footer.site nav a { text-decoration: none; }
footer.site nav a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
