/* ==========================================================================
   Grokking Exploits: styles.css
   Dark theme, green accent. All design tokens live in :root.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Self-hosted fonts (variable, latin subset)
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-var.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-italic-var.woff2") format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-var.woff2") format("woff2-variations");
}

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Backgrounds (darkest -> lightest) */
  --bg: #0b100e;
  --bg-elevated: #101614;
  --surface: #141c18;
  --surface-hover: #18221d;

  /* Borders */
  --border: #223029;
  --border-strong: #2f4237;

  /* Text */
  --text: #e8f0ec;
  --text-secondary: #b9c9c1;
  --text-muted: #86988f;

  /* Accent */
  --accent: #3ddc84;
  --accent-bright: #7cf0ae;
  --accent-dim: rgba(61, 220, 132, 0.12);
  --accent-glow: rgba(61, 220, 132, 0.25);

  /* Semantic (callouts) */
  --c-note: #58a6ff;
  --c-tip: #3ddc84;
  --c-warning: #e3b341;
  --c-danger: #f47067;

  /* Code */
  --code-bg: #101814;
  --code-inline-bg: #1a2620;
  --diff-add-bg: rgba(61, 220, 132, 0.10);
  --diff-del-bg: rgba(244, 112, 103, 0.10);

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Type scale. Use these, never hard-coded sizes */
  --fs-xs: 0.8rem;      /* labels, kbd hints, copy button */
  --fs-sm: 0.9rem;      /* metadata, breadcrumbs, captions, code blocks */
  --fs-md: 0.95rem;     /* card text, callouts, sidebars, nav, tables */
  --fs-base: 1rem;      /* default body */
  --fs-body: 1.0625rem; /* long-form prose */
  --fs-lg: clamp(1.05rem, 1rem + 0.4vw, 1.2rem);       /* leads, hero sub */
  --fs-h4: 1.15rem;                                     /* card headings */
  --fs-h3: clamp(1.15rem, 1.05rem + 0.5vw, 1.3rem);
  --fs-h2: clamp(1.4rem, 1.2rem + 1vw, 1.75rem);
  --fs-h1: clamp(1.9rem, 1.4rem + 2.2vw, 2.75rem);

  /* Layout */
  --container: 1320px;  /* shared by header, main, and footer */
  --prose-width: 46rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 10px;
  --radius-sm: 6px;
  --header-height: 4rem;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */

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

* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

input, button, textarea, select { font: inherit; }

::selection { background: var(--accent-glow); color: var(--text); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

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

/* Cross-document view transitions (progressive enhancement) */
@view-transition { navigation: auto; }

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 0.5rem; }

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

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }

code, kbd, pre { font-family: var(--font-mono); }

kbd {
  font-size: 0.85em;
  padding: 0.15em 0.45em;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(11, 16, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 100%;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.logo {
  font-family: var(--font-mono);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.logo:hover { color: var(--text); }
.logo-prompt { color: var(--accent); margin-right: 0.15em; }
.logo-accent { color: var(--accent); }
.logo-cursor {
  color: var(--accent);
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.site-nav { display: flex; gap: 0.25rem; }
.site-nav a {
  color: var(--text-secondary);
  font-size: var(--fs-md);
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background-color 0.15s;
}
.site-nav a:hover {
  color: var(--text);
  background: var(--surface);
}
.site-nav a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* Search button */
.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.search-btn:hover { color: var(--text); border-color: var(--border-strong); }
.search-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.search-btn kbd {
  font-size: var(--fs-xs);
  padding: 0.05em 0.4em;
  background: var(--bg);
  border-color: var(--border);
}

/* Hamburger: two equal bars that rotate into a perfect X */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s;
}
.nav-toggle:hover { background: var(--surface); }
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1), background-color 0.2s;
}
/* Bars are 10px apart center-to-center (8px gap + 2px height), so each
   travels 5px to meet in the middle before rotating 45°, forming a perfect X. */
.nav-toggle[aria-expanded="true"] span { background: var(--accent); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .search-btn {
    padding: 0.5rem;
    background: none;
    border: none;
  }
  .search-btn .search-label, .search-btn kbd { display: none; }
  .search-btn svg { width: 18px; height: 18px; }
  .site-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem var(--gutter) 1rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .site-nav.open {
    display: flex;
    animation: nav-in 0.28s cubic-bezier(0.65, 0, 0.35, 1);
  }
  .site-nav a { padding: 0.65rem 0.85rem; }
}

@keyframes nav-in {
  from { opacity: 0; transform: translateY(-8px); }
}

/* --------------------------------------------------------------------------
   Reading progress bar (injected by JS)
   -------------------------------------------------------------------------- */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  box-shadow: 0 0 8px var(--accent-glow);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--fs-md);
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #06130c;
}
.btn-primary:hover {
  background: var(--accent-bright);
  color: #06130c;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* --------------------------------------------------------------------------
   Hero (homepage)
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(4rem, 10vw, 7.5rem) 0 clamp(3rem, 8vw, 6rem);
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% -10%, var(--accent-glow), transparent 70%);
  pointer-events: none;
}
.hero > .container { position: relative; }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.hero h1 {
  max-width: 22ch;
  margin-inline: auto;
}
.hero-sub {
  max-width: 52ch;
  margin: 1.25rem auto 0;
  font-size: var(--fs-lg);
  color: var(--text-secondary);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 2.25rem;
}

/* --------------------------------------------------------------------------
   Page hero (listing pages)
   -------------------------------------------------------------------------- */

.page-hero {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
}
.page-hero .kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}
.page-hero p:not(.kicker) {
  max-width: 60ch;
  margin-top: 0.85rem;
  color: var(--text-secondary);
  font-size: var(--fs-body);
}

/* --------------------------------------------------------------------------
   Cards & grids
   -------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1.25rem;
  padding-block: 1rem 4rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s, background-color 0.15s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--surface-hover);
  color: var(--text);
}
.card h2, .card h3 { font-size: var(--fs-h4); }
.card p { color: var(--text-secondary); font-size: var(--fs-md); }

.card-disabled { opacity: 0.55; }
.card-disabled:hover {
  transform: none;
  border-color: var(--border);
  background: var(--surface);
}

.card-kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  letter-spacing: 0.05em;
}
.card-meta {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.card-cta {
  margin-top: auto;
  padding-top: 0.5rem;
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--accent);
}
.card:hover .card-cta { color: var(--accent-bright); }

/* List-style rows (module landing, sections) */

.item-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-block: 1rem 4rem;
}
.item-list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s, background-color 0.15s;
}
.item-list a:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}
.item-num {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--accent);
  min-width: 2.2rem;
  flex-shrink: 0;
}
.item-body { min-width: 0; }
.item-body strong { display: block; font-weight: 600; }
.item-body span { font-size: var(--fs-md); color: var(--text-secondary); }

/* --------------------------------------------------------------------------
   Long-form prose
   -------------------------------------------------------------------------- */

.prose {
  /* Explicit width: auto margins disable grid-item stretching, which would
     otherwise let content min-width push past the viewport on phones. */
  width: 100%;
  max-width: var(--prose-width);
  margin-inline: auto;
  padding-block: clamp(2rem, 5vw, 3.5rem) 3rem;
  font-size: var(--fs-body);
  overflow-wrap: break-word;
}

.prose > * + * { margin-top: 1.25em; }
.prose h1 { margin-bottom: 0.5em; }
.prose h2 { margin-top: 2.2em; padding-top: 0.4em; }
.prose h3 { margin-top: 1.8em; }
.prose p { color: var(--text-secondary); }
.prose strong { color: var(--text); }

/* --------------------------------------------------------------------------
   Lists (unclassed lists inside prose get branded markers automatically;
   add a class to a list to opt out, e.g. .social-links, .steps)
   -------------------------------------------------------------------------- */

.prose ul:not([class]),
.prose ol:not([class]) {
  list-style: none;
  padding-left: 0;
}
.prose ul:not([class]) > li,
.prose ol:not([class]) > li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--text-secondary);
}
.prose li + li { margin-top: 0.5em; }

/* Bullet: small accent square, terminal-flavored */
.prose ul:not([class]) > li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
}
/* Numbers: mono, accent */
.prose ol:not([class]) {
  counter-reset: li-counter;
}
.prose ol:not([class]) > li {
  counter-increment: li-counter;
}
.prose ol:not([class]) > li::before {
  content: counter(li-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95em;
  color: var(--accent);
}
/* Nested lists indent and tighten */
.prose li > ul:not([class]),
.prose li > ol:not([class]) {
  margin-top: 0.5em;
  padding-left: 1.2rem;
}

/* Steps: opt-in numbered walkthrough with badge markers, for tutorials */
.prose ol.steps {
  list-style: none;
  padding-left: 0;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.prose ol.steps > li {
  position: relative;
  counter-increment: step;
  padding: 0.15rem 0 0.15rem 3rem;
  color: var(--text-secondary);
  min-height: 2rem;
}
.prose ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
}
/* Connecting line between step badges */
.prose ol.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1rem;
  top: 2.2rem;
  bottom: -1rem;
  width: 1px;
  background: var(--border);
}
.prose ol.steps > li > strong:first-child {
  display: block;
  color: var(--text);
  margin-bottom: 0.15rem;
}

/* --------------------------------------------------------------------------
   Definitions (inline term + hover/click popover, enhanced by JS)
   -------------------------------------------------------------------------- */

.term {
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px dashed var(--accent);
  cursor: help;
  transition: color 0.15s, border-color 0.15s;
}
.term:hover,
.term:focus-visible {
  color: var(--accent-bright);
  border-bottom-color: var(--accent-bright);
}

.term-popup {
  position: fixed;
  z-index: 80;
  max-width: min(280px, calc(100vw - 2rem));
  padding: 0.7rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-secondary);
  pointer-events: none;
  animation: term-in 0.12s ease-out;
}
.term-popup[hidden] { display: none; }
@keyframes term-in {
  from { opacity: 0; transform: translateY(3px); }
}
/* Arrow: a rotated square aligned under (or over) the term center */
.term-popup::after {
  content: "";
  position: absolute;
  left: var(--arrow-x, 50%);
  width: 9px;
  height: 9px;
  background: var(--bg-elevated);
  transform: translateX(-50%) rotate(45deg);
}
.term-popup:not(.below)::after {
  bottom: -5px;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}
.term-popup.below::after {
  top: -5px;
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
}

/* --------------------------------------------------------------------------
   Active recall: quiz, spoiler reveal, progressive hints
   -------------------------------------------------------------------------- */

/* Knowledge-check quiz (enhanced by JS; the correct <button> has data-correct) */
.quiz {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.3rem 1.35rem;
}
.quiz-q {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.9rem;
}
.quiz-q::before {
  content: "Knowledge check";
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.45rem;
}
.quiz-options {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: opt;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.quiz-options > li { margin: 0; padding: 0; }
.quiz-options > li::before { display: none; }  /* cancel prose list markers */
.quiz-options button {
  counter-increment: opt;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.quiz-options button::before {
  content: counter(opt, upper-alpha);
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.quiz-options button:hover:not(:disabled) {
  border-color: var(--text-muted);
  background: var(--surface-hover);
  color: var(--text);
}
.quiz.answered button { cursor: default; }
.quiz button.correct {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text);
}
.quiz button.correct::before {
  content: "✓";
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}
.quiz button.incorrect {
  border-color: var(--c-danger);
  background: rgba(244, 112, 103, 0.1);
  color: var(--text);
}
.quiz button.incorrect::before {
  content: "✗";
  color: #fff;
  background: var(--c-danger);
  border-color: var(--c-danger);
}
.quiz-status {
  margin-top: 0.9rem;
  font-weight: 600;
  font-size: var(--fs-md);
}
.quiz-status.ok { color: var(--accent); }
.quiz-status.no { color: var(--c-danger); }
.quiz-explanation {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  font-size: var(--fs-md);
  color: var(--text-secondary);
}
.quiz.answered .quiz-explanation { display: block; }

/* Shared <details> disclosure styling for spoiler + hints */
details.spoiler > summary,
details.hint > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
details.spoiler > summary::-webkit-details-marker,
details.hint > summary::-webkit-details-marker { display: none; }
details.spoiler > summary::after,
details.hint > summary::after {
  content: "";
  margin-left: auto;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0.6;
  transition: transform 0.2s;
}
details.spoiler[open] > summary::after,
details.hint[open] > summary::after { transform: rotate(-135deg); }

/* Spoiler: click to reveal a solution */
details.spoiler {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
details.spoiler > summary {
  padding: 0.8rem 1.1rem;
  font-weight: 600;
  color: var(--accent);
}
details.spoiler > summary:hover { color: var(--accent-bright); }
details.spoiler[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 0.9rem; }
details.spoiler > :not(summary) { padding-inline: 1.1rem; }
details.spoiler[open] { padding-bottom: 1.1rem; }

/* Progressive hints: a stack of auto-numbered disclosures */
.hints {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  counter-reset: hint;
}
details.hint {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
details.hint > summary {
  counter-increment: hint;
  padding: 0.6rem 0.9rem;
  font-weight: 600;
  color: var(--text);
}
details.hint > summary::before {
  content: "Hint " counter(hint);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--accent);
}
details.hint > summary:hover { color: var(--accent); }
details.hint > :not(summary) {
  padding: 0 0.9rem 0.7rem;
  color: var(--text-secondary);
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--accent-glow);
  text-underline-offset: 3px;
}
.prose a:hover { text-decoration-color: var(--accent-bright); }

.prose blockquote {
  border-left: 3px solid var(--border-strong);
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-style: italic;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin-block: 2.5em;
}

.lead {
  font-size: var(--fs-lg);
  color: var(--text);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: 0.75em !important;
}
.post-meta .tag { color: var(--accent); }

.prose .handle {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.handle .logo-prompt { color: var(--accent); }
.handle-name { color: var(--accent); }

/* Heading anchor links (injected by JS) */
.heading-anchor {
  margin-left: 0.4em;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none !important;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
h2:hover .heading-anchor,
h3:hover .heading-anchor,
.heading-anchor:focus-visible { opacity: 1; }
.heading-anchor:hover { color: var(--accent); }

/* Inline code */
.prose code:not(pre code) {
  background: var(--code-inline-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.12em 0.4em;
  font-size: 0.86em;
  color: var(--accent-bright);
}

/* --------------------------------------------------------------------------
   Code blocks
   -------------------------------------------------------------------------- */

.prose pre,
.code-block pre {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: var(--fs-sm);
  line-height: 1.65;
}
.prose pre code { background: transparent; padding: 0; }

/* Make highlight.js theme sit on our background */
.hljs { background: transparent !important; }

/* Framed code blocks with a filename header (built by JS from data-filename) */
.code-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-frame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1.1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.code-frame-lang { color: var(--accent); }
.code-frame pre {
  border: none;
  border-radius: 0;
  margin: 0;
}

/* Line highlighting and diffs (built by JS from data-hl / data-add / data-del) */
pre code .line {
  display: block;
  padding-inline: 1.25rem;
  margin-inline: -1.25rem;
}
pre code .line.hl {
  background: var(--accent-dim);
  box-shadow: inset 2px 0 0 var(--accent);
}
pre code .line.add,
pre code .line.del {
  position: relative;
  padding-left: 2.1rem;
}
pre code .line.add {
  background: var(--diff-add-bg);
  box-shadow: inset 2px 0 0 var(--accent);
}
pre code .line.del {
  background: var(--diff-del-bg);
  box-shadow: inset 2px 0 0 var(--c-danger);
  opacity: 0.75;
}
/* +/- markers live in ::before so copied code stays clean */
pre code .line.add::before,
pre code .line.del::before {
  position: absolute;
  left: 0.8rem;
  user-select: none;
}
pre code .line.add::before { content: "+"; color: var(--accent); }
pre code .line.del::before { content: "-"; color: var(--c-danger); }

/* Copy button (injected by JS) */
.copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); opacity: 1; }

/* Terminal block */
.terminal {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.terminal-bar .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
}
.terminal-bar .dot:first-child { background: #f47067; }
.terminal-bar .dot:nth-child(2) { background: #e3b341; }
.terminal-bar .dot:nth-child(3) { background: var(--accent); }
.terminal-title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.terminal pre {
  border: none;
  border-radius: 0;
  margin: 0;
  background: transparent;
  overflow-x: auto;
}
.terminal .prompt { color: var(--accent); user-select: none; }
.terminal .cmd { color: var(--text); }
.terminal .output { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Callouts
   -------------------------------------------------------------------------- */

.callout {
  --callout-color: var(--c-note);
  border: 1px solid var(--border);
  border-left: 3px solid var(--callout-color);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.25rem;
  min-width: 0;
}
.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: 0.02em;
  color: var(--callout-color);
  margin-bottom: 0.35rem;
}
.callout-title::before {
  content: "";
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: var(--callout-icon) center / contain no-repeat;
  mask: var(--callout-icon) center / contain no-repeat;
}
.callout p { font-size: var(--fs-md); }
.callout p + p { margin-top: 0.6em; }

.callout-note {
  --callout-color: var(--c-note);
  --callout-icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="11" x2="12" y2="17"/><circle cx="12" cy="7.5" r="0.5" fill="black"/></svg>');
}
.callout-tip {
  --callout-color: var(--c-tip);
  --callout-icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.8.6 1.5 1.6 1.5 2.6v.5h4v-.5c0-1 .7-2 1.5-2.6A6 6 0 0 0 12 3z"/></svg>');
}
.callout-warning {
  --callout-color: var(--c-warning);
  --callout-icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/><line x1="12" y1="9" x2="12" y2="13"/><circle cx="12" cy="17" r="0.5" fill="black"/></svg>');
}
.callout-danger {
  --callout-color: var(--c-danger);
  --callout-icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>');
}

/* --------------------------------------------------------------------------
   Tables & figures
   -------------------------------------------------------------------------- */

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-md);
  display: block;
  overflow-x: auto;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
}
.prose th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.prose td { color: var(--text-secondary); }
.prose tbody tr:hover td { background: var(--bg-elevated); }

.prose figure { margin-inline: 0; }
.prose figure img, .prose figure svg {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  width: 100%;
}
.prose figcaption {
  margin-top: 0.6rem;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Course section layout (sidebar + content + toc)
   -------------------------------------------------------------------------- */

.section-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.section-layout > * { min-width: 0; }

@media (min-width: 900px) {
  .section-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 3.5rem;
  }
}

@media (min-width: 1150px) {
  .section-layout {
    grid-template-columns: 220px minmax(0, 1fr) 200px;
    gap: 3rem;
  }
}

.module-sidebar {
  padding-block: clamp(2rem, 5vw, 3.5rem) 0;
}

@media (min-width: 900px) {
  .module-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    align-self: start;
    max-height: calc(100vh - var(--header-height) - 3rem);
    overflow-y: auto;
  }
}

.sidebar-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sidebar-title {
  font-weight: 700;
  margin: 0.25rem 0 1rem;
}
.sidebar-title a { color: var(--text); }
.sidebar-title a:hover { color: var(--accent); }

.sidebar-sections {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}
.sidebar-sections a {
  display: block;
  padding: 0.45rem 0.9rem;
  margin-left: -1px;
  font-size: var(--fs-md);
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.sidebar-sections a:hover { color: var(--text); }
.sidebar-sections a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* On narrow screens the sidebar becomes a compact card above content */
@media (max-width: 899px) {
  .module-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    margin-top: 1.5rem;
  }
  .section-layout .prose { padding-top: 0.5rem; }
}

/* --------------------------------------------------------------------------
   Article layout (content + toc) & table of contents
   -------------------------------------------------------------------------- */

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.article-layout > * { min-width: 0; }

@media (min-width: 1150px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 3rem;
  }
}

.toc { display: none; }

@media (min-width: 1150px) {
  .toc {
    display: block;
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    align-self: start;
    max-height: calc(100vh - var(--header-height) - 3rem);
    overflow-y: auto;
    padding-top: clamp(2rem, 5vw, 3.5rem);
  }
}

.toc-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.toc ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}
.toc a {
  display: block;
  padding: 0.3rem 0.9rem;
  margin-left: -1px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.toc a:hover { color: var(--text); }
.toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Breadcrumb & pager
   -------------------------------------------------------------------------- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

.pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 3rem !important;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.pager a:hover { border-color: var(--accent); background: var(--surface-hover); }
.pager a span {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pager-next { text-align: right; grid-column: 2; }
.pager-prev { grid-column: 1; }
.pager a:hover span { color: var(--accent); }

@media (max-width: 560px) {
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-next, .pager-prev { grid-column: auto; text-align: left; }
}

/* --------------------------------------------------------------------------
   Search palette
   -------------------------------------------------------------------------- */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 8, 6, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(3rem, 12vh, 8rem) 1rem 1rem;
}
.search-overlay[hidden] { display: none; }

.search-modal {
  width: 100%;
  max-width: 580px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: modal-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}
.search-input-row svg { stroke: var(--text-muted); flex-shrink: 0; }
.search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: var(--fs-base);
}
.search-input::placeholder { color: var(--text-muted); }

.search-results {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  max-height: 55vh;
  overflow-y: auto;
}
.search-result a {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.search-result .result-type {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  margin-right: 0.6rem;
}
.search-result .result-title { font-weight: 600; font-size: var(--fs-md); }
.search-result p {
  margin-top: 0.15rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result.active a { background: var(--surface-hover); }
.search-result.active .result-title { color: var(--accent-bright); }

.search-empty {
  padding: 1.4rem;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-md);
}

.search-footer {
  display: flex;
  gap: 1.25rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.search-footer kbd { font-size: 0.95em; }

/* --------------------------------------------------------------------------
   404 page
   -------------------------------------------------------------------------- */

.error-page {
  text-align: center;
  padding-block: clamp(4rem, 15vh, 9rem);
}
.error-code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow);
}
.error-page h1 { margin-top: 1rem; }
.error-msg {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: 1rem;
}
.error-page .hero-actions { margin-top: 2.25rem; }

/* --------------------------------------------------------------------------
   Back to top (injected by JS on long-form pages)
   -------------------------------------------------------------------------- */

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s, color 0.15s, border-color 0.15s;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.back-to-top svg { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   Newsletter
   -------------------------------------------------------------------------- */

.newsletter { padding-block: 1rem 4rem; }

.newsletter-box {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.newsletter-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 90% at 0% 50%, var(--accent-dim), transparent 70%);
  pointer-events: none;
}
.newsletter-copy { position: relative; }
.newsletter-copy h2 { font-size: var(--fs-h3); }
.newsletter-copy p {
  margin-top: 0.35rem;
  color: var(--text-secondary);
  font-size: var(--fs-md);
  max-width: 44ch;
}

.newsletter-form {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex: 1;
  min-width: min(100%, 320px);
  justify-content: flex-end;
}
.newsletter-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.6rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.newsletter-input::placeholder { color: var(--text-muted); }

/* On phones, stack the field and a full-width button */
@media (max-width: 560px) {
  .newsletter-form { flex-direction: column; align-items: stretch; }
  .newsletter-form .btn { width: 100%; justify-content: center; }
}

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

/* --------------------------------------------------------------------------
   Social links (about page)
   -------------------------------------------------------------------------- */

.social-links {
  list-style: none;
  padding: 0 !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.social-links li + li { margin-top: 0 !important; }
.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  font-size: var(--fs-md);
  text-decoration: none !important;
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.social-links a:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface-hover);
  transform: translateY(-1px);
}
.social-links svg { width: 18px; height: 18px; flex-shrink: 0; }

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

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding-block: 2.5rem 1.5rem;
}
.footer-brand {
  font-family: var(--font-mono);
  font-weight: 600;
}
.footer-tagline {
  margin-top: 0.4rem;
  font-size: var(--fs-md);
  color: var(--text-muted);
  max-width: 38ch;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer-nav a {
  font-size: var(--fs-md);
  color: var(--text-secondary);
}
.footer-nav a:hover { color: var(--accent); }
.footer-bottom {
  padding-block: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  @view-transition { navigation: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
