/* ============================================================
   The Hunter's Ledger — Design System
   ============================================================ */

/* --- Tokens ------------------------------------------------- */
:root {
  --hl-bg-page:        #111111;
  --hl-bg-card:        #1a1a1a;
  --hl-bg-row:         #161616;
  --hl-border-card:    #2a2a2a;
  --hl-border-row:     #222222;
  --hl-text-primary:   #eeeeee;
  --hl-text-secondary: #aaaaaa;
  --hl-text-muted:     #888888;
  --hl-text-dim:       #555555;
  --hl-accent-blue:    #58a6ff;
  --hl-sev-high:       #ff4444;
  --hl-sev-high-lbl:   #ff6666;
  --hl-sev-med:        #f97316;
  --hl-sev-med-lbl:    #fb923c;
  --hl-accent-green:   #4ade80;
  --hl-accent-red:     #f87171;
}

/* --- Global theme overrides --------------------------------- */
/* Theme sets body { font-size: 1.25em } = 20px — let it cascade.
   We only override background, color, and heading colors. */
body,
body.dark {
  background-color: var(--hl-bg-page) !important;
  color: var(--hl-text-primary) !important;
}

/* Subtle edge glow — faint blue gradient from both sides */
body::before,
body::after {
  content: '';
  position: fixed;
  top: 0;
  bottom: 0;
  width: 125px;
  pointer-events: none;
  z-index: 0;
}
body::before {
  left: 0;
  background: linear-gradient(to right, rgba(88,166,255,0.02), transparent);
}
body::after {
  right: 0;
  background: linear-gradient(to left, rgba(88,166,255,0.02), transparent);
}

/* Theme dark mode sets wild heading colors (h2: purple, h3: pink).
   Override globally for our design system. */
h1, h2, h3, h4, h5, h6 {
  color: var(--hl-text-primary) !important;
}

/* Bold text uses blue accent across the whole site */
strong, b {
  color: var(--hl-accent-blue);
  font-weight: 600;
}

main.content {
  background-color: var(--hl-bg-page) !important;
  background-image: none !important;
  color: var(--hl-text-primary);
  min-height: 100vh;
  max-width: 900px !important;
  margin: 0 auto !important;
  padding: 0 28px 36px !important;
  box-sizing: border-box;
  /* Bump all em-based sizes ~10% (theme body = 20px → effective 22px here) */
  font-size: 1.1em;
}

/* Top gap between navbar and first content element.
   Using padding-top on .hl-page (not main.content) so it appears
   AFTER the navbar's normal-flow position, not behind it. */
.hl-page {
  padding-top: 3rem;
}

/* Theme's prev/next post navigation — restyle to match dark theme */
#post-nav {
  background: var(--hl-bg-page) !important;
  border-top: 1px solid var(--hl-border-row) !important;
  padding: 20px 0 !important;
  margin-top: 2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

#post-nav a,
#post-nav a:visited {
  color: var(--hl-accent-blue) !important;
  font-size: 0.85em !important;
}

#post-nav p,
#post-nav .meta {
  color: var(--hl-text-dim) !important;
  font-size: 0.72em !important;
}

/* Keep old theme header hidden — replaced by .hl-nav */
.site-header {
  display: none !important;
}

/* --- Navigation bar (replaces theme .site-header) ----------- */
/* Uses rem/px so it's unaffected by the theme's nav ul { font-size: 0 } */
.hl-nav {
  background: #0d1117;
  border-bottom: 1px solid var(--hl-border-card);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 96px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-sizing: border-box;
  width: 100%;
}

/* Text brand link */
.hl-nav__brand,
.hl-nav__brand:visited {
  color: var(--hl-text-primary) !important;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none !important;
  flex-shrink: 0;
  white-space: nowrap;
  transition: color 0.15s;
}

.hl-nav__brand:hover {
  color: #ffffff !important;
  text-decoration: none !important;
}

.hl-nav__links {
  display: flex;
  align-items: center;
  gap: 40px;
}

.hl-nav__link,
.hl-nav__link:visited {
  color: var(--hl-text-muted) !important;
  font-size: 1.2rem;
  font-weight: 500;
  text-decoration: none !important;
  white-space: nowrap;
  transition: color 0.15s;
  letter-spacing: 0.02em;
}

.hl-nav__link:hover {
  color: var(--hl-text-primary) !important;
  text-decoration: none !important;
}

@media (max-width: 700px) {
  .hl-nav {
    height: auto;
    padding: 14px 20px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .hl-nav__brand {
    font-size: 1.1rem;
  }
  .hl-nav__links {
    width: 100%;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 6px;
  }
}


/* --- Masthead banner (home page) --------------------------- */
.hl-masthead {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

/* ============================================================
   POST LAYOUT — Individual report and detection pages
   ============================================================ */

/* --- Post header card --------------------------------------- */
.hl-post-header {
  background: linear-gradient(135deg, #1a0808 0%, #0d1117 60%, #111111 100%);
  border: 1px solid var(--hl-border-card);
  border-left: 4px solid var(--hl-sev-high);
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 2.5rem;
}

.hl-post-header__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

/* "Threat Intelligence" / "Detection Rules" pill badge */
.hl-post-header__badge {
  font-size: 0.62em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid;
}

.hl-post-header__badge--report {
  color: var(--hl-sev-high-lbl);
  background: #ff444415;
  border-color: #ff444440;
}

.hl-post-header__badge--detect {
  color: var(--hl-accent-green);
  background: #4ade8015;
  border-color: #4ade8040;
}

.hl-post-header__sep {
  color: var(--hl-text-dim);
  font-size: 0.65em;
  user-select: none;
}

.hl-post-header__date {
  font-size: 0.65em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999999;
}

.hl-post-header__title {
  color: var(--hl-text-primary) !important;
  font-size: 1.5em !important;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
}

/* Detection pages get a green header accent instead of red */
.hl-post-header--detect {
  background: linear-gradient(135deg, #0a1a0e 0%, #0d1117 60%, #111111 100%);
  border-left-color: var(--hl-accent-green);
}


/* --- Post body ---------------------------------------------- */
.hl-post-content {
  color: var(--hl-text-primary);
  line-height: 1.75;
}

.hl-post-content > p:first-child {
  color: var(--hl-text-primary);
  font-size: 1.05em;
}

.hl-post-content p {
  color: var(--hl-text-primary);
  margin-bottom: 0.9em;
}

.hl-post-content strong {
  color: var(--hl-accent-blue);
  font-weight: 600;
}

.hl-post-content a {
  color: var(--hl-accent-blue) !important;
  text-decoration: none;
}
.hl-post-content a:hover {
  text-decoration: underline;
}

.hl-post-content ul,
.hl-post-content ol {
  padding-left: 1.4em;
  color: var(--hl-text-primary);
}

.hl-post-content li {
  margin-bottom: 0.3em;
}

/* --- Headings inside posts ---------------------------------- */
/* Override theme's huge heading sizes (h2=1.75em, h3=1.5em off 20px body) */

/* Primary section headings (# H1) — slightly more prominent than H2 */
.hl-post-content h1 {
  color: var(--hl-text-primary) !important;
  font-size: 1.2em !important;
  font-weight: 700 !important;
  margin-top: 3rem !important;
  margin-bottom: 0.7rem !important;
  padding: 10px 14px !important;
  background: linear-gradient(to right, #ff444418, transparent) !important;
  border-left: 4px solid var(--hl-sev-high) !important;
  border-bottom: none !important;
  border-radius: 0 4px 4px 0;
}

.hl-post-content h2 {
  color: var(--hl-text-primary) !important;
  font-size: 1.15em !important;
  font-weight: 700 !important;
  margin-top: 2.5rem !important;
  margin-bottom: 0.6rem !important;
  padding: 8px 14px !important;
  background: linear-gradient(to right, #ff444412, transparent) !important;
  border-left: 3px solid var(--hl-sev-high) !important;
  border-bottom: none !important;
  border-radius: 0 4px 4px 0;
}

.hl-post-content h3 {
  color: var(--hl-text-primary) !important;
  font-size: 1.0em !important;
  font-weight: 600 !important;
  margin-top: 1.75rem !important;
  margin-bottom: 0.4rem !important;
  padding-left: 10px !important;
  border-left: 2px solid var(--hl-accent-blue) !important;
  border-bottom: none !important;
}

.hl-post-content h4 {
  color: var(--hl-text-secondary) !important;
  font-size: 0.95em !important;
  font-weight: 600 !important;
  margin-top: 1.25rem !important;
  margin-bottom: 0.3rem !important;
  padding-left: 8px !important;
  border-left: 2px solid var(--hl-border-card) !important;
  border-bottom: none !important;
}

/* --- Code & pre -------------------------------------------- */
.hl-post-content code {
  background: #1f1f1f;
  border: 1px solid var(--hl-border-card);
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 0.88em;
  color: #e6b17a !important;
}

.hl-post-content pre {
  background: #151515;
  border: 1px solid #333333;
  border-left: 3px solid #333333;
  border-radius: 5px;
  padding: 14px 18px;
  overflow-x: auto;
  margin: 1.25rem 0;
}

.hl-post-content pre code {
  background: none !important;
  border: none !important;
  padding: 0;
  color: #e6b17a !important;
  font-size: 0.88em;
}

/* --- Tables ------------------------------------------------- */
.hl-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9em;
}

.hl-post-content th {
  background: linear-gradient(to bottom, #1d2535, #171d29) !important;
  color: var(--hl-accent-blue) !important;
  font-size: 0.75em !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em;
  padding: 9px 14px !important;
  border: 1px solid #1f3a5a !important;
  text-align: left;
  font-weight: 700;
}

.hl-post-content td {
  padding: 8px 14px !important;
  border: 1px solid #2a2a2a !important;
  color: #cccccc !important;
  background: #161616 !important;
}

.hl-post-content tr:nth-child(even) td {
  background: #1a1a1a !important;
}

.hl-post-content tr:hover td {
  background: #1e1e1e !important;
  color: var(--hl-text-primary) !important;
}

/* --- Blockquotes -------------------------------------------- */
/* Standard blockquotes: blue accent (callouts, quoted text) */
.hl-post-content blockquote {
  border-left: 3px solid var(--hl-accent-blue) !important;
  background: #0d1520 !important;
  border-radius: 0 4px 4px 0;
  margin: 1.5rem 0 !important;
  padding: 12px 18px !important;
  color: var(--hl-text-secondary) !important;
}

.hl-post-content blockquote p {
  color: var(--hl-text-secondary) !important;
  margin: 0 0 0.4em;
}

.hl-post-content blockquote p:last-child {
  margin: 0;
}

.hl-post-content blockquote strong {
  color: var(--hl-text-primary) !important;
}

/* --- Horizontal rules --------------------------------------- */
.hl-post-content hr {
  border: none !important;
  height: 1px;
  background: linear-gradient(to right, var(--hl-sev-high), #333333 40%, transparent) !important;
  margin: 2.5rem 0 !important;
}

/* --- Figures / images --------------------------------------- */
.hl-post-content figure {
  margin: 2rem 0;
  text-align: center;
}

.hl-post-content figure img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

.hl-post-content figcaption {
  color: var(--hl-text-secondary);
  font-size: 0.82em;
  font-style: italic;
  margin-top: 10px;
  line-height: 1.55;
  text-align: center;
}

.hl-post-content figcaption code {
  font-style: normal;
}


/* ============================================================
   INDEX PAGE COMPONENTS
   ============================================================ */

/* --- Featured card grid ------------------------------------- */
.hl-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 14px;
  margin-bottom: 2rem;
}

.hl-card {
  background: var(--hl-bg-card) !important;
  border: 1px solid var(--hl-border-card);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none !important;
  display: block !important;
  color: var(--hl-text-primary) !important;
  min-height: 80px;
  transition: border-color 0.15s, background 0.15s;
}
.hl-card:hover {
  border-color: #444 !important;
  background: #1e1e1e !important;
  text-decoration: none !important;
}

.hl-card__inner {
  padding: 14px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.hl-card__bar {
  width: 3px;
  min-height: 20px;
  border-radius: 2px;
  flex-shrink: 0;
  align-self: stretch;
}

.hl-card__meta {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.hl-card__title {
  color: var(--hl-text-primary) !important;
  font-size: 0.95em !important;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 9px;
}

/* --- Compact row list --------------------------------------- */
.hl-row-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 2rem;
}

.hl-row {
  background: var(--hl-bg-row);
  border: 1px solid var(--hl-border-row);
  border-radius: 4px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  text-decoration: none !important;
  color: var(--hl-text-primary) !important;
  transition: border-color 0.15s, background 0.15s;
}
.hl-row:hover {
  border-color: #333 !important;
  background: #1a1a1a !important;
  text-decoration: none !important;
}

.hl-row__bar {
  width: 2px;
  flex-shrink: 0;
}

.hl-row__body {
  padding: 9px 12px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hl-row__left { flex: 1; }

.hl-row__title {
  color: var(--hl-text-primary) !important;
  font-size: 0.9em !important;
  font-weight: 500;
  margin: 0;
}

.hl-row__date {
  color: var(--hl-text-dim);
  font-size: 0.72em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* --- Tag badges -------------------------------------------- */
.hl-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.hl-card__tags {
  padding: 0 14px 10px;
  margin-top: 0;
}

.hl-tag {
  font-size: 0.68em;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid;
  white-space: nowrap;
}

.hl-tag--blue   { background: #1f6feb33; color: #58a6ff; border-color: #1f6feb55; }
.hl-tag--red    { background: #b91c1c33; color: #f87171; border-color: #b91c1c55; }
.hl-tag--green  { background: #16653433; color: #4ade80; border-color: #16653455; }
.hl-tag--purple { background: #7c3aed33; color: #c084fc; border-color: #7c3aed55; }
.hl-tag--yellow { background: #3a3a1a;   color: #facc15; border-color: #aaaa2255; }

/* --- Severity bar colors ----------------------------------- */
.hl-sev--high { background: var(--hl-sev-high); }
.hl-sev--med  { background: var(--hl-sev-med); }
.hl-sev--info { background: #333333; }

/* --- Section header ---------------------------------------- */
.hl-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--hl-text-primary);
  border-bottom: 1px solid var(--hl-border-row);
  padding-bottom: 7px;
  margin: 2rem 0 14px;
}

.hl-section-header__bar {
  width: 2px;
  height: 13px;
  border-radius: 1px;
  flex-shrink: 0;
}

/* --- Page header card -------------------------------------- */
.hl-page-header {
  background: linear-gradient(135deg, var(--hl-bg-card), #0d1117);
  border: 1px solid var(--hl-border-card);
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 2rem;
}

.hl-page-header__label {
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
}

.hl-page-header__title {
  color: var(--hl-text-primary) !important;
  font-size: 1.5em !important;
  font-weight: 700;
  margin: 0 0 7px;
}

.hl-page-header__desc {
  color: var(--hl-text-primary);
  font-size: 0.9em;
  line-height: 1.55;
  margin: 0;
}

/* --- Prose section card ------------------------------------ */
.hl-prose-section {
  background: var(--hl-bg-row);
  border: 1px solid var(--hl-border-row);
  border-radius: 5px;
  padding: 14px 18px;
  margin-bottom: 10px;
}

.hl-prose-section__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #bbbbbb;
  margin-bottom: 9px;
  font-weight: 600;
}

.hl-prose-section__bar {
  width: 2px;
  height: 12px;
  border-radius: 1px;
}

.hl-prose-section__body {
  color: var(--hl-text-primary);
  font-size: 0.9em;
  line-height: 1.65;
  margin: 0;
}

.hl-prose-section__body a {
  color: var(--hl-accent-blue);
}

.hl-contact-heading {
  font-size: 1.0em;
  font-weight: 600;
  color: var(--hl-text-primary);
  margin-bottom: 10px;
}

/* --- Nav tile grid ----------------------------------------- */
.hl-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 2rem;
}

.hl-nav-tile {
  background: var(--hl-bg-row);
  border: 1px solid var(--hl-border-row);
  border-radius: 5px;
  padding: 12px 14px;
  text-decoration: none !important;
  display: block;
  transition: border-color 0.15s;
}
.hl-nav-tile:hover { border-color: #333 !important; text-decoration: none !important; }

.hl-nav-tile__title {
  color: var(--hl-accent-blue) !important;
  font-size: 0.9em !important;
  font-weight: 600;
  margin: 0 0 4px;
}

.hl-nav-tile__desc {
  color: var(--hl-text-muted);
  font-size: 0.78em;
  margin: 0;
}

/* --- Note / callout box ------------------------------------ */
.hl-note {
  background: #1a1a0d;
  border: 1px solid #4a4a1a;
  border-left: 3px solid #facc15;
  border-radius: 5px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.hl-note__label {
  color: #facc15;
  font-size: 0.68em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 5px;
}

.hl-note__body {
  color: var(--hl-text-primary);
  font-size: 0.9em;
  line-height: 1.6;
  margin: 0;
}

/* --- Logo / hero area -------------------------------------- */
.hl-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  background: linear-gradient(135deg, var(--hl-bg-card), #0d1117);
  border: 1px solid var(--hl-border-card);
  border-left: 3px solid var(--hl-sev-high);
  border-radius: 6px;
  padding: 28px 32px;
  margin-bottom: 2rem;
}

.hl-hero__logo {
  width: 280px;
  height: 100px;
  flex-shrink: 0;
  mix-blend-mode: screen;
  background-size: 160%;
  background-position: center center;
  background-repeat: no-repeat;
}

.hl-hero__label {
  font-size: 0.68em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--hl-sev-high-lbl);
  margin-bottom: 5px;
}

.hl-hero__title {
  color: var(--hl-text-primary) !important;
  font-size: 1.5em !important;
  font-weight: 700;
  margin: 0 0 7px;
}

.hl-hero__desc {
  color: var(--hl-text-primary);
  font-size: 0.9em;
  line-height: 1.55;
  margin: 0;
}

/* --- "View all" link --------------------------------------- */
.hl-view-all {
  display: block;
  text-align: right;
  color: var(--hl-accent-blue) !important;
  font-size: 0.9em;
  margin-bottom: 2rem;
  text-decoration: none !important;
}
.hl-view-all:hover { text-decoration: underline !important; }

/* --- Subscribe option cards -------------------------------- */
.hl-subscribe-option {
  background: var(--hl-bg-card);
  border: 1px solid var(--hl-border-card);
  border-radius: 6px;
  padding: 22px 24px;
  margin-bottom: 14px;
}

.hl-subscribe-option--rss {
  border-left: 4px solid #4ade80;
}

.hl-subscribe-option--email {
  border-left: 4px solid var(--hl-accent-blue);
}

.hl-subscribe-option__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.hl-subscribe-option__icon {
  font-size: 1.4em;
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
}

.hl-subscribe-option--rss .hl-subscribe-option__icon { color: #4ade80; }
.hl-subscribe-option--email .hl-subscribe-option__icon { color: var(--hl-accent-blue); }

.hl-subscribe-option__title {
  color: var(--hl-text-primary);
  font-size: 1.05em;
  font-weight: 600;
  margin-bottom: 5px;
}

.hl-subscribe-option__desc {
  color: var(--hl-text-secondary);
  font-size: 0.9em;
  line-height: 1.6;
}

.hl-subscribe-option__url {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0d1117;
  border: 1px solid #333333;
  border-radius: 4px;
  padding: 10px 14px;
}

.hl-subscribe-option__url-label {
  color: #4ade80;
  font-size: 0.7em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  flex-shrink: 0;
}

.hl-subscribe-option__url-value {
  color: #e6b17a !important;
  font-size: 0.88em;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  word-break: break-all;
}

.hl-subscribe-option__form {
  margin-top: 4px;
}

/* --- Post page layout -------------------------------------- */
/* No grid — TOC floats in the page margin via fixed positioning */
.hl-post-body {
  display: block;
}

/* --- Sticky TOC sidebar ------------------------------------ */
/* Positioned in the right margin outside the content column.
   calc: 50vw = center of viewport, +422px = right edge of content
   inner area (900px max - 56px padding = 844px / 2 = 422px), +24px gap */
.hl-post-toc {
  position: fixed;
  left: calc(75vw + 135px);
  top: 116px;
  width: 180px;
  background: var(--hl-bg-row);
  border: 1px solid var(--hl-border-row);
  border-radius: 6px;
  padding: 14px 4px;
  font-size: 0.78em;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.2s;
}
.hl-post-toc:hover {
  scrollbar-color: rgba(88,166,255,0.2) transparent;
}
.hl-post-toc::-webkit-scrollbar {
  width: 3px;
}
.hl-post-toc::-webkit-scrollbar-track {
  background: transparent;
}
.hl-post-toc::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background 0.2s;
}
.hl-post-toc:hover::-webkit-scrollbar-thumb {
  background: rgba(88,166,255,0.2);
}

.hl-post-toc__heading {
  font-size: 1em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--hl-accent-blue);
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--hl-border-row);
}

.hl-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hl-toc__item {
  position: relative;
}

.hl-toc__item a {
  color: var(--hl-text-primary);
  text-decoration: none;
  display: block;
  padding: 4px 26px 4px 8px;
  border-radius: 4px;
  border-left: 2px solid transparent;
  line-height: 1.4;
  word-break: break-word;
  transition: color 0.1s, background 0.1s, border-color 0.1s;
}

.hl-toc__item a:hover {
  color: var(--hl-accent-blue);
  background: rgba(88,166,255,0.06);
  border-left-color: var(--hl-border-card);
}

.hl-toc__item a.hl-toc__active {
  color: var(--hl-accent-blue);
  background: rgba(88,166,255,0.08);
  border-left-color: var(--hl-accent-blue);
  font-weight: 600;
}

.hl-toc__item--h3 a {
  padding-left: 18px;
  font-size: 0.92em;
  color: var(--hl-text-dim);
}

.hl-toc__item--h3 a:hover {
  color: var(--hl-text-secondary);
}

.hl-toc__copy-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  background: none;
  border: none;
  color: var(--hl-accent-blue);
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 3px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: opacity 0.15s, background 0.15s;
}
.hl-toc__item:hover .hl-toc__copy-btn { opacity: 0.45; }
.hl-toc__copy-btn:hover                { opacity: 1 !important; background: rgba(88,166,255,0.1); }

/* --- Responsive -------------------------------------------- */
/* Hide TOC when viewport is too narrow to show it in the margin */
@media (max-width: 1280px) {
  .hl-post-toc {
    display: none;
  }
}

@media (max-width: 640px) {
  .hl-grid,
  .hl-nav-grid {
    grid-template-columns: 1fr !important;
  }
  .hl-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  main.content {
    padding: 24px 16px !important;
  }
}

/* --- Smooth scroll ------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* --- Reading progress bar (vertical, left margin) ----------- */
.hl-progress-track {
  position: fixed;
  left: 17px; top: 96px;
  width: 4px; height: calc(100vh - 96px);
  background: rgba(88,166,255,0.08);
  border-radius: 2px;
  z-index: 499;
  pointer-events: none;
}
.hl-progress-bar {
  position: fixed;
  left: 17px; top: 96px;
  width: 4px; height: 0px;
  background: var(--hl-accent-blue);
  box-shadow: 0 0 6px rgba(88,166,255,0.5);
  border-radius: 2px;
  z-index: 500;
  pointer-events: none;
  transition: height 0.08s linear;
}
@media (max-width: 900px) {
  .hl-progress-track, .hl-progress-bar { display: none; }
}

/* --- Read time in post eyebrow ------------------------------ */
.hl-read-time {
  color: var(--hl-text-dim);
  font-size: 0.85em;
}
.hl-read-time::before {
  content: '·';
  margin: 0 0.45em;
  color: var(--hl-text-dim);
}

/* --- Copy button on code blocks ----------------------------- */
.hl-post-content pre { position: relative; }
.hl-copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  padding: 3px 9px;
  font-size: 0.72em;
  font-family: inherit;
  background: rgba(88,166,255,0.08);
  color: var(--hl-accent-blue);
  border: 1px solid rgba(88,166,255,0.25);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  line-height: 1.6;
}
.hl-post-content pre:hover .hl-copy-btn,
.hl-copy-btn:focus { opacity: 1; }
.hl-copy-btn:hover  { background: rgba(88,166,255,0.18); }

/* --- Permalink anchors on headings -------------------------- */
.hl-heading-anchor {
  position: relative;
  margin-left: 0.45em;
  color: var(--hl-accent-blue);
  opacity: 0;
  font-size: 0.68em;
  font-weight: 400;
  text-decoration: none;
  transition: opacity 0.15s;
  vertical-align: middle;
  user-select: none;
  display: inline-flex;
  align-items: center;
}
.hl-heading-anchor::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(15,17,21,0.96);
  color: var(--hl-text-primary);
  font-size: 12px;
  font-weight: 400;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--hl-border-card);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
}
.hl-heading-anchor:hover::after                { opacity: 1; }
.hl-post-content h1:hover .hl-heading-anchor,
.hl-post-content h2:hover .hl-heading-anchor   { opacity: 0.55; }
.hl-heading-anchor:hover                       { opacity: 1 !important; }

/* --- First-visit section tip toast -------------------------- */
.hl-toast {
  position: fixed;
  bottom: 28px;
  left: 28px;
  transform: translateY(20px);
  width: 300px;
  background: var(--hl-bg-row);
  color: var(--hl-text-primary);
  border: 1px solid rgba(88,166,255,0.35);
  border-bottom: 3px solid var(--hl-accent-blue);
  border-radius: 8px 8px 0 0;
  padding: 14px 42px 14px 18px;
  font-size: 0.86em;
  line-height: 1.6;
  box-shadow:
    0 -4px 28px rgba(0,0,0,0.5),
    0 0 0 1px rgba(88,166,255,0.06),
    0 0 18px rgba(88,166,255,0.08);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 600;
  pointer-events: none;
}
.hl-toast--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
@media (max-width: 900px) {
  .hl-toast { display: none; }
}
.hl-toast__label {
  display: block;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hl-accent-blue);
  margin-bottom: 4px;
}
.hl-toast__close {
  position: absolute;
  top: 10px; right: 10px;
  background: none;
  border: 1px solid var(--hl-border-row);
  border-radius: 4px;
  color: var(--hl-text-dim);
  cursor: pointer;
  font-size: 0.95em;
  line-height: 1;
  padding: 3px 7px;
  transition: color 0.15s, border-color 0.15s;
}
.hl-toast__close:hover {
  color: var(--hl-text-primary);
  border-color: var(--hl-accent-blue);
}

/* --- Back to top button ------------------------------------- */
.hl-back-top {
  position: fixed;
  bottom: 28px; right: 22px;
  width: 38px; height: 38px;
  background: var(--hl-bg-row);
  border: 1px solid var(--hl-border-row);
  border-radius: 50%;
  color: var(--hl-accent-blue);
  font-size: 1.1em;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s, border-color 0.15s;
  z-index: 500;
}
.hl-back-top--visible {
  opacity: 1;
  pointer-events: auto;
}
.hl-back-top:hover {
  transform: translateY(-3px);
  border-color: var(--hl-accent-blue);
}

/* --- Last updated date -------------------------------------- */
.hl-last-updated {
  color: var(--hl-accent-blue);
  font-size: 0.9em;
  opacity: 0.75;
}

/* --- Share button in post eyebrow --------------------------- */
.hl-share-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--hl-border-row);
  border-radius: 4px;
  color: var(--hl-text-dim);
  cursor: pointer;
  font-size: 0.75em;
  font-family: inherit;
  padding: 3px 10px;
  line-height: 1.6;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s, border-color 0.15s;
}
.hl-share-btn:hover {
  color: var(--hl-accent-blue);
  border-color: var(--hl-accent-blue);
}

/* --- Related reports section -------------------------------- */
.hl-related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hl-border-row);
}
.hl-related__heading {
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hl-text-dim);
  margin-bottom: 1rem;
}
.hl-related__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .hl-related__grid { grid-template-columns: 1fr; }
}

/* --- Quick reference slide-out tabs (left margin) ----------- */
.hl-quicklinks {
  position: fixed;
  left: 32px;
  top: 42%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 400;
}
.hl-quicklink {
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 35px;
  height: 40px;
  border-radius: 7px;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(88, 166, 255, 0.2);
  color: var(--hl-accent-blue);
  text-decoration: none;
  transition: width 0.22s ease, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
button.hl-quicklink {
  cursor: pointer;
  font: inherit;
}
.hl-quicklink:hover {
  width: 140px;
  border-color: rgba(88, 166, 255, 0.5);
  background: rgba(20, 30, 50, 0.95);
}
.hl-quicklink--ioc-btn.hl-ioc-open,
.hl-quicklink--detect-btn.hl-detect-open {
  border-color: rgba(88, 166, 255, 0.6);
  background: rgba(20, 30, 50, 0.98);
  width: 35px;
}
.hl-quicklink__icon {
  flex-shrink: 0;
  width: 35px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hl-quicklink__label {
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-right: 12px;
  opacity: 0;
  transition: opacity 0.1s;
}
.hl-quicklink:hover .hl-quicklink__label {
  opacity: 1;
  transition: opacity 0.15s 0.1s;
}
/* Detection panel (appears to right of detect tab on click) */
.hl-detect-panel {
  position: fixed;
  width: 220px;
  background: rgba(11, 16, 28, 0.98);
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 8px;
  padding: 13px 14px;
  z-index: 450;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(63,185,80,0.05);
}
.hl-detect-panel--open {
  opacity: 1;
  pointer-events: auto;
}
.hl-detect-panel__hdr {
  font-size: 0.63em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #3fb950;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(63, 185, 80, 0.15);
}
.hl-detect-panel__list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hl-detect-panel__item a {
  font-size: 0.75em;
  color: var(--hl-text-primary);
  text-decoration: none;
  display: block;
  padding: 3px 0;
  transition: color 0.15s;
}
.hl-detect-panel__item a:hover { color: #3fb950; }
.hl-detect-panel__foot {
  border-top: 1px solid rgba(63, 185, 80, 0.15);
  padding-top: 9px;
}
.hl-detect-panel__link {
  font-size: 0.68em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #3fb950;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.hl-detect-panel__link:hover { opacity: 1; }
/* IOC panel (appears to right of tab on click) */
.hl-ioc-panel {
  position: fixed;
  width: 240px;
  background: rgba(11, 16, 28, 0.98);
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 8px;
  padding: 13px 14px;
  z-index: 450;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(88,166,255,0.05);
}
.hl-ioc-panel--open {
  opacity: 1;
  pointer-events: auto;
}
.hl-ioc-panel__hdr {
  font-size: 0.63em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hl-accent-blue);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(88, 166, 255, 0.15);
}
.hl-ioc-panel__list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hl-ioc-panel__item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.hl-ioc-panel__ioc { flex: 1; min-width: 0; }
.hl-ioc-panel__val {
  font-family: 'Courier New', monospace;
  font-size: 0.74em;
  color: var(--hl-text-primary);
  display: block;
  word-break: break-all;
}
.hl-ioc-panel__note {
  font-size: 0.65em;
  color: var(--hl-text-dim);
  display: block;
  margin-top: 2px;
}
.hl-ioc-cpbtn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--hl-border-row);
  border-radius: 3px;
  color: var(--hl-text-dim);
  cursor: pointer;
  font-size: 0.62em;
  font-family: inherit;
  padding: 2px 5px;
  transition: color 0.15s, border-color 0.15s;
  margin-top: 1px;
}
.hl-ioc-cpbtn:hover {
  color: var(--hl-accent-blue);
  border-color: var(--hl-accent-blue);
}
.hl-ioc-panel__foot {
  border-top: 1px solid rgba(88, 166, 255, 0.15);
  padding-top: 9px;
}
.hl-ioc-panel__link {
  font-size: 0.68em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--hl-accent-blue);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.hl-ioc-panel__link:hover { opacity: 1; }
@media (max-width: 900px) {
  .hl-quicklinks, .hl-ioc-panel, .hl-detect-panel { display: none !important; }
}

/* ============================================================
   MOBILE RESPONSIVE ENHANCEMENTS
   Desktop (>=769px) is unchanged. All rules below either live
   inside a mobile @media block or are universal safety rules
   that are invisible on desktop.
   ============================================================ */

/* --- Universal safety rules (no visible desktop effect) ----- */
/* Root background matches page so horizontal overflow can't
   expose the theme's default grey/light background. */
html {
  background: var(--hl-bg-page);
  -webkit-text-size-adjust: 100%;
}

/* Any bare image (non-figure) also constrained to its container */
img { max-width: 100%; height: auto; }

/* --- Tablet & small laptop (<=900px) ------------------------ */
@media (max-width: 900px) {
  /* Narrow the edge-glow overlays (were 125px each) */
  body::before, body::after { width: 40px; }
}

/* --- Mobile phones & small tablets (<=768px) ---------------- */
@media (max-width: 768px) {
  /* Hide decorative edge-glow overlays on phones —
     at 125px they covered most of the viewport */
  body::before, body::after { display: none; }

  /* Tighter content gutters + reduce base font from 22px → 18px */
  main.content {
    padding: 0 16px 28px !important;
    font-size: 0.9em;
  }
  .hl-page { padding-top: 1.5rem; }

  /* --- Navbar: compact, wrap nav links below brand --------- */
  .hl-nav {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .hl-nav__brand { font-size: 1.1rem; }
  .hl-nav__links {
    width: 100%;
    flex-wrap: wrap;
    gap: 18px;
    padding-bottom: 4px;
  }
  .hl-nav__link { font-size: 0.95rem; }

  /* --- Post header: compact + allow eyebrow to wrap -------- */
  .hl-post-header {
    padding: 16px 16px;
    margin-bottom: 1.75rem;
  }
  .hl-post-header__eyebrow {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .hl-post-header__title {
    font-size: 1.25em !important;
    line-height: 1.3;
  }

  /* --- Page header + hero card ----------------------------- */
  .hl-page-header { padding: 16px 16px; }
  .hl-page-header__title { font-size: 1.25em !important; }

  .hl-hero { padding: 20px 18px; gap: 14px; }
  .hl-hero__title { font-size: 1.25em !important; }
  .hl-hero__logo {
    width: 100%;
    max-width: 260px;
    height: 80px;
    background-size: 140%;
  }

  /* --- Long-string wrapping (hashes, IOCs, IPs, URLs) ------ */
  /* This is the fix for the "grey right margin" issue when
     long indicators overflow their container. */
  .hl-post-content,
  .hl-post-content p,
  .hl-post-content li,
  .hl-post-content a,
  .hl-post-content td,
  .hl-post-content th {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .hl-post-content code { word-break: break-all; }

  /* --- Headings: smaller + tighter padding ----------------- */
  .hl-post-content h1 {
    font-size: 1.12em !important;
    padding: 8px 10px !important;
    margin-top: 2.5rem !important;
  }
  .hl-post-content h2 {
    font-size: 1.08em !important;
    padding: 7px 10px !important;
    margin-top: 2rem !important;
  }
  .hl-post-content h3 {
    font-size: 1em !important;
    margin-top: 1.4rem !important;
  }
  .hl-post-content h4 { font-size: 0.92em !important; }

  /* --- Tables: horizontal scroll instead of compression ---- */
  /* Prevents columns like "Likelihood" from being squashed on
     portrait phones. User scrolls the table horizontally. */
  .hl-post-content table {
    font-size: 0.8em;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hl-post-content th,
  .hl-post-content td {
    padding: 6px 8px !important;
    white-space: nowrap;
  }

  /* --- Blockquotes: tighter padding ------------------------ */
  .hl-post-content blockquote {
    padding: 10px 14px !important;
    margin: 1.25rem 0 !important;
  }

  /* --- Pre / code blocks: tighter padding ------------------ */
  .hl-post-content pre {
    padding: 12px 14px;
    font-size: 0.85em;
    border-radius: 4px;
  }

  /* --- Grids → single column ------------------------------- */
  .hl-grid,
  .hl-nav-grid,
  .hl-related__grid {
    grid-template-columns: 1fr !important;
  }
  .hl-card__inner { padding: 12px; gap: 10px; }

  /* --- Row list: allow wrap for long titles ---------------- */
  .hl-row__body {
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 8px 10px;
  }
  .hl-row__date { font-size: 0.68em; }

  /* --- Subscribe cards + prose sections -------------------- */
  .hl-subscribe-option { padding: 18px 18px; }
  .hl-subscribe-option__url { padding: 8px 12px; }
  .hl-subscribe-option__url-value { font-size: 0.8em; }
  .hl-prose-section { padding: 12px 14px; }
  .hl-nav-tile { padding: 12px 14px; }

  /* --- Masthead + section spacing -------------------------- */
  .hl-masthead { margin-bottom: 1.25rem; border-radius: 6px; }
  .hl-section-header { margin: 1.5rem 0 12px; font-size: 0.8em; }

  /* --- Post nav: tighter ---------------------------------- */
  #post-nav { padding: 14px 10px !important; }

  /* --- Back-to-top button: smaller + safer position ------- */
  .hl-back-top {
    bottom: 18px; right: 14px;
    width: 36px; height: 36px;
    font-size: 1em;
  }
}

/* --- Ultra-narrow phones (<=380px) -------------------------- */
@media (max-width: 380px) {
  main.content { padding: 0 12px 24px !important; font-size: 0.88em; }
  .hl-nav { padding: 10px 12px; }
  .hl-nav__brand { font-size: 1rem; }
  .hl-nav__links { gap: 14px; }
  .hl-nav__link { font-size: 0.9rem; }
  .hl-post-header,
  .hl-page-header,
  .hl-hero { padding: 14px 14px; }
  .hl-post-header__title,
  .hl-page-header__title,
  .hl-hero__title { font-size: 1.15em !important; }
  .hl-post-content h1 { font-size: 1.05em !important; padding: 7px 8px !important; }
  .hl-post-content h2 { font-size: 1em !important; padding: 6px 8px !important; }
  .hl-post-content pre { padding: 10px 12px; font-size: 0.82em; }
  .hl-post-content table { font-size: 0.75em; }
  .hl-post-content th,
  .hl-post-content td { padding: 5px 6px !important; }
}

/* ============================================================
   TOUCH DEVICE ENHANCEMENTS
   All rules below are invisible on desktop with a mouse.
   Universal rules use properties/values that desktop browsers
   either ignore (tap-highlight-color, touch-action) or compute
   to identical values as today (env() = 0 on non-notched).
   ============================================================ */

/* --- Universal tap-interaction polish ----------------------- */
/* Theme-matched tap flash (desktop browsers ignore this) */
html {
  -webkit-tap-highlight-color: rgba(88,166,255,0.2);
}

/* Remove 300ms tap delay on interactive elements.
   No-op for mouse input — only affects touch events. */
a,
button,
[role="button"],
.hl-copy-btn,
.hl-back-top,
.hl-share-btn,
.hl-quicklink,
.hl-ioc-cpbtn,
.hl-toc__copy-btn {
  touch-action: manipulation;
}

/* --- iPhone safe-area insets (notch + home indicator) ------- */
/* env() returns 0 on desktop + non-notched devices, so
   computed padding on those devices is unchanged. */
.hl-nav {
  padding-left: max(40px, env(safe-area-inset-left));
  padding-right: max(40px, env(safe-area-inset-right));
}
.hl-back-top {
  bottom: max(28px, env(safe-area-inset-bottom));
  right: max(22px, env(safe-area-inset-right));
}

@media (max-width: 768px) {
  .hl-nav {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  main.content {
    padding-left: max(16px, env(safe-area-inset-left)) !important;
    padding-right: max(16px, env(safe-area-inset-right)) !important;
  }
  .hl-back-top {
    bottom: max(18px, env(safe-area-inset-bottom));
    right: max(14px, env(safe-area-inset-right));
  }
}

@media (max-width: 380px) {
  .hl-nav {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  main.content {
    padding-left: max(12px, env(safe-area-inset-left)) !important;
    padding-right: max(12px, env(safe-area-inset-right)) !important;
  }
}

/* --- Touch-only behaviors (@media hover: none) -------------- */
/* Devices without hover capability get:
   - always-visible copy/anchor affordances (analysts need these
     to copy IOCs/hashes/permalinks on mobile)
   - 44px minimum touch targets
   - no sticky hover transforms that get stuck after tap */
@media (hover: none) {
  /* Copy buttons on code blocks — always visible on touch */
  .hl-copy-btn {
    opacity: 0.8;
  }
  .hl-copy-btn:active {
    opacity: 1;
    background: rgba(88,166,255,0.25);
  }

  /* Heading permalink anchors — always visible on touch */
  .hl-heading-anchor {
    opacity: 0.55;
  }
  .hl-heading-anchor:active {
    opacity: 1;
  }
  /* Hide the hover-only tooltip on touch — it looks odd on tap */
  .hl-heading-anchor::after { display: none; }

  /* Kill hover transforms (prevents stuck lifted state after tap) */
  .hl-back-top:hover { transform: none; }

  /* 44px minimum touch targets (WCAG 2.5.5) */
  .hl-nav__link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .hl-back-top {
    width: 44px;
    height: 44px;
    font-size: 1.15em;
  }
  .hl-share-btn {
    min-height: 36px;
    padding: 6px 12px;
  }
  .hl-copy-btn {
    min-height: 32px;
    padding: 6px 12px;
  }
  .hl-ioc-cpbtn {
    min-height: 28px;
    padding: 4px 8px;
  }
}

/* --- Custom text selection colors --------------------------- */
/* Matches site accent blue for legibility on dark background. */
::selection {
  background: rgba(88,166,255,0.35);
  color: #ffffff;
}
::-moz-selection {
  background: rgba(88,166,255,0.35);
  color: #ffffff;
}

/* ============================================================
   MOBILE TOC (collapsible, replaces sidebar ≤1280px)
   Hidden on desktop — sidebar TOC remains the desktop experience.
   ============================================================ */
.hl-post-toc-mobile { display: none; }

@media (max-width: 1280px) {
  /* Spacer holds layout space for the fixed TOC bar */
  #hl-toc-spacer          { display: none; height: 44px; }
  #hl-toc-spacer.visible  { display: block; }

  /* Fixed below the navbar — JS sets top to navEl.offsetHeight */
  .hl-post-toc-mobile {
    display: block;
    position: fixed;
    top: 96px; /* fallback — overridden by JS with measured navbar height */
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--hl-bg-row);
    border-top: 2px solid var(--hl-accent-blue);
    border-bottom: 1px solid var(--hl-border-row);
    margin: 0;
  }

  .hl-post-toc-mobile summary {
    cursor: pointer;
    padding: 11px 14px;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--hl-accent-blue);
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    user-select: none;
    transition: background 0.15s;
  }
  .hl-post-toc-mobile summary::-webkit-details-marker { display: none; }
  .hl-post-toc-mobile summary::before {
    content: '▸';
    font-size: 0.9em;
    transition: transform 0.2s ease;
    display: inline-block;
    line-height: 1;
  }
  .hl-post-toc-mobile[open] summary::before {
    transform: rotate(90deg);
  }
  .hl-post-toc-mobile[open] summary {
    border-bottom: 1px solid var(--hl-border-row);
  }
  .hl-post-toc-mobile summary:hover {
    background: rgba(88,166,255,0.04);
  }

  .hl-post-toc-mobile nav {
    padding: 6px 6px 8px;
    max-height: 60vh;
    overflow-y: auto;
    position: absolute;
    left: 0;
    right: 0;
    background: var(--hl-bg-row);
    border-top: 1px solid var(--hl-border-row);
    border-bottom: 2px solid var(--hl-accent-blue);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }

  .hl-post-toc-mobile ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .hl-post-toc-mobile li a {
    display: block;
    padding: 9px 10px;
    color: var(--hl-text-primary);
    text-decoration: none;
    font-size: 0.88em;
    line-height: 1.4;
    border-radius: 4px;
    border-left: 2px solid transparent;
    word-break: break-word;
    transition: color 0.1s, background 0.1s, border-color 0.1s;
  }
  .hl-post-toc-mobile li a:hover,
  .hl-post-toc-mobile li a:active {
    background: rgba(88,166,255,0.08);
    border-left-color: var(--hl-accent-blue);
    color: var(--hl-accent-blue);
  }
}

/* ============================================================
   SUPPORT CTA — post-footer donation card
   ============================================================ */

.hl-support-cta {
  background: var(--hl-bg-card);
  border: 1px solid var(--hl-border-card);
  border-left: 4px solid var(--hl-accent-green);
  border-radius: 6px;
  padding: 20px 24px;
  margin: 2.5rem 0;
}

.hl-support-cta__heading {
  color: var(--hl-text-primary);
  font-size: 1em;
  font-weight: 700;
  margin: 0 0 8px;
}

.hl-support-cta__body {
  color: var(--hl-text-secondary);
  font-size: 0.88em;
  line-height: 1.6;
  margin: 0 0 16px;
}

.hl-support-cta__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.hl-support-cta__btn {
  display: inline-block;
  background: var(--hl-accent-green);
  color: #111111 !important;
  font-size: 0.85em;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 5px;
  text-decoration: none !important;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.hl-support-cta__btn:hover {
  opacity: 0.85;
  text-decoration: none !important;
}

.hl-support-cta__btn--outline {
  display: inline-block;
  background: transparent;
  color: var(--hl-text-secondary) !important;
  border: 1px solid var(--hl-border-card);
  font-size: 0.85em;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 5px;
  text-decoration: none !important;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.hl-support-cta__btn--outline:hover {
  border-color: #555;
  color: var(--hl-text-primary) !important;
  text-decoration: none !important;
}

.hl-support-cta__secondary {
  color: var(--hl-text-muted) !important;
  font-size: 0.82em;
  text-decoration: none !important;
  transition: color 0.15s;
}

.hl-support-cta__secondary:hover {
  color: var(--hl-text-secondary) !important;
  text-decoration: none !important;
}

/* ============================================================
   SPONSOR BANNER — per-post sponsored-by header
   ============================================================ */

.hl-sponsor-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--hl-bg-row);
  border: 1px solid var(--hl-border-row);
  border-radius: 5px;
  padding: 9px 16px;
  margin-bottom: 1.5rem;
}

.hl-sponsor-banner__label {
  color: var(--hl-text-muted);
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.hl-sponsor-banner__name,
.hl-sponsor-banner__name:visited {
  color: var(--hl-text-secondary) !important;
  font-size: 0.85em;
  font-weight: 600;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s;
}

.hl-sponsor-banner__name:hover {
  color: var(--hl-text-primary) !important;
}

.hl-sponsor-banner__logo {
  height: 20px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
}

/* ============================================================
   SUPPORT PAGE — sections, donate block, tier grid
   ============================================================ */

.hl-support-section {
  margin-bottom: 1.5rem;
}

.hl-support-donate {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 16px 18px;
  background: var(--hl-bg-row);
  border: 1px solid var(--hl-border-row);
  border-radius: 5px;
}

.hl-support-donate__note {
  color: var(--hl-text-muted);
  font-size: 0.8em;
  margin: 0;
}

/* Tier grid */
.hl-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 2rem;
}

@media (max-width: 700px) {
  .hl-tier-grid {
    grid-template-columns: 1fr;
  }
}

.hl-tier-card {
  background: var(--hl-bg-card);
  border: 1px solid var(--hl-border-card);
  border-radius: 6px;
  padding: 16px;
}

.hl-tier-card__name {
  color: var(--hl-accent-blue);
  font-size: 0.82em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.hl-tier-card__desc {
  color: var(--hl-text-muted);
  font-size: 0.78em;
  line-height: 1.5;
  margin-bottom: 14px;
}

.hl-tier-card__slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hl-tier-card__sponsor {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--hl-bg-row);
  border: 1px solid var(--hl-border-row);
  border-radius: 4px;
}

.hl-tier-card__logo {
  height: 18px;
  width: auto;
  object-fit: contain;
}

.hl-tier-card__sponsor-name,
.hl-tier-card__sponsor-name:visited {
  color: var(--hl-text-secondary) !important;
  font-size: 0.82em;
  font-weight: 600;
  text-decoration: none !important;
}

.hl-tier-card__sponsor-name:hover {
  color: var(--hl-text-primary) !important;
}

.hl-tier-card__placeholder {
  padding: 8px 10px;
  border: 1px dashed var(--hl-border-row);
  border-radius: 4px;
  color: var(--hl-text-dim);
  font-size: 0.78em;
  text-align: center;
  letter-spacing: 0.05em;
}

.hl-support-contact {
  color: var(--hl-text-muted);
  font-size: 0.8em;
  margin-top: 0.75rem;
}

/* ============================================================
   SITE FOOTER
   ============================================================ */

.hl-footer {
  background: #0d1117;
  border-top: 1px solid var(--hl-border-card);
  padding: 24px 40px 16px;
  margin-top: 3rem;
  box-sizing: border-box;
  width: 100%;
}

.hl-footer__inner {
  max-width: 900px;
  margin: 0 auto;
}

.hl-footer__links {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hl-footer__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hl-footer__group-label {
  color: var(--hl-accent-blue);
  font-size: 0.62em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-bottom: 2px;
}

.hl-footer__link,
.hl-footer__link:visited {
  color: var(--hl-text-muted) !important;
  font-size: 0.78em;
  text-decoration: none !important;
  transition: color 0.15s;
}

.hl-footer__link:hover {
  color: var(--hl-text-primary) !important;
  text-decoration: none !important;
}

.hl-footer__bottom {
  color: var(--hl-text-dim);
  font-size: 0.7em;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--hl-border-row);
}

@media (max-width: 600px) {
  .hl-footer {
    padding: 20px 20px 16px;
  }
  .hl-footer__links {
    gap: 28px;
  }
}

/* --- Site sponsors ------------------------------------------ */
.hl-site-sponsors {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hl-border-row);
}

.hl-site-sponsors__label {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hl-text-muted);
  margin-bottom: 12px;
}

.hl-site-sponsors__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hl-site-sponsor {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--hl-bg-card);
  border: 1px solid var(--hl-border-card);
  border-radius: 6px;
  padding: 10px 14px;
  text-decoration: none !important;
  color: var(--hl-text-primary) !important;
  transition: border-color 0.15s;
}

.hl-site-sponsor:hover {
  border-color: #444 !important;
  text-decoration: none !important;
}

.hl-site-sponsor__logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.hl-site-sponsor__name {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--hl-text-primary);
}

.hl-site-sponsor__tagline {
  font-size: 0.72em;
  color: var(--hl-text-muted);
  margin-top: 2px;
}

/* --- Consulting service cards -------------------------------- */
.hl-service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 2rem;
}

.hl-service-card {
  cursor: default;
}

.hl-service-card__title {
  font-size: 1.0em;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 7px;
  text-transform: none;
  letter-spacing: 0;
}

.hl-service-card__body {
  color: var(--hl-text-primary);
  font-size: 0.835em;
  line-height: 1.65;
}

@media (max-width: 700px) {
  .hl-service-grid {
    grid-template-columns: 1fr;
  }
}
