/* ==========================================================================
   secretpassword.net: site stylesheet
   ========================================================================== */

/* ---------- Fonts (self-hosted, Latin subset) ---------- */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  /* Weight 600 only (the only weight the site uses), optical sizes kept. */
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --ink: #0a0a0a;
  --ink-2: #27272a;
  --ink-3: #52525b;
  --line: #d4d4d8;
  --line-strong: #0a0a0a;

  --accent: #0047ff;
  --accent-hover: #0036c2;
  --accent-ink: #ffffff;
  --accent-soft: #e6edff;

  --good: #2e7a4d;
  --good-soft: #e3f1e8;
  --fair: #806510;
  --fair-soft: #f6efd9;
  --warn: #a3520f;
  --warn-soft: #f8e9dc;
  --bad: #b03a2e;
  --bad-soft: #f8e4e1;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow: none;
  --container: 1100px;
  --gutter: 20px;
  color-scheme: light;
}

/* Dark theme: follows the system setting unless the visitor picks one with the header toggle (assets/js/theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #0f0f11;
    --surface-2: #1a1a1d;
    --ink: #fafafa;
    --ink-2: #d4d4d8;
    --ink-3: #a1a1aa;
    --line: #27272a;
    --line-strong: #52525b;

    --accent: #5b9bff;
    --accent-hover: #85b4ff;
    --accent-ink: #000000;
    --accent-soft: #0f1f3d;

    --good: #6cc391;
    --good-soft: #1b2e24;
    --fair: #d8bc5c;
    --fair-soft: #2e2a1a;
    --warn: #e59a5c;
    --warn-soft: #33241a;
    --bad: #ec8577;
    --bad-soft: #36201e;

    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #0f0f11;
  --surface-2: #1a1a1d;
  --ink: #fafafa;
  --ink-2: #d4d4d8;
  --ink-3: #a1a1aa;
  --line: #27272a;
  --line-strong: #52525b;

  --accent: #5b9bff;
  --accent-hover: #85b4ff;
  --accent-ink: #000000;
  --accent-soft: #0f1f3d;

  --good: #6cc391;
  --good-soft: #1b2e24;
  --fair: #d8bc5c;
  --fair-soft: #2e2a1a;
  --warn: #e59a5c;
  --warn-soft: #33241a;
  --bad: #ec8577;
  --bad-soft: #36201e;

  --shadow: none;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }

code, kbd, .mono { font-family: var(--font-mono); font-size: 0.9em; }
code {
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

strong { font-weight: 600; }

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

::selection { background: var(--accent-soft); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 30px; height: 30px; flex-shrink: 0; }
.brand-tld { color: var(--ink-3); font-weight: 500; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
.site-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a[aria-current] {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Tools dropdown: opens on hover or keyboard focus (desktop), inline on mobile */
.nav-has-sub { position: relative; }
.nav-has-sub > a::after {
  content: "";
  display: inline-block;
  width: 0.4em; height: 0.4em;
  margin-left: 0.45em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.2em) rotate(45deg);
}
.site-nav .nav-sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.nav-has-sub:hover > .nav-sub,
.nav-has-sub:focus-within > .nav-sub { display: flex; }
.site-nav .nav-sub a[aria-current="page"] { background: var(--accent-soft); }

/* "Been hacked?" stands apart from the regular items */
.site-nav a.nav-urgent {
  color: var(--bad);
  border: 1px solid var(--bad);
  margin-left: 8px;
}
.site-nav a.nav-urgent:hover,
.site-nav a.nav-urgent[aria-current] { color: var(--bad); background: var(--bad-soft); }

.nav-toggle {
  display: none;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
}

@media (max-width: 880px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 12px; font-size: 1rem; }
  .nav-has-sub > a::after { display: none; }
  .site-nav .nav-sub {
    display: flex;
    position: static;
    min-width: 0;
    padding: 0 0 0 16px;
    border: 0;
    border-left: 2px solid var(--line);
    margin-left: 12px;
    border-radius: 0;
    box-shadow: none;
    background: none;
  }
  .site-nav a.nav-urgent { margin: 8px 0 0; text-align: center; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.92rem;
  color: var(--ink-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, 1fr);
  gap: 32px;
  padding-top: 40px;
  padding-bottom: 32px;
}
.footer-grid h2 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); text-decoration: underline; }
.footer-about p { max-width: 34ch; }
.footer-grid a.footer-urgent { color: var(--bad); font-weight: 600; }
@media (max-width: 1040px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-about { grid-column: 1 / -1; }
}
.footer-base {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  padding-bottom: 24px;
  font-size: 0.85rem;
  color: var(--ink-3);
}
@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn--sm { padding: 8px 14px; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.text-link { font-weight: 500; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- Page heads & sections ---------- */
.page-head {
  padding-top: 48px;
  padding-bottom: 28px;
}
.page-head .lede { max-width: 62ch; }
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--accent); }

/* Breadcrumb (sits where the eyebrow used to be) */
.breadcrumb { margin-bottom: 10px; font-size: 0.88rem; color: var(--ink-3); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; color: var(--ink-3); }
.breadcrumb a { color: var(--ink-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--ink-3); }

/* Anchor targets clear the sticky header */
h2[id], h3[id], section[id] { scroll-margin-top: 88px; }

/* Inline "On this page" list for full-width pages */
.jump-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 0.92rem; }
.jump-nav span { color: var(--ink-3); }
.jump-nav a { font-weight: 500; }

/* Homepage "Guides written for" strip */
.audience-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.audience-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 14px; padding-bottom: 14px; }
.audience-inner h2 { font-family: var(--font-sans); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); margin: 0; }
.audience-inner ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.audience-inner a { font-weight: 500; }

/* "Read next" block at the end of guides, tools and quizzes */
.next-steps { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.next-steps > h2 { margin-bottom: 18px; }
.lede { font-size: 1.15rem; color: var(--ink-2); }

.section { padding: 56px 0; }
.section--alt { background: var(--surface-2); }
.section-head { max-width: 62ch; margin-bottom: 28px; }
.section-head p { color: var(--ink-2); }

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .grid--3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid--2 { grid-template-columns: 1fr; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-2); }
.card p:last-child { margin-bottom: 0; }
.card .meta, .card .card-label, .card .pm-byline { color: var(--ink-3); }

.card--link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.card--link:hover { border-color: var(--accent); color: inherit; }
.card--link .card-more {
  margin-top: auto;
  padding-top: 12px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}
.card-kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.card-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

/* ---------- Home hero ---------- */
.hero { padding: 64px 0 56px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.3rem); }
.hero .lede { margin-bottom: 28px; max-width: 46ch; }
@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
}

.quick-gen .actions { margin-top: 16px; }

/* ---------- Password output ---------- */
.pw-output {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-wrap: anywhere;
  user-select: all;
  min-height: 3.2em;
}
.pw-output--lg { font-size: clamp(1.25rem, 3vw, 1.7rem); padding: 18px 20px; }
.meta { font-size: 0.88rem; color: var(--ink-3); margin: 10px 0 0; }

/* ---------- Tool layout ---------- */
.tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tool-section { padding: 24px; }
.tool-section + .tool-section { border-top: 1px solid var(--line); }
.tool-section--muted { background: var(--surface-2); }
.tool-split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
}
.tool-split > .tool-section + .tool-section { border-top: 0; border-left: 1px solid var(--line); }
@media (max-width: 860px) {
  .tool-split { grid-template-columns: 1fr; }
  .tool-split > .tool-section + .tool-section { border-left: 0; border-top: 1px solid var(--line); }
}
.tool-heading {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
.field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
label, .label { font-weight: 600; font-size: 0.95rem; }
.value {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--accent);
}

.input-wrap { position: relative; display: flex; }
.input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 76px 12px 14px;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--ink-3); font-family: var(--font-sans); }
.input-btn {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
}
.input-btn:hover { color: var(--ink); background: var(--surface-2); }

.inline-form { display: flex; gap: 10px; }
.inline-form .input-wrap { flex: 1; }
@media (max-width: 560px) {
  .inline-form { flex-direction: column; }
}

select {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  width: 100%;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin: 4px 0 0;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
}

.scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-top: 4px;
}

fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
legend { font-weight: 600; font-size: 0.95rem; padding: 0; margin-bottom: 10px; }

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 560px) { .options { grid-template-columns: 1fr; } }
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
}
.option:hover { border-color: var(--line-strong); }
.option-sample {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-3);
}
.option--wide { grid-column: 1 / -1; }

.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.segmented button {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 4px;
  padding: 8px 14px;
  cursor: pointer;
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ---------- Strength meter ---------- */
.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 20px 0 8px;
}
.meter-label { font-weight: 600; }
.meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  height: 8px;
}
.meter span {
  border-radius: 99px;
  background: var(--line);
  transition: background-color 0.2s;
}
.meter[data-tier="1"] span:nth-child(-n+1) { background: var(--bad); }
.meter[data-tier="2"] span:nth-child(-n+2) { background: var(--warn); }
.meter[data-tier="3"] span:nth-child(-n+3) { background: var(--fair); }
.meter[data-tier="4"] span:nth-child(-n+4) { background: var(--good); }
.meter[data-tier="5"] span:nth-child(-n+5) { background: var(--good); }
.rating[data-tier="1"] { color: var(--bad); }
.rating[data-tier="2"] { color: var(--warn); }
.rating[data-tier="3"] { color: var(--fair); }
.rating[data-tier="4"], .rating[data-tier="5"] { color: var(--good); }
.verdict { color: var(--ink-2); font-size: 0.95rem; margin-top: 10px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.stat-label { font-size: 0.82rem; color: var(--ink-3); }
.stat-value {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.stat-note { font-size: 0.8rem; color: var(--ink-3); }

/* ---------- Checklist ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  font-size: 0.94rem;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface) center / 12px no-repeat;
}
.checklist li[data-state="pass"] { color: var(--ink); }
.checklist li[data-state="pass"]::before {
  border-color: var(--good);
  background-color: var(--good);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.checklist li[data-state="fail"]::before {
  border-color: var(--bad);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 3.5l5 5M8.5 3.5l-5 5' fill='none' stroke='%23b03a2e' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---------- Result boxes ---------- */
.result {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left-width: 4px;
  padding: 14px 16px;
  font-size: 0.95rem;
  color: var(--ink-2);
  background: var(--surface);
}
.result p { margin: 0 0 6px; }
.result p:last-child { margin-bottom: 0; }
.result__title { font-weight: 600; color: var(--ink); font-size: 1.02rem; }
.result--good { border-color: var(--good); background: var(--good-soft); }
.result--bad { border-color: var(--bad); background: var(--bad-soft); }
.result--bad .result__title { color: var(--bad); }
.result--warn { border-color: var(--warn); background: var(--warn-soft); }
.result--pending { border-left-color: var(--accent); }

/* ---------- Details / inspector ---------- */
details.disclosure {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: 16px;
}
details.disclosure summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.94rem;
}
details.disclosure[open] summary { border-bottom: 1px solid var(--line); }
.disclosure-body { padding: 14px; font-size: 0.9rem; }
.hash-row { margin-bottom: 12px; }
.hash-row:last-child { margin-bottom: 0; }
.hash-row .label { display: block; font-size: 0.85rem; margin-bottom: 4px; color: var(--ink-2); }
.hash {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 8px 10px;
  overflow-wrap: anywhere;
}
.hash--sent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Prose (article-style content) ---------- */
.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose .note {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.95rem;
}

.content-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) {
  .content-cols { grid-template-columns: 1fr; }
  .content-cols aside { order: -1; }
}
.toc {
  position: sticky;
  top: 88px;
  font-size: 0.92rem;
}
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  color: var(--ink-2);
  text-decoration: none;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  color: var(--ink-3);
  font-size: 0.85em;
  padding-top: 1px;
}
.toc a:hover { color: var(--accent); }
@media (max-width: 900px) { .toc { position: static; } }

/* Numbered practice sections */
.practice {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.practice:first-child { border-top: 0; padding-top: 0; }
.practice-num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

/* Steps list (k-anonymity etc.) */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin-bottom: 16px;
  color: var(--ink-2);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Password manager cards ---------- */
.pm-card { display: flex; flex-direction: column; }
.pm-card .tag {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-2);
  margin-bottom: 12px;
}
.pm-card--featured { border: 2px solid var(--accent); }
.pm-card--featured .tag { background: var(--accent-soft); color: var(--accent); }
.pm-byline { font-size: 0.88rem; color: var(--ink-3); margin-top: -4px; }
.spec {
  margin: 16px 0;
  padding: 0;
  font-size: 0.88rem;
}
.spec div {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.spec dt { color: var(--ink-3); }
.spec dd { margin: 0; }
.proscons { list-style: none; padding: 0; margin: 0 0 16px; font-size: 0.92rem; }
.proscons li { padding-left: 22px; position: relative; margin-bottom: 6px; color: var(--ink-2); }
.proscons li::before { position: absolute; left: 2px; font-weight: 700; }
.proscons .pro::before { content: "+"; color: var(--good); }
.proscons .con::before { content: "\2212"; color: var(--warn); }
.pm-best { font-size: 0.9rem; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.pm-card .btn { margin-top: 12px; width: 100%; }

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; min-width: 640px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 600; font-size: 0.88rem; }
tbody th { font-weight: 600; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
td.yes { color: var(--good); font-weight: 500; }
td.no { color: var(--ink-3); }

/* ---------- Privacy summary ---------- */
.privacy-points .card h3 { font-family: var(--font-sans); font-size: 1.02rem; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.is-visible { opacity: 1; transform: none; }
.toast--error { background: var(--bad); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ==========================================================================
   Guides, quizzes and interactive content
   ========================================================================== */

.reviewed { font-size: 0.88rem; color: var(--ink-3); margin: 0; }

/* Table inside a .tool panel */
.table-wrap--flush {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
.crack-time { font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.crack-time[data-level="bad"] { color: var(--bad); }
.crack-time[data-level="warn"] { color: var(--warn); }
.crack-time[data-level="good"] { color: var(--good); }

/* Badges (method ratings etc.) */
.badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 9px;
  border-radius: 99px;
  vertical-align: middle;
  background: var(--surface-2);
  color: var(--ink-2);
}
.badge--good { background: var(--good-soft); color: var(--good); }
.badge--fair { background: var(--fair-soft); color: var(--fair); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }

/* Ranked option cards (2FA methods, etc.) */
.ranked { list-style: none; padding: 0; margin: 0 0 1.2em; display: grid; gap: 12px; }
.ranked > li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.ranked h3 { margin: 0 0 6px; font-size: 1.1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ranked p { margin: 0 0 6px; color: var(--ink-2); }
.ranked p:last-child { margin-bottom: 0; }

/* Callouts */
.callout {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 0 0 1.2em;
}
.callout p:last-child { margin-bottom: 0; }
.callout--warn { border-color: var(--warn); background: var(--warn-soft); }
.callout--bad { border-color: var(--bad); background: var(--bad-soft); }

/* Sources */
.sources {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink-2);
}
.sources h2 { font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600; margin: 0 0 8px; }
.sources ul { padding-left: 1.2em; margin: 0; }

/* Saved to-do checklists */
.todo-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.todo-progress { font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent); }
.todo-group { margin-bottom: 28px; }
.todo-group > h2 { font-size: 1.3rem; margin: 0 0 12px; }
.todo-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.todo-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.todo-item input { margin-top: 4px; width: 20px; height: 20px; }
.todo-item label { font-weight: 400; font-size: 1rem; cursor: pointer; }
.todo-item strong { display: block; font-weight: 600; margin-bottom: 2px; }
.todo-item span { color: var(--ink-2); font-size: 0.95rem; }
.todo-item:has(input:checked) { background: var(--good-soft); border-color: var(--good); }
.todo-item:has(input:checked) strong { text-decoration: line-through; text-decoration-color: var(--good); }

/* Quizzes */
.quiz-score {
  position: sticky;
  top: 72px;
  z-index: 5;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 16px;
}
.quiz-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; counter-reset: quiz; }
.quiz-q {
  counter-increment: quiz;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.quiz-q > .quiz-prompt { font-size: 1.08rem; font-weight: 500; margin-bottom: 14px; }
.quiz-q > .quiz-prompt::before {
  content: counter(quiz) ". ";
  font-family: var(--font-mono);
  color: var(--ink-3);
}
.quiz-answers { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-answers .btn[data-result="right"] { background: var(--good-soft); border-color: var(--good); color: var(--good); opacity: 1; cursor: default; }
.quiz-answers .btn[data-result="wrong"] { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); opacity: 1; cursor: default; }
.quiz-answers .btn[disabled]:not([data-result]) { opacity: 0.5; cursor: default; }
.quiz-explain { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-2); }
.quiz-explain p:last-child { margin-bottom: 0; }
.quiz-verdict { font-weight: 600; margin-right: 4px; }
.quiz-verdict[data-result="right"] { color: var(--good); }
.quiz-verdict[data-result="wrong"] { color: var(--bad); }

/* Phishing scenario "message" mock-ups (fictional brands only) */
.message {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.message-head { font-size: 0.85rem; color: var(--ink-3); margin-bottom: 8px; line-height: 1.5; }
.message-head b { color: var(--ink-2); font-weight: 600; }
.message p { margin-bottom: 8px; }
.message p:last-child { margin-bottom: 0; }
.fake-link { color: var(--accent); text-decoration: underline; font-family: var(--font-mono); font-size: 0.9em; overflow-wrap: anywhere; }

/* Security checkup */
.check-q {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 14px;
  box-shadow: var(--shadow);
}
.check-q legend { font-size: 1.05rem; font-weight: 500; float: left; width: 100%; margin-bottom: 12px; }
.check-q legend + * { clear: both; }
.check-opts { display: grid; gap: 6px; }
.check-opts label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-weight: 400;
  cursor: pointer;
}
.check-opts label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check-opts input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.checkup-results {
  margin-top: 32px;
  scroll-margin-top: 88px;
}
.score-big {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}
.advice-list { padding-left: 1.3em; margin: 0; }
.advice-list li { margin-bottom: 10px; color: var(--ink-2); }
.advice-list strong { color: var(--ink); }

/* Glossary */
.glossary { margin: 0; }
.glossary dt {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.15rem;
  margin-top: 22px;
  scroll-margin-top: 88px;
}
.glossary dd { margin: 4px 0 0; color: var(--ink-2); }
.alpha-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.alpha-nav a {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
  background: var(--surface);
}
.alpha-nav a:hover { border-color: var(--accent); }
.glossary-letter {
  font-family: var(--font-mono);
  color: var(--ink-3);
  font-size: 0.95rem;
  margin: 36px 0 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 88px;
}

/* Guide hub lists */
.hub-group { margin-bottom: 44px; }
.hub-group > h2 { margin-bottom: 6px; }
.hub-group > p { color: var(--ink-2); margin-bottom: 18px; max-width: 62ch; }
.card--link .card-meta { font-size: 0.85rem; color: var(--ink-3); margin-top: 4px; }

/* Step-by-step walkthrough */
.walkthrough { list-style: none; padding: 0; margin: 0; counter-reset: walk; }
.walkthrough > li {
  counter-increment: walk;
  position: relative;
  padding: 0 0 28px 52px;
  border-left: 2px solid var(--line);
  margin-left: 17px;
}
.walkthrough > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.walkthrough > li::before {
  content: counter(walk);
  position: absolute;
  left: -18px;
  top: -2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.walkthrough h3 { margin: 2px 0 8px; }
.walkthrough p, .walkthrough ul { color: var(--ink-2); }

/* Printable one-page sheet */
.print-sheet {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 760px;
}
.print-sheet h2 { margin-top: 0; }
.print-sheet ol { padding-left: 1.3em; }
.print-sheet li { margin-bottom: 10px; font-size: 1.05rem; }
.write-in {
  display: block;
  border-bottom: 1px solid var(--ink-3);
  height: 2em;
  margin-top: 4px;
}


@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .site-header, .site-footer, .skip-link, .no-print, .toc, .toasts, .breadcrumb, .next-steps { display: none !important; }
  .print-only-sheet main > *:not(.print-target) { display: none !important; }
  .print-sheet { border-color: #000; box-shadow: none; max-width: none; }
  a { color: #000; }
  .card, .tool, .table-wrap { box-shadow: none; }
}

.walkthrough > li { scroll-margin-top: 88px; }

/* Code blocks */
.prose pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0 0 1.2em;
}
.prose pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }

/* ---------- High-contrast look ---------- */
/* The header is a black bar in both themes; re-scoping the tokens darkens its dropdown and mobile menu too. */
.site-header {
  --bg: #0a0a0a;
  --surface: #0a0a0a;
  --surface-2: #27272a;
  --ink: #fafafa;
  --ink-2: #d4d4d8;
  --ink-3: #a1a1aa;
  --line: #27272a;
  --line-strong: #52525b;
  --accent: #6ea0ff;
  --accent-soft: #16233f;
  --bad: #ff6b5e;
  --bad-soft: #3a1714;
  color-scheme: dark;
  background: var(--surface);
  color: var(--ink);
}
.card, .tool { border-color: var(--line-strong); }

/* ---------- Theme toggle ---------- */
.site-nav { margin-left: auto; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }
@media (max-width: 880px) {
  .theme-toggle { margin-left: auto; }
}

/* ---------- Utility classes ----------
   These replace inline style="" attributes, which the Content Security Policy blocks.
   !important keeps the precedence the inline styles had. */
.fill-accent { fill: var(--accent) !important; }
.fill-bg { fill: var(--bg) !important; }
.u-cursor-default { cursor: default !important; }
.u-d-block { display: block !important; }
.u-fs-1-35rem { font-size: 1.35rem !important; }
.u-m-0-auto-0-0 { margin: 0 auto 0 0 !important; }
.u-maxw-760 { max-width: 760px !important; }
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-1-2em { margin-bottom: 1.2em !important; }
.u-mb-16 { margin-bottom: 16px !important; }
.u-mb-40 { margin-bottom: 40px !important; }
.u-mb-8 { margin-bottom: 8px !important; }
.u-minw-520 { min-width: 520px !important; }
.u-ml-auto { margin-left: auto !important; }
.u-mt-0 { margin-top: 0 !important; }
.u-mt-12 { margin-top: 12px !important; }
.u-mt-16 { margin-top: 16px !important; }
.u-mt-20 { margin-top: 20px !important; }
.u-mt-24 { margin-top: 24px !important; }
.u-mt-28 { margin-top: 28px !important; }
.u-mt-32 { margin-top: 32px !important; }
.u-mt-44 { margin-top: 44px !important; }
.u-mt-48 { margin-top: 48px !important; }
.u-mt-56 { margin-top: 56px !important; }
.u-mt-8 { margin-top: 8px !important; }
.u-mt-n8 { margin-top: -8px !important; }
.u-pos-static { position: static !important; }
.u-transform-none { transform: none !important; }
.u-w-auto { width: auto !important; }
.u-ws-nowrap { white-space: nowrap !important; }
