/* LGSpyware.com — themed to the Critical Error Computing house style.
 * Dark surfaces, Saira type, hot-magenta accent (#ed2398), a faint grid,
 * and a subtle glitch on accent words. Red (#ff3040) is reserved for the
 * breaking banner and warning callouts. */

:root {
  color-scheme: dark;

  --bg: #0a0a0f;
  --bg-2: #0f1017;
  --surface: #14151f;
  --surface-2: #191b27;
  --border: #262838;
  --border-strong: #333650;

  --ink: #eceef4;
  --ink-soft: #b4b9c8;
  --ink-faint: #7d8397;

  --accent: #ed2398;          /* CEC magenta */
  --accent-ink: #ff62b6;
  --accent-soft: rgba(237, 35, 152, 0.14);

  --red: #ff3040;             /* alerts / warnings only */
  --red-ink: #ff6f79;
  --red-soft: rgba(255, 48, 64, 0.13);

  --amber: #ffb020;
  --ok: #37c97f;

  --grid-opacity: 0.5;
  --grid-line: rgba(237, 35, 152, 0.06);

  --font: "Saira", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-cond: "Saira Condensed", "Saira", system-ui, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }
marquee-fallback { display: inline; }

/* Faint grid backdrop used behind section bands. */
.grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: var(--grid-opacity);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0, #000, transparent 75%);
          mask-image: radial-gradient(120% 80% at 50% 0, #000, transparent 75%);
}

/* ---------- Glitch accent word (CEC signature) ---------- */
.gw {
  position: relative;
  color: var(--accent-ink);
  display: inline-block;
}
.gw::before,
.gw::after {
  content: attr(data-alt);
  position: absolute; left: 0; top: 0;
  clip-path: inset(0 0 0 0);
  opacity: 0;
  pointer-events: none;
}
.gw:hover::before {
  opacity: 0.9; color: #22e0d0; transform: translate(-2px, -1px);
  animation: gwx 0.5s steps(2) infinite;
}
.gw:hover::after {
  opacity: 0.9; color: var(--accent); transform: translate(2px, 1px);
  animation: gwx 0.4s steps(2) reverse infinite;
}
@keyframes gwx {
  0% { clip-path: inset(0 0 70% 0); }
  50% { clip-path: inset(50% 0 20% 0); }
  100% { clip-path: inset(80% 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  .gw:hover::before, .gw:hover::after { animation: none; }
}

/* ---------- Breaking bar (RED) ---------- */
.breaking {
  position: sticky; top: 0; z-index: 50;
  background: var(--red);
  color: #fff;
  display: flex; align-items: center; gap: 14px;
  padding: 9px 20px;
  font-size: 0.88rem; font-weight: 600;
  letter-spacing: 0.01em;
  border-bottom: 1px solid rgba(0,0,0,0.3);
}
.breaking .pulse {
  font-family: var(--font-cond);
  font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  white-space: nowrap;
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.4} }
@media (prefers-reduced-motion: reduce) { .breaking .pulse { animation: none; } }

/* ---------- Masthead ---------- */
.masthead {
  position: relative;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.masthead-in {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; gap: 16px; flex-wrap: wrap;
}
.brandblock { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand {
  font-family: var(--font-cond);
  font-size: 1.5rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink); line-height: 1;
}
.brand:hover { text-decoration: none; }
.brand .err { color: var(--accent-ink); }
.brand-by {
  font-size: 0.72rem; color: var(--ink-faint);
  font-family: var(--mono); letter-spacing: 0.04em;
}
.brand-by a { color: var(--ink-soft); }
.topnav { display: flex; gap: 20px; flex-wrap: wrap; }
.topnav a { color: var(--ink-soft); font-size: 0.9rem; font-weight: 500; }
.topnav a:hover { color: var(--accent-ink); text-decoration: none; }

/* ---------- Shared bits ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--accent-ink); font-weight: 600;
}
.kicker-tag {
  display: inline-block;
  font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-faint);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px;
}
.section-num {
  font-family: var(--mono); font-size: 0.74rem;
  letter-spacing: 0.14em; color: var(--ink-faint);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font); font-weight: 600; font-size: 0.95rem;
  padding: 11px 20px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #ff3aa8; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-sm { padding: 8px 14px; font-size: 0.86rem; }

/* ---------- Lead ---------- */
.lead { position: relative; padding: 46px 20px 22px; overflow: hidden; }
.lead .grid-bg { opacity: 0.5; }
.lead-in { position: relative; z-index: 1; }
.lead-top { display: grid; grid-template-columns: 1fr 0.85fr; gap: 30px; align-items: center; margin-bottom: 22px; }
.lead-top h1 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); margin-bottom: 0; }
.hero-img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); background: #0d0e16; box-shadow: 0 24px 60px -30px rgba(0,0,0,0.8); }
@media (max-width: 860px) { .lead-top { grid-template-columns: 1fr; gap: 18px; } .hero-img { max-height: 240px; object-fit: cover; object-position: center; } }
.eyebrow-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.tag-red {
  background: var(--red); color: #fff;
  font-family: var(--font-cond); font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 4px;
}
h1 {
  font-family: var(--font-cond);
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.02; letter-spacing: 0.005em;
  text-transform: uppercase; font-weight: 700;
  margin: 0 0 20px;
}
.dek { font-size: 1.16rem; color: var(--ink-soft); margin: 0 0 22px; max-width: 62ch; }
.dek strong { color: var(--ink); font-weight: 600; }
.byline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink-faint); font-size: 0.9rem; }
.byline .sep { opacity: 0.5; }
.byline .live { color: var(--red-ink); font-weight: 600; }

/* ---------- Video ---------- */
.video-block { padding: 8px 20px 26px; }
.video { position: relative; padding-bottom: 56.25%; height: 0; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.caption { color: var(--ink-faint); font-size: 0.92rem; margin: 12px 2px 0; }
.caption strong { color: var(--ink); }

/* ---------- Outlet strip ---------- */
.outlets { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 18px 20px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.outlets-label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.outlets ul { list-style: none; display: flex; gap: 8px 18px; flex-wrap: wrap; margin: 0; padding: 0; }
.outlets li a { color: var(--ink); font-weight: 600; font-size: 0.94rem; opacity: 0.85; }
.outlets li a:hover { opacity: 1; color: var(--accent-ink); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 28px 20px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; text-align: center; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 2px; background: var(--accent); opacity: 0.7; }
.stat-num { font-family: var(--font-cond); font-size: 2.1rem; font-weight: 700; color: var(--accent-ink); line-height: 1; }
.stat-den { font-size: 1.05rem; color: var(--ink-faint); }
.stat-lbl { font-size: 0.82rem; color: var(--ink-faint); margin-top: 8px; line-height: 1.42; }

/* ---------- Body ---------- */
.body section { padding: 28px 0; border-top: 1px solid var(--border); }
.body section:first-child { border-top: none; }
h2 { font-family: var(--font-cond); font-size: clamp(1.5rem, 4vw, 2.05rem); text-transform: uppercase; letter-spacing: 0.01em; margin: 0 0 14px; font-weight: 700; }
h3 { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: 0.02em; font-size: 1.15rem; margin: 20px 0 8px; }
p { margin: 0 0 14px; }
code { font-family: var(--mono); font-size: 0.85em; background: #0d0e16; border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--accent-ink); }
pre { background: #0c0d15; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 10px 0 14px; }
pre code { background: none; border: none; padding: 0; color: #d8dbe6; font-size: 0.84rem; line-height: 1.55; white-space: pre; }
.callout-fix pre { background: #0a1310; border-color: rgba(55,201,127,0.28); }
.callout-fix pre code { color: #d6efe1; }

ul.ticks { list-style: none; padding-left: 0; margin: 0 0 14px; }
ul.ticks li { position: relative; padding-left: 28px; margin: 10px 0; }
ul.ticks li::before { content: "▸"; position: absolute; left: 5px; color: var(--accent); font-weight: 700; }

ol.steps { counter-reset: step; list-style: none; padding-left: 0; margin: 14px 0; }
ol.steps > li { position: relative; padding: 10px 0 10px 44px; }
ol.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 8px;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-weight: 700;
  display: grid; place-items: center;
}

/* Callouts */
.callout-danger, .callout-fix { position: relative; margin: 6px 0; padding: 24px; border-radius: var(--r-lg); }
.callout-danger { background: var(--red-soft); border: 1px solid rgba(255,48,64,0.34); }
.callout-danger h2 { color: var(--red-ink); }
.callout-danger .big { font-size: 1.14rem; color: var(--ink); }
.callout-danger u { text-decoration-color: var(--red); text-underline-offset: 3px; }
.callout-fix { background: rgba(55,201,127,0.08); border: 1px solid rgba(55,201,127,0.3); }
.callout-fix h2 { color: var(--ok); }
.callout-fix ol.steps > li::before { background: var(--ok); color: #04160c; }
.warn { background: var(--red-soft); border-left: 3px solid var(--red); padding: 12px 14px; border-radius: 6px; font-size: 0.95rem; }

/* Permissions */
.perm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
@media (max-width: 640px) { .perm-grid { grid-template-columns: repeat(2, 1fr); } }
.perm-grid span { background: var(--surface); border: 1px solid rgba(255,48,64,0.26); border-radius: 8px; padding: 12px 10px; text-align: center; font-size: 0.85rem; font-weight: 600; color: #ffd4d8; }
.modelgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; margin: 14px 0; }
.modelgrid span { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 6px; text-align: center; font-family: var(--mono); font-size: 0.82rem; color: var(--ink-soft); }
.redact { background: #2a2c3a; color: #2a2c3a; border-radius: 3px; padding: 0 6px; user-select: none; }
.backlink { display: inline-block; margin: 18px 0 0; font-family: var(--mono); font-size: 0.85rem; color: var(--ink-soft); }
.evidence-note { background: var(--surface); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); border-radius: 8px; padding: 14px 16px; margin: 16px 0; font-size: 0.95rem; color: var(--ink-soft); }
.fine { font-size: 0.92rem; color: var(--ink-faint); }
.fine strong { color: var(--ink); }
.note-dim { color: var(--ink-faint); font-size: 0.92rem; }

/* Timeline */
.timeline { list-style: none; padding-left: 0; margin: 10px 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 22px 26px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.timeline li.pending::before { background: var(--ink-faint); }
.timeline time { display: block; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.05em; color: var(--accent-ink); text-transform: uppercase; margin-bottom: 4px; }
.timeline li.pending time { color: var(--ink-faint); }

/* Sources */
.sources { font-size: 0.96rem; padding-left: 20px; }
.sources li { margin: 9px 0; }

/* Tip */
.tip { position: relative; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); padding: 26px; text-align: center; overflow: hidden; }
.tip::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: var(--accent); }
.tip h2 { color: var(--accent-ink); }
.mail { display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: 1.05rem; font-weight: 700; color: var(--accent-ink); }

#timeline, #sources, #tips { padding-top: 34px; padding-bottom: 10px; }
#timeline h2, #sources h2 { margin-bottom: 18px; }

/* ---------- Publisher (CEC) credit ---------- */
.publisher {
  position: relative;
  margin: 30px 0 0;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.publisher-in { position: relative; z-index: 1; padding: 26px 20px; }
.pub-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pub-mark {
  font-family: var(--font-cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; font-size: 1.25rem; color: var(--ink);
}
.pub-mark .err { color: var(--accent-ink); }
.pub-tag { color: var(--ink-faint); font-size: 0.9rem; }
.pub-body { margin-top: 14px; color: var(--ink-soft); font-size: 0.96rem; max-width: 68ch; }
.pub-body strong { color: var(--ink); }

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--border); background: var(--bg-2); padding: 30px 0 48px; color: var(--ink-faint); font-size: 0.86rem; }
footer.site p { margin: 0 0 12px; }
footer.site a { color: var(--ink-soft); }
.disclaimer { font-size: 0.8rem; line-height: 1.6; opacity: 0.92; }
