/* =================================================================
   r00t4ccess.com — Tokyo cyberpunk theme
   Hand-written, no build step. Neon-on-dark, scanlines, glitch.
   ================================================================= */

/* ---- Fonts (self-hosted, SIL OFL) ------------------------------- */
@font-face {
  font-family: 'Orbitron';
  src: url('/assets/fonts/Orbitron.ttf') format('truetype');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Share Tech Mono';
  src: url('/assets/fonts/ShareTechMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

/* ---- Design tokens ---------------------------------------------- */
:root {
  --bg:          #0a0a12;
  --bg-elev:     #11111e;
  --bg-card:     #13132288;
  --bg-card-2:   #181830;
  --line:        rgba(0, 240, 255, 0.16);
  --line-soft:   rgba(255, 255, 255, 0.07);

  --cyan:        #00f0ff;
  --magenta:     #ff2bd1;
  --purple:      #8b5cff;
  --amber:       #ffb84d;
  --green:       #5cffa6;

  --text:        #d9d9ec;
  --text-dim:    #9494b0;
  --text-faint:  #6b6b85;
  --white:       #f4f4ff;

  --display: 'Orbitron', 'Segoe UI', Tahoma, sans-serif;
  --mono:    'Share Tech Mono', 'Consolas', 'Courier New', monospace;
  --sans:    'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1180px;
  --radius: 4px;
  --glow-cyan:    0 0 18px rgba(0, 240, 255, 0.45);
  --glow-magenta: 0 0 18px rgba(255, 43, 209, 0.45);
}

/* ---- Reset / base ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  overflow-x: hidden;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--cyan); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--magenta); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.18;
  color: var(--white);
  letter-spacing: .5px;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.3rem); }
h3 { font-size: 1.22rem; }

p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem 1.3rem; }
li { margin: .35rem 0; }

::selection { background: var(--magenta); color: #fff; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--cyan); color: #001014; padding: 10px 18px;
  font-family: var(--mono); font-weight: 700;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---- Ambient FX overlays ---------------------------------------- */
.fx-grid, .fx-scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
}
.fx-grid {
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
}
.fx-scanlines {
  background: repeating-linear-gradient(
    to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.22) 3px, rgba(0, 0, 0, 0) 4px);
  opacity: .5; mix-blend-mode: overlay;
}
/* The FX overlays sit at z-index:-1 (behind all content), so real
   elements keep their natural stacking. The sticky header — and the
   dropdown / mobile menu inside it — therefore stay on top WITHOUT a
   global `z-index: 1` override (that override was outranking the
   header's own z-index and hiding the menus behind <main>). */

/* ---- Header / nav ----------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 18, 0.92);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
}
.site-header.scrolled { box-shadow: 0 6px 26px rgba(0, 0, 0, 0.55); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 70px;
}

.brand { display: flex; flex-direction: column; line-height: 1; }
.brand-mark {
  font-family: var(--display); font-weight: 800; font-size: 1.42rem;
  color: var(--white); letter-spacing: 1px; text-shadow: var(--glow-cyan);
}
.brand-accent { color: var(--magenta); }
.brand-cursor { color: var(--cyan); animation: blink 1.1s steps(1) infinite; }
.brand-sub {
  font-family: var(--mono); font-size: .58rem; letter-spacing: 2.5px;
  color: var(--text-faint); margin-top: 4px;
}

.primary-nav .nav-list {
  list-style: none; margin: 0; display: flex; align-items: center; gap: 4px;
}
.nav-list a, .drop-toggle {
  font-family: var(--mono); font-size: .92rem; color: var(--text-dim);
  padding: 9px 13px; display: inline-block; background: none; border: none;
  cursor: pointer; letter-spacing: .5px; transition: color .15s ease;
}
.nav-list a:hover, .drop-toggle:hover,
.nav-list a.is-active, .drop-toggle.is-active { color: var(--cyan); }
.nav-list a.is-active { text-shadow: 0 0 10px rgba(0, 240, 255, 0.55); }

.nav-cta {
  border: 1px solid var(--magenta); color: var(--magenta) !important;
  border-radius: var(--radius); margin-left: 8px;
}
.nav-cta:hover { background: var(--magenta); color: #fff !important; box-shadow: var(--glow-magenta); }

.has-drop { position: relative; }
.caret { font-size: .7rem; display: inline-block; transition: transform .15s ease; }

/* Dropdown — opacity/visibility (not display) so there is no flicker,
   a 1px overlap so the hover path has no dead gap, and :focus-within
   for keyboard users. */
.drop-menu {
  list-style: none; margin: 0; padding: 6px;
  position: absolute; top: calc(100% - 1px); left: 0;
  min-width: 240px; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6); z-index: 130;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s;
}
.has-drop:hover > .drop-menu,
.has-drop:focus-within > .drop-menu,
.has-drop.open > .drop-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity .14s ease, transform .14s ease;
}
.has-drop:hover .caret, .has-drop.open .caret { transform: rotate(180deg); }
.drop-menu li { margin: 0; }
.drop-menu a { display: block; padding: 10px 12px; border-radius: 3px; }
.drop-menu a:hover { background: var(--bg-card-2); color: var(--cyan); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 9px; cursor: pointer;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--cyan); display: block; }

/* ---- Buttons ---------------------------------------------------- */
.btn {
  display: inline-block; font-family: var(--mono); font-size: .96rem;
  font-weight: 400; letter-spacing: .7px; padding: 13px 26px;
  border-radius: var(--radius); cursor: pointer; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 9px 16px; font-size: .85rem; }
.btn-primary {
  background: linear-gradient(120deg, var(--cyan), var(--purple));
  color: #00141a !important; font-weight: 700; border-color: var(--cyan);
}
.btn-primary:hover { box-shadow: var(--glow-cyan); color: #00141a !important; }
.btn-ghost {
  background: transparent; color: var(--cyan) !important; border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); }

/* ---- Generic section / typography helpers ----------------------- */
.section { padding: 78px 0; }
.section-sm { padding: 52px 0; }
.section-alt { background: var(--bg-elev); border-block: 1px solid var(--line-soft); }

.eyebrow {
  font-family: var(--mono); font-size: .8rem; letter-spacing: 3px;
  color: var(--cyan); text-transform: uppercase; margin-bottom: 12px;
}
.eyebrow.magenta { color: var(--magenta); }
.lead { font-size: 1.16rem; color: var(--text); }
.muted { color: var(--text-dim); }
.center { text-align: center; }
.measure { max-width: 720px; }
.measure.center { margin-inline: auto; }
.mt-0 { margin-top: 0; }
.section-head { margin-bottom: 40px; }
.section-head.center { margin-inline: auto; }

.blink { animation: blink 1.1s steps(1) infinite; color: var(--cyan); }

/* Glitch headings — subtle chromatic rest state, a brief idle glitch
   burst every cycle, and a stronger glitch while hovered/focused.
   --glitch-delay (set per-element in JS) desyncs the idle burst. */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  overflow: hidden; pointer-events: none;
}
.glitch::before {
  color: var(--magenta); transform: translate(-2px, 0);
  animation: glitch-idle-a 7s steps(1) infinite;
  animation-delay: var(--glitch-delay, 0s);
}
.glitch::after {
  color: var(--cyan); transform: translate(2px, 0);
  animation: glitch-idle-b 7s steps(1) infinite;
  animation-delay: var(--glitch-delay, 0s);
}
.glitch:hover::before, .glitch:focus-within::before { animation: glitch-a .45s steps(2) infinite; }
.glitch:hover::after,  .glitch:focus-within::after  { animation: glitch-b .45s steps(2) infinite; }

/* ---- Hero ------------------------------------------------------- */
.hero {
  padding: 96px 0 84px; position: relative;
  background:
    radial-gradient(ellipse 60% 50% at 78% 8%, rgba(255, 43, 209, 0.14), transparent 70%),
    radial-gradient(ellipse 60% 55% at 12% 92%, rgba(0, 240, 255, 0.13), transparent 70%);
}
.hero h1 { margin-bottom: 18px; }
.hero .lead { max-width: 640px; margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-meta {
  font-family: var(--mono); font-size: .82rem; color: var(--text-faint);
  margin-top: 26px; letter-spacing: 1px;
}
.hero-meta b { color: var(--green); }

/* ---- Cards / grids ---------------------------------------------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Grid/flex children default to min-width:auto, which lets a fixed-width
   child (e.g. the 304px reCAPTCHA widget) blow the column out past the
   viewport. min-width:0 lets the column shrink to fit. */
.grid > *, .article-layout > *, .split > *, .field-row > * { min-width: 0; }

.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; position: relative;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover {
  transform: translateY(-4px); border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.2), 0 14px 36px rgba(0, 0, 0, 0.5);
}
.card h3 { margin-bottom: 8px; }
.card .card-tag {
  font-family: var(--mono); font-size: .72rem; letter-spacing: 2px;
  color: var(--magenta); text-transform: uppercase;
}
.card p:last-child { margin-bottom: 0; }
.card-link {
  display: inline-block; margin-top: 12px; font-family: var(--mono);
  font-size: .86rem; color: var(--cyan);
}
.card-link::after { content: ' →'; }

/* Whole-card click target — the cover link's ::after stretches over the
   entire (position:relative) .card, so the full box is clickable. */
.card-clickable { cursor: pointer; }
.card-cover { position: static; }
.card-cover::after { content: ''; position: absolute; inset: 0; z-index: 2; }
.card-clickable:hover .card-link { color: var(--magenta); }

/* Threat card with corner accent */
.threat-card { border-top: 2px solid var(--magenta); }
.threat-card .num {
  font-family: var(--display); font-size: 2.2rem; color: var(--line);
  position: absolute; top: 14px; right: 18px; font-weight: 800;
}

/* Stat strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { text-align: center; padding: 20px 10px; }
.stat .num {
  font-family: var(--display); font-size: 2.4rem; font-weight: 800;
  color: var(--cyan); text-shadow: var(--glow-cyan); line-height: 1;
}
.stat .label {
  font-family: var(--mono); font-size: .78rem; letter-spacing: 1.5px;
  color: var(--text-dim); margin-top: 8px; text-transform: uppercase;
}

/* ---- Threat / article page layout ------------------------------- */
.page-hero {
  padding: 70px 0 46px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse 70% 60% at 85% 0%, rgba(139, 92, 255, 0.16), transparent 72%);
}
.breadcrumb {
  font-family: var(--mono); font-size: .8rem; color: var(--text-faint);
  margin-bottom: 16px; list-style: none; display: flex; gap: 8px; flex-wrap: wrap;
}
.breadcrumb li::after { content: '/'; margin-left: 8px; color: var(--line); }
.breadcrumb li:last-child::after { content: ''; }
.breadcrumb li[aria-current] { color: var(--text-dim); }

.threat-badge {
  display: inline-block; font-family: var(--mono); font-size: .74rem;
  letter-spacing: 2px; padding: 5px 12px; border: 1px solid var(--magenta);
  color: var(--magenta); border-radius: 999px; margin-bottom: 16px;
  text-transform: uppercase;
}

.article-layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 48px;
  padding: 56px 0;
}
.toc {
  position: sticky; top: 92px; align-self: start;
  font-family: var(--mono); font-size: .86rem;
}
.toc h4 {
  font-family: var(--mono); font-size: .76rem; letter-spacing: 2px;
  color: var(--text-faint); text-transform: uppercase; margin-bottom: 10px;
}
.toc ul { list-style: none; margin: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; color: var(--text-dim); }
.toc a:hover { color: var(--cyan); }

.prose > section { margin-bottom: 44px; scroll-margin-top: 92px; }
.prose h2 {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
}
.prose h2 .hash { font-family: var(--mono); color: var(--cyan); font-size: 1.1rem; }
.prose h3 { color: var(--cyan); margin: 22px 0 8px; }
.prose ul li::marker { color: var(--magenta); }

.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--cyan);
  background: var(--bg-card); padding: 18px 22px; border-radius: var(--radius);
  margin: 20px 0;
}
.callout.warn { border-left-color: var(--amber); }
.callout.danger { border-left-color: var(--magenta); }
.callout .callout-title {
  font-family: var(--mono); font-size: .8rem; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 6px;
}
.callout.warn .callout-title { color: var(--amber); }
.callout.danger .callout-title { color: var(--magenta); }
.callout p:last-child { margin-bottom: 0; }

/* Detect / defend split lists */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.signal-list { list-style: none; margin: 0; }
.signal-list li {
  padding: 9px 0 9px 26px; position: relative; border-bottom: 1px solid var(--line-soft);
}
.signal-list li::before {
  position: absolute; left: 0; font-family: var(--mono); font-weight: 700;
}
.signal-list.detect li::before { content: '>'; color: var(--amber); }
.signal-list.defend li::before { content: '+'; color: var(--green); }

/* Attack-chain steps */
.steps { list-style: none; margin: 0; counter-reset: step; }
.steps li {
  position: relative; padding: 14px 0 14px 56px; counter-increment: step;
  border-bottom: 1px solid var(--line-soft);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 12px; font-family: var(--display);
  font-weight: 800; color: var(--magenta); font-size: 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
}

/* ---- FAQ accordion ---------------------------------------------- */
.faq { border-top: 1px solid var(--line); }
.faq details {
  border-bottom: 1px solid var(--line); padding: 4px 0;
}
.faq summary {
  font-family: var(--display); font-size: 1.04rem; font-weight: 700;
  color: var(--white); cursor: pointer; padding: 16px 36px 16px 4px;
  list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; position: absolute; right: 6px; top: 14px;
  font-family: var(--mono); color: var(--cyan); font-size: 1.4rem;
}
.faq details[open] summary::after { content: '–'; }
.faq details[open] summary { color: var(--cyan); }
.faq .faq-body { padding: 0 4px 18px; color: var(--text-dim); }

/* ---- CTA band --------------------------------------------------- */
.cta-band {
  background:
    linear-gradient(120deg, rgba(0, 240, 255, 0.09), rgba(255, 43, 209, 0.09)),
    var(--bg-elev);
  border-block: 1px solid var(--line);
}
.cta-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 34px; padding: 52px 22px; flex-wrap: wrap;
}
.cta-copy { max-width: 620px; }
.cta-copy h2 { margin-bottom: 8px; }
.cta-actions { display: flex; flex-direction: column; gap: 12px; min-width: 250px; }

/* ---- Forms ------------------------------------------------------ */
.form-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block; font-family: var(--mono); font-size: .82rem;
  letter-spacing: 1px; color: var(--text-dim); margin-bottom: 6px;
}
.field label .req { color: var(--magenta); }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; font-family: var(--sans); font-size: 1rem;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.14);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hp-field { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

.alert {
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 22px;
  font-size: .96rem; border: 1px solid;
}
.alert-error { border-color: var(--magenta); background: rgba(255, 43, 209, 0.08); color: #ffc8ee; }
.alert-ok    { border-color: var(--green);   background: rgba(92, 255, 166, 0.08); color: #c9ffe3; }
.field-error { color: var(--magenta); font-family: var(--mono); font-size: .8rem; margin-top: 5px; }
.form-note {
  font-family: var(--mono); font-size: .76rem; color: var(--text-faint);
  margin-top: 14px;
}
/* reCAPTCHA v2 checkbox widget */
.recaptcha-field { margin-bottom: 18px; }
.recaptcha-field .g-recaptcha { display: inline-block; }
.recaptcha-note {
  display: none; margin-top: 6px;
  color: var(--magenta); font-family: var(--mono); font-size: .8rem;
}
.recaptcha-note.show { display: block; }
/* The reCAPTCHA v2 widget is a fixed 304px wide — scale it down so it
   fits inside the form card on narrow phones (the negative margin
   reclaims the empty space the transform leaves below it). */
@media (max-width: 384px) {
  .recaptcha-field { overflow: hidden; }
  .recaptcha-field .g-recaptcha {
    transform: scale(0.85); transform-origin: 0 0; margin-bottom: -11px;
  }
}
@media (max-width: 332px) {
  .recaptcha-field .g-recaptcha { transform: scale(0.74); margin-bottom: -20px; }
}

/* ---- Resources list --------------------------------------------- */
.resource-item {
  display: flex; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.resource-item .r-date {
  font-family: var(--mono); font-size: .8rem; color: var(--text-faint);
  white-space: nowrap; min-width: 110px;
}
.resource-item h3 { margin-bottom: 4px; }
.tag {
  display: inline-block; font-family: var(--mono); font-size: .68rem;
  letter-spacing: 1.5px; text-transform: uppercase; padding: 3px 9px;
  border: 1px solid var(--line); color: var(--cyan); border-radius: 3px;
  margin-right: 6px;
}
.badge-soon { color: var(--amber); border-color: rgba(255,184,77,.4); }

/* ---- Footer ----------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-elev); margin-top: 10px; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 36px;
  padding: 56px 22px 40px;
}
.footer-col h3 {
  font-family: var(--mono); font-size: .82rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 14px;
}
.footer-col ul { list-style: none; margin: 0; }
.footer-col li { margin: 7px 0; }
.footer-col a { color: var(--text-dim); }
.footer-col a:hover { color: var(--cyan); }
.footer-brand p { font-size: .92rem; color: var(--text-dim); }
.footer-region { font-family: var(--mono); font-size: .8rem; color: var(--text-faint); }
.footer-contact .btn { margin-top: 12px; }
.footer-bar { border-top: 1px solid var(--line-soft); background: rgba(0, 0, 0, 0.25); }
.footer-bar-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px 48px; flex-wrap: wrap; padding: 20px 22px;
}
.footer-bar-inner p { margin: 0; }
.footer-copy {
  font-family: var(--mono); font-size: .82rem; color: var(--text-dim);
  letter-spacing: .4px;
}
.footer-copy a, .footer-pc-link { color: var(--cyan); }
.footer-copy a:hover, .footer-pc-link:hover { color: var(--magenta); }
.footer-fineprint {
  font-size: .78rem; color: var(--text-faint); line-height: 1.6;
  max-width: 470px; text-align: right;
}

/* ---- Animations ------------------------------------------------- */
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes glitch-a {
  0% { clip-path: inset(0 0 82% 0); } 50% { clip-path: inset(54% 0 18% 0); }
  100% { clip-path: inset(86% 0 2% 0); }
}
@keyframes glitch-b {
  0% { clip-path: inset(74% 0 8% 0); } 50% { clip-path: inset(22% 0 56% 0); }
  100% { clip-path: inset(4% 0 78% 0); }
}
/* Idle: fully visible at rest (the subtle chromatic offset), with a
   short glitch burst near the end of each cycle. */
@keyframes glitch-idle-a {
  0%, 86%, 100% { clip-path: inset(0 0 0 0); transform: translate(-2px, 0); }
  88% { clip-path: inset(12% 0 62% 0); transform: translate(-6px, 0); }
  91% { clip-path: inset(54% 0 22% 0); transform: translate(5px, 0); }
  94% { clip-path: inset(30% 0 48% 0); transform: translate(-4px, 0); }
  97% { clip-path: inset(72% 0 6% 0);  transform: translate(3px, 0); }
}
@keyframes glitch-idle-b {
  0%, 86%, 100% { clip-path: inset(0 0 0 0); transform: translate(2px, 0); }
  88% { clip-path: inset(64% 0 14% 0); transform: translate(6px, 0); }
  91% { clip-path: inset(20% 0 58% 0); transform: translate(-5px, 0); }
  94% { clip-path: inset(44% 0 34% 0); transform: translate(4px, 0); }
  97% { clip-path: inset(6% 0 80% 0);  transform: translate(-3px, 0); }
}
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---- Responsive ------------------------------------------------- */
@media (max-width: 940px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; gap: 12px; }
  .toc { position: static; border: 1px solid var(--line); padding: 16px; border-radius: var(--radius); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-toggle { display: flex; }
  .primary-nav {
    position: fixed; inset: 70px 0 auto 0; background: var(--bg-elev);
    border-bottom: 1px solid var(--line); padding: 14px 0;
    display: none; max-height: calc(100vh - 70px); overflow-y: auto;
  }
  .primary-nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list > li { border-bottom: 1px solid var(--line-soft); }
  .nav-list a, .drop-toggle { padding: 14px 22px; width: 100%; text-align: left; }
  .drop-toggle { display: flex; align-items: center; justify-content: space-between; }
  .nav-list > li:last-child { border-bottom: none; }
  /* Mobile menu CTA — solid magenta button by default (the desktop
     hover state), so it reads as the primary action. */
  .nav-cta {
    display: block; width: auto; margin: 18px 22px;
    background: var(--magenta); color: #fff !important;
    border-color: var(--magenta); border-radius: var(--radius);
    box-shadow: var(--glow-magenta); text-align: center; font-weight: 700;
  }
  /* Mobile dropdown — JS `.open` only; no hover rules (touch has no hover). */
  .drop-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    transition: none; display: none; z-index: auto;
    border: none; box-shadow: none; background: var(--bg-card-2);
    min-width: 0; padding: 0;
  }
  .has-drop.open > .drop-menu { display: block; }
  .drop-menu a { padding-left: 40px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .split, .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; padding-bottom: 48px; }
  .footer-bar-inner {
    flex-direction: column; align-items: flex-start;
    gap: 14px; padding: 40px 22px 40px;
  }
  .footer-fineprint { text-align: left; max-width: 100%; }
  .section { padding: 56px 0; }
  .section-sm { padding: 40px 0; }
  .hero { padding: 64px 0 56px; }
  .page-hero { padding: 48px 0 34px; }
  .article-layout { padding: 36px 0; }
  .cta-inner { padding: 44px 20px; }
  .cta-actions { min-width: 100%; }
  .hero-actions, .cta-actions { width: 100%; }
  .hero-actions .btn, .cta-actions .btn { width: 100%; }
}

/* ---- Small phones ---------------------------------------------- */
@media (max-width: 540px) {
  /* horizontal only — a `padding` shorthand here would wipe the vertical
     padding off every .wrap element that sets its own (footer rows, CTA). */
  .wrap { padding-inline: 16px; }
  h1 { font-size: clamp(1.7rem, 8vw, 2.3rem); }
  h2 { font-size: clamp(1.35rem, 6vw, 1.9rem); }
  .lead { font-size: 1.05rem; }
  .eyebrow { letter-spacing: 1.5px; font-size: .72rem; }
  .hero { padding: 44px 0 38px; }
  .section, .section-sm { padding: 38px 0; }
  .section-head { margin-bottom: 28px; }
  .card { padding: 20px; }
  .form-card { padding: 20px; }
  .stats { grid-template-columns: 1fr; gap: 12px; }
  .stat { padding: 14px 8px; }
  .cta-inner { padding: 34px 16px; }
  .prose > section { margin-bottom: 32px; }
  .threat-card .num { font-size: 1.7rem; }
  .brand-sub { display: none; }
}

/* ---- Reduced motion -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .fx-scanlines { display: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---- Print ------------------------------------------------------ */
@media print {
  .fx-grid, .fx-scanlines, .site-header, .cta-band, .nav-toggle { display: none; }
  body { background: #fff; color: #000; }
}
