/* WasteWise - evidence dashboard styles
   Mobile-first. One theme family (auto light/dark via CSS variables).
   Accent: emerald, locked page-wide. Radius system: 14px cards, 10px inner, pill buttons. */

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f4f4f3;
  --ink: #1c1c1a;
  --ink-2: #57534e;
  --ink-3: #79716b;
  --line: #e7e5e4;
  --accent: #047857;
  --accent-ink: #ffffff;
  --accent-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --info: #1d4ed8;
  --info-soft: #eff6ff;
  --shadow: 0 1px 2px rgb(28 25 23 / 0.05), 0 8px 24px rgb(28 25 23 / 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131312;
    --surface: #1c1c1a;
    --surface-2: #232321;
    --ink: #f5f5f4;
    --ink-2: #c7c2bd;
    --ink-3: #948f89;
    --line: #2e2d2a;
    --accent: #34d399;
    --accent-ink: #06281c;
    --accent-soft: #0c2a20;
    --warn: #fbbf24;
    --warn-soft: #2a2108;
    --danger: #f87171;
    --danger-soft: #2b1212;
    --info: #93c5fd;
    --info-soft: #14213a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px rgb(0 0 0 / 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 1.05rem;
}

.brand-text { display: none; line-height: 1.2; }
.brand-text strong { display: block; font-size: 0.95rem; }
.brand-text small { color: var(--ink-3); font-size: 0.72rem; }

.nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-width: 0;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.nav a.active,
.nav a:hover { color: var(--ink); background: var(--surface-2); }

.run-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.78rem;
  flex-shrink: 0;
}

.state-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
}
.run-state[data-state="api"] .state-light { background: var(--accent); }
.run-state[data-state="fallback"] .state-light { background: var(--warn); }
.run-state[data-state="error"] .state-light { background: var(--danger); }

/* ---------------------------------------------------------------- shared */

section { scroll-margin-top: 76px; }

.kicker {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker.accent-light { color: #34d399; }
.kicker.tone-warn { color: var(--warn); }

.page:not([data-page="scan"]) { padding-top: 40px; }
.page-title {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 720px;
}
.page-intro { margin: 0 0 32px; color: var(--ink-2); font-size: 0.95rem; max-width: 640px; }

.section-heading { margin: 48px 0 22px; max-width: 640px; }
.section-heading h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3.5vw, 1.8rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.section-heading p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.panel-heading strong { color: var(--ink); font-family: var(--mono); font-size: 0.78rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, filter 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }

.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn.secondary:hover { background: var(--surface-2); }

.badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.badge.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 40px 0 8px;
  align-items: center;
}

.hero-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 5.2vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.hero-copy h1 .accent { color: var(--accent); }

.type-caret {
  display: inline-block;
  width: 3px;
  height: 0.9em;
  background: var(--accent);
  vertical-align: -0.08em;
  margin-left: 3px;
  animation: wwBlink 1s step-end infinite;
}
@keyframes wwBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .type-caret { animation: none; opacity: 0.6; } }

.hero-copy > p:not(.kicker) {
  margin: 0 0 20px;
  color: var(--ink-2);
  max-width: 46ch;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.hero-counters { display: flex; flex-wrap: wrap; gap: 24px 36px; margin-top: 32px; }
.hero-counters strong { display: block; font-size: 1.7rem; letter-spacing: -0.02em; font-family: var(--mono); }
.hero-counters span { font-size: 0.78rem; color: var(--ink-3); }

.hero-demo {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.hero-demo-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hero-demo-head strong { font-size: 0.75rem; text-transform: none; letter-spacing: normal; color: var(--warn); }
.hero-demo-frame { position: relative; border-radius: 12px; overflow: hidden; background: #111; }
.hero-demo-frame img { display: block; width: 100%; height: auto; }

.sweep {
  position: absolute;
  left: 0;
  right: 0;
  top: -4%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #34d399, transparent);
  box-shadow: 0 0 18px 4px rgba(52, 211, 153, 0.55);
  animation: wwSweep 1.4s linear infinite;
}
@keyframes wwSweep { 0% { top: -4%; } 100% { top: 102%; } }
@media (prefers-reduced-motion: reduce) { .sweep { animation: none; top: 50%; } }

.hero-demo-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  transition: background 0.4s;
}
.hero-demo-result span { font-size: 0.8rem; color: var(--ink-2); }
.hero-demo-result strong { font-size: 0.85rem; color: var(--ink-3); }
.hero-demo-result[data-done="1"] { background: var(--accent-soft); }
.hero-demo-result[data-done="1"] strong { color: var(--accent); }

/* ---------------------------------------------------------------- marquee */

.marquee {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px 0;
  margin: 8px 0 0;
}
.marquee-track {
  display: flex;
  gap: 44px;
  width: max-content;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  animation: wwMarquee 26s linear infinite;
  padding: 0 24px;
}
@keyframes wwMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------------------------------------------------------------- scanner */

.stage-pills {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stage-pills li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink-3);
  border: 1px solid var(--line);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.stage-pills .pill-id { font-family: var(--mono); font-size: 0.7rem; }
.stage-pills li[data-state="active"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.stage-pills li[data-state="done"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.scanner-grid { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.scanner-left, .scanner-right { display: flex; flex-direction: column; gap: 16px; }

.drop-zone {
  position: relative;
  display: grid;
  place-content: center;
  gap: 4px;
  text-align: center;
  min-height: 96px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.drop-zone:hover,
.drop-zone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-title { font-weight: 700; }
.drop-meta { font-size: 0.78rem; color: var(--ink-3); }

.sample-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.sample-picker button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}
.sample-picker button:hover { border-color: var(--accent); }
.sample-picker img { width: 30px; height: 30px; border-radius: 999px; object-fit: cover; }

.image-stage {
  position: relative;
  min-height: 260px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.image-stage img { width: 100%; height: 100%; object-fit: contain; }

.empty-stage { text-align: center; color: var(--ink-3); padding: 24px; }
.empty-stage strong { display: block; color: var(--ink-2); margin-bottom: 4px; }
.image-stage.has-image .empty-stage { display: none; }

.box-layer { position: absolute; inset: 0; pointer-events: none; }

.detection-box {
  position: absolute;
  border: 2px solid var(--box-color, var(--accent));
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.25);
}
.detection-box > span {
  position: absolute;
  top: -1.6em;
  left: -2px;
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--box-color, var(--accent));
  color: #fff;
  white-space: nowrap;
}
.detection-box[data-state="not_waste"] { opacity: 0.55; }
.detection-box[data-state="review"] { border-style: dashed; }

.demo-box { transition: opacity 0.28s ease, transform 0.28s ease; }
.demo-box[data-shown="0"] { opacity: 0; transform: scale(0.8); }
.demo-box[data-shown="1"] { opacity: 1; transform: scale(1); }

.loading-mask {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}
.loading-mask.is-visible { display: flex; }
.loading-mask span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}
.loading-mask span:nth-child(2) { animation-delay: 0.16s; }
.loading-mask span:nth-child(3) { animation-delay: 0.32s; }

@keyframes pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.5; }
  50% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-mask span { animation: none; opacity: 0.8; }
}

.result-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.result-topline span { display: block; font-size: 0.75rem; color: var(--ink-3); }
.result-topline strong { font-size: 1.3rem; letter-spacing: -0.01em; }

.confidence-block > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.confidence-block span { font-size: 0.78rem; color: var(--ink-3); }
.confidence-block strong { font-family: var(--mono); }

.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.bin-route {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.bin-route span { font-size: 0.78rem; color: var(--ink-2); }
.bin-route strong { color: var(--accent); }
.bin-route.is-idle { background: var(--surface); border-color: var(--line); }
.bin-route.is-idle strong { color: var(--ink-3); }
.bin-route.not-waste { background: var(--surface); border-color: var(--line); }
.bin-route.not-waste strong { color: var(--ink-2); }
.bin-route.needs-review { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.bin-route.needs-review strong { color: var(--warn); }

.result-facts { margin: 0; display: grid; gap: 8px; }
.result-facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
}
.result-facts dt { color: var(--ink-3); }
.result-facts dd { margin: 0; font-weight: 600; text-align: right; }

.score-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.top-prediction-list { display: grid; gap: 8px; margin-bottom: 16px; }

.top-prediction-row {
  display: grid;
  grid-template-columns: 24px 90px 1fr 48px;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}
.top-prediction-row span:first-child { font-family: var(--mono); color: var(--ink-3); }
.top-prediction-row span:last-child { font-family: var(--mono); text-align: right; }

.top-prediction-meter {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.top-prediction-meter > * {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--score-color, var(--accent));
}

.score-list { display: grid; gap: 7px; }

.score-row {
  display: grid;
  grid-template-columns: 90px 1fr 48px;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ink-2);
}
.score-row > span:last-child { font-family: var(--mono); text-align: right; }

.score-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.score-track > * {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--score-color, var(--accent));
  transition: width 0.4s ease;
}

/* ---------------------------------------------------------------- teasers */

.teasers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 40px 0 8px;
}
@media (min-width: 700px) {
  .teasers { grid-template-columns: repeat(3, 1fr); }
}
.teaser {
  display: block;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: inherit;
}
.teaser:hover { border-color: var(--accent); }
.teaser strong { display: block; margin: 8px 0 6px; font-size: 1.05rem; color: var(--ink); }
.teaser p { margin: 0; font-size: 0.86rem; color: var(--ink-2); line-height: 1.5; }
.teaser.dark { background: #103b2c; border-color: #103b2c; }
.teaser.dark:hover { background: #0c2f23; }
.teaser.dark strong { color: #ffffff; }
.teaser.dark p { color: #b9d6c9; }

/* ---------------------------------------------------------------- pipeline page */

.step-stack { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; }
.step-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.step-id {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
}
.step-card strong { font-size: 1.02rem; }
.step-card p { margin: 4px 0 0; font-size: 0.88rem; color: var(--ink-2); line-height: 1.55; }

.diagram-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 8px;
}
.diagram-card img { width: 100%; height: auto; border-radius: 10px; margin-top: 4px; }

.page-cta { display: flex; justify-content: center; margin-top: 28px; }

/* ---------------------------------------------------------------- history */

.history-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }

.history-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 700px) { .history-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .history-grid { grid-template-columns: repeat(3, 1fr); } }

.history-tile {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.history-tile:hover { border-color: var(--accent); }

.history-tile-image { display: block; width: 100%; height: 160px; background: var(--surface-2); }
.history-tile-image img { width: 100%; height: 100%; object-fit: cover; }
.history-tile-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--ink-2);
}

.history-tile-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.history-tile-body strong { font-size: 0.92rem; }
.history-tile-body small { color: var(--ink-3); font-size: 0.74rem; }
.history-tile-body .badge { align-self: flex-start; margin-top: 4px; }

.history-empty {
  grid-column: 1 / -1;
  padding: 56px 24px;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-3);
}
.history-empty strong { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 1rem; }
.history-empty span { display: block; font-size: 0.86rem; }
.history-empty .btn { margin-top: 16px; }

/* ---------------------------------------------------------------- evidence */

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.metric-card span { display: block; font-size: 0.78rem; color: var(--ink-3); margin-bottom: 6px; }
.metric-card strong {
  display: block;
  font-family: var(--mono);
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.metric-card i { display: block; font-style: normal; font-size: 0.74rem; color: var(--ink-3); margin-top: 6px; }

.metric-card.tone-success strong { color: var(--accent); }
.metric-card.tone-info strong { color: var(--info); }
.metric-card.tone-warning strong { color: var(--warn); }
.metric-card.tone-danger strong { color: var(--danger); }

.evidence-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.evidence-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.evidence-card h3 { margin: 0 0 8px; font-size: 1.05rem; letter-spacing: -0.01em; }
.evidence-card p { margin: 0; color: var(--ink-2); font-size: 0.9rem; }

.evidence-card.dark {
  background: #1c1c1a;
  color: #f5f5f4;
  border-color: transparent;
}
.evidence-card.dark h3 { color: #f5f5f4; }
.evidence-card.dark p { color: rgb(245 245 244 / 0.72); }
.evidence-card.dark .panel-heading { color: rgb(245 245 244 / 0.55); }
.evidence-card.dark .panel-heading strong { color: #34d399; }

.artifact-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.metric-label { display: block; font-size: 0.78rem; color: var(--ink-3); margin-bottom: 4px; }
.big-number {
  display: block;
  font-family: var(--mono);
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.evidence-card.tone-info .big-number { color: var(--info); }
.evidence-card.tone-warning .big-number { color: var(--warn); }

.baseline-card { margin-top: 0; }
.baseline-row { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.baseline-row strong { font-size: 2rem; letter-spacing: -0.02em; font-family: var(--mono); }
.baseline-row p { margin: 0; font-size: 0.9rem; color: var(--ink-2); line-height: 1.6; }

/* ---------------------------------------------------------------- limits */

.limit-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 8px;
}
.limit-stack article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.limit-stack span { display: block; font-size: 0.75rem; color: var(--ink-3); }
.limit-stack strong { display: block; margin: 3px 0 6px; font-size: 1rem; }
.limit-stack p { margin: 0; font-size: 0.88rem; color: var(--ink-2); }

.method-note {
  margin-top: 32px;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.method-note p { margin: 0; font-size: 0.88rem; color: var(--ink-2); line-height: 1.6; max-width: 60ch; }
.method-note strong { color: var(--ink); }

/* ---------------------------------------------------------------- about */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (min-width: 700px) { .about-grid { grid-template-columns: 1fr 1fr; } }

.about-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.about-card > span { font-size: 0.78rem; color: var(--ink-3); }
.about-card h3 { margin: 8px 0 10px; font-size: 1.15rem; }
.about-card > p { margin: 0 0 16px; font-size: 0.88rem; color: var(--ink-2); line-height: 1.6; }

.artifact-list { display: flex; flex-direction: column; gap: 8px; }

.about-stats {
  background: #103b2c;
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  text-align: center;
}
@media (min-width: 700px) { .about-stats { grid-template-columns: repeat(4, 1fr); } }
.about-stats strong { display: block; font-size: 1.8rem; letter-spacing: -0.02em; color: #ffffff; }
.about-stats span { font-size: 0.78rem; color: #7fb59d; }

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

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.footer strong { display: block; margin-bottom: 4px; }
.footer p { margin: 0; color: var(--ink-2); font-size: 0.88rem; max-width: 60ch; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--ink-2); text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.footer-links a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 40;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- reveal */

.reveal-on-scroll { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .reveal-on-scroll {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .reveal-on-scroll.is-visible { opacity: 1; transform: none; }
}

/* ================================================================ tablet */

@media (min-width: 700px) {
  .page-shell { padding: 0 24px 64px; }

  .brand-text { display: block; }

  .hero {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 36px;
    padding: 56px 0 12px;
  }

  .metrics { grid-template-columns: repeat(4, 1fr); }

  .result-column { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .result-column > * { flex: 1 1 200px; }

  .image-stage { min-height: 340px; }

  .limit-stack { grid-template-columns: repeat(3, 1fr); }
}

/* ================================================================ desktop */

@media (min-width: 1024px) {
  .image-stage { min-height: 420px; }

  .evidence-grid { grid-template-columns: repeat(12, 1fr); }
  .evidence-card.span-7 { grid-column: span 7; }
  .evidence-card.span-5 { grid-column: span 5; }
  .evidence-card.span-4 { grid-column: span 4; }

  .scanner-grid { grid-template-columns: 1.25fr 1fr; }
}
