/* Threat Guard — single stylesheet. No external resources, no trackers. */

:root {
  --bg: #f6f3ea;
  --surface: #fffdf7;
  --surface-alt: #efeadc;
  --ink: #201d18;
  --muted: #514c44;
  --primary: #0e4a45;
  --primary-dark: #093430;
  --accent: #9c3f1c;
  --line: #d9d0be;
  --radius: 4px;
  --wrap: 1140px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.68 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  line-height: 1.22;
  color: var(--primary-dark);
  margin: 2.2rem 0 0.8rem;
  font-weight: 700;
}

h1 { font-size: 2.15rem; margin-top: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.18rem; }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1.05rem; }

a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

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

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--primary-dark);
  color: #fff; padding: 12px 18px; z-index: 50; text-decoration: none;
}
.skip:focus { left: 0; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 2px solid var(--primary-dark);
}

.hdr { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem; font-weight: 700; color: var(--primary-dark);
  text-decoration: none; letter-spacing: -0.01em;
}

.brand .mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: var(--radius);
  background: var(--primary-dark); color: #f6f3ea;
  font-size: 0.86rem; letter-spacing: 0.04em;
}

.menu-toggle {
  margin-left: auto; display: none;
  font: inherit; font-size: 0.95rem;
  background: var(--surface-alt); color: var(--primary-dark);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 14px; cursor: pointer;
}

.primary-nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 2px 4px; }

.primary-nav a {
  display: inline-block; padding: 7px 10px; font-size: 0.9rem;
  color: var(--muted); text-decoration: none; border-radius: var(--radius);
}
.primary-nav a:hover { background: var(--surface-alt); color: var(--primary-dark); }
.primary-nav a[aria-current="page"] {
  color: var(--primary-dark); font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---------- Layout ---------- */

main { display: block; padding: 2.4rem 0 3rem; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 2.6rem; align-items: start; }
.prose { max-width: 42rem; }
.prose.full { max-width: 46rem; }

.sidebar { position: sticky; top: 84px; font-size: 0.94rem; }
.sidebar h2, .sidebar h3 { font-size: 1rem; margin-top: 0; }
.sidebar ol, .sidebar ul { padding-left: 1.1rem; margin: 0 0 1rem; }
.sidebar li { margin-bottom: 0.45rem; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1.4rem;
}

/* ---------- Hero ---------- */

.hero { background: var(--primary-dark); color: #f1ece0; padding: 3rem 0 2.6rem; }
.hero h1 { color: #fffdf7; max-width: 22ch; }
.hero p { color: #e4ddce; max-width: 62ch; font-size: 1.06rem; }
.hero a { color: #ffd9a8; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.74rem;
  font-weight: 700; color: #f3bd90; margin: 0 0 0.9rem;
}

.path-list { list-style: none; counter-reset: step; padding: 0; margin: 1.8rem 0 0; display: grid; gap: 8px; }
.path-list li { counter-increment: step; }
.path-list a {
  display: flex; gap: 12px; align-items: baseline;
  background: rgba(255, 253, 247, 0.07);
  border: 1px solid rgba(255, 253, 247, 0.28);
  border-radius: var(--radius); padding: 11px 14px;
  color: #fffdf7; text-decoration: none;
}
.path-list a:hover { background: rgba(255, 253, 247, 0.16); color: #fffdf7; }
.path-list a::before {
  content: counter(step); flex: 0 0 auto;
  font-family: Georgia, serif; font-size: 0.85rem; font-weight: 700;
  color: #f3bd90;
}
.path-list .label { font-weight: 600; }
.path-list .note { display: block; font-size: 0.86rem; color: #e4ddce; font-weight: 400; }

/* ---------- Sections ---------- */

.section { padding: 2.4rem 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: 0; }
.section > .wrap > h2:first-child { margin-top: 0; }

.tint { background: var(--surface-alt); }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem 1.25rem;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

/* ---------- Disclosure ---------- */

.disclosure {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin: 0 0 1.8rem;
}
.disclosure h2 { margin: 0 0 0.6rem; font-size: 1.12rem; color: var(--accent); }
.disclosure p:last-child { margin-bottom: 0; }

.link-note {
  font-size: 0.95rem; color: var(--muted);
  border-left: 3px solid var(--accent); padding-left: 12px; margin: 0.6rem 0 1.4rem;
}

.outlink {
  display: inline-block; background: var(--primary); color: #fffdf7;
  padding: 12px 20px; border-radius: var(--radius); font-weight: 600;
  text-decoration: none; border: 1px solid var(--primary-dark);
}
.outlink:hover { background: var(--primary-dark); color: #fffdf7; }

/* ---------- Body units ---------- */

.callout {
  background: var(--surface); border-left: 4px solid var(--primary);
  padding: 1rem 1.2rem; margin: 1.6rem 0; border-radius: 0 var(--radius) var(--radius) 0;
}
.callout h3 { margin-top: 0; font-size: 1.05rem; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

.watch {
  background: #fbf0e6; border: 1px solid #cf9b73;
  padding: 1rem 1.2rem; margin: 1.6rem 0; border-radius: var(--radius);
}
.watch h3 { margin-top: 0; font-size: 1.05rem; color: var(--accent); }
.watch p:last-child, .watch ul:last-child { margin-bottom: 0; }

.method {
  background: var(--surface-alt); border: 1px dashed var(--muted);
  padding: 1rem 1.2rem; margin: 1.6rem 0; border-radius: var(--radius);
}
.method h3 { margin-top: 0; font-size: 1.05rem; }
.method p:last-child { margin-bottom: 0; }

ol.procedure { padding-left: 1.3rem; }
ol.procedure > li { margin-bottom: 1rem; }
ol.procedure > li > strong { display: block; }

ul.checklist { list-style: none; padding-left: 0; }
ul.checklist li { position: relative; padding-left: 30px; margin-bottom: 0.7rem; }
ul.checklist li::before {
  content: ""; position: absolute; left: 0; top: 5px;
  width: 16px; height: 16px; border: 2px solid var(--primary); border-radius: 2px;
}

dl.terms dt { font-weight: 700; color: var(--primary-dark); margin-top: 1rem; }
dl.terms dd { margin: 0.25rem 0 0; }

.tablewrap { overflow-x: auto; margin: 1.6rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; background: var(--surface); }
caption { text-align: left; font-size: 0.9rem; color: var(--muted); padding-bottom: 8px; }
th, td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
thead th { background: var(--surface-alt); color: var(--primary-dark); }

details.faq {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 8px;
}
details.faq > summary {
  cursor: pointer; padding: 12px 14px; font-weight: 600; color: var(--primary-dark);
  list-style: none;
}
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::before { content: "+ "; color: var(--accent); font-weight: 700; }
details.faq[open] > summary::before { content: "\2013 "; }
details.faq .faq-body { padding: 0 14px 4px; }

#expandAll {
  font: inherit; font-size: 0.92rem; background: var(--surface-alt);
  color: var(--primary-dark); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 14px; cursor: pointer; margin-bottom: 12px;
}

.related { background: var(--surface); border-top: 3px solid var(--primary); padding: 1.2rem 1.3rem; margin-top: 2.6rem; }
.related h2 { margin-top: 0; font-size: 1.12rem; }
.related ul { margin: 0; padding-left: 1.1rem; }
.related li { margin-bottom: 0.4rem; }

.steplinks { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2.4rem; font-size: 0.95rem; }

.meta { color: var(--muted); font-size: 0.92rem; }
.lede { font-size: 1.1rem; color: var(--muted); }

figure.diagram { margin: 1.8rem 0; }
figure.diagram svg { width: 100%; height: auto; display: block; }
figure.diagram figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 0.5rem; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--primary-dark); color: #e4ddce;
  padding: 2.4rem 0 2.6rem; margin-top: 2rem; font-size: 0.94rem;
}
.site-footer a { color: #ffd9a8; }
.site-footer p { margin: 0 0 0.3rem; color: #e4ddce; }
.pub-name { font-family: Georgia, serif; font-size: 1.1rem; color: #fffdf7 !important; font-weight: 700; }
.footer-links { margin: 1.1rem 0; color: #e4ddce; }
.tm { margin-top: 1.1rem !important; max-width: 70ch; }
.reviewed { margin-top: 0.8rem !important; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 1.6rem; }
  .sidebar { position: static; }
  .menu-toggle { display: block; }
  .primary-nav { display: none; width: 100%; flex-direction: column; margin-left: 0; padding-bottom: 8px; }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: 10px 6px; border-bottom: 1px solid var(--line); border-radius: 0; }
  h1 { font-size: 1.8rem; }
  .hero { padding: 2.2rem 0 2rem; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.35rem; }
}
