/* All Eyes on Me Wiki — "security monitor" theme.
   Reference: a night-shift CCTV desk. One signature element: the hero is framed like a camera feed
   (corner brackets + REC light). Everything else stays quiet: one red accent, one green status tint. */

:root {
  --bg: #0d1110;
  --panel: #151b19;
  --panel-2: #1b2320;
  --ink: #e4ebe6;
  --muted: #93a39b;
  --line: #27322d;
  --rec: #e5484d;
  --rec-deep: #c4363b;
  --signal: #4fd1a0;
  --on-rec: #ffffff;
  --radius: 10px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .08);
  --head: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --icon-filter: invert(92%) sepia(6%) saturate(220%) hue-rotate(95deg);
  color-scheme: dark;
}
[data-mode="light"] {
  --bg: #eef2ef;
  --panel: #ffffff;
  --panel-2: #f5f8f6;
  --ink: #131a17;
  --muted: #56655e;
  --line: #d3dcd7;
  --rec: #c9343a;
  --rec-deep: #a8282d;
  --signal: #1f8a63;
  --icon-filter: none;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  overflow-x: hidden;
}
.gfs-raw { display: contents; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--rec) 60%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--rec); }
:focus-visible { outline: 2px solid var(--rec); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 16px; }
h1 { font-size: 48px; }
h2 { font-size: 28px; margin-top: 48px; }
h3 { font-size: 18px; }
p { margin: 0 0 16px; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 24px; }
.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 30; background: var(--rec); color: var(--on-rec); padding: 8px 16px; border-radius: var(--radius); }

.ui-icon { width: 22px; height: 22px; flex-shrink: 0; vertical-align: middle; filter: var(--icon-filter); }

.eyebrow, .hero-kicker {
  display: block;
  font: 600 12px/1.4 var(--head);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 8px;
}
.meta, .article-meta { color: var(--muted); font-size: 14px; }
.lead { font-size: 18px; color: var(--muted); max-width: 70ch; }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; gap: 16px;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font: 700 18px/1 var(--head);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.brand::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--rec); box-shadow: 0 0 0 4px color-mix(in srgb, var(--rec) 25%, transparent);
}
.brand-context {
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px;
}
.site-header > nav { margin-left: auto; display: flex; gap: 4px; }
.site-header > nav a {
  text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: var(--radius);
}
.site-header > nav a:hover { background: var(--panel-2); color: var(--ink); }
#theme-toggle {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--radius);
  background: transparent; border: 1px solid var(--line); color: var(--ink); cursor: pointer;
}
#theme-toggle:hover { background: var(--panel-2); }
[data-mode="dark"] .theme-moon, [data-mode="light"] .theme-sun { display: none; }

/* ---------- home: camera-feed hero ---------- */
.expedition-hero { padding: 32px 24px; }
.hero-content {
  position: relative;
  padding: 64px 48px 48px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 3px, color-mix(in srgb, var(--ink) 3%, transparent) 3px 4px),
    var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
}
.hero-content::before, .hero-content::after {
  content: ""; position: absolute; width: 32px; height: 32px; pointer-events: none;
  border: 2px solid var(--muted);
}
.hero-content::before { top: 16px; left: 16px; border-right: 0; border-bottom: 0; }
.hero-content::after { bottom: 16px; right: 16px; border-left: 0; border-top: 0; }
.hero-kicker { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.hero-kicker::before {
  content: "REC"; color: var(--on-rec); background: var(--rec);
  padding: 2px 8px; border-radius: 4px; letter-spacing: .1em;
}
.expedition-hero h1 { font-size: 48px; max-width: 16ch; margin-top: 16px; }
.hero-description { color: var(--muted); max-width: 62ch; font-size: 18px; }

.hero-search {
  display: flex; align-items: center; gap: 8px;
  margin-top: 24px; max-width: 640px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 4px 4px 16px;
}
.hero-search input {
  flex: 1; min-width: 0; height: 44px;
  background: transparent; border: 0; color: var(--ink); font: inherit;
}
.hero-search input:focus { outline: none; }
.hero-search:focus-within { border-color: var(--rec); }
.hero-search button, .button, #consent-allow {
  height: 44px; padding: 0 24px;
  background: var(--rec); color: var(--on-rec);
  border: 0; border-radius: var(--radius);
  font: 600 16px/44px var(--body); text-decoration: none; cursor: pointer;
  display: inline-block;
}
.hero-search button:hover, .button:hover, #consent-allow:hover { background: var(--rec-deep); color: var(--on-rec); }

.task-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.task-links a {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; text-decoration: none; font-weight: 600;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.task-links a:hover { border-color: var(--rec); color: var(--ink); }

.facts {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0 32px; margin: 32px 0 0;
  border-top: 1px dashed var(--line);
}
.facts > div { display: grid; grid-template-columns: 12ch 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.facts dt { font: 600 12px/1.6 var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-size: 16px; }

.home-content { padding-bottom: 48px; }
.home-content > section, .home-content > nav { margin-top: 64px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 0 0 16px; }
.section-heading > a { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted); }
.section-heading > a .ui-icon { width: 16px; height: 16px; }
.section-intro { color: var(--muted); max-width: 70ch; }

/* featured guides: numbered "case files", not identical cards */
.feature-grid {
  list-style: none; padding: 0; margin: 24px 0 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px;
  counter-reset: casefile;
}
.feature-grid li { counter-increment: casefile; border-top: 1px solid var(--line); }
.feature-card { display: grid; grid-template-columns: 48px 1fr; gap: 16px; padding: 24px 0; text-decoration: none; }
.feature-card::before {
  content: counter(casefile, decimal-leading-zero);
  font: 700 22px/1.2 var(--head); color: var(--rec);
}
.feature-card h3 { margin: 0 0 8px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 16px; }
.feature-card:hover h3 { color: var(--rec); }

/* recently checked: a timeline log */
.recent-list { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.recent-list li {
  position: relative; display: grid; grid-template-columns: 12ch 1fr 24px; gap: 4px 16px;
  align-items: baseline; padding: 12px 0 12px 24px;
}
.recent-list li::before {
  content: ""; position: absolute; left: -7px; top: 20px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--signal);
}
.recent-list time { font: 600 14px/1.6 var(--head); color: var(--muted); }
.recent-list a { font-weight: 600; }
.recent-list p { grid-column: 2; margin: 0; color: var(--muted); font-size: 16px; }
.recent-list .ui-icon { grid-column: 3; grid-row: 1; width: 16px; height: 16px; }

.browse-modules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.browse-modules a {
  display: flex; align-items: center; gap: 12px; padding: 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; font: 700 22px/1.2 var(--head);
}
.browse-modules .meta { margin-left: auto; font: 400 14px/1.6 var(--body); }
.browse-modules a:hover { border-color: var(--rec); color: var(--ink); }

/* ---------- FAQ / details ---------- */
details { border-bottom: 1px solid var(--line); }
summary {
  cursor: pointer; list-style: none; padding: 16px 32px 16px 0; position: relative;
  font-weight: 600;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 400 22px/1.4 var(--head); color: var(--rec); }
details[open] > summary::after { content: "–"; }
details > p { color: var(--muted); max-width: 70ch; }
.home-section { margin-top: 64px; }
.home-section h2 { margin-top: 0; }

/* ---------- guide pages ---------- */
main.wrap { padding-block: 32px 48px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.breadcrumb a { text-decoration: none; color: var(--muted); }
.breadcrumb > * + *::before { content: "/"; margin-right: 8px; color: var(--line); }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start; }
.article-content { min-width: 0; }
.article-content h1 { font-size: 40px; }
.article-content > p, article p, article li { max-width: 70ch; }
article section { margin-top: 48px; }
article h2 { margin-top: 0; padding-top: 16px; border-top: 1px solid var(--line); }
article ul, article ol { padding-left: 24px; }
article li { margin-bottom: 8px; }

.quick-answer {
  margin: 24px 0 32px; padding: 24px;
  background: var(--panel); border-radius: var(--radius);
  border-left: 4px solid var(--rec); box-shadow: var(--shadow-1);
}
.quick-answer h2 { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--rec); margin: 0 0 8px; border: 0; padding: 0; }
.quick-answer p { margin-bottom: 12px; }
.answer-actions { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; font-weight: 600; margin: 0; }

.toc { position: sticky; top: 24px; font-size: 14px; }
.toc nav { display: grid; gap: 2px; border-left: 1px solid var(--line); padding-left: 16px; }
.toc a { text-decoration: none; color: var(--muted); padding: 4px 0 4px 14px; margin-left: -17px; border-left: 3px solid transparent; }
.toc a[aria-current="location"] { color: var(--ink); font-weight: 600; border-left-color: var(--rec); }
.mobile-toc { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; margin-bottom: 24px; }
.mobile-toc nav { display: grid; gap: 8px; padding-bottom: 16px; font-size: 16px; }

.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
caption { caption-side: top; text-align: left; padding: 12px 16px; font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font: 600 12px/1.6 var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--panel); }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 600; }

.source-section h2 { font-size: 22px; }
.sources { padding-left: 24px; font-size: 16px; }
.sources span { display: block; color: var(--muted); font-size: 14px; }

.next-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 48px; padding: 16px; background: var(--panel-2); border-radius: var(--radius); }
.next-steps span { font-weight: 600; margin-right: 8px; }
.next-steps a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; text-decoration: none; background: var(--panel); }
.next-steps a:hover { border-color: var(--rec); }

/* ---------- lists of guides ---------- */
.entry-list { list-style: none; padding: 0; margin: 24px 0 0; }
.entry-list > li { display: flex; gap: 24px; align-items: center; padding: 24px 0; border-top: 1px solid var(--line); }
.entry-list > li > div { flex: 1; min-width: 0; }
.entry-list h2, .entry-list h3 { font-size: 22px; margin: 0 0 8px; }
.entry-list h2 a, .entry-list h3 a { text-decoration: none; }
.entry-list p { color: var(--muted); margin: 0 0 8px; max-width: 70ch; }
.read-link {
  flex-shrink: 0; display: inline-flex; align-items: center; height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-weight: 600;
}
.read-link:hover { border-color: var(--rec); color: var(--ink); }
mark { background: color-mix(in srgb, var(--rec) 30%, transparent); color: inherit; border-radius: 2px; }

#search-tools {
  display: grid; grid-template-columns: 1fr 220px auto; gap: 8px 16px; align-items: end;
  margin: 24px 0; padding: 24px; background: var(--panel); border-radius: var(--radius);
}
#search-tools label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); grid-row: 1; }
#search-tools label[for="module-filter"] { grid-column: 2; }
#query, #module-filter {
  grid-row: 2; height: 44px; padding: 0 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
#clear-search { grid-row: 2; grid-column: 3; }
#search-status { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 14px; }
#clear-search, #consent-reject {
  height: 44px; padding: 0 16px; background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); font: 600 16px var(--body); cursor: pointer;
}
#empty-search { color: var(--rec); font-weight: 600; }

/* ---------- ads (fixed-size slots keep their size; the banner is scaled by script) ---------- */
.site-ads { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 48px; }
.ad-placement { min-width: 0; padding-top: 12px; border-top: 1px dashed var(--line); }
.ad-label { margin: 0 0 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: center; }
.native-ad-frame { display: block; width: 100%; border: 0; background: transparent; }
.banner-ad-box { width: 100%; overflow: hidden; }
.banner-ad-size { position: relative; margin-inline: auto; max-width: 100%; overflow: hidden; }
.banner-ad-frame { position: absolute; top: 0; left: 0; max-width: none; border: 0; transform-origin: top left; background: transparent; }

/* ---------- footer, consent ---------- */
body footer.wrap { margin-top: 48px; padding-block: 32px 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer strong { color: var(--ink); font: 700 18px/1.2 var(--head); display: block; margin-bottom: 8px; }
footer p { max-width: 70ch; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
footer nav a { color: var(--muted); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }

.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20;
  max-width: 520px; margin-inline: auto; padding: 24px;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-top: 4px solid var(--rec); border-radius: var(--radius);
  box-shadow: var(--shadow-2);
}
.consent p { font-size: 14px; margin-bottom: 16px; }
.consent > div { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .mobile-toc { display: block; }
  .task-links { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 16px; }
  h1, .expedition-hero h1, .article-content h1 { font-size: 32px; }
  h2 { font-size: 22px; }
  .site-header { flex-wrap: wrap; gap: 8px; padding-block: 8px; }
  .brand-context { display: none; }
  .site-header > nav { margin-left: 0; order: 3; width: 100%; }
  #theme-toggle { margin-left: auto; }
  .expedition-hero { padding: 16px; }
  .hero-content { padding: 48px 20px 32px; }
  .task-links { gap: 8px; }
  .task-links a { padding: 12px; gap: 8px; font-size: 14px; min-width: 0; }
  .task-links .ui-icon { width: 18px; height: 18px; }
  .hero-search button { padding: 0 16px; }
  .facts, .feature-grid, .browse-modules, .site-ads { grid-template-columns: 1fr; }
  .facts > div { grid-template-columns: 1fr; gap: 4px; }
  .recent-list li { grid-template-columns: 1fr; }
  .recent-list p, .recent-list .ui-icon { grid-column: 1; grid-row: auto; }
  .recent-list .ui-icon { display: none; }
  .entry-list > li { flex-direction: column; align-items: stretch; }
  .read-link { justify-content: center; }
  #search-tools { grid-template-columns: 1fr; }
  #search-tools label, #query, #module-filter, #clear-search, #search-status { grid-column: 1; grid-row: auto; }
  thead { display: none; }
  table, caption, tbody, tr, th, td { display: block; }
  tbody tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  tbody th, tbody td { padding: 4px 0; border: 0; }
  td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
}
