/* ==========================================================================
   nofacelearn — style.css
   Plain CSS, mobile first: base rules target phones, and each component adds
   its own min-width media queries right below it.
   --------------------------------------------------------------------------
   Breakpoints (CSS variables can't be used in @media, so they are listed here):
     xs  ≥ 480px   wide phones (tiles go 2-up)
     sm  ≥ 600px   large phones / small tablets
     md  ≥ 900px   tablets / laptops (desktop nav appears)
   --------------------------------------------------------------------------
    1. Design tokens
    2. Reset
    3. Base & typography
    4. Layout
    5. Shared patterns (surfaces, labels, hand-drawn bits)
    6. Components (buttons, chips, fields, tags, tables, breadcrumb)
    7. Header & navigation
    8. Footer
    9. Home: hero
   10. Cards (base)
   11. Tools: binary + password widgets
   12. Roadmap timeline & progress bar
   13. About & follow
   14. Page hero, filters & search
   15. Inner pages: glossary
   16. Inner pages: prose, privacy, about, FAQ
   17. 404 page
   17b–17i. Tiles, topic cards, topic page, tools, roadmaps, cheat sheets, contact, split rows, light-theme tweaks
   18. Utilities
   19. Motion (reveal, keyframes, reduced motion)
   20. Print
   ========================================================================== */


/* ==========================================================================
   1. Design tokens
   Recolor the whole site here. Brand colors are written as "R G B" so the
   same value drives solid colors, see-through tints and glows.
   ========================================================================== */
:root {
  /* Brand colors (R G B) */
  --bg-rgb:      7 3 15;
  --surface-rgb: 28 11 58;
  --lilac-rgb:   179 136 255;
  --purple-rgb:  124 58 237;
  --blue-rgb:    47 123 255;
  --gold-rgb:    255 207 90;

  /* Solid colors */
  --bg:            rgb(var(--bg-rgb));
  --surface-solid: #160a2e;
  --lilac:         rgb(var(--lilac-rgb));
  --purple:        rgb(var(--purple-rgb));
  --blue:          rgb(var(--blue-rgb));
  --gold:          rgb(var(--gold-rgb));

  --text:          #f1ecff;
  --text-muted:    #bfb3dd;
  --on-gold:       #1d1300;   /* text on gold buttons/badges */
  --on-lilac:      #14072b;   /* text on lilac chips */
  --bulb-off:      #2a1f3f;

  --good:          #5cf2a4;
  --warn:          #ffb648;
  --bad:           #ff5c8a;

  /* Derived tints */
  --surface:       rgb(var(--surface-rgb) / .55);
  --line:          rgb(var(--lilac-rgb) / .22);
  --line-strong:   rgb(var(--lilac-rgb) / .5);
  --tint-lilac:    rgb(var(--lilac-rgb) / .08);
  --field-bg:      rgb(var(--bg-rgb) / .7);
  --track:         rgb(255 255 255 / .07);

  /* Glows */
  --glow-lilac: 0 0 18px rgb(var(--lilac-rgb) / .45), 0 0 42px rgb(var(--purple-rgb) / .25);
  --glow-blue:  0 0 18px rgb(var(--blue-rgb) / .55),  0 0 44px rgb(var(--blue-rgb) / .25);
  --glow-gold:  0 0 14px rgb(var(--gold-rgb) / .55);
  --glow-text:  0 0 20px rgb(var(--lilac-rgb) / .4);

  /* Gradients & textures */
  --grad-page:
    radial-gradient(1200px 700px at 85% -10%, rgb(var(--purple-rgb) / .35), transparent 60%),
    radial-gradient(900px 600px at -10% 30%,  rgb(var(--blue-rgb) / .16),   transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgb(var(--purple-rgb) / .25), transparent 60%);
  --notebook-lines: repeating-linear-gradient(180deg, transparent 0 31px, rgb(var(--lilac-rgb) / .07) 31px 32px);

  /* Fonts */
  --font-marker: "Permanent Marker", "Comic Sans MS", cursive;           /* hero title, brand, big numbers */
  --font-head:   "Caveat", "Segoe Print", cursive;                      /* headings */
  --font-note:   "Kalam", "Segoe Print", cursive;                       /* handwritten asides */
  --font-body:   "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;  /* paragraphs, UI */
  --font-mono:   "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  /* Layout */
  --gutter:      16px;
  --max:         1120px;
  --max-narrow:  780px;
  --header-h:    64px;
  --section-pad: 4.5rem;
  --radius:      18px;
  --radius-sm:   10px;
  --pill:        999px;
  --border:      1.5px solid var(--line);

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (min-width: 600px) {
  :root { --gutter: 24px; }
}

@media (min-width: 900px) {
  :root {
    --header-h:    72px;
    --section-pad: 6rem;
  }
}

/* --- Light theme ---------------------------------------------------------
   Set by the theme toggle (saved in localStorage as "nfl-theme").
   Derived tints and glows above recalculate from these values automatically. */
:root[data-theme="light"] {
  color-scheme: light;

  --bg-rgb:      247 243 255;
  --surface-rgb: 255 255 255;
  --lilac-rgb:   109 40 217;     /* deeper violet so links pass contrast on white */
  --purple-rgb:  124 58 237;
  --blue-rgb:    29 78 216;
  --gold-rgb:    180 83 9;       /* amber: readable as text on light paper */

  --surface-solid: #ffffff;
  --text:          #1c1233;
  --text-muted:    #554a70;
  --on-gold:       #ffffff;
  --on-lilac:      #ffffff;
  --bulb-off:      #ddd3f5;

  --good: #047857;
  --warn: #b45309;
  --bad:  #be123c;

  --surface:   rgb(var(--surface-rgb) / .9);
  --field-bg:  #ffffff;
  --track:     rgb(0 0 0 / .07);

  --glow-lilac: 0 4px 18px rgb(var(--lilac-rgb) / .16);
  --glow-blue:  0 4px 18px rgb(var(--blue-rgb) / .22);
  --glow-gold:  0 2px 10px rgb(var(--gold-rgb) / .22);
  --glow-text:  none;

  --grad-page:
    radial-gradient(1200px 700px at 85% -10%, rgb(var(--purple-rgb) / .12), transparent 60%),
    radial-gradient(900px 600px at -10% 30%,  rgb(var(--blue-rgb) / .07),   transparent 60%);
}


/* ==========================================================================
   2. Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

ul[role="list"], ol { list-style: none; padding: 0; }


/* ==========================================================================
   3. Base & typography
   ========================================================================== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* Page glow lives on a fixed layer (background-attachment: fixed is janky on phones) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--grad-page);
  pointer-events: none;
}

/* Twinkling stars canvas (drawn by script.js) */
#sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.1;
}
h2      { font-size: clamp(2.4rem, 7vw, 3.4rem); }
h3, .h3 { font-size: 1.75rem; }

a {
  color: var(--lilac);
  text-underline-offset: 3px;
}
a:hover { color: var(--text); }

code, kbd {
  font-family: var(--font-mono);
  font-size: .9em;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--purple);
  color: #fff;
}


/* ==========================================================================
   4. Layout
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.narrow { max-width: var(--max-narrow); }

.section {
  position: relative;
  padding-block: var(--section-pad);
}
.section-tight { padding-top: 1.5rem; }
.section-alt {
  background: linear-gradient(180deg,
    transparent,
    rgb(var(--surface-rgb) / .45) 12%,
    rgb(var(--surface-rgb) / .45) 88%,
    transparent);
}

.section-head { margin-bottom: 2.25rem; }
.section-head h2 { text-shadow: var(--glow-text); }

.section-sub {
  max-width: 60ch;
  margin-top: .6rem;
  color: var(--text-muted);
  font-family: var(--font-note);
}
.center .section-sub { margin-inline: auto; }


/* ==========================================================================
   5. Shared patterns
   ========================================================================== */

/* --- Surfaces: every glowing "panel" shares one look --- */
.card,
.tool,
.note-card,
.social-btn,
.timeline details,
.faq details {
  background-color: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
}

/* Notebook-paper lines on cards */
.card,
.note-card { background-image: var(--notebook-lines); }

/* --- Small monospace labels --- */
.eyebrow,
.field-label,
.out-label,
.week,
.breadcrumb ol,
.result-count,
.updated {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow {
  margin-bottom: .4rem;
  letter-spacing: .12em;
  color: var(--gold);
}

/* --- Hand-drawn wavy underline --- */
.wavy {
  text-decoration: underline wavy var(--lilac);
  text-decoration-thickness: 2px;
  text-decoration-skip-ink: none;
  text-underline-offset: 8px;
}

/* --- Hand-drawn circle around a word (SVG path inside the span) --- */
.circled {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.scribble-circle {
  position: absolute;
  top: -22%;
  left: -16%;
  width: 132%;
  height: 144%;
  overflow: visible;
  pointer-events: none;
}
.circled-sm .scribble-circle {
  left: -10%;
  width: 120%;
}
.scribble-circle path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 620;
  stroke-dashoffset: 0;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px rgb(var(--gold-rgb) / .6));
}

/* --- Handwritten margin note --- */
.margin-note {
  font-family: var(--font-head);
  font-size: 1.35rem;
  color: var(--lilac);
  transform: rotate(-2deg);
}
.margin-note.small {
  margin-top: 1rem;
  font-size: 1.2rem;
}

/* --- Sparkle bullet list --- */
.scribble-list {
  display: grid;
  gap: .5rem;
  padding: 0;
  list-style: none;
}
.scribble-list li {
  position: relative;
  padding-left: 1.7rem;
}
.scribble-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--gold);
  text-shadow: var(--glow-gold);
}

/* --- Stroke icons from assets/icons.svg (one style everywhere) --- */
.ico {
  display: inline-block;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-sm { width: 1em; height: 1em; stroke-width: 2; vertical-align: -.15em; }
.ico-inline { color: var(--gold); }
.ico-heading {
  width: .8em;
  height: .8em;
  margin-right: .1em;
  vertical-align: -.06em;
  color: var(--gold);
  stroke-width: 1.6;
}

/* --- Filled brand icons (YouTube, Instagram, theme toggle) --- */
.icon {
  flex: none;
  width: 1.2em;
  height: 1.2em;
  fill: currentColor;
}


/* ==========================================================================
   6. Components
   ========================================================================== */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 48px;                 /* comfortable tap target */
  padding: .7rem 1.35rem;
  border: 2px solid transparent;
  border-radius: var(--pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s;
}
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--lilac);
  color: var(--on-lilac);
  box-shadow: var(--glow-lilac);
}
.btn-primary:hover {
  color: var(--on-lilac);
  box-shadow: 0 0 24px rgb(var(--lilac-rgb) / .7), 0 0 56px rgb(var(--purple-rgb) / .4);
}

.btn-ghost {
  background: var(--tint-lilac);
  border-color: var(--lilac);
  color: var(--text);
}
.btn-ghost:hover {
  background: rgb(var(--lilac-rgb) / .18);
  box-shadow: var(--glow-lilac);
  color: var(--text);
}

.btn-glow {
  background: var(--gold);
  color: var(--on-gold);
  box-shadow: var(--glow-gold);
}
.btn-glow:hover {
  color: var(--on-gold);
  box-shadow: 0 0 22px rgb(var(--gold-rgb) / .9);
}

.btn-small {
  min-height: 40px;
  padding: .4rem 1rem;
  font-size: .95rem;
}

/* Text-style button */
.link-btn {
  padding: .2rem .4rem;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--bad); }

/* --- Chips (small pill links/buttons) --- */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .35rem .95rem;
  border: var(--border);
  border-radius: var(--pill);
  background: rgb(255 255 255 / .03);
  color: var(--text);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.chip:hover { color: var(--text); }
.chip-ig:hover { border-color: var(--lilac); box-shadow: var(--glow-lilac); }
.chip-yt:hover { border-color: var(--blue);  box-shadow: var(--glow-blue); }

/* --- Form fields --- */
.field-label {
  display: block;
  margin-bottom: .35rem;
}

.field {
  width: 100%;
  min-height: 50px;
  padding: .6rem .9rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--field-bg);
  font-size: 1.15rem;              /* ≥16px stops iOS zooming on focus */
  transition: border-color .2s, box-shadow .2s;
}
.field:focus {
  outline: none;
  border-color: var(--lilac);
  box-shadow: var(--glow-lilac);
}
.field-mono { font-family: var(--font-mono); }

/* Search box with a magnifier icon (colored by --lilac via mask) */
.search-wrap { position: relative; }
.search-wrap::before {
  content: "";
  position: absolute;
  top: 50%;
  left: .85rem;
  width: 1.1rem;
  height: 1.1rem;
  transform: translateY(-50%);
  background-color: var(--lilac);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}
.search-field { padding-left: 2.6rem; }

/* --- Tags (category + level on topic cards) --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--tint-lilac);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .04em;
  white-space: nowrap;
}
.tag-level {
  border-color: transparent;
  text-transform: uppercase;
}
.tag-level.is-beginner {
  background: var(--gold);
  color: var(--on-gold);
}
.tag-level.is-intermediate {
  background: var(--purple);
  color: #fff;
}

/* --- Chip helpers --- */
.chip-count {
  margin-left: .35rem;
  opacity: .7;
  font-family: var(--font-mono);
  font-size: .75em;
}
.chip-nav,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.chip-nav { margin-top: 1.25rem; }
.chip-row { margin-bottom: 1rem; }

/* --- Data tables (cheat sheets, crack-time) --- */
.table-wrap {
  overflow-x: auto;                 /* wide tables scroll inside their box on phones */
  border: var(--border);
  border-radius: var(--radius-sm);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.data-table caption {
  padding: .6rem .8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}
.data-table th,
.data-table td {
  padding: .55rem .8rem;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.data-table thead th {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.data-table tbody th { font-weight: 400; }
.data-table code { color: var(--gold); white-space: nowrap; }
.group-row th {
  background: var(--tint-lilac);
  color: var(--lilac);
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
}

/* --- Breadcrumb --- */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  text-transform: none;
  letter-spacing: 0;
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: .4rem;
  opacity: .6;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--lilac); }


/* ==========================================================================
   7. Header & navigation
   Mobile: logo + menu button; the nav is a drop-down panel (needs JS).
   No JS: the nav simply wraps under the logo.
   md: the nav sits inline and the menu button disappears.
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgb(var(--bg-rgb) / .72);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--text);
  text-decoration: none;
}
.brand-logo {
  width: 52px;
  height: 52px;
  margin: -6px -4px -6px -8px;     /* trims the logo's built-in glow padding */
}
.brand-name {
  font-family: var(--font-marker);
  font-size: 1.3rem;
  letter-spacing: .02em;
}

/* Menu button (hamburger → X) */
.nav-toggle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: var(--border);
  border-radius: 12px;
  background: transparent;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .25s var(--ease), background-color .2s;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after  { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars          { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before  { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after   { transform: translateY(-7px) rotate(-45deg); }

/* Theme toggle + menu button sit together on the right */
.header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: var(--border);
  border-radius: var(--pill);
  background: transparent;
  color: var(--gold);
  transition: border-color .2s, box-shadow .2s, transform .3s var(--ease);
}
.theme-toggle:hover {
  border-color: var(--lilac);
  box-shadow: var(--glow-lilac);
}
.theme-toggle .icon { width: 1.25rem; height: 1.25rem; }
.theme-toggle .icon-moon,
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; color: var(--lilac); }
html:not(.js) .theme-toggle { display: none; }   /* needs JS to work */

/* Nav: mobile drop-down panel */
.site-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .75rem;
}
.js .site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: .5rem var(--gutter) 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgb(var(--bg-rgb) / .97);
}
.js .site-nav.is-open { display: flex; }

.site-nav ul {
  display: flex;
  flex-direction: column;
  padding: 0;
  list-style: none;
}
.site-nav ul a {
  display: block;
  padding: .7rem .25rem;
  border-bottom: 1px dashed var(--line);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 1.6rem;
  text-decoration: none;
}
.site-nav ul a:hover { color: var(--lilac); }
.site-nav a[aria-current="page"] { color: var(--gold); }

/* Nav: no-JS fallback */
html:not(.js) .header-inner { flex-wrap: wrap; padding-block: .5rem; }
html:not(.js) .nav-toggle   { display: none; }
html:not(.js) .site-nav     { flex-direction: row; flex-wrap: wrap; align-items: center; }
html:not(.js) .site-nav ul  { flex-direction: row; flex-wrap: wrap; gap: 0 1rem; }
html:not(.js) .site-nav ul a { border: 0; font-size: 1.3rem; }

/* Nav: desktop */
@media (min-width: 900px) {
  .nav-toggle { display: none; }

  /* Order on desktop: brand · nav · theme toggle */
  .header-actions { order: 3; }

  .site-nav,
  .js .site-nav {
    display: flex;
    position: static;
    order: 2;
    flex-direction: row;
    align-items: center;
    gap: 1.2rem;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
  }

  .site-nav ul { flex-direction: row; gap: 1rem; }

  .site-nav ul a {
    position: relative;
    padding: .2rem 0;
    border: 0;
    font-size: 1.45rem;
  }
  .site-nav ul a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--lilac);
    box-shadow: var(--glow-lilac);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s var(--ease);
  }
  .site-nav ul a:hover::after,
  .site-nav ul a:focus-visible::after { transform: scaleX(1); }
}


/* ==========================================================================
   8. Footer
   ========================================================================== */
.site-footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--line);
  background: rgb(var(--bg-rgb) / .8);
  color: var(--text-muted);
  font-size: .95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 1.5rem;
}
.footer-brand { grid-column: 1 / -1; }
.footer-brand .brand { margin-bottom: .5rem; }
.footer-brand p + p { margin-top: .4rem; }
.footer-social a { color: var(--text-muted); }
.footer-social a:hover { color: var(--lilac); }

.footer-h {
  margin-bottom: .4rem;
  color: var(--text);
  font-size: 1.5rem;
}

.footer-links {
  display: grid;
  gap: .1rem;
  padding: 0;
  list-style: none;
}
.footer-links a {
  display: inline-block;
  padding: .3rem 0;                /* bigger tap target */
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--lilac);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--line);
  font-size: .9rem;
}
.made-with code { color: var(--lilac); }

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}


/* ==========================================================================
   9. Home: hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 3rem 0 4rem;
}

.hero-inner {
  display: grid;
  align-items: center;
  gap: 2.5rem;
}

.hero-title {
  margin-bottom: .6rem;
  font-family: var(--font-marker);
  font-size: clamp(2.9rem, 13vw, 5.6rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: .01em;
  text-shadow: 0 0 22px rgb(var(--lilac-rgb) / .45);
}
.hero-title .circled {
  color: var(--gold);
  text-shadow: var(--glow-gold);
}

.hero-tagline {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
}

/* Typed word */
.typed-line {
  margin: 1rem 0 1.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 1rem;
}
.typed-wrap {
  display: inline-flex;
  align-items: center;
}
.typed {
  min-height: 1.4em;
  color: var(--blue);
  font-weight: 600;
  text-shadow: 0 0 10px rgb(var(--blue-rgb) / .7);
}
.caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 3px;
  background: var(--gold);
  animation: blink 1s steps(1) infinite;
}

/* Buttons: full-width on phones, natural width from md */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}
.hero-actions .btn { flex: 1 1 220px; }
.hero-actions.centered { justify-content: center; }

/* Logo in orbit */
.hero-art {
  display: grid;
  justify-items: center;
  gap: .5rem;
}
.orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: min(68vw, 300px);
  aspect-ratio: 1;
}
.orbit::before {
  content: "";
  position: absolute;
  inset: -6%;
  border: 2px dashed rgb(var(--lilac-rgb) / .35);
  border-radius: 50%;
  animation: spin 40s linear infinite;
}
/* logo.png has empty glow space around the ring, so it is drawn larger than the orbit */
.hero-logo {
  position: absolute;
  inset: -12.5%;
  width: 125%;
  max-width: none;
  filter: drop-shadow(0 0 40px rgb(var(--purple-rgb) / .35));
  animation: float 6s ease-in-out infinite;
}
.orbit-dot {
  position: absolute;
  padding: .25rem .55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  box-shadow: var(--glow-lilac);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: .85rem;
}
.orbit-dot-1 { top: 4%;     left: -2%; }
.orbit-dot-2 { top: 20%;    right: -6%; color: var(--lilac); }
.orbit-dot-3 { bottom: 6%;  left: 8%;   color: var(--blue); }

@media (min-width: 900px) {
  .hero { padding: 5rem 0 6rem; }
  .hero-inner { grid-template-columns: 1.25fr 1fr; }
  .hero-actions .btn { flex: 0 0 auto; }
}


/* ==========================================================================
   10. Cards (base styles, also used by topic cards)
   ========================================================================== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1.4rem 1.3rem 1.2rem;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.card:focus-within {
  border-color: var(--lilac);
  box-shadow: var(--glow-lilac);
}
.card[hidden] { display: none; }

.card h3,
.card-title { font-size: 1.9rem; }

.card p {
  flex: 1;
  color: var(--text-muted);
}

.card-icon { color: var(--gold); }
.card-icon .ico { width: 1.75rem; height: 1.75rem; }

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .4rem;
}

.see-all {
  margin-top: 2rem;
  text-align: center;
}

@media (min-width: 600px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .card-grid      { grid-template-columns: repeat(4, 1fr); }
  .card-grid-wide { grid-template-columns: repeat(3, 1fr); }
}


/* ==========================================================================
   11. Tools: binary + password widgets
   ========================================================================== */
.tool-grid {
  display: grid;
  gap: 1.4rem;
}

.tool {
  padding: 1.5rem 1.25rem;
  box-shadow: 0 10px 40px rgb(0 0 0 / .35);
}
.tool h3 {
  margin-bottom: .3rem;
  font-size: 2rem;
}
.tool-hint {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: .98rem;
}
.privacy-note strong { color: var(--good); }

.out-label {
  min-width: 4.2rem;
  font-size: .72rem;
}

/* --- Binary converter --- */
.bits {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: .35rem;
  margin: 1.25rem 0 1rem;
}

.bit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  min-height: 72px;
  padding: .55rem 0 .45rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--field-bg);
  font-family: var(--font-mono);
  transition: background-color .2s, box-shadow .2s, border-color .2s, transform .1s;
}
.bit:active { transform: scale(.95); }

.bit-bulb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bulb-off);
  transition: background-color .2s, box-shadow .2s;
}
.bit-value {
  color: var(--text-muted);
  font-size: 1.35rem;
  font-weight: 600;
}
.bit-place {
  color: var(--text-muted);
  font-size: .64rem;
  opacity: .85;
}

.bit[aria-pressed="true"] {
  border-color: var(--blue);
  background-color: rgb(var(--blue-rgb) / .14);
  box-shadow: var(--glow-blue);
}
.bit[aria-pressed="true"] .bit-value { color: #fff; }
.bit[aria-pressed="true"] .bit-bulb {
  background: var(--gold);
  box-shadow: var(--glow-gold);
}

.binary-out p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem;
  margin-bottom: .3rem;
}
.binary-out code {
  color: var(--gold);
  font-size: 1.05rem;
  word-break: break-all;
}

/* --- Password checker --- */
.pw-row {
  display: flex;
  gap: .5rem;
}
.pw-row .field {
  flex: 1;
  min-width: 0;
}

.meter {
  height: 10px;
  margin: 1rem 0 .6rem;
  overflow: hidden;
  border-radius: var(--pill);
  background: var(--track);
}
.meter-fill {
  --meter-color: var(--bad);
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--meter-color);
  box-shadow: 0 0 12px var(--meter-color);
  transition: width .35s var(--ease), background-color .35s;
}
.meter-fill[data-score="2"] { --meter-color: var(--warn); }
.meter-fill[data-score="3"] { --meter-color: var(--lilac); }
.meter-fill[data-score="4"] { --meter-color: var(--good); }

.pw-verdict {
  font-family: var(--font-head);
  font-size: 1.6rem;
  line-height: 1.2;
}

.pw-time {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem;
  margin: .3rem 0 1rem;
}
.pw-time code { color: var(--gold); }

.checklist {
  display: grid;
  gap: .35rem;
}
.checklist li {
  position: relative;
  padding-left: 1.9rem;
  color: var(--text-muted);
}
.checklist li::before {
  content: "○";
  position: absolute;
  top: 0;
  left: .2rem;
  font-family: var(--font-mono);
}
.checklist li.is-ok { color: var(--text); }
.checklist li.is-ok::before {
  content: "✓";
  color: var(--good);
  text-shadow: 0 0 8px var(--good);
}

.noscript {
  margin-top: 1rem;
  color: var(--warn);
  text-align: center;
}

@media (min-width: 600px) {
  .bit-place { font-size: .72rem; }
}

@media (min-width: 900px) {
  .tool-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .tool { padding: 2rem 1.75rem; }
}


/* ==========================================================================
   12. Roadmap timeline & progress bar
   ========================================================================== */

/* Progress bar */
.progress { margin-bottom: 2rem; }
.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .45rem;
  font-family: var(--font-head);
  font-size: 1.45rem;
}
.progress-bar {
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--track);
}
.progress-fill {
  width: 0;
  height: 100%;
  background: var(--gold);
  box-shadow: var(--glow-gold);
  transition: width .4s var(--ease);
}

/* Timeline with a dashed spine and a dot per week */
.timeline {
  position: relative;
  display: grid;
  gap: 1rem;
  padding-left: 1.6rem;
}
.timeline::before {
  content: "";
  position: absolute;
  top: .5rem;
  bottom: .5rem;
  left: .45rem;
  border-left: 2px dashed rgb(var(--lilac-rgb) / .4);
}

.timeline-item { position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  top: 1.35rem;
  left: -1.55rem;
  width: 14px;
  height: 14px;
  border: 2px solid var(--lilac);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--glow-lilac);
}
.timeline-item.is-complete::before {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: var(--glow-gold);
}

/* Accordion */
.timeline details { transition: border-color .2s, box-shadow .2s; }
.timeline details[open] {
  border-color: var(--line-strong);
  box-shadow: 0 0 24px rgb(var(--purple-rgb) / .2);
}

.timeline summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  list-style: none;
  cursor: pointer;
}
.timeline summary::-webkit-details-marker { display: none; }
.timeline summary::after {
  content: "+";
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--lilac);
  font-family: var(--font-mono);
  font-size: 1.4rem;
  transition: transform .25s var(--ease);
}
.timeline details[open] summary::after { transform: rotate(45deg); }

.week { color: var(--gold); }
.week-title {
  grid-column: 1;
  font-family: var(--font-head);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
}
.week-count {
  grid-column: 1;
  color: var(--text-muted);
  font-size: .9rem;
}

/* Day checkboxes */
.days {
  display: grid;
  gap: .15rem;
  padding: 0 1.2rem 1.1rem;
}
.days label {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .55rem .4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color .15s;
}
.days label:hover { background-color: rgb(var(--lilac-rgb) / .07); }
.days input {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: .2rem;
  accent-color: var(--purple);
  cursor: pointer;
}
.days b { color: var(--lilac); }
.days input:checked + span {
  color: var(--text-muted);
  text-decoration-line: line-through;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
}


/* ==========================================================================
   13. About & follow (home + /about)
   ========================================================================== */
.about-grid {
  display: grid;
  gap: 1.4rem;
}

.note-card { padding: 1.5rem 1.4rem; }
.note-card p + p { margin-top: .9rem; }
.note-card strong { color: var(--gold); }
.note-card h3 {
  margin-bottom: .6rem;
  color: var(--lilac);
}
.note-card-tilt { transform: rotate(.6deg); }
.note-more { margin-top: 1rem; }

/* Follow */
.follow { padding-bottom: 5rem; }
.follow-logo {
  margin: 0 auto 1rem;
  filter: drop-shadow(0 0 18px rgb(var(--blue-rgb) / .5));
}

.social-row {
  display: grid;
  gap: .9rem;
  margin-top: 1.8rem;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  min-height: 64px;
  padding: .8rem 1.4rem;
  color: var(--text);
  text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.social-btn:hover { color: var(--text); }
.social-btn .icon {
  width: 1.8rem;
  height: 1.8rem;
}
.social-btn span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}
.social-btn small {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .8rem;
}
.social-ig .icon { color: var(--lilac); }
.social-yt .icon { color: var(--blue); }
.social-ig:hover { border-color: var(--lilac); box-shadow: var(--glow-lilac); }
.social-yt:hover { border-color: var(--blue);  box-shadow: var(--glow-blue); }

@media (min-width: 600px) {
  .social-row {
    grid-template-columns: repeat(2, minmax(0, 260px));
    justify-content: center;
  }
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .about-grid .section-head {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }
}


/* ==========================================================================
   14. Inner pages: page hero, filters & search
   ========================================================================== */
.page-hero { padding: 2.5rem 0 1rem; }
.page-hero h1 {
  margin: .3rem 0 .4rem;
  font-size: clamp(2.6rem, 10vw, 4.4rem);
  text-shadow: var(--glow-text);
}
.page-hero .circled { color: var(--gold); }

.lead { font-size: 1.15rem; }
.updated {
  margin-top: .8rem;
  text-transform: none;
  letter-spacing: 0;
}

/* Filters + search */
.toolbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.filter-chip:hover { border-color: var(--lilac); }
.filter-chip[aria-pressed="true"] {
  border-color: var(--lilac);
  background: var(--lilac);
  color: var(--on-lilac);
  box-shadow: var(--glow-lilac);
}

.result-count {
  min-height: 1.5em;
  margin-bottom: 1rem;
  text-transform: none;
  letter-spacing: 0;
}

.empty-state {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: center;
}


.cta-card {
  margin-top: 2.5rem;
  text-align: center;
}
.cta-card .btn { margin-top: 1rem; }

@media (min-width: 600px) {
  .toolbar {
    grid-template-columns: 1fr minmax(220px, 300px);
    align-items: center;
  }
}

@media (min-width: 900px) {
  .page-hero { padding: 4rem 0 1.5rem; }
}


/* ==========================================================================
   15. Inner pages: glossary
   ========================================================================== */
.glossary-search { margin-top: 1.5rem; }

/* A–Z jump links */
.az-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .5rem;
}
.az-nav a,
.az-nav span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
}
.az-nav a:hover {
  border-color: var(--lilac);
  box-shadow: var(--glow-lilac);
}
.az-nav .is-dim {
  opacity: .3;
  pointer-events: none;
}

/* Letter groups + terms */
.glossary-group { margin-bottom: 2rem; }
.glossary-group[hidden],
.term[hidden] { display: none; }

.letter {
  margin-bottom: .6rem;
  border-bottom: 1px dashed var(--line);
  color: var(--gold);
  font-family: var(--font-marker);
  font-size: 2.6rem;
  font-weight: 400;
  text-shadow: var(--glow-gold);
}

.term {
  margin-bottom: .6rem;
  padding: .9rem 1.1rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  transition: border-color .2s;
}
.term:target {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}
.term dt {
  color: var(--lilac);
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}
.term dt small {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 400;
}
.term dd { margin-top: .2rem; }

.like {
  color: var(--gold);
  font-family: var(--font-note);
}


/* ==========================================================================
   16. Inner pages: prose (privacy), about principles, FAQ
   ========================================================================== */
.prose h2 {
  margin: 2.2rem 0 .6rem;
  font-size: clamp(2rem, 6vw, 2.6rem);
}
.prose p + p { margin-top: .9rem; }
.prose ul {
  display: grid;
  gap: .6rem;
  padding-left: 1.2rem;
}
.prose code { color: var(--gold); }
.prose em   { color: var(--lilac); }

/* Privacy summary cards */
.summary-grid {
  display: grid;
  gap: 1rem;
}
.summary-grid .note-card { padding: 1.2rem; }
.summary-grid .h3 {
  margin: .2rem 0;
  color: var(--lilac);
}
.summary-icon { color: var(--gold); }
.summary-icon .ico { width: 1.6rem; height: 1.6rem; }

/* About: three principles */
.principles {
  display: grid;
  gap: 1.2rem;
}
.principles h3 {
  margin: .4rem 0;
  color: var(--lilac);
}
.principle-num {
  color: var(--gold);
  font-family: var(--font-marker);
  font-size: 2.4rem;
  line-height: 1;
  text-shadow: var(--glow-gold);
}

/* FAQ accordion */
.faq {
  display: grid;
  gap: .8rem;
}
.faq details[open] { border-color: var(--line-strong); }
.faq summary {
  position: relative;
  padding: 1rem 3rem 1rem 1.2rem;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 1.2rem;
  color: var(--lilac);
  font-family: var(--font-mono);
  transform: translateY(-50%);
  transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p {
  padding: 0 1.2rem 1.1rem;
  color: var(--text-muted);
}

@media (min-width: 600px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .principles { grid-template-columns: repeat(3, 1fr); }
}


/* ==========================================================================
   17. 404 page
   ========================================================================== */
.page-404 {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem var(--gutter);
  text-align: center;
}
.page-404 img {
  margin: 0 auto 1rem;
  filter: drop-shadow(0 0 18px rgb(var(--blue-rgb) / .5));
}
.page-404 .big {
  color: var(--lilac);
  font-family: var(--font-marker);
  font-size: clamp(5rem, 28vw, 11rem);
  line-height: 1;
  text-shadow: var(--glow-lilac);
}
.page-404 .big span {
  color: var(--gold);
  text-shadow: var(--glow-gold);
}
.page-404 h1 {
  margin: .5rem 0;
  font-size: clamp(2.2rem, 8vw, 3.2rem);
}
.page-404 p {
  max-width: 42ch;
  margin: 0 auto 1.6rem;
  color: var(--text-muted);
}
.page-404 .binary-joke {
  margin-top: 1.4rem;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: .9rem;
}


/* ==========================================================================
   17b. Tiles (home categories, featured tools, roadmap teaser)
   ========================================================================== */
.tile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 0;
  list-style: none;
}
.tile-grid > li { display: flex; }

.tile {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .35rem;
  padding: 1.2rem 1.2rem 1.1rem;
  border: var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.tile:hover,
.tile:focus-visible {
  border-color: var(--lilac);
  box-shadow: var(--glow-lilac);
  color: var(--text);
}
.tile-icon { color: var(--gold); }
.tile-icon .ico { width: 1.75rem; height: 1.75rem; }
.tile-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}
.tile-text {
  color: var(--text-muted);
  font-size: .92rem;
  line-height: 1.45;
}
.tile-count {
  margin-top: auto;
  padding-top: .4rem;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: .75rem;
}

.mini-progress {
  display: block;
  height: 6px;
  margin-top: .5rem;
  overflow: hidden;
  border-radius: var(--pill);
  background: var(--track);
}
.mini-progress span {
  display: block;
  height: 100%;
  background: var(--gold);
}

.hero-more { margin-top: 1rem; }
.hero-more a { color: var(--text-muted); }
.hero-more a:hover { color: var(--lilac); }

@media (min-width: 480px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .tile-grid-5 { grid-template-columns: repeat(5, 1fr); }
}


/* ==========================================================================
   17c. Topic cards (home, /topics, related topics)
   The title link stretches over the whole card; the chips sit above it.
   ========================================================================== */
.topic-card { gap: .7rem; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem;
}

.card-link {
  color: var(--text);
  text-decoration: none;
}
.card-link:hover { color: var(--text); }
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.topic-card .card-links {
  position: relative;
  z-index: 1;
}

.filter-groups {
  display: grid;
  gap: .6rem;
}


/* ==========================================================================
   17d. Topic page (topic?slug=...)
   ========================================================================== */
.topic-tags {
  justify-content: flex-start;
  margin: .9rem 0 .3rem;
}
.topic-body { padding-bottom: var(--section-pad); }

.topic-section { margin-top: 2.5rem; }
.topic-section > h2 {
  margin-bottom: .9rem;
  font-size: clamp(2rem, 6vw, 2.6rem);
}

/* Video: click-to-load facade, then the youtube-nocookie iframe */
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--glow-lilac);
}
.video.is-short {
  max-width: 340px;
  margin-inline: auto;
  aspect-ratio: 9 / 16;
}
.video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-facade {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  width: 100%;
  height: 100%;
  padding: 1rem;
  border: 0;
  background:
    radial-gradient(circle at 50% 40%, rgb(var(--purple-rgb) / .35), transparent 70%),
    var(--surface-solid);
  color: var(--text);
}
.video-play {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding-left: 4px;
  border-radius: 50%;
  background: var(--lilac);
  box-shadow: var(--glow-lilac);
  color: var(--on-lilac);
  font-size: 1.6rem;
  transition: transform .2s var(--ease);
}
.video-facade:hover .video-play { transform: scale(1.08); }
.video-title {
  font-family: var(--font-head);
  font-size: 1.7rem;
  line-height: 1.15;
  text-align: center;
}
.video-note {
  margin-top: .6rem;
  color: var(--text-muted);
  font-size: .85rem;
}
.video-placeholder p { margin-bottom: 1rem; }

/* 5 steps with hand-drawn number circles */
.steps {
  display: grid;
  gap: .8rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: .9rem 1rem .9rem 3.7rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: .8rem;
  left: 1rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--gold);
  border-radius: 50%;
  box-shadow: var(--glow-gold);
  color: var(--gold);
  font-family: var(--font-marker);
  font-size: 1rem;
}

/* Key takeaway: a dashed sticky note */
.takeaway {
  margin-top: 2rem;
  padding: 1.3rem 1.4rem;
  border: 2px dashed var(--gold);
  border-radius: var(--radius);
  background: rgb(var(--gold-rgb) / .07);
  transform: rotate(-.5deg);
}
.takeaway-label {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.takeaway-text {
  margin-top: .3rem;
  font-family: var(--font-head);
  font-size: 1.8rem;
  line-height: 1.25;
}
.try-it-link { margin-top: 1.5rem; }

/* Quiz */
.quiz-sub {
  margin-left: .4rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 400;
  vertical-align: middle;
}
.quiz-form {
  display: grid;
  gap: 1rem;
}
.quiz-q {
  min-width: 0;
  padding: 1rem 1.1rem;
  border: var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
}
.quiz-q legend {
  float: left;                    /* keeps the legend inside the box instead of on its border */
  width: 100%;
  margin-bottom: .6rem;
  padding: 0;
  font-weight: 700;
}
.quiz-q legend + * { clear: both; }
.quiz-num { color: var(--gold); }

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .5rem .6rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.quiz-option:hover { background-color: var(--tint-lilac); }
.quiz-option input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: .3rem;
  accent-color: var(--purple);
}
.quiz-option.is-correct { border-color: var(--good); }
.quiz-option.is-wrong   { border-color: var(--bad); }

.quiz-feedback {
  margin-top: .4rem;
  font-weight: 700;
}
.quiz-feedback.is-right { color: var(--good); }
.quiz-feedback.is-wrong { color: var(--bad); }
.quiz-feedback.is-skip  { color: var(--text-muted); }
.quiz-explain {
  color: var(--text-muted);
  font-size: .95rem;
}
.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.quiz-score {
  min-height: 1.2em;
  font-family: var(--font-head);
  font-size: 1.6rem;
  line-height: 1.2;
}

/* Share + prev/next */
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.share-row .chip:hover { border-color: var(--lilac); }
.share-status {
  min-height: 1.4em;
  margin-top: .5rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .8rem;
  word-break: break-all;
}

.prev-next {
  display: grid;
  gap: 1rem;
  margin-top: 3rem;
}
.prev-next-link {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 1rem 1.2rem;
  border: var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.prev-next-link:hover {
  border-color: var(--lilac);
  box-shadow: var(--glow-lilac);
  color: var(--text);
}
.prev-next-dir {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .75rem;
  text-transform: uppercase;
}
.prev-next-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  line-height: 1.15;
}

.topic-missing { padding-block: 5rem; }

@media (min-width: 600px) {
  .prev-next { grid-template-columns: 1fr 1fr; }
  .prev-next-link.is-next { grid-column: 2; text-align: right; }
}


/* ==========================================================================
   17e. Tools page
   ========================================================================== */
.tools-stack {
  display: grid;
  gap: 2rem;
}
.tool { scroll-margin-top: calc(var(--header-h) + 12px); }
.tool-title {
  margin-bottom: .3rem;
  font-size: clamp(2rem, 6vw, 2.4rem);
}
.tool-sub {
  margin: 1.5rem 0 .6rem;
  color: var(--lilac);
}
textarea.field {
  resize: vertical;
  font-size: 1rem;
  line-height: 1.5;
}
.tool p:has(> .btn) { margin-top: .8rem; }

/* Outputs */
.out-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
.out-block {
  padding: .8rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--field-bg);
}
.out-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .3rem;
}
.out-value {
  display: block;
  color: var(--gold);
  font-size: .95rem;
  white-space: pre-wrap;
  word-break: break-all;
}
.out-value.is-error { color: var(--bad); }
.out-help {
  margin-top: .5rem;
  color: var(--text-muted);
  font-size: .88rem;
}

.crack-table { margin: 0; }
.tool .table-wrap { margin: 1rem 0; }

.assumptions { margin-top: 1rem; }
.assumptions summary {
  color: var(--lilac);
  font-weight: 700;
  cursor: pointer;
}
.assumptions ul {
  display: grid;
  gap: .4rem;
  margin-top: .6rem;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: .95rem;
}

/* IAM explainer */
.iam-output {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}
.iam-summary {
  padding: .7rem 1rem;
  border-left: 4px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--tint-lilac);
  font-weight: 700;
}
.iam-summary.is-danger { border-left-color: var(--bad); }
.iam-summary.is-warn   { border-left-color: var(--warn); }
.iam-summary.is-good   { border-left-color: var(--good); }
.iam-error {
  color: var(--bad);
  font-weight: 700;
}

.iam-statement {
  padding: 1rem 1.1rem;
  border: var(--border);
  border-radius: var(--radius);
  background-color: var(--field-bg);
}
.iam-statement-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem;
}
.iam-effect {
  padding: .15rem .7rem;
  border-radius: var(--pill);
  background: var(--track);
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.iam-effect.is-allow { background: var(--good); color: var(--bg); }
.iam-effect.is-deny  { background: var(--bad);  color: var(--bg); }
.iam-sid { font-size: 1.5rem; }
.iam-sentence { margin: .5rem 0 .8rem; }

.iam-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .4rem 1rem;
}
.iam-grid dt {
  padding-top: .2rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
}
.iam-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .6rem;
  padding: 0;
  list-style: none;
}
.iam-list code {
  color: var(--gold);
  word-break: break-all;
}
.muted { color: var(--text-muted); }

.iam-warnings {
  display: grid;
  gap: .5rem;
  margin-top: .8rem;
  padding: 0;
  list-style: none;
}
.iam-warning {
  padding: .6rem .8rem;
  border-left: 4px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--tint-lilac);
  font-size: .95rem;
}
.iam-badge {
  margin-right: .3rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.iam-warning.is-danger { border-left-color: var(--bad); }
.iam-warning.is-warn   { border-left-color: var(--warn); }
.iam-warning.is-info   { border-left-color: var(--blue); }
.iam-warning.is-good   { border-left-color: var(--good); }
.is-danger .iam-badge { color: var(--bad); }
.is-warn   .iam-badge { color: var(--warn); }
.is-info   .iam-badge { color: var(--blue); }
.is-good   .iam-badge { color: var(--good); }

/* Phishing quiz */
.phish-list {
  display: grid;
  gap: .8rem;
  padding: 0;
  list-style: none;
}
.phish-item {
  padding: .9rem 1rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--field-bg);
  transition: border-color .2s;
}
.phish-item.is-right { border-color: var(--good); }
.phish-item.is-wrong { border-color: var(--bad); }
.phish-context {
  color: var(--text-muted);
  font-size: .9rem;
}
.phish-url code {
  display: block;
  margin: .3rem 0 .7rem;
  color: var(--text);
  font-size: .95rem;
  word-break: break-all;
}
.phish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.phish-actions .chip:hover { border-color: var(--lilac); }
.phish-actions .chip:disabled { opacity: .5; cursor: default; }
.phish-actions .chip[aria-pressed="true"] {
  opacity: 1;
  border-color: var(--lilac);
  background: var(--lilac);
  color: var(--on-lilac);
}
.phish-feedback {
  margin-top: .7rem;
  font-size: .95rem;
}
.is-right .phish-feedback strong { color: var(--good); }
.is-wrong .phish-feedback strong { color: var(--bad); }


/* ==========================================================================
   17f. Roadmaps page
   ========================================================================== */
.roadmaps {
  display: grid;
  gap: 4rem;
}
.roadmap-head { margin-bottom: 1.2rem; }
.roadmap-head h2 { font-size: clamp(2.2rem, 7vw, 3rem); }

.days li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.days li label { flex: 1; }
.day-link {
  flex: none;
  padding: .55rem .4rem;
  font-size: .85rem;
  white-space: nowrap;
}

.resources { margin-top: 1.5rem; }
.resources h3 {
  margin-bottom: .6rem;
  color: var(--lilac);
}
.resource-note {
  display: block;
  color: var(--text-muted);
  font-size: .9rem;
}


/* ==========================================================================
   17g. Cheat sheets page (print styles are at the end of the file)
   ========================================================================== */
.sheets {
  display: grid;
  gap: 3.5rem;
}
.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .5rem;
}
.sheet-head h2 { font-size: clamp(2rem, 6vw, 2.6rem); }
.sheet-intro {
  margin-bottom: 1rem;
  color: var(--text-muted);
}
.sheet-tip {
  margin-top: .9rem;
  color: var(--lilac);
  font-family: var(--font-head);
  font-size: 1.35rem;
  line-height: 1.3;
}

.term-grid {
  display: grid;
  gap: .6rem;
}
.term-grid > div {
  padding: .7rem .9rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
}
.term-grid dt {
  color: var(--lilac);
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}
.term-grid dd { font-size: .95rem; }

.owasp-list {
  display: grid;
  gap: .8rem;
  padding: 0;
  list-style: none;
}
.owasp-list li {
  padding: 1rem 1.1rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
}
.owasp-list h3 {
  margin-bottom: .3rem;
  font-size: 1.6rem;
}
.owasp-id {
  margin-right: .3rem;
  padding: .1rem .5rem;
  border-radius: var(--pill);
  background: var(--purple);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .8rem;
  vertical-align: middle;
}
.owasp-list p + p { margin-top: .3rem; }
.defend {
  color: var(--text-muted);
  font-size: .95rem;
}
.defend strong { color: var(--good); }

.print-footer { display: none; }

@media (min-width: 600px) {
  .term-grid { grid-template-columns: 1fr 1fr; }
}


/* ==========================================================================
   17h. Contact page
   ========================================================================== */
.contact-grid {
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.contact-card p { color: var(--text-muted); }
.contact-card p:last-child { margin-top: auto; padding-top: .4rem; }
.contact-icon { color: var(--gold); }
.contact-icon .ico { width: 1.75rem; height: 1.75rem; }
.contact-email {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: .95rem;
  word-break: break-all;
}
.contact-more { margin-top: 2.5rem; }

@media (min-width: 900px) {
  .contact-grid { grid-template-columns: repeat(3, 1fr); }
}


/* ==========================================================================
   17h2. Split sections + row lists (home: tools, roadmaps)
   Heading on the left, a list on the right, so the home page isn't three
   identical tile grids in a row.
   ========================================================================== */
.split {
  display: grid;
  gap: 1.5rem;
}
.split-cta { margin-top: 1.5rem; }

.row-list {
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.feature-row,
.roadmap-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem .6rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  transition: background-color .2s;
}
.feature-row { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.feature-row:hover,
.roadmap-row:hover {
  background-color: var(--tint-lilac);
  color: var(--text);
}

.feature-num {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .8rem;
}
.row-icon { color: var(--gold); }
.row-icon .ico { width: 1.6rem; height: 1.6rem; }
.row-main {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}
.row-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.15;
}
.row-sub {
  color: var(--text-muted);
  font-size: .95rem;
}
.row-meta,
.row-arrow {
  color: var(--lilac);
  font-family: var(--font-mono);
  font-size: .8rem;
  white-space: nowrap;
}
.row-arrow {
  font-size: 1.2rem;
  transition: transform .2s var(--ease);
}
.feature-row:hover .row-arrow { transform: translateX(4px); }
.roadmap-row .mini-progress { max-width: 16rem; }

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    align-items: start;
    gap: 4rem;
  }
  .split-head {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    margin-bottom: 0;
  }
}


/* ==========================================================================
   17i. Light theme tweaks (things tokens alone can't express)
   ========================================================================== */
:root[data-theme="light"] #sky { display: none; }
:root[data-theme="light"] .hero-title { text-shadow: none; }
:root[data-theme="light"] .hero-logo { filter: none; }   /* the logo already carries its own glow */
:root[data-theme="light"] .tool { box-shadow: 0 10px 30px rgb(var(--lilac-rgb) / .08); }
:root[data-theme="light"] .typed { text-shadow: none; }


/* ==========================================================================
   18. Utilities (last, so they win over components)
   ========================================================================== */
.center { text-align: center; }

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

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }


/* ==========================================================================
   19. Motion
   ========================================================================== */

/* Hover lifts only on devices with a real pointer (no "stuck" hover after a tap) */
@media (hover: hover) {
  .btn:hover        { transform: translateY(-2px); }
  .social-btn:hover,
  .tile:hover,
  .prev-next-link:hover { transform: translateY(-3px); }
  .card:hover {
    border-color: var(--lilac);
    box-shadow: var(--glow-lilac);
    transform: translateY(-4px) rotate(-.4deg);
  }
}

/* Scroll reveal (only when JS is running, so content never stays hidden) */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Draw-on animation for circled words */
.js .circled .scribble-circle path {
  stroke-dashoffset: 620;
  transition: stroke-dashoffset 1.2s var(--ease) .3s;
}
.js .is-visible .circled .scribble-circle path { stroke-dashoffset: 0; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes spin  { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .js .reveal { opacity: 1; transform: none; }
  .js .circled .scribble-circle path { stroke-dashoffset: 0; }
  .caret { animation: none; }
}


/* ==========================================================================
   20. Print (cheat sheets and any page printed from the browser)
   Clean black-on-white, no glows, no navigation. "Print this sheet" adds
   .printing-one to <body> and .print-target to the chosen sheet.
   ========================================================================== */
@media print {
  @page { margin: 14mm; }

  :root,
  :root[data-theme="light"] {
    --bg-rgb:      255 255 255;
    --surface-rgb: 255 255 255;
    --lilac-rgb:   40 20 90;
    --purple-rgb:  40 20 90;
    --gold-rgb:    0 0 0;
    --text:        #000;
    --text-muted:  #333;
    --line:        #bbb;
    --surface:     #fff;
    --field-bg:    #fff;
    --tint-lilac:  #f1f1f1;
    --good:        #000;
    --glow-lilac:  none;
    --glow-blue:   none;
    --glow-gold:   none;
    --glow-text:   none;
  }

  html,
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  body::before,
  #sky,
  .skip-link,
  .site-header,
  .site-footer,
  .breadcrumb,
  .page-hero .chip-nav,
  .page-hero .hero-actions,
  .sheet-head .btn,
  .theme-toggle { display: none !important; }

  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .js .reveal { opacity: 1; transform: none; }

  a { color: #000; }
  .page-hero { padding: 0 0 8pt; }
  .page-hero h1 { font-size: 24pt; }
  .section,
  .section-alt { padding: 0; background: none; }

  /* One sheet per page */
  .sheet { break-before: page; }
  .sheet:first-of-type { break-before: auto; }
  .data-table tr,
  .owasp-list li,
  .term-grid > div { break-inside: avoid; }
  .table-wrap { overflow: visible; }
  .data-table code { white-space: normal; }

  .owasp-id {
    -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
  }

  /* "Print this sheet": hide everything except the chosen one */
  .printing-one .page-hero,
  .printing-one .sheet:not(.print-target) { display: none; }
  .printing-one .sheet { break-before: auto; }

  .print-footer {
    display: block;
    margin-top: 12pt;
    color: #555;
    font-size: 9pt;
  }
}
