/* Macsta Threat Intelligence - shared theme.
   One file for all three sections (daily feed, blog, weekly reports) so the
   palette lives in one place. Matches macsta.co.uk and the Publisher rather
   than inventing a third scheme; the old charcoal grey was the odd one out.

   Readability is a hard constraint here, not a nice-to-have: this site is read
   long-form. Every colour pair below clears WCAG AA for body text (measured,
   lowest pair is accent-on-panel at 5.6:1), body text is deliberately NOT pure
   white (halation on dark backgrounds), measure is capped near 70 characters,
   and article line-height is 1.75. */

:root {
  --bg:      #080b12;   /* page */
  --panel:   #0f141f;   /* cards, article surface */
  --panel-2: #0a0e17;   /* inset: code, inputs */
  --line:    #1e2838;
  --text:    #e8ecf3;   /* headings, UI */
  --body:    #dbe3ee;   /* long-form body - softened on purpose */
  --muted:   #93a0b5;
  --accent:  #4a8fe7;
  --accent-dim: #1b3f94;
  --ok:      #3fb950;
  --warn:    #d29922;
  --bad:     #f85149;
  color-scheme: dark;
  accent-color: #4a8fe7;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Ubuntu, Helvetica, Arial, sans-serif;
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }

/* ---------------------------------------------------------------------------
   Banner. Same construction idea as the YouTube channel art: decoration lives
   at the edges and is allowed to crop, the brand block sits in a centred safe
   area that is never cut. Built from CSS + the real logo + real text rather
   than a flat image, so it stays crisp at any width and the title is
   selectable, translatable and readable by a screen reader.
--------------------------------------------------------------------------- */
.banner {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 140% at 50% -20%, #14243f 0%, #0b1220 45%, transparent 72%),
    linear-gradient(180deg, #0d1729 0%, #0a1120 55%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.banner::before,
.banner::after {   /* katakana rain, edges only - the crop zone */
  content: ""; position: absolute; top: 0; bottom: 0; width: 32%;
  background-image: url("/assets/rain.svg");
  background-size: auto 100%; background-repeat: repeat-x;
  opacity: .5; pointer-events: none;
}
.banner::before { left: 0; }
.banner::after  { right: 0; transform: scaleX(-1); }

.banner-inner {                    /* the safe area */
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto; padding: 1.35rem 1.5rem 1rem;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.banner img { height: 42px; width: auto; display: block; }
.banner h1 {
  margin: .6rem 0 .25rem; font-size: 1.62rem; line-height: 1.15;
  letter-spacing: .01em; font-weight: 700; color: var(--text);
}
.banner h1 .thin { font-weight: 300; color: var(--muted); }
.banner .strap {
  margin: 0; color: var(--muted); font-size: .84rem;
  letter-spacing: .14em; text-transform: uppercase;
}
/* "(mostly)" is a deliberate admission, not decoration: it links to the accuracy
   statement, because the daily feed is published with no human review at all. */
.banner .strap a {
  color: var(--muted); text-decoration: none;
  border-bottom: 1px dotted var(--muted); padding-bottom: 1px;
}
.banner .strap a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Tabs: the site's real navigation. */
.tabs {
  position: relative; z-index: 1;
  display: flex; gap: .3rem; justify-content: center; flex-wrap: wrap;
  padding: 0 1rem 0; margin-top: .8rem;
}
.tabs a {
  color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 550;
  padding: .55rem .95rem; border-radius: 8px 8px 0 0;
  border: 1px solid transparent; border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--text); background: rgba(74,143,231,.08); }
.tabs a[aria-current] {
  color: var(--text); background: var(--panel);
  border-color: var(--line); border-bottom-color: var(--accent);
}

/* Search sits under the tabs so it never competes with the brand block. */
.banner form { position: relative; z-index: 1; margin: .7rem 0 0; }
.banner input[type=search] {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: .5rem .75rem; border-radius: 8px; min-width: 260px; font-size: .92rem;
}
.banner input[type=search]:focus { outline: none; border-color: var(--accent); }

/* ---------------------------------------------------------------------------
   Layout and long-form typography
--------------------------------------------------------------------------- */
.wrap { padding: 1.5rem; max-width: 880px; margin: 0 auto; }

main, article {
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  padding: 1.7rem 1.9rem;
}
main, article, .item .t { overflow-wrap: anywhere; word-break: break-word; }
main p, article p, main li, article li {
  color: var(--body); line-height: 1.75; max-width: 68ch;
}
main h1, article h1 { font-size: 1.55rem; line-height: 1.28; margin-top: 0; }
main h2, article h2 {
  font-size: 1.16rem; margin-top: 1.9rem; padding-bottom: .35rem;
  border-bottom: 1px solid var(--line);
}
main h3, article h3 { font-size: 1.02rem; margin-top: 1.4rem; }
main a, article a { color: var(--accent); }
main ol, main ul, article ol, article ul { padding-left: 1.45rem; }
main li, article li { margin: .35rem 0; }
main code, article code {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px;
  padding: .1em .35em; font-size: .87em; color: #9ec5ff;
}
main hr, article hr { border: 0; border-top: 1px solid var(--line); margin: 1.3rem 0; }

/* Toolbar (daily feed): older / date / newer / latest, times folded in right. */
.toolbar {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  padding: .5rem .6rem; margin-bottom: 1.1rem;
}
.stepper { display: flex; align-items: center; gap: .35rem; }
.stepper form { display: flex; margin: 0; }
.stepper a, .stepper span.off {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 6px; color: var(--text);
  text-decoration: none; font-size: 1.05rem; line-height: 1;
}
.stepper a:hover { background: var(--panel-2); color: var(--accent); }
.stepper span.off { opacity: .28; }
.stepper input[type=date] {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: .35rem .5rem; border-radius: 6px; font: inherit; font-size: .86rem;
}
.times { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin-left: auto; }
.times .lbl { color: var(--muted); font-size: .76rem; margin-right: .15rem; }
.times a, .times span.cur {
  font-size: .76rem; padding: .22rem .5rem; border-radius: 999px; text-decoration: none;
  color: var(--muted); border: 1px solid transparent; font-variant-numeric: tabular-nums;
}
.times a:hover { color: var(--text); border-color: var(--line); }
.times span.cur { color: var(--text); border-color: var(--accent); background: var(--panel-2); }
.latest {
  font-size: .82rem; color: var(--accent); text-decoration: none;
  padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 6px;
}
.latest:hover { border-color: var(--accent); background: var(--panel-2); }

/* List items (search results, blog index, weekly index) */
.item {
  display: block; padding: 1rem 1.1rem; border: 1px solid var(--line);
  border-radius: 9px; margin-bottom: .7rem; text-decoration: none;
  color: var(--text); background: var(--panel);
}
.item:hover { border-color: var(--accent); }
.item .t { font-weight: 650; font-size: 1.02rem; display: block; margin-bottom: .3rem; }
.item .m { color: var(--muted); font-size: .78rem; display: flex; gap: .5rem;
           align-items: center; flex-wrap: wrap; }
.item .p { color: var(--muted); font-size: .89rem; margin: .35rem 0 0; line-height: 1.6; }

.note { color: var(--muted); font-size: .84rem; margin: 0 0 1rem; }
.empty { color: var(--muted); padding: 2.4rem; text-align: center; }
.byline { color: var(--muted); font-size: .83rem; }

/* Severity + exploit/KEV marks */
.badge { font-size: .68rem; font-weight: 700; padding: .12rem .4rem; border-radius: 4px;
         letter-spacing: .03em; }
.sev-crit { background:#4a1418; color:#ff9b9b; } .sev-high { background:#4a2f14; color:#ffc08a; }
.sev-med  { background:#4a4414; color:#ffe98a; } .sev-low  { background:#14361c; color:#8fffab; }
.sev-info { background:#182131; color:#9fb0c7; }
.xb { display:inline-block; font-size:.62rem; font-weight:700; padding:.08rem .32rem;
      border-radius:4px; margin-left:.28rem; vertical-align:.12em; letter-spacing:.03em;
      text-transform:uppercase; }
.xb-exp { background:#4a1418; color:#ff9b9b; border:1px solid #7a2a2a; }
.xb-kev { background:#33194f; color:#d9a6ff; border:1px solid #5d3a73; }
.cvechips { display:flex; gap:.45rem; margin:0 0 1rem; flex-wrap:wrap; align-items:center; }
.cvechips .lbl { color:var(--muted); font-size:.78rem; }
.cvechips a, .cvechips span.cc {
  font-size:.78rem; padding:.22rem .6rem; border-radius:999px; text-decoration:none;
  font-family:ui-monospace,Consolas,monospace; border:1px solid #7a2a2a;
  background:#2a1418; color:#ffb0b0; }
.cvechips a:hover { border-color:#ff8585; }
.cvechips span.cc { border-color:#5d3a73; background:#1e1430; color:#d9a6ff; }
section.exploits { margin-top:1.5rem; }
section.exploits h2 { font-size:1.05rem; margin:0 0 .7rem; color:var(--text);
                      border-bottom:1px solid var(--line); padding-bottom:.35rem; }
section.exploits .cve { font-family:ui-monospace,Consolas,monospace; font-size:.72rem;
  color:#ffb0b0; background:#2a1418; border:1px solid #7a2a2a; border-radius:4px;
  padding:.05rem .35rem; }

footer { color: var(--muted); font-size: .77rem; text-align: center;
         padding: 1.4rem 1rem 2rem; border-top: 1px solid var(--line); margin-top: 2rem; }
footer a { color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------------------
   Mobile. The banner crops toward its centre exactly like the channel art:
   the rain columns narrow and fade, the brand block and tabs stay put.
--------------------------------------------------------------------------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .banner::before, .banner::after { width: 18%; opacity: .32; }
  .banner-inner { padding: 1.5rem 1rem 1.1rem; }
  .banner img { height: 40px; }
  .banner h1 { font-size: 1.4rem; }
  .banner .strap { font-size: .72rem; letter-spacing: .1em; }
  .banner input[type=search] { min-width: 0; width: 100%; }
  .banner form { width: 100%; padding: 0 1rem; }
  .tabs { gap: .15rem; margin-top: .9rem; }
  .tabs a { padding: .68rem .62rem; font-size: .84rem; }  /* >=44px tap target */
  .wrap { padding: 1rem; }
  main, article { padding: 1.15rem 1.2rem; }
  main h1, article h1 { font-size: 1.28rem; }
  main p, article p, main li, article li { line-height: 1.7; }
  .toolbar { gap: .6rem; }
  .stepper { flex: 1 1 100%; }
  .stepper form { flex: 1 1 auto; }
  .stepper input[type=date] { width: 100%; }
  .times { margin-left: 0; flex: 1 1 100%; }
}
@media (max-width: 420px) {
  .banner::before, .banner::after { display: none; }   /* full crop, brand only */
}
