:root {
  --bg: #020812;
  --cyan: #00d9ff;
  --red: #ff3860;
  --green: #2bff88;
  --amber: #ffb547;
  --txt: #d8f3ff;
  --dim: #6f8ca3;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--cyan); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* background */
canvas#map { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, .75) 100%);
}
.scan {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px);
}

/* centre */
main {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 16px 32px;
  width: 100%;
}
h1 {
  margin: 0 0 6px;
  font-size: clamp(34px, 6vw, 64px);
  letter-spacing: 2px;
  text-shadow: 0 0 24px rgba(0, 217, 255, .55);
  text-align: center;
}
h1 b { color: var(--red); text-shadow: 0 0 24px rgba(255, 56, 96, .6); }
.tag {
  margin: 0 0 34px; color: var(--dim); font-size: 13px; letter-spacing: 3px;
  text-transform: uppercase; text-align: center;
}

form { width: min(680px, 100%); position: relative; }
#q {
  width: 100%;
  padding: 20px 72px 20px 26px;
  font: inherit; font-size: 20px; color: var(--txt);
  background: rgba(3, 14, 28, .82);
  border: 1px solid rgba(0, 217, 255, .55);
  border-radius: 999px;
  outline: none;
  box-shadow: 0 0 30px rgba(0, 217, 255, .25), inset 0 0 20px rgba(0, 217, 255, .08);
  transition: border-color .2s, box-shadow .2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#q::placeholder { color: var(--dim); opacity: 1; }
#q:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 44px rgba(0, 217, 255, .5), inset 0 0 20px rgba(0, 217, 255, .12);
}
#go {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: var(--cyan); color: #001018; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 0 20px var(--cyan);
  transition: box-shadow .2s;
}
#go:hover { box-shadow: 0 0 32px var(--cyan); }
#go:active { transform: translateY(-50%) scale(.9); }
#go:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* scanning (used by the search flow) */
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --ang: 360deg; } }
@keyframes btnpulse { to { box-shadow: 0 0 40px #00d9ff, 0 0 80px #00d9ff; } }
form.scanning #q {
  border-color: transparent;
  background:
    linear-gradient(rgba(3, 14, 28, .92), rgba(3, 14, 28, .92)) padding-box,
    conic-gradient(from var(--ang), #00d9ff, transparent 30%, #ff3860 50%, transparent 70%, #00d9ff) border-box;
  animation: spin .9s linear infinite;
}
form.scanning #go { animation: btnpulse .5s ease-in-out infinite alternate; }

.bar {
  height: 2px; width: min(680px, 100%); margin-top: 6px;
  background: rgba(0, 217, 255, .12); border-radius: 2px; overflow: hidden;
  opacity: 0; transition: opacity .2s;
}
.bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #00d9ff, #ff3860);
  box-shadow: 0 0 10px #00d9ff;
}
form.scanning ~ .bar { opacity: 1; }
@keyframes barwait { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.bar.wait i { width: 40% !important; animation: barwait 1.1s ease-in-out infinite; }

.status-row {
  margin-top: 12px; min-height: 22px; width: min(680px, 100%);
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.status {
  font-size: 13px; color: var(--cyan); letter-spacing: 1px; text-align: center;
  text-shadow: 0 0 8px rgba(0, 217, 255, .6);
  overflow-wrap: anywhere;
}
.status.warn { color: var(--amber); text-shadow: 0 0 8px rgba(255, 181, 71, .55); }
.status.bad { color: var(--red); text-shadow: 0 0 8px rgba(255, 56, 96, .6); }
.status.ok { color: var(--green); text-shadow: 0 0 8px rgba(43, 255, 136, .5); }
.retry {
  font: inherit; font-size: 12px; letter-spacing: 1px;
  color: var(--amber); background: rgba(255, 181, 71, .1);
  border: 1px solid var(--amber); border-radius: 999px;
  padding: 3px 12px; cursor: pointer;
}
.retry:hover { background: rgba(255, 181, 71, .2); }
.retry[hidden] { display: none; }

.help {
  margin: 14px 0 0; color: var(--dim); font-size: 13.5px; text-align: center;
  max-width: 620px; line-height: 1.6;
}
.ex {
  font: inherit; color: var(--txt);
  background: rgba(0, 217, 255, .08); border: 0;
  padding: 1px 6px; border-radius: 4px; cursor: pointer;
}
.ex:hover { background: rgba(0, 217, 255, .2); color: #fff; }
.privacy {
  margin: 10px 0 0; font-size: 12.5px; color: var(--green); letter-spacing: .5px;
  display: inline-flex; align-items: center; gap: 7px; text-align: center;
  text-shadow: 0 0 8px rgba(43, 255, 136, .35);
}
.privacy svg { flex: none; }

.result { margin-top: 26px; width: min(680px, 100%); min-height: 150px; }

/* result cards */
.card {
  border-radius: 14px; padding: 20px 24px;
  background: rgba(3, 14, 28, .88);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: pop .35s ease-out;
  overflow-wrap: anywhere;
  scroll-margin: 52px 12px 12px; /* the top one clears the ES/EN switcher */
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.card.bad { border: 1px solid var(--red); box-shadow: 0 0 40px rgba(255, 56, 96, .35); }
.card.ok { border: 1px solid var(--green); box-shadow: 0 0 40px rgba(43, 255, 136, .25); }
.card.warn { border: 1px solid var(--amber); box-shadow: 0 0 40px rgba(255, 181, 71, .25); }
.verdict {
  font-size: 24px; font-weight: 800; letter-spacing: 2px;
  display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap;
}
.bad .verdict { color: var(--red); }
.ok .verdict { color: var(--green); }
.warn .verdict { color: var(--amber); }
.verdict .ip { color: var(--txt); font-weight: 400; font-size: 16px; letter-spacing: 0; opacity: .85; }
.where { margin-top: 8px; font-size: 14px; color: var(--txt); }
.lead { margin-top: 10px; font-size: 13.5px; color: var(--dim); line-height: 1.6; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); }
.pill.on { border-color: var(--red); color: #ffd0da; background: rgba(255, 56, 96, .12); }
.pill.off { color: var(--dim); text-decoration: line-through; text-decoration-color: rgba(111, 140, 163, .6); }
.pill.info { color: var(--cyan); border-color: rgba(0, 217, 255, .35); }
.src { margin-top: 14px; font-size: 13px; color: var(--dim); line-height: 1.9; }
.src-label { margin-right: 8px; }
.src-item { margin-right: 14px; white-space: nowrap; }
.dim { color: var(--dim); }
.badge {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px;
  font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; line-height: 1.6;
  vertical-align: 1px;
}
.badge.cat-attack { color: #ffb3c2; background: rgba(255, 56, 96, .16); }
.badge.cat-c2 { color: #e2b8ff; background: rgba(186, 104, 255, .2); }
.actions {
  margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  font-size: 13px; color: var(--dim);
}
.act {
  font: inherit; font-size: 12.5px; color: var(--cyan);
  background: rgba(0, 217, 255, .08); border: 1px solid rgba(0, 217, 255, .45);
  border-radius: 999px; padding: 4px 14px; cursor: pointer; min-width: 9em;
}
.act:hover { background: rgba(0, 217, 255, .18); }
.hits { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; line-height: 1.75; }
.hit-cidr { color: var(--txt); }
.hit-rest { color: var(--dim); }
.more { margin-top: 4px; font-size: 13px; color: var(--dim); }
.stale {
  margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255, 181, 71, .3);
  font-size: 12.5px; color: var(--amber);
}

/* impact flash */
.flash {
  position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255, 56, 96, .28), rgba(255, 56, 96, .1) 60%, transparent);
}

/* language toggle */
.lang {
  position: fixed; top: 12px; right: 12px; z-index: 3;
  display: flex; border: 1px solid rgba(0, 217, 255, .35); border-radius: 999px; overflow: hidden;
  background: rgba(3, 14, 28, .7);
}
.lang button {
  font: inherit; font-size: 12px; letter-spacing: 1px;
  background: transparent; color: var(--dim); border: 0; padding: 5px 11px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: rgba(0, 217, 255, .18); color: var(--cyan); }
.lang button:hover { color: var(--txt); }

/* ticker (SOC-style corner) */
.ticker {
  position: fixed; left: 16px; bottom: 64px; z-index: 2;
  width: 360px; max-width: calc(50vw - 40px);
  font-size: 11.5px; color: var(--dim);
  pointer-events: none;
}
.tk-head {
  display: flex; align-items: center; gap: 8px;
  color: var(--cyan); text-transform: uppercase; letter-spacing: 2px; font-size: 10.5px;
}
.tk-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 8px var(--red); animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .25; } }
.tk-note { font-size: 10px; letter-spacing: .5px; margin: 2px 0 6px 15px; opacity: .8; }
#ticker-list {
  list-style: none; margin: 0; padding: 0 0 0 15px;
  border-left: 1px solid rgba(0, 217, 255, .2);
}
#ticker-list li {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.7;
  animation: tkin .45s ease-out;
}
#ticker-list li:nth-child(2) { opacity: .8; }
#ticker-list li:nth-child(3) { opacity: .62; }
#ticker-list li:nth-child(4) { opacity: .46; }
#ticker-list li:nth-child(5) { opacity: .32; }
#ticker-list li:nth-child(6) { opacity: .18; }
#ticker-list li:first-child .tk-ip { color: var(--red); text-shadow: 0 0 8px rgba(255, 56, 96, .6); }
.tk-ip { color: #ff8aa2; }
@keyframes tkin { from { opacity: 0; transform: translateX(-12px); } }

/* sources dialog */
.linkbtn {
  font: inherit; color: var(--cyan); background: none; border: 0; padding: 0; cursor: pointer;
}
.linkbtn:hover { text-decoration: underline; }
dialog.sources {
  padding: 0; border: 1px solid rgba(0, 217, 255, .45); border-radius: 14px;
  width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  background: rgba(3, 14, 28, .97); color: var(--txt);
  box-shadow: 0 0 60px rgba(0, 217, 255, .2);
}
dialog.sources::backdrop { background: rgba(0, 4, 10, .7); }
.dlg-in { padding: 18px 20px 20px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dlg-head h2 { margin: 0; font-size: 17px; letter-spacing: 1.5px; color: var(--cyan); }
.dlg-close {
  font: inherit; font-size: 22px; line-height: 1; width: 34px; height: 34px; flex: none;
  color: var(--txt); background: rgba(0, 217, 255, .08); border: 1px solid rgba(0, 217, 255, .35);
  border-radius: 50%; cursor: pointer;
}
.dlg-close:hover { background: rgba(0, 217, 255, .2); }
.dlg-intro { margin: 8px 0 14px; font-size: 12.5px; color: var(--dim); line-height: 1.6; }
.tbl-wrap { overflow-x: auto; }
.sources table { border-collapse: collapse; width: 100%; font-size: 12.5px; min-width: 640px; }
.sources th, .sources td {
  text-align: left; vertical-align: top; padding: 7px 10px;
  border-bottom: 1px solid rgba(0, 217, 255, .12);
}
.sources th { color: var(--dim); font-weight: 400; letter-spacing: 1px; text-transform: uppercase; font-size: 10.5px; }
.sources td.num { white-space: nowrap; }
.sources td.notice { color: var(--dim); font-size: 11.5px; min-width: 14em; }
.src-name { white-space: nowrap; }
.src-failed { color: var(--amber); }
/* the same data as stacked cards, on narrow screens */
.src-cards { display: none; list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.src-card { padding: 10px 0; border-bottom: 1px solid rgba(0, 217, 255, .12); line-height: 1.55; }
.src-card:first-child { padding-top: 2px; }
.sc-head { font-size: 13.5px; }
.sc-line { margin-top: 4px; overflow-wrap: anywhere; }
.sc-k {
  display: block; color: var(--dim); letter-spacing: 1px; text-transform: uppercase; font-size: 10px;
}
.sc-line.notice { color: var(--dim); font-size: 11.5px; }

/* footer */
.foot {
  position: relative; z-index: 2;
  padding: 10px 16px 14px; text-align: center; font-size: 12px; color: var(--dim);
  line-height: 1.7;
}
#foot-counts { color: var(--txt); }
/* separators never start a line: app.js marks an item that starts one with .ls */
.fl { white-space: nowrap; }
.foot-counts .fl + .fl::before { content: '· '; }
.foot-links .fl + .fl::before { content: '·'; margin: 0 6px; }
.fl-list > .fl.ls::before { content: none; }
.fl-list > .fl.ls-keep::before { visibility: hidden; }

@media (max-width: 699.98px) {
  .ticker { display: none; }
  .lang { position: absolute; } /* scrolls away with the page instead of over the title */
  main { padding-top: 64px; }
  .tag { margin-bottom: 26px; letter-spacing: 2px; font-size: 12px; }
  #q { font-size: 16px; padding: 16px 62px 16px 20px; }
  #go { width: 44px; height: 44px; right: 7px; }
  .result { min-height: 60px; }
  .card { padding: 16px 16px; }
  .verdict { font-size: 20px; }
  .dlg-in { padding: 14px 14px 16px; }
  .status { text-wrap: balance; }
  body.searched .help { display: none; }
  .tbl-wrap { display: none; }
  .src-cards { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker { display: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
