/* soc-feed — dark operations theme, tuned for both desk and video wall */

:root {
  --bg:        #06080b;
  --bg-grid:   rgba(90, 130, 170, 0.045);
  --panel:     #0c1219;
  --panel-2:   #101822;
  --border:    #1b2734;
  --border-hi: #27384a;

  --text:      #dde6ef;
  --text-dim:  #7f92a6;
  --text-mute: #55677a;

  --critical:  #ff3d57;
  --high:      #ff9d2e;
  --medium:    #2ad4ff;
  --info:      #62788d;
  --kev:       #ff2bd6;
  --watch:     #6ee787;

  --radius: 10px;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(42, 212, 255, 0.07), transparent 70%),
    linear-gradient(var(--bg-grid) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px) 0 0 / 44px 100%,
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Faint horizontal sweep — reads as "live" on a wall without being tacky */
.scanline {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(to bottom, transparent, rgba(42, 212, 255, 0.035), transparent);
  height: 140px;
  animation: sweep 9s linear infinite;
}
@keyframes sweep { from { transform: translateY(-160px); } to { transform: translateY(100vh); } }

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 22px;
  background: rgba(8, 12, 17, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  width: 12px; height: 34px; border-radius: 3px;
  background: linear-gradient(180deg, var(--critical), var(--high) 45%, var(--medium));
  box-shadow: 0 0 18px rgba(255, 61, 87, 0.45);
}

.brand-text h1 {
  margin: 0; font-size: 17px; font-weight: 700;
  letter-spacing: 0.16em; font-family: var(--mono);
}
.brand-text p {
  margin: 0; font-size: 11px; color: var(--text-mute);
  letter-spacing: 0.08em; text-transform: uppercase;
}

.stats { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }

.pill {
  display: flex; align-items: baseline; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 12px;
}
.pill b { font-size: 15px; font-weight: 700; }
.pill span { color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.07em; }

.pill.critical { border-color: rgba(255, 61, 87, 0.45); }
.pill.critical b { color: var(--critical); }
.pill.high     { border-color: rgba(255, 157, 46, 0.4); }
.pill.high b   { color: var(--high); }
.pill.kev      { border-color: rgba(255, 43, 214, 0.45); }
.pill.kev b    { color: var(--kev); }
.pill.down     { border-color: rgba(255, 157, 46, 0.4); }
.pill.down b   { color: var(--high); }

.clock { text-align: right; font-family: var(--mono); white-space: nowrap; }
.clock-time { font-size: 22px; font-weight: 600; letter-spacing: 0.04em; }
.clock-meta { font-size: 10.5px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------------------------------------------------------------- ticker */

.ticker {
  display: flex; align-items: stretch;
  background: linear-gradient(90deg, rgba(255, 61, 87, 0.16), rgba(255, 61, 87, 0.03));
  border-bottom: 1px solid rgba(255, 61, 87, 0.35);
  overflow: hidden;
}
.ticker-label {
  flex: none; display: flex; align-items: center;
  padding: 0 14px; background: var(--critical); color: #10040a;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em;
}
.ticker-viewport { flex: 1; overflow: hidden; padding: 8px 0; }
.ticker-track {
  display: inline-flex; gap: 46px; white-space: nowrap;
  font-family: var(--mono); font-size: 13px; color: #ffc9d1;
  animation: marquee 60s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track a { color: inherit; text-decoration: none; }
.ticker-track a:hover { text-decoration: underline; }
@keyframes marquee { from { transform: translateX(2%); } to { transform: translateX(-100%); } }

/* --------------------------------------------------------------- toolbar */

.toolbar {
  position: sticky; top: 63px; z-index: 15;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 22px;
  background: rgba(8, 12, 17, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.spacer { flex: 1; }

input[type="search"], select {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; font-family: inherit;
}
input[type="search"] { min-width: 300px; flex: 0 1 380px; }
input[type="search"]:focus, select:focus {
  outline: none; border-color: var(--medium);
  box-shadow: 0 0 0 3px rgba(42, 212, 255, 0.14);
}

.segmented { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented button {
  background: var(--panel); color: var(--text-dim); border: 0;
  padding: 8px 14px; font-size: 12.5px; font-family: inherit; cursor: pointer;
  border-right: 1px solid var(--border);
}
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--panel-2); color: var(--text); }
.segmented button.on { background: var(--medium); color: #041018; font-weight: 600; }

.toggle { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.toggle input { accent-color: var(--watch); width: 15px; height: 15px; }

.ghost {
  background: var(--panel); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 14px; font-size: 12.5px; font-family: inherit;
  cursor: pointer; text-decoration: none; display: inline-block;
}
.ghost:hover { background: var(--panel-2); color: var(--text); border-color: var(--border-hi); }

/* ------------------------------------------------------------------ feed */

.feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 14px;
  padding: 20px 22px 60px;
}

.card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 18px 14px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--info);
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hi);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.card.critical::before { background: var(--critical); box-shadow: 0 0 16px var(--critical); }
.card.high::before     { background: var(--high); }
.card.medium::before   { background: var(--medium); }

.card.critical {
  border-color: rgba(255, 61, 87, 0.4);
  background: linear-gradient(180deg, rgba(255, 61, 87, 0.07), transparent 60%), var(--panel);
}
.card.high { border-color: rgba(255, 157, 46, 0.28); }

/* Newly arrived items flash once so a wall watcher notices movement */
.card.fresh { animation: arrive 2.4s ease-out; }
@keyframes arrive {
  0%   { box-shadow: 0 0 0 2px var(--medium), 0 0 26px rgba(42, 212, 255, 0.55); }
  100% { box-shadow: none; }
}

.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.badge {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
}
.badge.sev-critical { background: var(--critical); color: #140307; }
.badge.sev-high     { background: var(--high);     color: #170c02; }
.badge.sev-medium   { background: var(--medium);   color: #03151c; }
.badge.sev-info     { background: #1d2836;         color: var(--text-dim); }

.badge.kev {
  background: var(--kev); color: #17001a;
  animation: kevpulse 2s ease-in-out infinite;
}
@keyframes kevpulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 43, 214, 0); }
  50%      { box-shadow: 0 0 14px rgba(255, 43, 214, 0.85); }
}

.badge.watch { background: rgba(110, 231, 135, 0.16); color: var(--watch); border: 1px solid rgba(110, 231, 135, 0.35); }

.source {
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px;
}
.also { font-family: var(--mono); font-size: 10.5px; color: var(--text-mute); }

.card-time { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-mute); white-space: nowrap; }

.card h3 { margin: 0; font-size: 15.5px; line-height: 1.35; font-weight: 600; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--medium); }

.card p { margin: 0; font-size: 13.2px; color: var(--text-dim); line-height: 1.5; }

.card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

.cve {
  font-family: var(--mono); font-size: 11px;
  color: #ffd9de; background: rgba(255, 61, 87, 0.14);
  border: 1px solid rgba(255, 61, 87, 0.3);
  padding: 2px 7px; border-radius: 4px; text-decoration: none;
}
.cve:hover { background: rgba(255, 61, 87, 0.26); }

.reason { font-family: var(--mono); font-size: 10.5px; color: var(--text-mute); font-style: italic; }

mark { background: rgba(42, 212, 255, 0.28); color: inherit; border-radius: 2px; padding: 0 2px; }

/* ----------------------------------------------------------------- empty */

.empty { grid-column: 1 / -1; text-align: center; padding: 90px 20px; color: var(--text-dim); }
.empty p { margin: 18px 0 6px; font-size: 15px; }
.empty small { color: var(--text-mute); }
.pulse {
  width: 46px; height: 46px; margin: 0 auto; border-radius: 50%;
  border: 2px solid var(--medium); animation: ping 1.6s ease-out infinite;
}
@keyframes ping {
  0%   { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ---------------------------------------------------------------- drawer */

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 92vw); z-index: 40;
  background: var(--panel-2); border-left: 1px solid var(--border-hi);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.6);
  overflow-y: auto; padding: 0 0 30px;
}
.drawer-head {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: var(--panel-2); border-bottom: 1px solid var(--border);
}
.drawer-head h2 { margin: 0; font-size: 14px; font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }

.hrow {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.ok   { background: var(--watch); box-shadow: 0 0 9px rgba(110, 231, 135, 0.8); }
.dot.bad  { background: var(--critical); box-shadow: 0 0 9px rgba(255, 61, 87, 0.8); }
.dot.idle { background: var(--text-mute); }
.hname { font-size: 13.5px; }
.hmeta { font-family: var(--mono); font-size: 11px; color: var(--text-mute); }
.herr  { font-family: var(--mono); font-size: 11px; color: var(--critical); word-break: break-word; }
.hrow .right { margin-left: auto; text-align: right; }

/* ------------------------------------------------------------- wall mode */

body.wall { font-size: 19px; }
body.wall .toolbar { display: none; }
body.wall .brand-text h1 { font-size: 24px; }
body.wall .clock-time { font-size: 34px; }
body.wall .pill { font-size: 15px; padding: 9px 17px; }
body.wall .pill b { font-size: 21px; }
body.wall .feed { grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 20px; padding: 26px; }
body.wall .card h3 { font-size: 21px; }
body.wall .card p { font-size: 16.5px; }
body.wall .badge { font-size: 12.5px; padding: 4px 10px; }
body.wall .source, body.wall .card-time, body.wall .cve { font-size: 14px; }
body.wall .ticker-track { font-size: 17px; }
body.wall .ticker-label { font-size: 14px; padding: 0 20px; }

/* -------------------------------------------------------------- courtesy */

@media (prefers-reduced-motion: reduce) {
  .scanline, .ticker-track, .badge.kev, .pulse, .card.fresh { animation: none; }
}

@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .clock { margin-left: auto; }
  .feed { grid-template-columns: 1fr; padding: 14px; }
  input[type="search"] { min-width: 0; flex: 1 1 100%; }
  .toolbar { top: 0; position: static; }
}
