/*
 * theme.css — CYBER THREAT AGENT.
 *
 * Paper in daylight, a blue-black watch room at night, one indigo signal.
 * Every view reads these tokens and nothing else.
 */

:root {
  color-scheme: light;

  --canvas: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #eeeeea;
  --border: #dedcd6;
  --border-strong: #b9b6ad;

  --ink: #101215;
  --muted: #5c6068;

  --accent: #1f3fd8;
  --accent-hover: #182fa8;
  --accent-ink: #ffffff;
  --accent-text: #1c34b8;
  --accent-soft: #e5e8fb;
  --accent-strong: #16287f;
  --accent-border: #b9c2f2;

  --success: #0f7a43;
  --success-ink: #ffffff;
  --success-soft: #e0efe6;
  --success-strong: #0b5c33;

  --warning: #a85b00;
  --warning-ink: #ffffff;
  --warning-soft: #f7ead9;
  --warning-strong: #7d4300;

  --danger: #bb1f2a;
  --danger-ink: #ffffff;
  --danger-soft: #fbe4e5;
  --danger-strong: #8f1620;

  --chart-1: #1f3fd8;
  --chart-2: #7a2e9e;
  --chart-3: #b25400;
  --chart-4: #3f6b00;
  --chart-5: #0b6a7a;
  --chart-6: #8a3fa8;

  --font-display: "Archivo Variable", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Manrope Variable", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Manrope Variable", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --display-weight: 650;
  --display-tracking: -0.025em;
  --eyebrow-tracking: 0.14em;

  --radius-btn: 0.25rem;
  --radius-card: 0.375rem;
  --radius-input: 0.25rem;
  --border-w: 1px;
  --border-strong-w: 1px;
  --shadow-card: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent);
  --shadow-raised: 0 18px 40px -24px color-mix(in srgb, var(--ink) 40%, transparent);
  --shadow-btn: 0 1px 0 color-mix(in srgb, var(--ink) 12%, transparent);
  --card-pad: 1.25rem;
  --caps: none;
  --caps-tracking: 0.06em;
  --btn-weight: 600;
  --measure: 68ch;

  --x-rule: #e6e4dd;
  --x-scan: #f1f4ff;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --canvas: #0f131a;
  --surface: #171c26;
  --surface-2: #1e2430;
  --border: #2c3444;
  --border-strong: #46506a;

  --ink: #eceef2;
  --muted: #9aa1ad;

  --accent: #6d86ff;
  --accent-hover: #8b9fff;
  --accent-ink: #0f131a;
  --accent-text: #9db1ff;
  --accent-soft: #1a2136;
  --accent-strong: #c2cdff;
  --accent-border: #33406b;

  --success: #4cc38a;
  --success-ink: #06120c;
  --success-soft: #12261c;
  --success-strong: #8ce0b4;

  --warning: #e0a24a;
  --warning-ink: #1a1206;
  --warning-soft: #2a2113;
  --warning-strong: #f0c489;

  --danger: #f0736f;
  --danger-ink: #1a0807;
  --danger-soft: #2c1618;
  --danger-strong: #f7a7a3;

  --chart-1: #6d86ff;
  --chart-2: #c07be0;
  --chart-3: #e0a24a;
  --chart-4: #9cc45a;
  --chart-5: #4cc3c3;
  --chart-6: #b18cff;

  --x-rule: #232a38;
  --x-scan: #141a26;
}

/*
 * app.css — the briefing's own screen.
 *
 * A front page, not a dashboard: a masthead rule, a lead with a severity spine,
 * a wire list in four columns, and a posture rail. Tokens only.
 */

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
  z-index: 60;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  border-bottom: 2px solid var(--ink);
  padding: 1.85rem 0 0.6rem;
}

.navlink {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-btn);
  padding: 0.35rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
}

.navlink:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.navlink.is-active {
  color: var(--ink);
  background: var(--surface-2);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: var(--eyebrow-tracking);
  color: var(--muted);
}

.meta {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: var(--radius-btn);
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---- the lead ---------------------------------------------------------- */

.lead {
  border-left-width: 4px;
  border-left-style: solid;
  padding-left: 1.1rem;
}

.lead-link {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 4px;
}

.lead-link:hover {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.sev-word {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.pull {
  margin-top: 1.25rem;
  max-width: 64ch;
  border-left: 2px solid var(--accent-border);
  padding-left: 0.9rem;
  font-size: 15px;
  line-height: 1.6;
  color: var(--accent-strong);
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-bottom: 1px solid var(--accent-border);
  padding-bottom: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-text);
  text-decoration: none;
}

.read-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ---- the wire ---------------------------------------------------------- */

.brief-row {
  display: grid;
  grid-template-columns: 56px 84px minmax(0, 1fr) 132px;
  align-items: baseline;
  gap: 0.9rem;
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0;
  text-decoration: none;
}

.brief-row:hover {
  background: var(--surface-2);
}

.brief-time {
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.brief-sev {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.brief-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.brief-row:hover .brief-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.brief-src {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 639px) {
  .brief-row {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 0.35rem 0.75rem;
  }

  .brief-time {
    grid-column: 1;
    grid-row: 1;
  }

  .brief-title {
    grid-column: 2;
    grid-row: 1;
  }

  .brief-sev {
    grid-column: 1;
    grid-row: 2;
  }

  .brief-src {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }
}

/* ---- posture ----------------------------------------------------------- */

.posture-cell {
  background: var(--surface);
  padding: 0.75rem 0.9rem 0.85rem;
}

.posture-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.posture-num {
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: var(--display-weight);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pipe-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.pipe-line:last-child {
  border-bottom: 0;
}

.digest-line {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0;
}

.digest-line:last-child {
  border-bottom: 0;
}

/* ---- filters ----------------------------------------------------------- */

.chip-filter {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.chip-filter:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.chip-filter.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--canvas);
}

@media (prefers-reduced-motion: reduce) {
  .brief-row {
    transition: none;
  }
}
