:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-2: #ece8de;
  --text: #16150f;
  --muted: #5d5a50;
  --line: #d8d3c6;
  --hazard: #f5c400;
  --hazard-ink: #111;
  --accent: #b54708;
  --crit: #c4141c;
  --high: #d9480f;
  --med: #b08800;
  --low: #2f7d4f;
  --none: #6b6b6b;
  --good: #1f8a4c;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sign: "Oswald", "Arial Narrow", Impact, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12120f;
    --surface: #1c1b17;
    --surface-2: #26251f;
    --text: #f1eee6;
    --muted: #a7a395;
    --line: #34322a;
    --accent: #f59f00;
    --crit: #ff5c63;
    --high: #ff8a3d;
    --med: #f0c419;
    --low: #4cc480;
    --none: #9a9a9a;
    --good: #4cc480;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #12120f; --surface: #1c1b17; --surface-2: #26251f; --text: #f1eee6; --muted: #a7a395;
  --line: #34322a; --accent: #f59f00; --crit: #ff5c63; --high: #ff8a3d; --med: #f0c419;
  --low: #4cc480; --none: #9a9a9a; --good: #4cc480; --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.muted { color: var(--muted); margin: .2rem 0 0; }
.mono { font-family: var(--mono); }

/* top bar */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .75rem 16px; max-width: 1100px; margin: 0 auto;
}
.brand { font-family: var(--sign); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: .5rem; }
.brand-mark {
  display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem;
  background: var(--hazard); color: var(--hazard-ink); border-radius: 4px; font-weight: 700;
}
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.status { color: var(--muted); font-size: .8rem; text-align: right; }
.btn.sound { padding: .35rem .7rem; font-size: .8rem; white-space: nowrap; }
.btn.sound[aria-pressed="true"] { background: var(--hazard); color: var(--hazard-ink); border-color: #c9a100; }
.btn.sound.blocked { animation: none; outline: 2px dashed var(--accent); outline-offset: 2px; }
.status.err { color: var(--crit); }

main { max-width: 1100px; margin: 0 auto; padding: 0 16px 2rem; }

/* hero sign */
.sign {
  --stripe: repeating-linear-gradient(-45deg, var(--hazard) 0 22px, var(--hazard-ink) 22px 44px);
  background: var(--stripe);
  padding: 14px;
  border-radius: 10px;
  margin-top: .5rem;
}
.sign-inner {
  background: #fbfaf5; color: #111;
  border-radius: 4px;
  text-align: center;
  padding: clamp(1.25rem, 4vw, 2.5rem) 1rem;
}
.sign-kicker {
  font-family: var(--sign); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.1rem, 3.2vw, 2rem); letter-spacing: .06em; margin: 0;
}
.timer {
  font-family: var(--mono); font-weight: 800;
  font-size: clamp(2.6rem, 12vw, 7.5rem); line-height: 1.05;
  font-variant-numeric: tabular-nums;
  margin: .35rem auto;
  display: inline-block;
  background: #111; color: #ff3b30;
  padding: .1em .35em; border-radius: 8px;
  text-shadow: 0 0 18px rgba(255,59,48,.45);
  letter-spacing: .02em;
}
.timer.calm { color: #39d98a; text-shadow: 0 0 18px rgba(57,217,138,.45); }
.sign-sub { margin: .75rem 0 0; color: #333; font-size: .95rem; }
.sign-sub a { color: #8a3a00; font-weight: 600; }
.quip { margin: .5rem 0 0; font-style: italic; color: #444; min-height: 1.5em; }
.record { margin: .25rem 0 0; font-size: .85rem; color: #555; }
.record strong { color: #111; }
.record .new { background: var(--hazard); color: #111; padding: 0 .35em; border-radius: 3px; font-weight: 700; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.1rem; box-shadow: var(--shadow); min-width: 0;
  border-top: 6px solid var(--hazard);
}
.tile h2 { margin: 0; font: 600 .78rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tile-num { font-family: var(--sign); font-weight: 700; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.1; margin: .3rem 0; font-variant-numeric: tabular-nums; }
.tile-num.mono { font-family: var(--mono); font-weight: 800; font-size: clamp(1.7rem, 4.5vw, 2.6rem); padding: .2em 0; }
.tile-foot { margin: 0; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }

/* panels */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.1rem; margin: 14px 0; box-shadow: var(--shadow);
}
.panel-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-family: var(--sign); text-transform: uppercase; letter-spacing: .04em; font-size: 1.35rem; }
.panel-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.btn {
  font: 600 .875rem var(--sans); cursor: pointer;
  background: var(--hazard); color: var(--hazard-ink);
  border: 1px solid #c9a100; border-radius: 6px; padding: .5rem .9rem;
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }

input[type="text"], input[type="password"], input[type="search"] {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: .5rem .7rem; min-width: 0;
}
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.watch-form { display: flex; gap: .5rem; margin-top: .9rem; }
.watch-form input { flex: 1; }
.apikey { margin-top: .6rem; font-size: .9rem; }
.apikey summary { cursor: pointer; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 1rem; }
.cards:empty::after {
  content: "Nothing watched yet. Add the vendors you run and see how long they've gone without a CVE.";
  color: var(--muted); grid-column: 1 / -1; padding: 1rem 0;
}
.card {
  border: 1px solid var(--line); border-radius: 8px; padding: .8rem .9rem;
  background: var(--bg); position: relative; min-width: 0;
}
.card h3 { margin: 0 1.6rem 0 0; font-size: .95rem; text-transform: lowercase; overflow-wrap: anywhere; }
.card .x {
  position: absolute; top: .4rem; right: .4rem; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: .25rem .4rem; border-radius: 4px;
}
.card .x:hover { background: var(--surface-2); color: var(--text); }
.card .big { font-family: var(--sign); font-weight: 700; font-size: 2.1rem; line-height: 1.1; margin: .25rem 0 0; font-variant-numeric: tabular-nums; }
.card .big small { font-size: .95rem; font-weight: 500; color: var(--muted); margin-left: .25rem; }
.card .meta { font-size: .82rem; color: var(--muted); margin: .25rem 0 0; overflow-wrap: anywhere; }
.card .meta a { font-family: var(--mono); }
.card.loading .big { color: var(--muted); font-size: 1rem; font-family: var(--sans); font-weight: 500; padding: .6rem 0; }
.card.hot { border-color: var(--crit); }
.kev-flag { display: inline-block; font: 700 .68rem var(--sans); letter-spacing: .04em; background: var(--crit); color: #fff; border-radius: 3px; padding: .05rem .35rem; vertical-align: 1px; }
.ransom { background: #6d28d9; }

/* severity badge */
.sev { display: inline-block; min-width: 3.1rem; text-align: center; font: 700 .72rem/1.6 var(--mono); border-radius: 4px; padding: 0 .35rem; color: #fff; background: var(--none); white-space: nowrap; }
.sev.CRITICAL { background: var(--crit); }
.sev.HIGH { background: var(--high); }
.sev.MEDIUM { background: var(--med); color: #111; }
.sev.LOW { background: var(--low); }

/* kev list */
.kev-list { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: 0; }
.kev-list li { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--line); align-items: baseline; }
.kev-list li:first-child { border-top: 0; }
.kev-date { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.kev-name { min-width: 0; }
.kev-name a { font-family: var(--mono); font-weight: 600; }
.kev-name span { display: block; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.kev-due { font-size: .78rem; color: var(--muted); white-space: nowrap; text-align: right; }

/* feed */
.filters { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin: .9rem 0 .4rem; }
.filters input[type="search"] { flex: 1; min-width: 140px; }
.chips { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.chips button { font: 600 .8rem var(--sans); border: 0; background: transparent; color: var(--text); padding: .4rem .7rem; cursor: pointer; border-left: 1px solid var(--line); }
.chips button:first-child { border-left: 0; }
.chips button[aria-pressed="true"] { background: var(--hazard); color: var(--hazard-ink); }
.toggle { font-size: .875rem; display: inline-flex; gap: .35rem; align-items: center; cursor: pointer; white-space: nowrap; }

.feed { display: grid; }
.row { display: grid; grid-template-columns: 4.2rem 3.4rem 1fr; gap: .75rem; padding: .65rem 0; border-top: 1px solid var(--line); align-items: start; }
.row:first-child { border-top: 0; }
.row.mine { background: linear-gradient(90deg, color-mix(in srgb, var(--hazard) 18%, transparent), transparent 60%); }
.row .when { font: .78rem var(--mono); color: var(--muted); padding-top: .1rem; }
.row .body { min-width: 0; }
.row .id { font-family: var(--mono); font-weight: 600; margin-right: .4rem; }
.row .prod { font-size: .78rem; color: var(--muted); }
.row .desc { margin: .15rem 0 0; font-size: .875rem; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.feed-empty { color: var(--muted); padding: 1rem 0; }
.more { margin-top: .6rem; }

.foot { max-width: 1100px; margin: 0 auto; padding: 0 16px 2.5rem; color: var(--muted); font-size: .8rem; }

@media (max-width: 760px) {
  .tiles { grid-template-columns: 1fr; }
  .kev-list li { grid-template-columns: 1fr; gap: .15rem; }
  .kev-due { text-align: left; }
  .row { grid-template-columns: 3.4rem 1fr; }
  .row .when { grid-column: 1 / -1; padding: 0; }
  .status { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .timer.bump { animation: bump .5s ease-out; }
  @keyframes bump { 0% { transform: scale(1.06); } 100% { transform: scale(1); } }
}
