/* Large-format support matrix — control-room scan surface for Ambient Time.
   Local fonts only; pattern+text cells (never color-alone). */

@font-face {
  font-family: "Atkinson";
  src: url("/assets/fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson";
  src: url("/assets/fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --lf-bg: #040912;
  --lf-elev: #0a1220;
  --lf-panel: rgba(10, 22, 36, 0.92);
  --lf-phosphor: #5cd9ff;
  --lf-phosphor-dim: rgba(92, 217, 255, 0.16);
  --lf-amber: #f5b441;
  --lf-ink: rgba(234, 242, 255, 0.94);
  --lf-muted: rgba(150, 170, 200, 0.72);
  --lf-line: rgba(92, 217, 255, 0.14);
  --lf-good: #3dcea0;
  --lf-warn: #f5b441;
  --lf-info: #5cd9ff;
  --lf-bad: rgba(255, 120, 120, 0.75);
  --lf-sans: "Atkinson", system-ui, sans-serif;
  --lf-mono: "JetBrains Mono", ui-monospace, monospace;
  --lf-cell: 3.1rem;
  --lf-row-label: 15.5rem;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(92, 217, 255, 0.08), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(245, 180, 65, 0.06), transparent 50%),
    linear-gradient(180deg, #071018 0%, var(--lf-bg) 40%, #03070e 100%);
  color: var(--lf-ink);
  font-family: var(--lf-sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--lf-phosphor-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--lf-phosphor-dim) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.28;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--lf-amber);
  color: #111;
  padding: 0.5rem 0.75rem;
  z-index: 20;
}
.skip:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.top,
.legend,
.matrix-wrap,
.foot,
.tray {
  position: relative;
  z-index: 1;
}

.top {
  padding: 1.4rem clamp(1rem, 3vw, 2rem) 0.75rem;
  border-bottom: 1px solid var(--lf-line);
  background: linear-gradient(180deg, rgba(4, 9, 18, 0.96), rgba(4, 9, 18, 0.78));
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.crumb {
  font-family: var(--lf-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lf-phosphor);
  text-decoration: none;
}
.crumb:hover,
.crumb:focus-visible {
  text-decoration: underline;
}

.sep {
  color: var(--lf-muted);
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0.55rem 0 0;
  max-width: 62rem;
  color: var(--lf-muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  margin-top: 1rem;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lf-muted);
  font-family: var(--lf-mono);
}

.filters select,
.filters input {
  min-width: 10rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--lf-line);
  border-radius: 8px;
  background: var(--lf-elev);
  color: var(--lf-ink);
  font-family: var(--lf-sans);
  font-size: 0.92rem;
  letter-spacing: 0;
  text-transform: none;
}

.filters input:focus,
.filters select:focus {
  outline: 2px solid var(--lf-phosphor);
  outline-offset: 2px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--lf-line);
  background: rgba(4, 9, 18, 0.65);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--lf-mono);
  font-size: 0.72rem;
  color: var(--lf-muted);
}

.swatch {
  width: 1.35rem;
  height: 1.1rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.matrix-wrap {
  padding: 0.75rem clamp(0.5rem, 2vw, 1.25rem) 2rem;
  overflow: auto;
}

.status {
  font-family: var(--lf-mono);
  font-size: 0.8rem;
  color: var(--lf-muted);
}

.matrix {
  border-collapse: separate;
  border-spacing: 0;
  min-width: max-content;
  width: 100%;
}

.matrix th,
.matrix td {
  padding: 0;
  vertical-align: middle;
}

.matrix thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #07101c;
  border-bottom: 1px solid var(--lf-line);
  height: 3.4rem;
}

.matrix .corner {
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: var(--lf-row-label);
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-family: var(--lf-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lf-amber);
  background: #07101c;
}

.matrix .plat {
  min-width: var(--lf-cell);
  width: var(--lf-cell);
  text-align: center;
  font-family: var(--lf-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--lf-ink);
  padding: 0.35rem 0.25rem;
}

.matrix .plat small {
  display: block;
  color: var(--lf-muted);
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.group-row th {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  padding: 0.55rem 0.75rem;
  background: linear-gradient(90deg, rgba(245, 180, 65, 0.14), transparent 55%), #0a1422;
  border-top: 1px solid rgba(245, 180, 65, 0.28);
  border-bottom: 1px solid var(--lf-line);
  border-left: 3px solid var(--lf-amber);
  font-family: var(--lf-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lf-amber);
}

.row-label {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: var(--lf-row-label);
  max-width: var(--lf-row-label);
  padding: 0.35rem 0.75rem;
  background: var(--lf-panel);
  border-bottom: 1px solid rgba(92, 217, 255, 0.08);
  border-right: 1px solid var(--lf-line);
}

.row-label a,
.row-label .name {
  display: block;
  color: var(--lf-ink);
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-label a:hover,
.row-label a:focus-visible {
  color: var(--lf-phosphor);
  text-decoration: underline;
}

.row-label .id {
  display: block;
  margin-top: 0.1rem;
  font-family: var(--lf-mono);
  font-size: 0.68rem;
  color: var(--lf-muted);
}

.cell {
  width: var(--lf-cell);
  min-width: var(--lf-cell);
  height: 2.65rem;
  border-bottom: 1px solid rgba(92, 217, 255, 0.07);
  border-right: 1px solid rgba(92, 217, 255, 0.05);
  text-align: center;
}

.cell button {
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
  padding: 0.2rem;
  cursor: pointer;
  font-family: var(--lf-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--lf-ink);
  background: transparent;
  display: grid;
  place-items: center;
  gap: 0.1rem;
}

.cell button:focus-visible {
  outline: 2px solid var(--lf-phosphor);
  outline-offset: -2px;
  z-index: 1;
  position: relative;
}

.cell button .mark {
  width: 1.55rem;
  height: 1.1rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: block;
}

.tone-good .mark {
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(61, 206, 160, 0.35) 2px, rgba(61, 206, 160, 0.35) 4px),
    rgba(61, 206, 160, 0.22);
  border-color: rgba(61, 206, 160, 0.55);
}
.tone-warn .mark {
  background:
    repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(245, 180, 65, 0.4) 2px, rgba(245, 180, 65, 0.4) 4px),
    rgba(245, 180, 65, 0.18);
  border-color: rgba(245, 180, 65, 0.55);
}
.tone-info .mark {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(92, 217, 255, 0.28) 3px, rgba(92, 217, 255, 0.28) 4px),
    rgba(92, 217, 255, 0.14);
  border-color: rgba(92, 217, 255, 0.5);
}
.tone-bad .mark {
  background:
    linear-gradient(135deg, transparent 42%, rgba(255, 120, 120, 0.75) 42%, rgba(255, 120, 120, 0.75) 58%, transparent 58%),
    linear-gradient(45deg, transparent 42%, rgba(255, 120, 120, 0.55) 42%, rgba(255, 120, 120, 0.55) 58%, transparent 58%),
    rgba(255, 80, 80, 0.08);
  border-color: rgba(255, 120, 120, 0.45);
  opacity: 0.85;
}

/*
 * Unexamined reads as an open field, not as work in progress. tone-warn (amber
 * solid hatch) already means DEBUG / release-gated — something someone is
 * holding. This is the absence of anyone holding it.
 */
.tone-open .mark {
  background: radial-gradient(rgba(245, 180, 65, 0.5) 1px, transparent 1px) 0 0 / 5px 5px;
  border-color: rgba(245, 180, 65, 0.4);
  border-style: dashed;
}

/* Visual evidence exists behind this cell. One dot; the grid stays a scan. */
.cell button.has-evidence {
  position: relative;
}

.cell button .ev-dot {
  position: absolute;
  top: 0.25rem;
  right: 0.3rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lf-phosphor);
  box-shadow: 0 0 4px rgba(92, 217, 255, 0.8);
}

.cell button:hover {
  background: rgba(92, 217, 255, 0.06);
}

.cell button.has-evidence:hover {
  background: rgba(92, 217, 255, 0.12);
}

/* Tray: the join between catalog verdict and visual evidence. */
.tray .evidence {
  margin: 0.75rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(92, 217, 255, 0.16);
}

.tray .evidence a {
  color: var(--lf-phosphor);
  font-weight: 700;
}

.tray .evidence .meta {
  display: block;
  margin-top: 0.15rem;
}

.tray .evidence.none {
  color: rgba(150, 170, 200, 0.6);
  font-style: italic;
}

.tray .absence-constraint {
  color: rgba(255, 140, 140, 0.85);
}

.tray .absence-unexamined {
  color: rgba(245, 180, 65, 0.9);
}

.tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  max-height: 42vh;
  overflow: auto;
  padding: 1rem 1.25rem 1.25rem;
  background: rgba(6, 12, 22, 0.96);
  border-top: 1px solid var(--lf-phosphor);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.45);
}

.tray[hidden] {
  display: none;
}

.tray-close {
  position: absolute;
  top: 0.55rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--lf-line);
  border-radius: 8px;
  background: transparent;
  color: var(--lf-ink);
  font-size: 1.25rem;
  cursor: pointer;
}

.tray h2 {
  margin: 0 1.5rem 0.35rem 0;
  font-size: 1.15rem;
}

.tray .meta {
  font-family: var(--lf-mono);
  font-size: 0.78rem;
  color: var(--lf-muted);
  margin: 0 0 0.65rem;
}

.tray p {
  margin: 0.35rem 0;
  color: var(--lf-ink);
  line-height: 1.5;
  max-width: 52rem;
}

.tray a {
  color: var(--lf-phosphor);
}

.foot {
  padding: 1.25rem clamp(1rem, 3vw, 2rem) 2rem;
  border-top: 1px solid var(--lf-line);
  color: var(--lf-muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

.foot a {
  color: var(--lf-phosphor);
}

@media (max-width: 720px) {
  :root {
    --lf-row-label: 10.5rem;
    --lf-cell: 2.6rem;
  }
  .matrix .plat {
    font-size: 0.58rem;
  }
}

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