/* Colors are sampled from the hero art: wine-black room, neon pink, cream lettering, cash green. */
@font-face { font-family: "Public Sans"; font-weight: 800; font-display: swap; src: url(/fonts/public-sans-800.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }

:root {
  --bg: #140a11;
  --panel: #1f0f1a;
  --panel-2: #29131f;
  --line: #43203a;
  --text: #f7ebee;
  --muted: #cdafbb;
  --pink: #ff4d6d;
  --cream: #ffe0a3;
  --green: #63d794;
  --ink: #150810;
  --display: "Public Sans", "Arial Black", sans-serif;
  --body: Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { display: flex; flex-direction: column; min-height: 100dvh; margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.6 var(--body); }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--cream); text-underline-offset: 3px; }
a:hover { color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--cream); outline-offset: 2px; }
::selection { background: var(--pink); color: var(--ink); }

.wrap { width: 100%; max-width: 1264px; margin-inline: auto; padding-inline: 24px; }
.sr-only, .offscreen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; background: var(--cream); color: var(--ink); padding: 10px 16px; }
.skip:focus { top: 8px; }
.note { font-size: .875rem; color: var(--muted); }
h1, h2 { font-family: var(--display); font-weight: 800; line-height: 1.08; text-wrap: balance; }
h2 { font-size: 1.75rem; }

.btn { display: inline-block; border: 2px solid transparent; border-radius: 4px; padding: 9px 16px; font-weight: 600; font-size: .9375rem; line-height: 1.3; text-decoration: none; transition: background-color .15s, border-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-main { background: var(--pink); color: var(--ink); }
.btn-main:hover { background: #ff7a92; color: var(--ink); }
.btn-quiet { background: none; border-color: var(--line); }
.btn-quiet:hover { border-color: var(--cream); }
.linkish { background: none; border: 0; padding: 0; color: var(--cream); text-decoration: underline; text-underline-offset: 3px; }

/* header */
.site-head { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font: 800 1.125rem/1 var(--display); }
.brand img { border-radius: 4px; }
.head-nav { display: flex; gap: 24px; margin-left: auto; font-size: .9375rem; }
.head-nav a { color: var(--text); text-decoration: none; padding-block: 8px; }
.head-nav a:hover { text-decoration: underline; }

/* hero */
.hero { padding-top: 24px; }
.hero-art { display: block; }
.hero-art img { width: 100%; aspect-ratio: 3168 / 1344; object-fit: cover; border-radius: 6px; }
.hero-row { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 56px; align-items: start; }

/* The sign: a workplace "days since last accident" board. */
.sign { position: relative; margin: -72px 0 0 40px; background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 6px; text-align: center; box-shadow: 0 0 0 3px var(--cream), 0 18px 40px rgb(20 4 12 / .7); font-family: var(--display); font-weight: 800; overflow: hidden; }
.sign-top { background: var(--pink); border-bottom: 3px solid var(--ink); padding: 10px 12px; font-size: 1.0625rem; }
.sign-what { padding: 14px 12px 0; font-size: 1.5rem; line-height: 1.1; }
.sign-num { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 12px 8px; font-size: 1.75rem; }
.sign-num span:first-child { min-width: 1.5em; padding: 0 .16em; background: var(--ink); color: var(--cream); border-radius: 4px; font-size: 5.25rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.sign-rest { font-size: 1rem; font-variant-numeric: tabular-nums; }
.sign-ref { padding: 10px 12px 14px; font: 500 .8125rem/1.4 var(--body); }
.sign-ref a { color: var(--ink); }

.hero-copy { padding-top: 40px; max-width: 46rem; }
h1 span { display: inline-block; }
h1 { font-size: clamp(2.125rem, 4.4vw, 3.5rem); }
.lede { margin-top: 20px; font-size: 1.125rem; max-width: 40rem; }
.hero-copy .note { margin-top: 14px; max-width: 40rem; }

/* figures */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 64px; }
.facts > div { padding: 4px 32px; border-left: 1px solid var(--line); }
.facts > div:first-child { padding-left: 0; border-left: 0; }
.fact-n { font: 800 2.125rem/1.1 var(--display); color: var(--cream); }
.fact-t { margin-top: 8px; font-size: .9375rem; color: var(--muted); }

/* charts */
.charts { display: grid; grid-template-columns: 1.25fr 1fr; gap: 64px; margin-top: 72px; }
.chart h2 { font-size: 1.375rem; }
.chart .note { margin-top: 8px; }
.bars { margin-top: 16px; }
.bar { display: block; width: 100%; padding: 10px 12px; margin-inline: -12px; background: none; border: 0; border-radius: 4px; color: inherit; text-align: left; text-decoration: none; }
.bar:hover { background: var(--panel-2); }
.bar[aria-pressed="true"] { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--cream); }
.bar-top { display: flex; justify-content: space-between; gap: 16px; font-weight: 600; font-size: .9375rem; }
.bar-val { font-variant-numeric: tabular-nums; }
.bar-track { display: block; height: 14px; margin-top: 6px; background: var(--panel-2); }
.bar:hover .bar-track, .bar[aria-pressed="true"] .bar-track { background: var(--bg); }
.bar-fill { display: block; height: 100%; min-width: 2px; background: var(--pink); }
.bar-fill-alt { background: var(--cream); }
.bar-note { display: block; margin-top: 4px; font-size: .8125rem; color: var(--muted); }

/* log */
.log { margin-top: 80px; scroll-margin-top: 80px; }
.log-head { display: flex; align-items: baseline; gap: 16px; }
.controls { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; margin-top: 20px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button { background: none; border: 2px solid var(--line); border-radius: 4px; padding: 8px 14px; font-size: .9375rem; }
.tabs button:hover { border-color: var(--cream); }
.tabs [aria-pressed="true"] { background: var(--cream); border-color: var(--cream); color: var(--ink); font-weight: 600; }
.tabs .n { opacity: .8; font-variant-numeric: tabular-nums; }
.find { display: flex; gap: 8px; }
input, select, textarea { width: 100%; background: var(--panel); border: 2px solid var(--line); border-radius: 4px; padding: 8px 12px; font-size: 1rem; }
::placeholder { color: var(--muted); opacity: 1; }
.find input { width: 270px; }
.find select { width: auto; }
.chip { margin-top: 16px; background: var(--panel-2); border: 0; border-radius: 4px; padding: 8px 14px; font-size: .875rem; }
.chip b { font-weight: 600; color: var(--cream); }

#logList { margin-top: 24px; border-top: 2px solid var(--cream); }
.entry { border-bottom: 1px solid var(--line); scroll-margin-top: 64px; }
.entry.is-open { background: var(--panel); }
.entry-h { font: inherit; }
.entry-btn { display: grid; grid-template-columns: 112px 1.25fr 1.5fr 1.35fr 168px 20px; gap: 24px; align-items: start; width: 100%; padding: 20px 16px; background: none; border: 0; text-align: left; line-height: 1.4; }
.entry-btn:hover { background: var(--panel-2); }
.entry-btn > span > span { display: block; }
.date { font-weight: 600; font-size: .9375rem; }
.num { margin-top: 3px; font: 400 .75rem/1.4 var(--mono); color: var(--muted); }
.who { font: 800 1.125rem/1.25 var(--display); }
.sub { margin-top: 3px; font-size: .8125rem; color: var(--muted); overflow-wrap: anywhere; }
.said { font-size: 1rem; }
.said-none { color: var(--muted); }
.c-impact { font-size: .9375rem; }
.status { font-size: .8125rem; font-weight: 600; padding-left: 16px; position: relative; }
.status::before { content: ""; position: absolute; left: 0; top: .32em; width: 9px; height: 9px; border-radius: 50%; background: var(--cream); }
.status-closed::before { background: var(--green); }
.status-none::before { background: none; border: 2px solid var(--muted); }
.c-arrow { width: 10px; height: 10px; margin-top: 5px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
.is-open .c-arrow { transform: translateY(5px) rotate(225deg); }

.dossier { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; padding: 8px 16px 36px; }
.dossier h4 { font: 600 .875rem/1.4 var(--body); color: var(--cream); margin-bottom: 8px; }
.dossier p, .dossier li { font-size: .9375rem; max-width: 62ch; }
.dossier-right > h4:not(:first-child) { margin-top: 24px; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); }
.timeline .when { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
blockquote { font: 800 1.375rem/1.3 var(--display); text-wrap: pretty; }
.nostatement { color: var(--muted); }
.disagree { margin-top: 24px; padding: 14px 16px; background: var(--panel-2); border-radius: 4px; }
.refs { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 4px 20px; font-family: var(--mono); color: var(--muted); }
.dossier .refs { font-size: .8125rem; max-width: none; }
.sources { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.dossier .btn { margin-top: 24px; }
.empty { padding: 48px 16px; text-align: center; }
.empty .btn { margin-top: 16px; }

/* rules, footer, documents */
.rules { margin-top: 80px; scroll-margin-top: 80px; }
.rules dl { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 64px; margin-top: 24px; }
dt { font-weight: 600; }
dd { margin-top: 4px; color: var(--muted); max-width: 58ch; }
main { flex: 1; width: 100%; padding-bottom: 88px; }
.site-foot { padding-block: 36px 48px; background: var(--panel); border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.site-foot p { max-width: 90ch; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 20px; }
.site-foot nav:first-child { margin-top: 0; }
.site-foot nav a { padding-block: 6px; }
.doc { max-width: 46rem; padding-top: 56px; }
.doc h1 { font-size: 2.5rem; }
.doc h2 { font-size: 1.25rem; margin-top: 36px; }
.doc p { margin-top: 12px; }

/* dialog and toast */
dialog { width: min(640px, calc(100vw - 32px)); max-height: 90dvh; padding: 0; background: var(--panel); color: var(--text); border: 2px solid var(--line); border-radius: 6px; }
dialog::backdrop { background: rgb(12 3 8 / .8); }
.dlg-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 1.25rem; }
form { display: grid; gap: 16px; padding: 20px; }
form label { display: block; font-size: .875rem; font-weight: 500; }
form label > * { margin-top: 6px; background: var(--bg); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dlg-foot { text-align: right; }
.box { padding: 10px 14px; border-radius: 4px; border: 2px solid; font-size: .875rem; }
.box-bad { border-color: var(--pink); }
.box-ok { border-color: var(--green); }
#toast { position: fixed; right: 20px; bottom: 20px; z-index: 40; padding: 12px 18px; background: var(--cream); color: var(--ink); border-radius: 4px; font-weight: 600; font-size: .9375rem; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; }
#toast.is-on { opacity: 1; transform: none; }

@media (max-width: 1080px) {
  .entry-btn { grid-template-columns: 100px 1fr 1.2fr 20px; }
  .c-impact { grid-column: 2; grid-row: 2; }
  .c-status { grid-column: 3; grid-row: 2; }
  .c-arrow { grid-column: 4; grid-row: 1; }
  .hero-row { gap: 40px; grid-template-columns: 320px 1fr; }
  .sign { margin-left: 24px; }
}

@media (max-width: 760px) {
  .wrap { padding-inline: 16px; }
  .site-head .head-nav { display: none; }
  .head-row .btn { margin-left: auto; }

  .hero { padding: 0; }
  .hero-art img { border-radius: 0; }
  .hero-row { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding-inline: 16px; }
  .sign { margin: -14px 8px 0; }
  .sign-num span:first-child { font-size: 4.25rem; }
  .hero-copy { padding-top: 32px; }
  .facts { grid-template-columns: 1fr; gap: 24px; margin-top: 48px; }
  .facts > div { padding: 0 0 0 16px; border-left: 3px solid var(--line); }
  .facts > div:first-child { padding-left: 16px; border-left: 3px solid var(--line); }
  .charts { grid-template-columns: minmax(0, 1fr); gap: 48px; margin-top: 56px; }
  .bar { margin-inline: 0; padding-inline: 8px; }
  .log, .rules { margin-top: 64px; }
  .find { width: 100%; flex-wrap: wrap; }
  .find input, .find select { width: 100%; }
  .entry-btn { grid-template-columns: 1fr 20px; gap: 10px; padding: 18px 12px; }
  .c-date, .c-who, .c-said, .c-impact, .c-status { grid-column: 1; grid-row: auto; }
  .entry-btn .c-date { display: flex; gap: 12px; align-items: baseline; }
  .c-arrow { grid-column: 2; grid-row: 1; }
  .dossier { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-inline: 12px; }
  .rules dl, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .sources a { display: inline-block; padding-block: 4px; }
}

/* Subpages have one nav link ("Back to the log"); keep it on phones. */
@media (max-width: 760px) { .head-row:not(:has(.btn)) .head-nav { display: flex; } }

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