/* Cybersecurity for Everyone: site styles. No external fonts or resources. */
:root {
  --night: #100922;
  --plum: #1b1036;
  --violet: #42267a;
  --violet-2: #5b3a9e;
  --gold: #f2b848;
  --gold-ink: #8a5a00;
  --lav: #b2a0e2;
  --soft: #e2dcf2;

  --bg: #fbfaff;
  --bg-alt: #f2eff9;
  --surface: #ffffff;
  --text: #1d1a26;
  --muted: #59546a;
  --line: #ddd7ea;
  --link: #4b2c8f;
  --accent: #42267a;
  --accent-ink: #ffffff;
  --notice-bg: #fff6e2;
  --notice-line: #f0d496;
  --focus: #f2b848;

  --radius: 12px;
  --wrap: 1120px;
  --narrow: 780px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120c22;
    --bg-alt: #1a1230;
    --surface: #1f1638;
    --text: #ece8f6;
    --muted: #b7afcc;
    --line: #342a52;
    --link: #cdbdff;
    --accent: #b9a3f5;
    --accent-ink: #160d2c;
    --gold-ink: #f2b848;
    --notice-bg: #2b2213;
    --notice-line: #5c4720;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 0 0 0.5em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); margin: 1.6em 0 0.6em; }
h3 { font-size: 1.15rem; margin: 1.2em 0 0.4em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: var(--narrow); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--gold); color: var(--night); padding: 8px 14px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 700; color: var(--muted); margin: 0 0 0.4em; }
.gold { color: var(--gold); }
.center { text-align: center; }

/* header */
.site-header { background: var(--plum); color: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(178,160,226,0.25); }
.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: #fff; text-decoration: none; font-weight: 800; font-size: 1.08rem; letter-spacing: -0.01em; }
.brand em { font-style: normal; color: var(--gold); }
.brand .lock { width: 24px; height: 24px; color: var(--gold); flex: none; }
#site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
#site-nav a { color: var(--soft); text-decoration: none; padding: 8px 11px; border-radius: 8px; font-size: 0.97rem; font-weight: 600; }
#site-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
#site-nav a[aria-current="page"] { color: var(--night); background: var(--gold); }
.nav-toggle { display: none; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.35); border-radius: 8px; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 860px) {
  .brand { font-size: 1rem; }
  .nav-toggle { display: inline-block; }
  .js #site-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--plum); border-bottom: 1px solid rgba(178,160,226,0.25); }
  .js #site-nav.open { display: block; }
  #site-nav ul { flex-direction: column; padding: 8px 12px 14px; }
  #site-nav a { display: block; padding: 11px 12px; }
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) .header-inner { flex-wrap: wrap; padding-bottom: 8px; }
  html:not(.js) #site-nav ul { flex-direction: row; flex-wrap: wrap; padding: 0; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-weight: 700; font-size: 1rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-family: inherit; line-height: 1.2; }
.btn-gold { background: var(--gold); color: var(--night); }
.btn-gold:hover { background: #ffc95e; }
.btn-ghost { color: #fff; border-color: rgba(255,255,255,0.45); }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.06); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-small { padding: 8px 14px; font-size: 0.92rem; background: var(--accent); color: var(--accent-ink); }
.btn-ghost-dark { background: transparent; color: var(--text); border-color: var(--line); }
.btn-disabled { background: var(--bg-alt); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.btn-disabled small { font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* hero */
.hero { background: linear-gradient(180deg, var(--night) 0%, var(--plum) 45%, var(--violet) 100%); color: #fff; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.2rem); line-height: 1.02; margin-bottom: 0.3em; letter-spacing: -0.025em; }
.hero h1 .gold { display: block; }
.hero-sub { font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--soft); margin: 0 0 0.6em; line-height: 1.4; }
.hero-by { font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.95rem; margin: 0 0 1.4em; }
.hero-lede { color: var(--soft); max-width: 40em; margin: 0 0 1.8em; }
.hero-cover { display: flex; justify-content: center; }
.cover img { border-radius: 6px; box-shadow: 0 30px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(178,160,226,0.25); }
.hero-cover .cover { max-width: 360px; width: 100%; transform: rotate(1.5deg); }
.facts { list-style: none; padding: 0; margin: 2em 0 0; display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--soft); font-size: 0.95rem; }
.facts strong { color: var(--gold); font-size: 1.1rem; }
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 40px; gap: 36px; }
  .hero-cover { order: -1; }
  .hero-cover .cover { max-width: 230px; transform: none; }
}

/* bands */
.band { padding: 56px 0; }
.band.alt { background: var(--bg-alt); }
.band h2:first-child { margin-top: 0; }
.section-lede { color: var(--muted); margin-top: -0.3em; font-size: 1.08rem; }
.cards { list-style: none; padding: 0; margin: 28px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; }
.card h3 { margin-top: 0; font-size: 1.2rem; }
.card p { margin: 0 0 0.8em; color: var(--muted); font-size: 0.98rem; }
.mini { margin: 0; padding-left: 1.1em; font-size: 0.95rem; }
.mini li { margin: 2px 0; }
.features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px 28px; }
.features li { border-left: 4px solid var(--gold); padding: 2px 0 2px 16px; }
.features h3 { margin: 0 0 4px; }
.features p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.promo { background: var(--plum); color: #fff; }
.promo-inner { display: flex; gap: 32px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.promo h2 { margin: 0 0 0.3em; }
.promo p { color: var(--soft); max-width: 44em; margin: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; gap: 8px; } }
.more { font-weight: 700; }
.more::after { content: " \2192"; }

/* inner pages */
.page-head { background: var(--bg-alt); border-bottom: 1px solid var(--line); padding: 48px 0 32px; }
.page-head h1 { margin-bottom: 0.3em; }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 1em; }
.prose { padding-bottom: 48px; }
.prose > h2:first-child { margin-top: 1.2em; }
.notice { background: var(--notice-bg); border: 1px solid var(--notice-line); border-radius: 10px; padding: 14px 18px; margin: 28px 0; }
main > .wrap:last-child { padding-bottom: 56px; }

/* contents */
.toc .part { margin-top: 36px; }
.toc .part > p { color: var(--muted); }
.toc h2 { margin: 0 0 0.3em; }
.plain { padding-left: 1.1em; }
.chapter { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; }
.chapter summary { cursor: pointer; padding: 14px 18px; display: flex; gap: 14px; align-items: baseline; list-style: none; }
.chapter summary::-webkit-details-marker { display: none; }
.chapter summary::after { content: "+"; margin-left: auto; font-weight: 700; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.chapter[open] summary::after { content: "\2212"; }
.chapter .num { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--gold-ink); white-space: nowrap; min-width: 6.4em; }
.chapter .ctitle { font-weight: 700; font-size: 1.07rem; }
.sections { margin: 0; padding: 0 18px 16px 2.6em; color: var(--text); }
.sections li { margin: 3px 0; }
.sections .std { list-style: none; margin-left: -1.2em; margin-top: 8px; color: var(--muted); font-size: 0.93rem; font-style: italic; }
.toggle-all { margin: 0; }
@media (max-width: 520px) { .chapter summary { flex-direction: column; gap: 2px; } .chapter summary::after { display: none; } .sections { padding-left: 1.8em; } }

/* author */
.lede-name { font-size: 1.3rem; font-weight: 800; margin: 32px 0 0.4em; }

/* buy */
.buy-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; margin: 28px 0 8px; }
.buy-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.buy-card h2 { margin-top: 0; }
.cover.small { float: right; width: 110px; margin: 0 0 12px 16px; }
.cover.small img { box-shadow: 0 8px 20px rgba(0,0,0,0.25); }
@media (max-width: 700px) { .buy-grid { grid-template-columns: 1fr; } }

/* updates */
.news { list-style: none; padding: 0; }
.news li { border-left: 4px solid var(--accent); padding: 2px 0 2px 16px; margin: 0 0 18px; }
.news .date { margin: 0; font-size: 0.85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.news h3 { margin: 2px 0 4px; }
.news p { margin: 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
caption { text-align: left; font-weight: 700; padding-bottom: 6px; }

/* instructors */
.pkg { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.pkg li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.pkg h3 { margin: 0 0 4px; font-size: 1.05rem; }
.pkg p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.request { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.request p { margin: 0 0 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } .request { padding: 18px 16px; } }
.request label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.req { font-weight: 500; font-size: 0.8rem; color: var(--muted); margin-left: 4px; }
.request input:not([type=checkbox]), .request textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.request input:focus, .request textarea:focus { border-color: var(--accent); outline: 2px solid var(--focus); outline-offset: 1px; }
.request [aria-invalid="true"] { border-color: #c0392b !important; }
.hint { display: block; font-size: 0.88rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: 4px; flex: none; accent-color: var(--accent); }
.check label { font-weight: 500 !important; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-error { background: #fdecea; color: #7a1d14; border: 1px solid #f3b8b0; border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; }
.form-error ul { margin: 6px 0 0; padding-left: 1.2em; }
.form-done { background: var(--notice-bg); border: 1px solid var(--notice-line); border-radius: var(--radius); padding: 20px 22px; }
.form-done h3 { margin-top: 0; }

/* checklist */
.privacy-note { font-size: 0.95rem; color: var(--muted); margin: 0; }
.privacy-note::before { content: "\1F512  "; }
.check-tools { position: sticky; top: 64px; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; margin-top: 8px; }
.progress { margin: 0; font-weight: 700; }
.progress span { color: var(--gold-ink); font-size: 1.2rem; }
.jump { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin: 18px 0 0; font-size: 0.93rem; color: var(--muted); }
.jump ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.jump a { display: inline-block; min-width: 34px; text-align: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: var(--surface); }
.check-sec h2 { font-size: 1.3rem; margin: 1.8em 0 0.4em; }
.check-sec h3 { font-size: 1.02rem; color: var(--muted); margin: 1em 0 0.3em; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.checks input { width: 22px; height: 22px; margin-top: 3px; flex: none; accent-color: var(--accent); cursor: pointer; }
.checks label { cursor: pointer; }
.checks label strong { font-weight: 700; }
.checks input:checked + label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--lav); }
.source-note { color: var(--muted); font-size: 0.93rem; margin-top: 32px; }

/* footer */
.site-footer { background: var(--night); color: var(--soft); padding: 40px 0 20px; font-size: 0.95rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-inner p { margin: 0 0 4px; }
.foot-title { font-weight: 800; color: #fff; font-size: 1.05rem; }
.foot-links { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 32px; }
.foot-links li { margin: 0 0 6px; }
.site-footer a { color: var(--soft); }
.site-footer a:hover { color: #fff; }
.foot-legal { border-top: 1px solid rgba(178,160,226,0.2); margin-top: 28px; padding-top: 16px; font-size: 0.85rem; color: var(--lav); }
@media (max-width: 520px) { .foot-links { columns: 1; } }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* print: the checklist prints cleanly */
@media print {
  .site-header, .site-footer, .check-tools, .jump, .skip, .toggle-all, .privacy-note { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page-head { background: none; border: 0; padding: 0 0 8px; }
  .checks li { break-inside: avoid; padding: 4px 0; }
  .checks input:checked + label { text-decoration: none; color: #000; }
  .check-sec h2 { break-after: avoid; }
  a { color: #000; }
}
