/* Afterlaw site styles. Tokens first; the dark brand ground is the default. */
:root {
  color-scheme: dark light;
  --ground: #0b0c0a;
  --surface: #15170f;
  --fog: #2a2e26;
  --moss: #7c8b4e;
  --moss-light: #a3b26b;
  --amber: #f29a1f;
  --on-amber: #0b0c0a;
  --text: #e8e6da;
  --muted: #a9ab9b;
  --blocked: #8faac0;
  --line: #2a2e26;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  --step-3: clamp(2.5rem, 1.4rem + 5vw, 4.75rem);
  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 40rem;
  --radius: 4px;
}

@media (prefers-color-scheme: light) {
  :root {
    --ground: #f1efe6;
    --surface: #ffffff;
    --fog: #d9d7c9;
    --moss: #4f5a2e;
    --moss-light: #4f5a2e;
    --amber: #8a4f00;
    --on-amber: #ffffff;
    --text: #1c1e17;
    --muted: #55584a;
    --blocked: #3f5e77;
    --line: #cfcdbf;
  }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
}

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

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

h1, h2, h3 {
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.15;
  margin: 0 0 0.6em;
}
h1 { font-size: var(--step-2); }
h2 { font-size: var(--step-1); }
h3 { font-size: var(--step-0); }

p { margin: 0 0 1em; }

code, .mono { font-family: var(--font-mono); font-size: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 700;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem var(--gutter);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  color: var(--moss-light);
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.5rem 0;
}
.site-nav ul {
  display: flex;
  gap: 0.25rem;
  margin: 0; padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--fog); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--moss); color: var(--moss-light); }

main { display: block; }

.page {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--gutter);
}
.page.wide { max-width: calc(72rem + 2 * var(--gutter)); }

.lede { font-size: var(--step-1); line-height: 1.45; color: var(--text); }
.muted { color: var(--muted); }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.6rem 1.2rem;
  background: var(--amber);
  color: var(--on-amber);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
}
.button:hover { text-decoration: underline; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem var(--gutter);
  color: var(--muted);
}
.site-footer p { margin: 0; }

/* Home banner: the brand art is the slow backdrop; fog and the ground fade move faster. */
.hero {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 300px;
  max-height: 82vh;
  width: 100%;
  overflow: hidden;
  background: #0b0c0a; /* matches the top edge of the art when the backdrop lags behind */
}
.hero .layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
}
.hero .layer-art { object-fit: cover; object-position: 50% 30%; }
.hero .layer-fog {
  background: radial-gradient(120% 40% at 50% 100%, rgb(42 46 38 / 0.55), transparent 70%);
}
.hero .layer-ground {
  background: linear-gradient(to bottom, transparent 82%, #0b0c0a 100%);
}
@media (prefers-reduced-motion: reduce) {
  .hero .layer { transform: none !important; will-change: auto; }
}
@media (prefers-color-scheme: light) {
  .hero .layer-ground { background: linear-gradient(to bottom, transparent 88%, rgb(11 12 10 / 0.6) 100%); }
}

.home-headline { font-size: var(--step-2); }

.home-copy {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3.5rem) var(--gutter);
}
.home-copy section + section { margin-top: 2rem; }

.status-note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 0.25rem;
}

/* Report */
.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0 0 1.5rem;
}
.notice.sample { border-color: var(--amber); }

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.5rem;
  margin: 0 0 2rem;
}
.summary div { background: var(--surface); border: 1px solid var(--line); padding: 0.75rem 1rem; }
.summary dt { color: var(--muted); font-size: 1rem; }
.summary dd { margin: 0; font-size: var(--step-1); font-weight: 750; font-variant-numeric: tabular-nums; }
.summary dd.mono { font-size: 1.125rem; padding-top: 0.25rem; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: end;
  margin-bottom: 1rem;
}
.field { display: flex; flex-direction: column; gap: 0.25rem; }
.field label { font-weight: 600; }
.field.check { flex-direction: row; align-items: center; gap: 0.5rem; min-height: 44px; }
select, input[type="search"] {
  font: inherit;
  font-size: 1rem;
  min-height: 44px;
  padding: 0.4rem 0.6rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  max-width: 100%;
}
input[type="search"] { width: 16rem; font-family: var(--font-mono); }
input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--moss); }

.result-count { color: var(--muted); margin: 0 0 1rem; }

.groups { list-style: none; margin: 0; padding: 0; }
.group { border: 1px solid var(--line); margin-bottom: 0.5rem; background: var(--surface); }
.group > summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: baseline;
  padding: 0.75rem 1rem;
  cursor: pointer;
  min-height: 44px;
}
.group > summary h2 { display: inline; margin: 0; font-size: var(--step-0); }
.group-counts { color: var(--muted); }
.group-body { padding: 0 1rem 1rem; }

.scenarios { list-style: none; margin: 0; padding: 0; }
.scenario { border-top: 1px solid var(--line); }
.scenario > summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0.6rem 0;
  cursor: pointer;
}
.scenario .sid { flex: 1 1 14rem; min-width: 0; font-family: var(--font-mono); font-size: 1rem; overflow-wrap: anywhere; }
.scenario .meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: center; color: var(--muted); }
.scenario .reason { flex-basis: 100%; color: var(--muted); }
/* Flex summaries lose the native marker, so draw one. */
.group > summary::before, .scenario > summary::before { content: "\25B8"; color: var(--muted); width: 1em; }
.group[open] > summary::before, .scenario[open] > summary::before { content: "\25BE"; }
.group > summary::-webkit-details-marker, .scenario > summary::-webkit-details-marker { display: none; }
.scenario.is-retried { box-shadow: inset 4px 0 0 var(--blocked); padding-left: 0.75rem; }

.badge {
  display: inline-block;
  padding: 0 0.5rem;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.badge.pass { color: var(--moss-light); }
.badge.fail { color: var(--ground); background: var(--text); border-color: var(--text); }
.badge.blocked { color: var(--blocked); }
.badge.skip { color: var(--muted); border-style: dotted; }
.badge.retried { color: var(--blocked); border-style: dashed; }

.assertions { width: 100%; border-collapse: collapse; margin: 0.25rem 0 1rem; font-size: 1rem; }
.assertions th, .assertions td { text-align: left; vertical-align: top; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); }
.assertions th { color: var(--muted); font-weight: 600; }
.assertions th:first-child { width: 28%; }
.assertions td code { overflow-wrap: anywhere; }
.assertions tr.not-pass td { background: color-mix(in srgb, var(--text) 8%, transparent); }

@media (max-width: 40rem) {
  .assertions thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .assertions, .assertions tbody, .assertions tr, .assertions td { display: block; width: 100%; }
  .assertions tr { border-bottom: 1px solid var(--line); padding: 0.4rem 0; }
  .assertions td { border: 0; padding: 0.15rem 0; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.5rem; }
  .assertions td::before { content: attr(data-label); color: var(--muted); }
  input[type="search"] { width: 100%; }
  .filters .field { flex: 1 1 100%; }
}

.message { padding: 1rem; background: var(--surface); border: 1px solid var(--amber); border-radius: var(--radius); }
.message button, .group-body button {
  font: inherit; font-size: 1rem; min-height: 44px; padding: 0.4rem 1rem;
  background: var(--amber); color: var(--on-amber); border: 0; border-radius: var(--radius); cursor: pointer;
}

.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; }
.wordmark img { width: 40px; height: 40px; }

/* Contact */
.channel {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.channel img { width: 96px; height: 96px; }
.channel h2 { margin-bottom: 0.25rem; }
.channel p { margin: 0; }
.later { color: var(--muted); }
.later ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; margin: 0.25rem 0 0; padding: 0; }
/* The logo files have a square black background; the mark itself is round. */
.wordmark img, .channel img { border-radius: 50%; }
::placeholder { color: var(--muted); opacity: 1; }
