/* =============================================================
   Gary's Security Stories — Shared Stylesheet
   Extracted from gary-theme-magazine-carl.html (approved theme)
   Do NOT modify this file without Carl's explicit approval.
   All 19 output pages link this file.
   ============================================================= */

:root {
  /* --- Carl Simpson brand --- */
  --hero:      #0a0a0a;
  --black:     #000000;
  --orange:    #ff6600;
  --orange-2:  #ff7f1a;    /* hover */
  --white:     #ffffff;
  --bg:        #fafaf8;    /* off-white for body — softer than pure white, more magazine */
  --bg-2:      #f3f1eb;    /* sidebar / inset background */
  --gray-900:  #111827;
  --gray-800:  #1f2937;
  --gray-700:  #374151;
  --gray-600:  #4b5563;
  --gray-500:  #6b7280;
  --gray-400:  #9ca3af;
  --gray-300:  #d1d5db;
  --gray-200:  #e5e7eb;

  /* --- Cipher Lane palette (story-aside components, practice-quiz panels, See-story chip) --- */
  --paper:     #FAF7F2;   /* warm off-white background */
  --ink:       #1A1612;   /* dark warm-toned ink */
  --espresso:  #3B1F0A;   /* dark roast accent */
  --amber:     #C8861A;   /* saturated warm accent (In-the-wild rail) */

  /* --- Type --- */
  --display:   'Space Grotesk', 'Inter', system-ui, sans-serif;
  --sans:      'Inter', system-ui, -apple-system, sans-serif;
  --mono:      'JetBrains Mono', 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--gray-900);
  font-family: var(--sans); font-size: 17px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--orange); color: var(--white); }
a { color: var(--gray-900); text-decoration-color: var(--orange); text-underline-offset: 3px; transition: color 200ms ease; }
a:hover { color: var(--orange); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }

.shell { max-width: 1440px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2.5rem); }

/* ============================================================
   NAVIGATION (Carl's site pattern — white bar, black text)
   ============================================================ */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.topnav .inner {
  max-width: 1440px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem);
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.topnav .brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--gray-900); }
.topnav .brand .mark {
  position: relative; width: 40px; height: 40px; flex: 0 0 40px;
}
.topnav .brand .mark .block { position: absolute; inset: 0; background: var(--black); }
.topnav .brand .mark .dot { position: absolute; top: 0; right: 0; width: 12px; height: 12px; background: var(--orange); }
.topnav .brand .mark .letters {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--white);
}
.topnav .brand .name {
  font-family: var(--display); font-size: 13px; font-weight: 600;
  letter-spacing: -0.01em; text-transform: uppercase;
}
.topnav .links { display: none; gap: 2rem; align-items: center; }
@media (min-width: 768px) { .topnav .links { display: flex; } }
.topnav .links a {
  font-size: 13px; font-weight: 500; color: var(--gray-600); text-decoration: none;
  transition: color 200ms ease;
}
.topnav .links a:hover { color: var(--black); }
.topnav .links a.contact {
  padding: 0.625rem 1.5rem; background: var(--black); color: var(--white);
  transition: background 200ms ease;
}
.topnav .links a.contact:hover { background: var(--gray-700); color: var(--white); }

/* ============================================================
   HERO — signature black section, flat bottom (no skew)
   ============================================================ */
.hero {
  position: relative; background: var(--hero); color: var(--white);
  padding: clamp(4rem, 10vw, 8rem) 0 clamp(5rem, 12vw, 10rem);
  overflow: hidden;
}
.hero .grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 102, 0, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 102, 0, 0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}
.hero .inner {
  position: relative; max-width: 1440px; margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}
@media (max-width: 960px) { .hero .inner { grid-template-columns: 1fr; } }

.hero .status {
  display: inline-flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem;
}
.hero .status .square { width: 12px; height: 12px; background: var(--orange); }
.hero .status .label {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--gray-400);
}

.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(3rem, 8.5vw, 6.5rem); line-height: 0.92; letter-spacing: -0.035em;
  color: var(--white); margin: 0;
}
.hero h1 .line { display: block; }
.hero h1 .amp { font-weight: 500; color: var(--orange); font-style: italic; display: inline-block; transform: translateY(-2px); }

.hero .tagline-row {
  display: flex; align-items: flex-start; gap: 1rem; margin-top: 2.5rem;
}
.hero .tagline-row .bar { width: 4px; background: var(--orange); flex: 0 0 4px; align-self: stretch; min-height: 96px; }
.hero .tagline-row .copy .headline2 {
  font-family: var(--display); font-size: clamp(1.4rem, 2.4vw, 1.75rem); font-weight: 300;
  color: var(--white); line-height: 1.25; margin: 0 0 0.5rem;
}
.hero .tagline-row .copy .meta-line {
  font-family: var(--mono); font-size: 13px; color: var(--gray-400);
  letter-spacing: 0.02em;
}

.hero .strap {
  margin-top: 2.5rem; max-width: 48ch;
  font-size: 1.1rem; line-height: 1.55; color: var(--gray-300); font-weight: 400;
}

.hero .ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
.hero .btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.95rem 2rem; font-family: var(--sans); font-size: 13px; font-weight: 500;
  letter-spacing: 0.02em; text-decoration: none; cursor: pointer;
  border: 0; transition: background 200ms ease, color 200ms ease, gap 200ms ease;
}
.hero .btn.primary { background: var(--orange); color: var(--white); }
.hero .btn.primary:hover { background: var(--orange-2); gap: 0.9rem; }
.hero .btn.ghost { background: transparent; color: var(--white); border: 2px solid var(--white); padding: calc(0.95rem - 2px) calc(2rem - 2px); }
.hero .btn.ghost:hover { background: var(--white); color: var(--black); }
.hero .btn svg { width: 14px; height: 14px; }

/* Hero right — issue card */
.issue-card {
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 2rem;
  background: rgba(255, 255, 255, 0.02);
}
.issue-card .corner-square {
  position: absolute; top: -12px; right: -12px; width: 24px; height: 24px; background: var(--orange);
}
.issue-card .label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--orange); margin-bottom: 0.75rem;
}
.issue-card .issue-no {
  font-family: var(--display); font-size: 5rem; line-height: 0.9; font-weight: 700;
  color: var(--white); letter-spacing: -0.03em;
}
.issue-card .issue-no .sep { color: var(--orange); }
.issue-card .issue-sub {
  font-family: var(--sans); font-size: 0.95rem; color: var(--gray-400);
  margin-top: 0.5rem; line-height: 1.5;
}
.issue-card .stats {
  margin-top: 1.5rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.issue-card .stat .num {
  font-family: var(--display); font-size: 1.75rem; font-weight: 700; color: var(--white); line-height: 1;
}
.issue-card .stat .lbl {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--gray-400); margin-top: 0.35rem;
}

/* ============================================================
   KICKER / BYLINE / HEADLINES
   ============================================================ */
.kicker {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--hero);
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-bottom: 1rem;
}
.kicker::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--orange); }

.headline {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.03em;
  color: var(--gray-900); margin: 0 0 1rem;
}
.deck {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem); color: var(--gray-700); line-height: 1.4;
  max-width: 58ch; margin: 0 0 2rem;
}

.byline {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; color: var(--gray-600);
  display: flex; gap: 2rem; flex-wrap: wrap; align-items: center;
  padding: 1rem 0; border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200);
  margin: 1.5rem 0 2.5rem;
}
.byline strong { color: var(--gray-900); font-weight: 700; }
.byline .sep { width: 4px; height: 4px; background: var(--orange); }

/* ============================================================
   BODY COPY — magazine columns, carl typography
   ============================================================ */
.feature { padding: 4rem 0; }
.feature-grid { display: grid; grid-template-columns: minmax(0, 2fr) 400px; gap: 3.5rem; align-items: start; }
@media (max-width: 960px) { .feature-grid { grid-template-columns: 1fr; gap: 2rem; } }

.body-copy { font-size: 17px; line-height: 1.75; color: var(--gray-900); }
.body-copy p { margin: 0 0 1.25rem; }
.body-copy p.lede { font-size: 1.3rem; font-weight: 400; color: var(--black); line-height: 1.55; }
.body-copy p.narr { color: var(--gray-700); }
.body-copy p.narr em { color: var(--gray-900); }
.body-copy strong { color: var(--black); font-weight: 600; }
.feature .body-copy { max-width: 75ch; }
.body-copy .narr,
.body-copy p.narr {
  font-family: var(--sans);
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--gray-700);
  margin: 1.25rem 0;
  padding: 0.4rem 0 0.4rem 1.1rem;
  border-left: 2px solid var(--gray-300);
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}
.body-copy .narr em,
.body-copy p.narr em { font-style: italic; }
.body-copy .term {
  display: inline-block; padding: 0.08em 0.35em;
  background: var(--orange); color: var(--hero); font-weight: 600;
}

.drop-cap::first-letter {
  float: left; font-family: var(--display); font-weight: 700;
  color: var(--orange); font-size: 5.5rem; line-height: 0.85;
  padding: 0.1rem 0.65rem 0 0; letter-spacing: -0.04em;
}

.column-2 { column-count: 1; }
.column-2 p:first-child { margin-top: 0; }
@media (max-width: 780px) { .column-2 { column-count: 1; } }

/* ============================================================
   PULL QUOTE
   ============================================================ */
.pullquote {
  margin: 3rem 0; padding: 2rem 2rem 2rem 2.5rem;
  background: var(--bg-2); border-left: 4px solid var(--orange);
  font-family: var(--display); font-weight: 500; font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  line-height: 1.4; color: var(--black);
  position: relative;
}
.pullquote::before {
  content: ""; position: absolute; top: 0; right: 0; width: 32px; height: 32px;
  background: var(--black); clip-path: polygon(100% 0, 0 0, 100% 100%);
}
.pullquote .mark {
  display: inline-block; margin-right: 0.75rem; font-size: 2.25rem; color: var(--orange);
  font-family: var(--display); font-weight: 700; line-height: 0; vertical-align: -0.4em;
}
.pullquote cite {
  display: block; margin-top: 1.25rem;
  font-family: var(--mono); font-style: normal; font-size: 11px;
  font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gray-600);
}

/* ============================================================
   NAPKIN / SIDEBAR — black card, Carl-style
   ============================================================ */
.napkin {
  background: var(--hero); color: var(--white);
  padding: 2rem; position: relative; max-width: 400px; width: 100%;
}
@media (max-width: 960px) { .napkin { max-width: 100%; } }
.napkin::after {
  content: ""; position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; background: var(--orange);
}
.napkin .label {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--orange);
  margin-bottom: 0.75rem;
}
.napkin h3 {
  font-family: var(--display); font-size: 1.75rem; font-weight: 700;
  line-height: 1; margin: 0 0 1.25rem; color: var(--white); letter-spacing: -0.02em;
}
.formula {
  font-family: var(--mono); font-size: 1.05rem; font-weight: 700;
  padding: 0.85rem 1rem; background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 102, 0, 0.4);
  margin: 0.6rem 0; color: var(--white); letter-spacing: 0.02em;
}
.formula .op { color: var(--orange); padding: 0 0.2em; }
.napkin .note {
  font-size: 0.9rem; color: var(--gray-400); line-height: 1.65;
  font-style: italic; margin-top: 1rem;
}
.napkin .divide { height: 1px; background: rgba(255, 102, 0, 0.3); margin: 1.5rem 0; }
.napkin .small-kicker {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--orange);
  margin-bottom: 0.5rem;
}
.napkin p { color: var(--gray-400); margin: 0 0 0.75rem; font-size: 0.9rem; }
.napkin ul { color: var(--gray-400); margin: 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 0.85rem; line-height: 1.7; }
.napkin ul li::before { content: "·  "; color: var(--orange); }

/* ============================================================
   KEY CONCEPT
   ============================================================ */
.concept {
  max-width: 64ch; margin: 3rem 0; padding: 2rem 2.25rem;
  background: var(--hero); color: var(--white);
  border-left: 6px solid var(--orange); position: relative;
}
.concept::before {
  content: ""; position: absolute; top: 0; right: 0; width: 40px; height: 40px;
  background: var(--orange); clip-path: polygon(100% 0, 0 0, 100% 100%);
}
.concept .label {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--orange);
  margin-bottom: 0.75rem;
}
.concept p {
  font-family: var(--display); font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  font-weight: 500; line-height: 1.35; margin: 0; color: var(--white);
  letter-spacing: -0.01em;
}

/* ============================================================
   QUIZ
   ============================================================ */
.quiz {
  border: 2px solid var(--black); background: var(--white);
  padding: 2rem; max-width: 64ch; margin: 3rem 0;
  box-shadow: 8px 8px 0 var(--orange);
}
.quiz h3 {
  font-family: var(--display); font-size: 1.5rem; font-weight: 700;
  line-height: 1.25; letter-spacing: -0.02em; margin: 0.25rem 0 1.5rem; color: var(--gray-900);
}
.quiz ol { list-style: none; padding: 0; margin: 0 0 1.25rem; counter-reset: a; }
.quiz li {
  counter-increment: a;
  display: grid; grid-template-columns: 3rem 1fr auto; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; border-top: 1px solid var(--gray-200);
  cursor: pointer; font-size: 15px; color: var(--gray-900);
  transition: background 140ms ease, color 140ms ease;
}
.quiz li:last-child { border-bottom: 1px solid var(--gray-200); }
.quiz li::before {
  content: counter(a, upper-alpha);
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  letter-spacing: 0.1em; color: var(--gray-400);
}
.quiz li::after { content: ""; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gray-600); justify-self: end; }
.quiz li:hover { background: var(--bg-2); }
.quiz li[data-s="picked"] { background: var(--hero); color: var(--white); border-top-color: var(--hero); }
.quiz li[data-s="picked"]::before { color: var(--orange); }
.quiz li[data-s="picked"]::after { content: "// SELECTED"; color: var(--orange); }
.quiz li[data-s="correct"] { background: var(--orange); color: var(--white); border-top-color: var(--orange); }
.quiz li[data-s="correct"]::before { color: var(--white); }
.quiz li[data-s="correct"]::after { content: "✓ CORRECT"; color: var(--white); }
.quiz li[data-s="wrong"] { background: var(--hero); color: var(--gray-400); border-top-color: var(--hero); }
.quiz li[data-s="wrong"]::before { color: var(--gray-400); }
.quiz li[data-s="wrong"]::after { content: "✗ INCORRECT"; color: var(--orange); }

.quiz .actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
.quiz .explain {
  margin-top: 1.5rem; padding: 1.25rem 1.5rem;
  background: var(--bg-2); border-left: 3px solid var(--orange);
  font-size: 14px; color: var(--gray-700); line-height: 1.7;
}
.quiz .explain strong { color: var(--black); font-weight: 700; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 1.75rem; font-family: var(--sans); font-size: 13px; font-weight: 500;
  letter-spacing: 0.02em; text-decoration: none; cursor: pointer;
  border: 0; transition: background 200ms ease, color 200ms ease, gap 200ms ease;
}
.btn.primary { background: var(--orange); color: var(--white); }
.btn.primary:hover { background: var(--orange-2); gap: 0.85rem; }
.btn.dark { background: var(--black); color: var(--white); }
.btn.dark:hover { background: var(--gray-700); gap: 0.85rem; }
.btn.ghost { background: transparent; color: var(--gray-900); border: 2px solid var(--black); padding: calc(0.9rem - 2px) calc(1.75rem - 2px); }
.btn.ghost:hover { background: var(--black); color: var(--white); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ============================================================
   PROGRESS HUD
   ============================================================ */
.progress {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: stretch;
  margin: 3rem 0; border: 1px solid var(--gray-200); background: var(--white);
}
.progress .label {
  padding: 0.85rem 1rem; background: var(--hero); color: var(--white);
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase;
  display: flex; align-items: center; gap: 0.65rem;
}
.progress .label .dot { width: 10px; height: 10px; background: var(--orange); }
.progress .ticks { display: grid; grid-template-columns: repeat(22, 1fr); align-items: stretch; }
.progress .ticks .seg {
  border-right: 1px solid var(--gray-200); min-height: 44px;
}
.progress .ticks .seg:last-child { border-right: 0; }
.progress .ticks .seg.done { background: var(--black); }
.progress .ticks .seg.now { background: var(--orange); position: relative; }
.progress .ticks .seg.now::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 7px solid var(--orange);
}
.progress .count {
  padding: 0.85rem 1rem; font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: var(--gray-900); display: flex; align-items: center; gap: 0.35rem;
}
.progress .count .of { color: var(--gray-600); font-weight: 400; }

/* ============================================================
   FLASHCARDS
   ============================================================ */
.flashdeck { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.flash { height: 240px; perspective: 1200px; cursor: pointer; }
.flash .inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 500ms cubic-bezier(0.2, 0.9, 0.3, 1); }
.flash[aria-pressed="true"] .inner { transform: rotateY(180deg); }
.flash .face {
  position: absolute; inset: 0; backface-visibility: hidden; padding: 1.5rem 1.6rem;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--white); border: 2px solid var(--black);
  box-shadow: 6px 6px 0 var(--orange);
}
.flash .face.back { background: var(--hero); color: var(--white); border-color: var(--orange); box-shadow: 6px 6px 0 var(--black); transform: rotateY(180deg); }
.flash .face .label { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--orange); }
.flash .face.back .label { color: var(--orange); }
.flash .face .term { font-family: var(--display); font-weight: 700; font-size: 2.5rem; line-height: 1; color: var(--gray-900); letter-spacing: -0.03em; }
.flash .face.back .term { font-family: var(--sans); font-size: 0.95rem; font-weight: 400; line-height: 1.6; color: var(--white); letter-spacing: 0; }
.flash .face.back .term em { color: var(--orange); font-style: normal; font-weight: 600; font-family: var(--mono); }
.flash .face .foot { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gray-400); }
.flash .face.back .foot { color: var(--gray-400); }

/* ============================================================
   STORY NAVIGATION (prev/next cards at bottom of story pages)
   ============================================================ */
.story-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 4rem 0; }
@media (max-width: 640px) { .story-nav { grid-template-columns: 1fr; } }
.story-nav-card {
  display: block; text-decoration: none; padding: 1.5rem;
  border: 2px solid var(--gray-200); background: var(--white);
  transition: border-color 200ms ease, box-shadow 200ms ease;
  position: relative;
}
.story-nav-card:hover { border-color: var(--orange); box-shadow: 6px 6px 0 var(--orange); color: var(--gray-900); }
.story-nav-card .nav-dir {
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gray-700); margin-bottom: 0.5rem;
}
.story-nav-card .nav-title {
  font-family: var(--display); font-size: 1.15rem; font-weight: 700;
  color: var(--gray-900); letter-spacing: -0.02em; line-height: 1.2;
}
.story-nav-card:hover .nav-title { color: var(--orange); }
.story-nav-card .nav-meta {
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gray-700); margin-top: 0.5rem;
}

/* ============================================================
   DOMAIN FILTER CHIPS (dashboard)
   ============================================================ */
.filter-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 2rem 0 1.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  border: 2px solid var(--black); background: transparent; color: var(--gray-700);
  cursor: pointer; transition: background 150ms ease, color 150ms ease;
}
.chip:hover { background: var(--gray-900); color: var(--white); }
.chip.active { background: var(--black); color: var(--white); }
.chip.active .chip-sq { background: var(--orange); }
.chip .chip-sq { width: 8px; height: 8px; background: var(--gray-400); }

/* ============================================================
   STORY GRID CARDS (dashboard index)
   ============================================================ */
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.story-card {
  display: block; text-decoration: none; color: var(--gray-900);
  border: 2px solid var(--gray-200); background: var(--white);
  padding: 1.5rem; position: relative;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.story-card:hover { border-color: var(--orange); box-shadow: 6px 6px 0 var(--orange); }
.story-card .card-top {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem;
}
.story-card .card-top .sq { width: 12px; height: 12px; background: var(--orange); flex: 0 0 12px; }
.story-card .card-top .meta {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--gray-600);
}
.story-card .card-title {
  font-family: var(--display); font-size: 1.2rem; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.2; color: var(--gray-900);
  margin-bottom: 0.5rem;
}
.story-card:hover .card-title { color: var(--orange); }
.story-card .card-summary {
  font-size: 14px; color: var(--gray-600); line-height: 1.5; margin-bottom: 1rem;
}
.story-card .card-footer {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--gray-200); padding-top: 0.75rem; margin-top: 0.75rem;
}
.story-card .read-state {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase;
}
.story-card .read-state.unread { color: var(--gray-600); }
.story-card .read-state.reading { color: var(--orange); }
.story-card .read-state.complete { color: var(--gray-900); background: var(--black); color: var(--white); padding: 0.2em 0.5em; }
.story-card .read-time {
  font-family: var(--mono); font-size: 10px; color: var(--gray-600); letter-spacing: 0.1em; text-transform: uppercase;
}

/* ============================================================
   NAPKIN INDEX TABLE (dashboard)
   ============================================================ */
.napkin-index { margin: 2rem 0; }
.napkin-index table { width: 100%; border-collapse: collapse; }
.napkin-index th {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--gray-600);
  padding: 0.75rem 1rem; border-bottom: 2px solid var(--black); text-align: left;
}
.napkin-index td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--gray-200); font-size: 15px; }
.napkin-index td:first-child { font-family: var(--mono); font-size: 0.9rem; font-weight: 700; color: var(--gray-900); }
.napkin-index td:last-child { font-family: var(--mono); font-size: 0.85rem; color: var(--gray-600); }
.napkin-index tr:hover td { background: var(--bg-2); }
@media (max-width: 640px) { .napkin-index { overflow-x: auto; } }

/* ============================================================
   DOMAIN SECTION (dashboard)
   ============================================================ */
.domain-section { margin: 4rem 0; padding-top: 2rem; border-top: 2px solid var(--gray-200); }
.domain-section .domain-header { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.domain-section .domain-number {
  font-family: var(--display); font-size: 3rem; font-weight: 700; color: var(--orange);
  line-height: 1; letter-spacing: -0.04em;
}
.domain-section .domain-name {
  font-family: var(--display); font-size: 1.5rem; font-weight: 700;
  color: var(--gray-900); letter-spacing: -0.02em;
}
.domain-section .domain-summary { max-width: 72ch; color: var(--gray-700); margin-bottom: 2rem; }

/* ============================================================
   COLOPHON
   ============================================================ */
.colophon {
  margin-top: 4rem; padding: 3rem 0;
  border-top: 2px solid var(--black);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; align-items: center;
}
.colophon .left { display: flex; align-items: center; gap: 0.75rem; }
.colophon .mark {
  position: relative; width: 28px; height: 28px;
}
.colophon .mark .block { position: absolute; inset: 0; background: var(--black); }
.colophon .mark .dot { position: absolute; top: 0; right: 0; width: 8px; height: 8px; background: var(--orange); }
.colophon .tag {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--gray-600);
}
.colophon .tag strong { color: var(--gray-900); font-weight: 700; }
.colophon .right {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--gray-600);
}
.colophon .right span::before { content: "·"; margin: 0 0.5rem; color: var(--orange); }
.colophon .right span:first-child::before { display: none; }

/* ============================================================
   SKIP LINK (accessibility)
   ============================================================ */
.skip-link {
  position: absolute; top: -100%; left: 1rem; z-index: 200;
  padding: 0.75rem 1.5rem; background: var(--orange); color: var(--white);
  font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.05em;
  text-decoration: none;
  transition: top 150ms ease;
}
.skip-link:focus { top: 1rem; }

/* ============================================================
   SECTION HEADING (shared utility)
   ============================================================ */
.section-heading {
  font-family: var(--display); font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700;
  letter-spacing: -0.03em; color: var(--gray-900);
  margin: 0.5rem 0 2rem;
}

/* ============================================================
   FLASHDECK HEADER WRAPPER (replaces inline style="margin-top:4rem")
   ============================================================ */
.flashdeck-header { margin-top: 4rem; }

/* ============================================================
   NAPKIN UTILITY TEXT (replaces inline font-family styles)
   ============================================================ */
.napkin .note-meta {
  font-family: var(--mono); font-size: 0.85rem; color: var(--gray-400);
}
.napkin .note-alert {
  font-family: var(--mono); font-size: 0.85rem; color: var(--orange);
}

/* ============================================================
   BUTTON SVG SIZING (shared across all .btn contexts)
   ============================================================ */
.btn svg { width: 14px; height: 14px; flex: 0 0 14px; }

/* ============================================================
   GHOST / DISABLED NAV CARD (Story 01 — Start of Series)
   ============================================================ */
.story-nav-card.ghost-disabled {
  border-color: var(--gray-200); background: var(--bg-2); color: var(--gray-700);
  cursor: default; pointer-events: none;
}
.story-nav-card.ghost-disabled .nav-dir { color: var(--gray-600); }
.story-nav-card.ghost-disabled .nav-title { color: var(--gray-700); }
.story-nav-card.ghost-disabled .nav-meta { color: var(--gray-600); }

/* ============================================================
   DONE / RETURN NAV CARD (Story 18 — Return to Dashboard)
   ============================================================ */
.story-nav-card.done-card {
  background: var(--black); border-color: var(--black); color: var(--white);
}
.story-nav-card.done-card .nav-dir { color: var(--gray-400); }
.story-nav-card.done-card .nav-title { color: var(--white); }
.story-nav-card.done-card:hover { border-color: var(--orange); box-shadow: 6px 6px 0 var(--orange); }
.story-nav-card.done-card:hover .nav-title { color: var(--orange); }
.story-nav-card.done-card .nav-meta { color: var(--orange); }

/* ============================================================
   CONTROL GRID TABLE (Story 18 — 4×6 matrix)
   ============================================================ */
.control-grid-wrap { overflow-x: auto; margin: 2rem 0; }
.control-grid {
  width: 100%; border-collapse: collapse;
  font-family: var(--mono); font-size: 13px;
}
.control-grid th {
  padding: 0.75rem; border: 1px solid var(--gray-200);
  background: var(--hero); text-align: left;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}
.control-grid th:first-child { color: var(--white); }
.control-grid th:not(:first-child) { color: var(--orange); }
.control-grid td { padding: 0.65rem 0.75rem; border: 1px solid var(--gray-200); color: var(--gray-700); }
.control-grid td:first-child { background: var(--bg-2); font-weight: 700; color: var(--gray-900); }

/* ============================================================
   DASHBOARD SECTION PADDING (replaces inline style="padding-top:4rem")
   ============================================================ */
.section-pt { padding-top: 4rem; }

/* ============================================================
   MOBILE NAV — hamburger button + drop-down panel below 768px
   ============================================================ */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 2px solid var(--black);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--black);
  transition: transform 200ms ease, opacity 200ms ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Mobile: links hidden until .open added by Alpine */
.topnav .links.open {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 0.5rem 1.25rem 1.25rem;
  background: var(--white);
  border-bottom: 2px solid var(--black);
  box-shadow: 0 8px 0 0 rgba(10,10,10,0.06);
  z-index: 50;
}
.topnav .links.open a {
  padding: 0.9rem 0.25rem;
  border-top: 1px solid var(--gray-200);
}
.topnav .links.open a:first-child { border-top: none; }
.topnav .links.open a.contact {
  margin-top: 0.75rem;
  text-align: center;
  padding: 0.75rem 1rem;
}
/* note: .topnav is already position: sticky, which is a positioned ancestor, so .links.open absolute positioning anchors correctly */

/* Desktop (≥768px): hide hamburger, keep .links as inline flex */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .topnav .links.open {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: center;
    position: static;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  .topnav .links.open a { padding: 0; border-top: none; }
  .topnav .links.open a.contact { margin-top: 0; padding: 0.5rem 1rem; }
}

/* Exam practice cards — 2-col grid at ≥640px, reuses .story-card styling */
.exam-cards { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 640px) { .exam-cards { grid-template-columns: 1fr 1fr; } }

/* Hamburger hover state */
.nav-toggle:hover { border-color: var(--orange); }
.nav-toggle:hover span { background: var(--orange); }

/* Progress HUD label hidden on very small viewports so the 18 segments can breathe */
@media (max-width: 480px) {
  .progress { grid-template-columns: 1fr auto; }
  .progress .label { display: none; }
}

/* ============================================================
   Story callouts row — concept lock-in + quiz side-by-side
   on wide viewports, stacked on mobile.
   ============================================================ */
.story-callouts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 2rem;
  margin: 3rem 0;
  align-items: start;
}
.story-callouts .concept,
.story-callouts .quiz {
  margin: 0;
  max-width: none;
}
@media (max-width: 960px) {
  .story-callouts {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ============================================================
   REDUCED MOTION — respect user preference on flashcard flip
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .flash .inner { transition: none; }
  .nav-toggle span { transition: none; }
  .nav-toggle { transition: none; }
  .story-chip { transition: none; }
}

/* ============================================================
   Visually-hidden utility (screen-reader only)
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ============================================================
   Story asides — In-the-wild (Gary stories) and
   For-the-exam (authentic-reframe stories).
   Containers stretch full-shell; inner prose capped at 75ch.
   ============================================================ */
.in-the-wild,
.for-the-exam {
  margin: 4rem auto 3rem;
  padding: 2rem 2.25rem;
  border-radius: 0 4px 4px 0;
}
.in-the-wild { background: rgba(200, 134, 26, 0.055); border-left: 4px solid var(--amber); }
.for-the-exam { background: rgba(26, 22, 18, 0.04);   border-left: 4px solid var(--ink); }

.in-the-wild .kicker,
.for-the-exam .kicker {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
  font-weight: 600;
}
.in-the-wild .kicker  { color: var(--amber); }
.for-the-exam .kicker { color: var(--ink); }

.in-the-wild h3,
.for-the-exam h3 {
  font-family: var(--display);
  font-weight: 700;
  margin: 0 0 1.1rem;
  color: var(--ink);
}
.in-the-wild  h3 { font-size: 1.4rem; line-height: 1.3; }
.for-the-exam h3 { font-size: 1.3rem; line-height: 1.35; }

.in-the-wild .body,
.for-the-exam .body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  color: #2a2420;            /* warm dark gray, intentionally local to asides */
  max-width: 75ch;
}
.for-the-exam .body { line-height: 1.65; }
.in-the-wild  .body p:not(:last-child) { margin-bottom: 1rem; }
.for-the-exam .body p:not(:last-child) { margin-bottom: 1.35rem; }
.in-the-wild  .body p:last-child,
.for-the-exam .body p:last-child       { margin-bottom: 0; }

/* For-the-exam meta rows — Concepts and SY0-701 objectives */
.for-the-exam .meta-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b5d52;            /* warm muted, intentionally local to asides */
  font-weight: 600;
  margin: 0.25rem 0 0.5rem;
}
.for-the-exam .meta-content {
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.6;
  color: #2a2420;
  max-width: 75ch;
  margin: 0 0 1.1rem;
}
.for-the-exam .meta-content--objectives {
  color: var(--espresso);
  margin-bottom: 0;
}

/* ============================================================
   Story chip — links from a practice-quiz explanation back to
   the matching Gary story. Hover/focus state lifts the rail
   to amber to echo the In-the-wild aside.
   ============================================================ */
.story-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  transition: border-color 150ms ease, background 150ms ease;
}
.story-chip:hover,
.story-chip:focus-visible {
  border-color: var(--amber);
  background: rgba(200, 134, 26, 0.04);
  outline: none;
}
.story-chip .label { color: var(--gray-600); }
.story-chip .title { font-family: var(--sans); font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.story-chip .arrow { color: var(--gray-500); }
.story-chip--small { padding: 0.4rem 0.9rem; font-size: 10px; }
.story-chip--small .title { font-size: 11px; }

/* ============================================================
   Explain panel — "Why this answer" / "Explanation" boxes that
   sit under each MCQ feedback line in practice.html.
   ============================================================ */
.explain-panel {
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, 0.03);
  border-left: 4px solid var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--gray-800);
}
.explain-panel--small {
  padding: 1rem 1.25rem;
  border-left-width: 3px;
  font-size: 0.9rem;
  line-height: 1.55;
}
.explain-panel .kicker {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.explain-panel--small .kicker { margin-bottom: 0.5rem; }
.explain-panel .body-text {
  display: block;
  white-space: pre-wrap;
  max-width: 75ch;
}

/* ============================================================
   Post-article polish — added 2026-04-29
   Centres post-article zone in a 1100px lane within the 1440px
   shell, fixes accidental grid-nesting of flashdeck inside
   .story-callouts, and tightens the for-the-exam meta hierarchy.
   See design-maestro spec; safe across all 22 stories.
   ============================================================ */

/* Post-article lane: 1100px centred lane within 1440px shell. */
.story-callouts,
.for-the-exam,
.story-nav {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* .story-callouts: equalise concept/quiz columns; force flashdeck
   header + deck (which are accidentally nested inside) to span full
   grid width instead of slotting into the first column. */
.story-callouts {
  grid-template-columns: 1fr 1fr;
}
.story-callouts .flashdeck-header,
.story-callouts .flashdeck {
  grid-column: 1 / -1;
}

/* .flashdeck: raise min card width to 300px so the 5-card deck
   produces 3+2 at 1100px lane instead of 4+1. Taller cards give
   long back-face definitions more room. */
.flashdeck {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.flash {
  height: 280px;
}

/* .for-the-exam: pull the meta block away from the body paragraph,
   add a hairline separator above the first meta-label (Concepts),
   and bump the kicker size from 10px to 11px to match other kickers. */
.for-the-exam .meta-label {
  font-size: 11px;
  margin-top: 1.5rem;
}
.for-the-exam .meta-label:first-of-type {
  padding-top: 1.25rem;
  border-top: 1px solid rgba(26, 22, 18, 0.12);
}

/* ============================================================
   Exam stats panel (dashboard) — added 2026-04-29
   Streak / drill queue / best score / questions seen + 5-domain
   accuracy heatmap. Renders on index.html when user has progress.
   ============================================================ */
[x-cloak] { display: none !important; }

.exam-stats {
  background: var(--bg-2);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--orange);
  padding: 2rem clamp(1.25rem, 2.5vw, 2.25rem);
  margin: 0 0 2.5rem;
}
.exam-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem 2rem;
}
.exam-stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.exam-stat-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
}
.exam-stat-value {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1;
  color: var(--black);
  letter-spacing: -0.03em;
}
.exam-stat-unit {
  font-family: var(--display);
  font-size: 0.5em;
  font-weight: 600;
  color: var(--gray-600);
  letter-spacing: 0;
  margin-left: 0.15em;
}
.exam-stat-foot {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  min-height: 1.25rem;
}

.exam-stats-heat {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}
.exam-stats-heat-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.85rem;
}
.exam-heatmap {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.exam-heat-row {
  display: grid;
  grid-template-columns: minmax(0, 16rem) minmax(0, 1fr) 3rem 5rem;
  gap: 0.85rem;
  align-items: center;
}
@media (max-width: 640px) {
  .exam-heat-row {
    grid-template-columns: minmax(0, 1fr) 3rem;
    gap: 0.5rem 0.85rem;
  }
  .exam-heat-bar { grid-column: 1 / -1; order: 3; }
  .exam-heat-seen { display: none; }
}
.exam-heat-name {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exam-heat-bar {
  height: 12px;
  background: var(--gray-200);
  position: relative;
  overflow: hidden;
}
.exam-heat-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--orange);
  transition: width 400ms ease;
}
.exam-heat-fill.good { background: #2d8f4f; }
.exam-heat-fill.mid  { background: var(--orange); }
.exam-heat-fill.low  { background: #c0392b; }
.exam-heat-fill.empty { background: transparent; }
.exam-heat-pct {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-900);
  text-align: right;
  letter-spacing: 0.02em;
}
.exam-heat-seen {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray-500);
  letter-spacing: 0.05em;
  text-align: right;
}
