/* Signal Mission Control: executive cockpit.
   Signal Command tokens. Square corners, hairlines, no shadows. Colour never carries meaning alone. */

@font-face { font-family: "Archivo"; font-weight: 800; font-style: normal; font-display: swap; src: url("assets/fonts/archivo-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/archivo-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); }

:root {
  --canvas: #080810; --surface: #0F0F1A; --raised: #141422; --hairline: #23232F; --hairline-strong: #34344A;
  --ink: #F4F3F8; --ink-muted: #A6A5B8; --ink-faint: #7C7B90;
  --accent: #9B6BFF; --lavender: #C4ABFF;
  --amber: #F2B33D; --red: #F0645A;
  --display: "Archivo", "Arial Black", Arial, sans-serif;
  --body: Verdana, "DejaVu Sans", Geneva, Tahoma, sans-serif;
  --utility: "Space Grotesk", "Trebuchet MS", sans-serif;
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px;
  --r: 4px; --max: 1240px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--lavender); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--lavender); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- staging banner: always on top, on every screen ---------- */
.env {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 7px var(--s3); background: #2A2108; color: #FFE3A3; border-bottom: 1px solid #5A4512;
  font: 600 11px/1.3 var(--utility); letter-spacing: .12em; text-align: center;
}
.env-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: none; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: baseline; gap: var(--s3); margin: 0; color: var(--ink); text-decoration: none; }
.wordmark { font: 800 22px/1 var(--display); letter-spacing: -.01em; }
.brand-sub { font: 600 11px/1 var(--utility); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- buttons ---------- */
button { font: 600 12px/1 var(--utility); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; border-radius: var(--r); min-height: 44px; padding: 0 var(--s3); }
button.primary { background: var(--accent); color: var(--canvas); border: 1px solid var(--accent); }
button.primary:hover { background: var(--lavender); border-color: var(--lavender); }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--hairline-strong); }
button.ghost:hover { border-color: var(--lavender); }
button:disabled { opacity: .55; cursor: progress; }
.error { color: #FF9B93; }

/* ---------- sign-in and not-authorised ---------- */
.gate { min-height: calc(100vh - 32px); display: grid; place-items: center; padding: var(--s6) var(--s3); }
.gate-card { width: 100%; max-width: 420px; border: 1px solid var(--hairline); background: var(--surface); padding: var(--s6) var(--s5); }
.gate-card .brand { margin-bottom: var(--s6); }
.gate h1 { margin: 0 0 var(--s2); font: 800 32px/1.1 var(--display); letter-spacing: -.02em; }
.gate-lede { margin: 0 0 var(--s5); color: var(--ink-muted); }
#signin-form { display: flex; flex-direction: column; }
#signin-form label { font: 600 11px/1 var(--utility); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 var(--s2); }
#signin-form input { min-height: 44px; margin-bottom: var(--s4); padding: 0 var(--s3); background: var(--canvas); color: var(--ink); border: 1px solid var(--hairline-strong); border-radius: var(--r); font: 15px var(--body); }
#signin-form input:focus { border-color: var(--lavender); outline: none; }
#signin-form button { margin-top: var(--s2); }
#signin-error { min-height: 1.5em; margin: var(--s3) 0 0; }

/* ---------- app frame ---------- */
.top { border-bottom: 1px solid var(--hairline); background: var(--canvas); }
.top-inner { max-width: var(--max); margin: 0 auto; padding: var(--s4) var(--s5) var(--s3); display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; }
.account { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.who { color: var(--ink-muted); font-size: 12px; }
#nav { max-width: var(--max); margin: 0 auto; padding: 0 var(--s5); display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; }
#nav a {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3);
  color: var(--ink-muted); text-decoration: none; font: 600 13px/1 var(--utility); letter-spacing: .04em;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
#nav a:hover { color: var(--ink); }
#nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
main { max-width: var(--max); margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); }
.page { display: flex; flex-direction: column; gap: var(--s5); animation: rise .28s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } * { transition: none !important; } }

.page-h h1 { margin: 0; font: 800 clamp(30px, 4vw, 44px)/1.05 var(--display); letter-spacing: -.02em; }
.page-lede { margin: var(--s2) 0 0; color: var(--ink-muted); max-width: 680px; }
.page-overview .page-h h1 { font: 600 11px/1 var(--utility); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.section-h { margin: 0 0 var(--s3); font: 600 11px/1 var(--utility); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.block { display: flex; flex-direction: column; gap: var(--s3); }
.aside, .note { margin: 0; color: var(--ink-muted); font-size: 13px; }
.note { padding: var(--s3) var(--s4); border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); }
.small { font-size: 12px; color: var(--ink-muted); }
.gap-top { margin-top: 0; }

/* ---------- grids ---------- */
.grid { display: grid; gap: var(--s3); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.hero-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: var(--s3); align-content: start; }

/* ---------- tiles ---------- */
.tile {
  position: relative; display: flex; flex-direction: column; gap: var(--s2);
  padding: var(--s4); background: var(--surface); border: 1px solid var(--hairline); border-radius: 0;
  transition: border-color .15s;
}
.tile:hover { border-color: var(--hairline-strong); }
.tile header { display: flex; flex-direction: column; gap: 2px; }
.tile .name { margin: 0; font: 600 12px/1.3 var(--utility); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.tile .scope { margin: 0; font-size: 12px; color: var(--ink-muted); }
.tile .value { margin: var(--s2) 0 0; font: 800 34px/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.tile .unit { margin: 0; font-size: 12px; color: var(--ink-faint); }
.tile.hero .value { font-size: clamp(56px, 7vw, 88px); }
.tile.lead .value { font-size: 48px; }
.tile.compact { padding: var(--s3) var(--s4); }
.tile.compact .value { font-size: 28px; }

/* Unavailable: the word, the reason, a dashed frame. Never a zero. */
.tile.s-unavailable { border-style: dashed; border-color: var(--hairline-strong); background: transparent; }
.tile .value.na { font: 600 20px/1.2 var(--display); letter-spacing: 0; color: var(--ink-muted); }
.tile.hero .value.na, .tile.lead .value.na { font-size: 26px; }
.tile .why { margin: 0; font-size: 12px; color: var(--ink-muted); }

/* Out of date: shown alongside the state, never instead of it */
.tile.is-stale .value { color: var(--ink-muted); }
.tile.is-stale .asof { color: var(--amber); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: auto; padding-top: var(--s2); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--hairline-strong); font: 600 10px/1.4 var(--utility); letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
}
.mark { width: 8px; height: 8px; border-radius: 50%; flex: none; box-sizing: border-box; }
.s-verified .mark { background: var(--accent); }
.badge.s-verified { border-color: var(--accent); }
.s-manual .mark { border: 1.5px solid var(--lavender); }
.badge.s-manual { border-color: var(--lavender); }
.s-unavailable .mark { border: 1.5px dashed var(--ink-muted); }
.badge.s-unavailable { border-style: dashed; color: var(--ink-muted); }
.badge.stale { border-color: var(--amber); color: #FFD27A; }
.badge.stale .mark, .conf.stale .mark { border-radius: 1px; background: var(--amber); width: 7px; height: 7px; transform: rotate(45deg); }
.asof { font: 500 11px/1 var(--utility); letter-spacing: .06em; color: var(--ink-faint); }

/* "How is this counted?" */
.how { border-top: 1px solid var(--hairline); margin-top: var(--s1); padding-top: var(--s2); font-size: 12px; }
.how summary { cursor: pointer; list-style: none; color: var(--ink-faint); font: 500 11px/1.6 var(--utility); letter-spacing: .06em; min-height: 24px; }
.how summary::-webkit-details-marker { display: none; }
.how summary::before { content: "+"; display: inline-block; width: 14px; color: var(--lavender); }
.how[open] summary::before { content: "\2212"; }
.how summary:hover { color: var(--ink); }
.how-body p { margin: var(--s2) 0 0; color: var(--ink-muted); }
.how-body .k { font: 600 10px/1 var(--utility); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-right: 6px; }

/* ---------- Overview: the morning briefing ---------- */
.brief { display: flex; flex-direction: column; gap: var(--s3); max-width: 920px; }
.greet { margin: 0; font: 500 13px/1 var(--utility); letter-spacing: .06em; color: var(--lavender); }
.lede { margin: 0; font: 800 clamp(28px, 3.6vw, 44px)/1.12 var(--display); letter-spacing: -.02em; color: var(--ink-muted); }
.lede .hl { color: var(--ink); }

/* ---------- the next Session ---------- */
.next {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s5);
  padding: var(--s5); border: 1px solid var(--hairline-strong); background: var(--surface);
  position: relative; overflow: hidden;
}
.next::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 100%; height: 2px; background: var(--accent); }
.next.none { display: block; }
.next-when { display: flex; flex-direction: column; gap: var(--s2); }
.eyebrow { margin: 0; font: 600 11px/1 var(--utility); letter-spacing: .14em; text-transform: uppercase; color: var(--lavender); }
.next-name { margin: var(--s2) 0 0; font: 800 clamp(30px, 4vw, 48px)/1.04 var(--display); letter-spacing: -.02em; }
.next-date { margin: 0; color: var(--ink); font-size: 15px; }
.next-date .dow { color: var(--ink-muted); }
.next-count { margin: var(--s3) 0 0; align-self: flex-start; padding: 6px 12px; border: 1px solid var(--accent); font: 600 12px/1 var(--utility); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.next-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s3); align-content: start; }
.next .tile { background: var(--raised); }
.next.compact .tile.lead .value { font-size: 40px; }

.event-row { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: var(--s4); padding: var(--s4) 0; border-top: 1px solid var(--hairline); }
.event-row h4 { margin: 0; display: flex; flex-direction: column; gap: 4px; font: 800 18px/1.2 var(--display); }
.event-row .event-date { font: 500 12px/1 var(--utility); letter-spacing: .06em; color: var(--ink-muted); }

/* ---------- chapters: one system, three identities ---------- */
.chapters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.chapter { display: flex; flex-direction: column; gap: var(--s3); padding-top: var(--s3); border-top: 2px solid var(--hairline-strong); }
.chapter-h { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.chapter-h h2 { margin: 0; font: 800 22px/1.1 var(--display); letter-spacing: -.01em; }
.chapter-h h2 a { color: var(--ink); text-decoration: none; }
.chapter-h h2 a:hover { color: var(--lavender); }
.more { display: inline-flex; align-items: center; min-height: 44px; font: 600 11px/1 var(--utility); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); text-decoration: none; }
.more::after { content: "\2192"; margin-left: 6px; color: var(--lavender); }
.more:hover { color: var(--ink); }
.ch-commercial { border-top-color: var(--ink); }
.ch-community { border-top-color: var(--lavender); }
.ch-vox { grid-column: 1 / -1; border-top-color: var(--accent); }
.hero-grid.tight { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }

/* Revenue: collected leads, the rest beneath */
.revenue { display: flex; flex-direction: column; gap: var(--s3); }
.revenue .beneath .tile { background: transparent; }

/* Community: Signal Nexters drawn inside the Signaller bar */
.subset { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s2); }
.bar { position: relative; height: 10px; background: var(--hairline); }
.bar-all { position: absolute; inset: 0; background: linear-gradient(90deg, #2B2342, #2B2342); }
.bar-part { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--lavender); transition: width .6s ease-out; }
.subset-cap { margin: 0; font-size: 12px; color: var(--ink-muted); }
.subset-cap strong { color: var(--ink); font-weight: 700; }
.subset.na .subset-cap { font-style: italic; }
.page-signal-next > .subset { padding: var(--s4); border: 1px solid var(--hairline); background: var(--surface); }

/* Vox: a production line, read left to right, never summed */
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); counter-reset: stage; }
.pipeline li { position: relative; display: flex; }
.pipeline li .tile { flex: 1; }
.pipeline li:not(:last-child)::after {
  content: "\2192"; position: absolute; right: calc(var(--s3) * -1); top: 50%; width: var(--s3); text-align: center;
  transform: translateY(-50%); color: var(--accent); font: 600 14px/1 var(--utility); z-index: 1;
}

/* ---------- confidence: status, freshness and uncertainty in one glance ---------- */
.confidence {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s5); align-items: start;
  padding: var(--s4); border: 1px solid var(--hairline); background: var(--surface);
}
.conf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.conf { display: inline-flex; align-items: center; gap: var(--s2); font: 600 11px/1 var(--utility); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.conf .n { font: 800 20px/1 var(--display); letter-spacing: 0; color: var(--ink); }
.sources p { margin: 0; color: var(--ink-muted); font-size: 13px; }
.sources .n { font: 800 20px/1 var(--display); color: var(--ink); }
.sources .off { margin: var(--s2) 0 0; padding-left: var(--s3); color: #FFD27A; font-size: 12px; }

/* ---------- smaller screens ---------- */
@media (max-width: 960px) {
  .chapters, .hero-grid, .hero-grid.tight, .next, .confidence { grid-template-columns: minmax(0, 1fr); }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline li:nth-child(2)::after { display: none; }
}
@media (max-width: 600px) {
  .top-inner, #nav, main { padding-left: var(--s3); padding-right: var(--s3); }
  main { padding-top: var(--s5); }
  .next { padding: var(--s4); }
  .pipeline { grid-template-columns: minmax(0, 1fr); }
  .pipeline li::after { display: none; }
  .event-row { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .tile.hero .value { font-size: 56px; }
  .gate-card { padding: var(--s5) var(--s4); }
}
