:root {
  color-scheme: dark;
  --bg: #080b0c;
  --surface: #0d1214;
  --surface-raised: #12191b;
  --text: #eef8f2;
  --muted: #91a19a;
  --dim: #62716b;
  --line: #283338;
  --line-bright: #39484d;
  --green: #61f6aa;
  --green-soft: #0f2a20;
  --amber: #ffc45f;
  --amber-soft: #332511;
  --red: #ff7b72;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea { font: inherit; }
a { color: inherit; text-underline-offset: 4px; }
[hidden] { display: none !important; }

.page-grid {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: .45;
  background-image:
    linear-gradient(rgba(97, 246, 170, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(97, 246, 170, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 80px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--green);
  color: var(--bg);
  font-size: .72rem;
  letter-spacing: -.06em;
}

.community-badge,
.record-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.community-badge { color: var(--green); }
.community-badge a {
  color: var(--text);
  text-decoration-color: var(--line-bright);
}
.community-badge a:hover { color: var(--green); }

main { padding: 56px 0 48px; }

.intro {
  max-width: 900px;
  margin-bottom: 40px;
}

.eyebrow,
.panel-type,
.method-label {
  margin: 0;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.eyebrow span { color: var(--dim); }

h1 {
  max-width: 900px;
  margin: 16px 0 0;
  font-size: clamp(4rem, 7.5vw, 7rem);
  font-weight: 500;
  letter-spacing: -.075em;
  line-height: .86;
}

.lede {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  line-height: 1.45;
}

.incident-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.incident-panel {
  position: relative;
  min-width: 0;
  padding: 26px 36px 28px;
}

.incident-panel + .incident-panel { border-left: 1px solid var(--line); }

.incident-panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 36px;
  width: 88px;
  height: 2px;
  background: var(--green);
  box-shadow: 0 0 20px rgba(97, 246, 170, .55);
}

.incident-panel--community::before {
  background: var(--amber);
  box-shadow: 0 0 20px rgba(255, 196, 95, .55);
}

.panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-type { color: var(--muted); }
.record-state--confirmed { color: var(--green); }
.record-state--community { color: var(--amber); }

.counter-row {
  display: flex;
  align-items: end;
  gap: 18px;
  min-height: 132px;
  padding: 30px 0 18px;
}

.counter-number {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: clamp(5rem, 11vw, 8rem);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -.11em;
  line-height: .68;
}

.incident-panel--community .counter-number { color: var(--amber); }

.counter-number.is-loading {
  animation: pulse 1.5s ease-in-out infinite;
  color: var(--line-bright);
}

.counter-unit {
  margin-bottom: 3px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: .85rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.counter-caption {
  max-width: 390px;
  min-height: 3.1em;
  margin: 0 0 20px;
  font-size: 1.08rem;
  line-height: 1.55;
}

.evidence-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .82rem;
}

.evidence-link {
  color: var(--text);
  overflow-wrap: anywhere;
}

.evidence-link:hover { color: var(--green); }
.incident-panel--community .evidence-link:hover { color: var(--amber); }

.empty-message,
.record-note {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.55;
}

.record-note {
  margin-top: 17px;
  padding: 15px 17px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-raised);
}

.load-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 123, 114, .35);
  border-radius: 8px;
  background: rgba(255, 123, 114, .08);
  color: var(--red);
}

.load-error button,
.admin-button,
.secondary-button {
  min-height: 42px;
  border: 1px solid var(--line-bright);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.load-error button { padding: 8px 14px; }
.load-error button:hover, .secondary-button:hover { border-color: var(--green); }

.ticker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
}

.ticker span:nth-child(even) { color: var(--line-bright); }

.method {
  padding: 64px 0 54px;
}

.method-layout {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 80px;
  align-items: start;
  margin-top: 20px;
}

.method h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.05;
}

.method-copy { color: var(--muted); line-height: 1.7; }
.method-copy p { margin: 0; }
.method-copy p + p { margin-top: 20px; }

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: .72rem;
  line-height: 1.6;
}

.site-footer p { max-width: 480px; margin: 0; }
.site-footer p:last-child { text-align: right; }
.site-footer a:hover { color: var(--green); }

@keyframes pulse {
  0%, 100% { opacity: .35; }
  50% { opacity: .75; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .counter-number.is-loading { animation: none; }
}

@media (max-width: 820px) {
  .site-header, main, .site-footer { width: min(100% - 32px, 680px); }
  main { padding-top: 64px; }
  .intro { margin-bottom: 48px; }
  .incident-grid { grid-template-columns: 1fr; }
  .incident-panel { padding-inline: 8px; }
  .incident-panel::before { left: 8px; }
  .incident-panel + .incident-panel { border-left: 0; border-top: 1px solid var(--line); }
  .method { padding-top: 64px; }
  .method-layout { grid-template-columns: 1fr; gap: 34px; margin-top: 16px; }
  .site-footer { flex-direction: column; }
  .site-footer p:last-child { text-align: left; }
}

@media (min-width: 821px) and (max-height: 900px) {
  .site-header { min-height: 68px; }
  main { padding-top: 36px; }
  .intro { margin-bottom: 28px; }
  h1 {
    margin-top: 12px;
    font-size: clamp(3.75rem, 6.8vw, 6rem);
  }
  .lede { margin-top: 18px; }
  .incident-panel { padding-top: 22px; padding-bottom: 24px; }
  .counter-row { min-height: 108px; padding: 22px 0 14px; }
  .counter-number { font-size: clamp(4.75rem, 9vw, 7rem); }
  .counter-caption { min-height: 3.1em; margin-bottom: 14px; }
  .ticker { margin-top: 16px; padding-block: 12px; }
}

@media (max-width: 520px) {
  .site-header { min-height: 68px; }
  .brand { font-size: .78rem; }
  .brand-mark { width: 30px; }
  .community-badge { font-size: .65rem; }
  main { padding-top: 48px; }
  h1 { font-size: clamp(3.6rem, 20vw, 5.3rem); }
  .lede { font-size: 1.08rem; }
  .panel-topline { align-items: flex-start; flex-direction: column; }
  .counter-row { min-height: 150px; padding-top: 32px; }
  .counter-caption { min-height: auto; }
  .load-error { align-items: stretch; flex-direction: column; }
}

/* Admin */
.admin-shell { width: min(100% - 32px, 960px); margin: 0 auto; padding: 72px 0; }
.admin-intro { max-width: 720px; margin-bottom: 42px; }
.admin-intro h1 { font-size: clamp(3rem, 8vw, 6rem); }
.admin-intro .lede { font-size: 1.08rem; }
.admin-identity { color: var(--green); font-family: var(--font-mono); font-size: .78rem; }
.admin-identity.is-error { color: var(--red); }

.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.admin-card { padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.admin-card--community { border-top-color: var(--amber); }
.admin-card--confirmed { border-top-color: var(--green); }
.admin-card h2 { margin: 12px 0 6px; font-size: 1.65rem; font-weight: 500; letter-spacing: -.035em; }
.admin-card > p { margin: 0 0 24px; color: var(--muted); font-size: .9rem; line-height: 1.5; }

.admin-form { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.field input, .field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-bright);
  border-radius: 7px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
}
.field textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(97, 246, 170, .1); }
.admin-card--community .field input:focus, .admin-card--community .field textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255, 196, 95, .1); }
.field-hint { color: var(--dim); font-size: .72rem; line-height: 1.45; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.admin-button, .secondary-button { padding: 10px 14px; }
.admin-button { border-color: var(--green); background: var(--green); color: var(--bg); font-weight: 700; }
.admin-card--community .admin-button { border-color: var(--amber); background: var(--amber); }
.admin-button:hover { filter: brightness(1.07); }
.admin-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .55; }

.admin-message { min-height: 22px; margin-top: 14px; color: var(--muted); font-family: var(--font-mono); font-size: .75rem; }
.admin-message.is-success { color: var(--green); }
.admin-message.is-error { color: var(--red); }
.admin-card--community .admin-message.is-success { color: var(--amber); }
.admin-note { margin-top: 22px; padding: 15px 17px; border-radius: 8px; background: var(--surface-raised); color: var(--muted); font-size: .82rem; line-height: 1.5; }

@media (max-width: 760px) {
  .admin-shell { padding-top: 48px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-card { padding: 22px 18px; }
}
