:root {
  --ink: #0c0e0d;
  --ink-2: #131614;
  --ink-3: #1b1f1c;
  --rule: #2a2f2b;
  --paper: #ece8df;
  --muted: #9b9c93;
  --faint: #6e716a;
  --needle: #ff5c35;
  --needle-soft: #ff5c3522;
  --ok: #7fd18c;
  --bad: #ff7a66;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --models: #ff8a5c;
  --agents: #f2c14e;
  --science: #6fd6a8;
  --robotics: #62c6e8;
  --hardware: #a5a8ff;
  --research: #d9a7f0;
  --policy: #e8a1a1;
  --business: #a8aa9d;
  --tools: #c7c4b6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ink); color-scheme: dark; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 2px solid var(--needle); outline-offset: 2px; }

/* Status bar */
.statusbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center;
  height: 38px; padding: 0 28px;
  background: #0c0e0dee; backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  font: 400 11.5px var(--mono); color: var(--muted);
}
.live { display: flex; gap: 8px; align-items: center; color: var(--paper); text-transform: uppercase; letter-spacing: .08em; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.live.on i { background: var(--needle); animation: pulse 1.8s infinite; }
.live.off i { background: var(--bad); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 #ff5c3599; } 70%, 100% { box-shadow: 0 0 0 8px #ff5c3500; } }
.ticker { overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.ticker-track { display: inline-block; animation: ticker 120s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { margin-right: 44px; }
.ticker-track b { color: var(--needle); font-weight: 500; margin-right: 8px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Masthead */
.mast {
  display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end;
  padding: 44px 28px 28px; max-width: 1440px; margin: 0 auto;
}
h1 {
  margin: 0; font: 400 clamp(52px, 8.4vw, 124px)/.92 var(--serif); letter-spacing: -.025em;
}
h1 em { color: var(--needle); }
.mast p { margin: 18px 0 0; max-width: 56ch; color: var(--muted); font-size: 16px; }
.readings { display: grid; grid-template-columns: repeat(3, auto); gap: 0; margin: 0; border-left: 1px solid var(--rule); }
.readings div { padding: 2px 24px; border-right: 1px solid var(--rule); }
.readings dt { font: 400 10.5px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }
.readings dd { margin: 4px 0 0; font: 400 44px/1 var(--serif); font-variant-numeric: tabular-nums; }

/* Seismograph */
.instrument { border-block: 1px solid var(--rule); background: var(--ink-2); }
.instrument-head {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 10px 28px; border-bottom: 1px solid var(--rule);
  font: 400 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint);
}
.scope { position: relative; height: clamp(220px, 30vw, 340px); }
#trace { display: block; width: 100%; height: 100%; cursor: crosshair; }
.scope-tip {
  position: absolute; z-index: 5; width: 300px; padding: 12px 14px; pointer-events: none;
  background: var(--ink); border: 1px solid var(--needle); border-radius: 3px;
  box-shadow: 0 12px 40px #000a;
}
.scope-tip small { display: block; font: 400 10.5px var(--mono); color: var(--muted); margin-bottom: 5px; }
.scope-tip strong { font: 400 19px/1.18 var(--serif); }

/* Layout */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px;
  max-width: 1440px; margin: 0 auto; padding: 36px 28px 80px;
}

/* Lead story */
.lead { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; padding-bottom: 36px; border-bottom: 1px solid var(--rule); }
.lead:empty { display: none; }
.lead-eyebrow { display: flex; gap: 10px; align-items: center; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--needle); }
.lead h2 { margin: 12px 0 14px; font: 400 clamp(32px, 4vw, 54px)/1.03 var(--serif); letter-spacing: -.012em; }
.lead h2 a:hover { color: var(--needle); }
.lead p { margin: 0 0 16px; color: var(--muted); font-size: 16px; }
.lead-art { position: relative; min-height: 250px; overflow: hidden; border-radius: 3px; background: var(--ink-3); order: 2; }
.lead-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lead-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.lead-score { position: absolute; left: 12px; bottom: 10px; font: 400 56px/1 var(--serif); text-shadow: 0 2px 18px #000; }
.lead-score small { font: 400 10px var(--mono); letter-spacing: .1em; display: block; color: var(--paper); }

/* Controls */
.controls {
  position: sticky; top: 38px; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 14px 0; background: var(--ink); border-bottom: 1px solid var(--rule);
}
.seg { display: flex; border: 1px solid var(--rule); border-radius: 3px; }
.seg button { padding: 6px 12px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--paper); color: var(--ink); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.chip { padding: 5px 9px; font: 400 11.5px var(--mono); color: var(--muted); border-radius: 3px; text-transform: capitalize; }
.chip:hover { color: var(--paper); }
.chip.on { background: var(--ink-3); color: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); }
#q { width: 150px; padding: 6px 10px; background: var(--ink-2); border: 1px solid var(--rule); border-radius: 3px; font-size: 13px; }
#q::placeholder { color: var(--faint); }

.new-banner {
  display: block; width: 100%; margin-top: 14px; padding: 10px; border-radius: 3px;
  background: var(--needle); color: var(--ink); font: 500 12px var(--mono);
}

/* Feed */
.day { margin: 26px 0 2px; font: 400 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.item {
  position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) 96px; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--ink-3);
}
.item.fresh { animation: arrive 3.5s ease-out; }
@keyframes arrive { from { background: var(--needle-soft); box-shadow: -14px 0 0 var(--needle-soft), 14px 0 0 var(--needle-soft); } to { background: transparent; } }
.meter { font: 400 27px/1 var(--serif); font-variant-numeric: tabular-nums; color: var(--muted); }
.meter.high { color: var(--needle); }
.meter i { display: block; height: 2px; margin-top: 7px; background: var(--rule); }
.meter i::after { content: ''; display: block; height: 100%; width: var(--v); background: currentColor; }
.item h3 { margin: 0; font: 400 24px/1.16 var(--serif); }
.item h3 a:hover { color: var(--needle); }
.item p { margin: 7px 0 0; color: var(--muted); font-size: 14px; max-width: 72ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 9px; font: 400 11.5px var(--mono); color: var(--faint); }
.meta .src { color: var(--paper); }
.meta .cat { color: var(--c); text-transform: capitalize; }
.meta .cat::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--c); vertical-align: 1px; }
.meta a:hover { color: var(--needle); }
.thumb { width: 96px; height: 72px; border-radius: 3px; overflow: hidden; background: var(--ink-3); align-self: start; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.empty { padding: 60px 0; text-align: center; color: var(--muted); }
.more { display: block; margin: 26px auto 0; padding: 9px 20px; border: 1px solid var(--rule); border-radius: 3px; font-size: 13px; color: var(--muted); }
.more:hover { color: var(--paper); border-color: var(--muted); }

/* Sidebar */
.side { display: flex; flex-direction: column; gap: 30px; }
.panel h2 { display: flex; justify-content: space-between; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); font: 400 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.tiers { display: flex; flex-direction: column; }
.tier { display: flex; justify-content: space-between; padding: 6px 8px; margin-inline: -8px; font-size: 14px; color: var(--muted); border-radius: 3px; text-align: left; }
.tier:hover { color: var(--paper); }
.tier.on { color: var(--paper); background: var(--ink-3); }
.tier span { font: 400 12px var(--mono); }
.stations { list-style: none; margin: 0; padding: 0; font: 400 12px var(--mono); }
.stations li { display: grid; grid-template-columns: 12px 1fr auto; gap: 6px; align-items: center; padding: 4px 0; color: var(--muted); }
.stations i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.stations .ok i { background: var(--ok); }
.stations .bad i { background: var(--bad); }
.stations .bad { color: var(--bad); }
.stations a:hover { color: var(--paper); }
.note p { margin: 0; font-size: 13px; color: var(--muted); }

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .side { display: grid; grid-template-columns: 1fr 1fr; }
  .note { grid-column: 1 / -1; }
  .mast { grid-template-columns: 1fr; gap: 24px; }
  .readings { justify-self: start; }
}
@media (max-width: 680px) {
  .statusbar { grid-template-columns: auto 1fr; padding: 0 16px; }
  .sync { display: none; }
  .mast { padding: 28px 16px 22px; }
  .readings div { padding: 2px 14px; }
  .readings dd { font-size: 32px; }
  .instrument-head { padding: 9px 16px; }
  .scale { display: none; }
  .layout { padding: 24px 16px 60px; }
  .lead { grid-template-columns: minmax(0, 1fr); }
  .lead-art { order: 0; min-height: 180px; }
  .controls { position: static; }
  .chips { flex: 1 1 100%; order: 3; }
  #q { flex: 1; width: auto; }
  .item { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
  .thumb { display: none; }
  .item h3 { font-size: 21px; }
  .side { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .live.on i, .item.fresh { animation: none; }
}
