/* ==========================================================================
   Sanpu17 — "Neon Aurora" design system
   Dark glassmorphism · animated aurora mesh · gradient accents
   Hand-crafted, dependency-free, reduced-motion friendly.
   ========================================================================== */

:root {
  /* ---- surfaces ---- */
  --bg: #05070f;
  --bg-deep: #02030a;
  --bg-alt: #080b1a;
  --bg-card: rgba(255, 255, 255, 0.042);
  --bg-card-solid: #0b0f20;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);

  /* ---- lines ---- */
  --border: rgba(255, 255, 255, 0.11);
  --border-soft: rgba(255, 255, 255, 0.065);
  --border-bright: rgba(255, 255, 255, 0.22);

  /* ---- type ---- */
  --text: #b8c2da;
  --muted: #8a94b0;
  --heading: #f4f7ff;

  /* ---- accents ---- */
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --cyan: #22d3ee;
  --mint: #34e5b0;
  --pink: #f472b6;
  --amber: #fbbf24;
  --warn: #fb7185;

  --accent: #8b5cf6;
  --accent-2: var(--cyan);
  --accent-3: var(--mint);
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-line: rgba(139, 92, 246, 0.42);
  --cyan-soft: rgba(34, 211, 238, 0.12);
  --warn-soft: rgba(251, 113, 133, 0.1);

  /* ---- gradients ---- */
  --grad: linear-gradient(102deg, #8b5cf6 0%, #6366f1 32%, #22d3ee 68%, #34e5b0 100%);
  --grad-soft: linear-gradient(120deg, #ffffff 0%, #dcd8ff 42%, #b6a6ff 72%, #7dd3fc 100%);
  --grad-cyan: linear-gradient(100deg, #22d3ee, #34e5b0);
  --grad-violet: linear-gradient(100deg, #c084fc, #8b5cf6 55%, #6366f1);
  --grad-line: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.65), rgba(34, 211, 238, 0.65), transparent);
  --grad-panel: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018) 45%, rgba(10, 14, 30, 0.5));

  /* ---- glow ---- */
  --glow-violet: 0 18px 50px -22px rgba(139, 92, 246, 0.85);
  --glow-cyan: 0 18px 50px -22px rgba(34, 211, 238, 0.7);
  --glow-card: 0 24px 60px -28px rgba(8, 10, 24, 0.9);
  --ring: 0 0 0 1px rgba(255, 255, 255, 0.06);

  /* ---- geometry ---- */
  --radius: 18px;
  --radius-sm: 11px;
  --radius-pill: 999px;
  --max: 1140px;
  --measure: 700px;
  --header-h: 72px;

  --font: "Inter", "Inter var", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "Cascadia Mono", Consolas,
    "SF Mono", "Courier New", monospace;
  --ease: cubic-bezier(0.22, 0.68, 0.35, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.78;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
  position: relative;
  isolation: isolate;
}

/* ---------- animated aurora backdrop ---------- */

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -25% -15%;
  z-index: -2;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(closest-side at 18% 12%, rgba(139, 92, 246, 0.42), transparent 72%),
    radial-gradient(closest-side at 82% 6%, rgba(34, 211, 238, 0.3), transparent 70%),
    radial-gradient(closest-side at 68% 82%, rgba(244, 114, 182, 0.16), transparent 72%),
    radial-gradient(closest-side at 8% 76%, rgba(52, 229, 176, 0.16), transparent 70%);
  filter: blur(70px) saturate(125%);
  opacity: 0.75;
  animation: auroraDrift 34s var(--ease) infinite alternate;
  will-change: transform, opacity;
}

body::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 78%);
  opacity: 0.7;
  z-index: -1;
}

@keyframes auroraDrift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); opacity: 0.7; }
  50%  { transform: translate3d(3%, 2%, 0) scale(1.08); opacity: 0.9; }
  100% { transform: translate3d(-1%, 3%, 0) scale(1.04); opacity: 0.72; }
}

/* ---------- base elements ---------- */

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

a {
  color: var(--cyan);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.18s var(--ease);
}
a:hover { color: #7ff0ff; }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.85);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3, h4 {
  color: var(--heading);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 1.35rem + 2vw, 3rem); line-height: 1.14; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.85rem); letter-spacing: -0.02em; }
h3 { font-size: 1.16rem; }
h4 { font-size: 1rem; }

p { margin-bottom: 1rem; }
strong, b { color: var(--heading); font-weight: 650; }
small { font-size: 0.86rem; }

ul, ol { padding-inline-start: 1.35rem; margin-bottom: 1rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: rgba(139, 92, 246, 0.85); }
li > ul, li > ol { margin-top: 0.4rem; margin-bottom: 0.4rem; }

hr {
  border: none;
  height: 1px;
  background: var(--grad-line);
  margin: 2.4rem 0;
  opacity: 0.7;
}

::selection { background: rgba(139, 92, 246, 0.42); color: #fff; }

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

.skip-link {
  position: fixed; inset-inline-start: 1rem; top: -70px; z-index: 300;
  background: var(--grad); color: #06070f; font-weight: 750;
  padding: 0.65rem 1.15rem; border-radius: var(--radius-pill);
  box-shadow: var(--glow-violet);
  transition: top 0.22s var(--ease);
}
.skip-link:focus { top: 1rem; text-decoration: none; }

/* ---------- shared glass surface ---------- */

.card,
.toc,
.term,
.faq details,
.related-list a,
.author-card,
.feature-card,
.callout,
.takeaway,
.stats {
  position: relative;
  background: var(--grad-panel);
  background-color: rgba(11, 15, 32, 0.55);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 7, 15, 0.62);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header::after {
  content: "";
  position: absolute; inset-inline: 0; bottom: -1px; height: 1px;
  background: var(--grad-line);
  opacity: 0.55;
}
.site-header.is-stuck {
  background: rgba(4, 6, 13, 0.86);
  box-shadow: 0 18px 40px -30px rgba(0, 0, 0, 0.95);
  border-bottom-color: var(--border);
}

.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 1.5rem;
  height: var(--header-h); display: flex; align-items: center; gap: 1.5rem;
}

.logo {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--heading); font-weight: 800; font-size: 1.1rem;
  letter-spacing: -0.02em; text-decoration: none; flex: none;
}
.logo:hover { text-decoration: none; color: #fff; }
.logo-mark {
  display: inline-flex; flex: none;
  border-radius: 12px;
  box-shadow: 0 8px 24px -12px rgba(139, 92, 246, 0.95);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.06); box-shadow: 0 12px 30px -12px rgba(34, 211, 238, 0.9); }
.logo svg { width: 32px; height: 32px; display: block; border-radius: 12px; }
.logo-text {
  background: linear-gradient(100deg, #ffffff 15%, #cfc9ff 55%, #8ee9ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.nav { margin-inline-start: auto; }
.nav-links {
  display: flex; align-items: center; gap: 0.2rem;
  list-style: none; padding: 0; margin: 0;
}
.nav-links a {
  position: relative; display: inline-block;
  color: var(--text); font-size: 0.93rem; font-weight: 550;
  padding: 0.45rem 0.7rem; border-radius: var(--radius-pill);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; inset-inline: 0.7rem; bottom: 0.15rem; height: 2px;
  border-radius: 2px; background: var(--grad);
  transform: scaleX(0); transform-origin: center;
  transition: transform 0.28s var(--ease);
}
.nav-links a:hover { color: var(--heading); text-decoration: none; background: rgba(255, 255, 255, 0.05); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] {
  color: #fff; background: rgba(139, 92, 246, 0.16);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.35);
}
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

.menu-toggle {
  display: none; margin-inline-start: auto;
  background: var(--glass-strong); border: 1px solid var(--border-bright);
  color: var(--heading); width: 44px; height: 44px;
  border-radius: var(--radius-sm); font-size: 1.1rem; cursor: pointer;
  line-height: 1; transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.menu-toggle:hover { background: rgba(139, 92, 246, 0.22); border-color: rgba(139, 92, 246, 0.5); }

/* ---------- buttons ---------- */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1.5rem; border-radius: var(--radius-pill);
  font-family: var(--font); font-size: 0.95rem; font-weight: 650;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  letter-spacing: 0.005em; white-space: nowrap;
  transition: transform 0.22s var(--ease), box-shadow 0.28s var(--ease),
    background 0.22s var(--ease), border-color 0.22s var(--ease), color 0.22s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  color: #05060f;
  background: var(--grad);
  background-size: 160% 100%;
  background-position: 0% 50%;
  box-shadow: 0 14px 34px -16px rgba(139, 92, 246, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-primary:hover {
  color: #05060f;
  background-position: 100% 50%;
  box-shadow: 0 18px 44px -14px rgba(34, 211, 238, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-ghost {
  color: var(--heading);
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border-bright);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  color: #fff;
  border-color: rgba(139, 92, 246, 0.65);
  background: rgba(139, 92, 246, 0.16);
  box-shadow: 0 14px 34px -20px rgba(139, 92, 246, 0.9);
}

/* ---------- tags ---------- */

.tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #d9d2ff;
  background: linear-gradient(100deg, rgba(139, 92, 246, 0.22), rgba(99, 102, 241, 0.14));
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 0.22rem 0.65rem; border-radius: var(--radius-pill);
  white-space: nowrap;
}
.tag::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--grad-cyan); box-shadow: 0 0 8px rgba(34, 211, 238, 0.9);
  flex: none;
}
.tag--cyan {
  color: #c3f5ff;
  background: linear-gradient(100deg, rgba(34, 211, 238, 0.2), rgba(52, 229, 176, 0.12));
  border-color: rgba(34, 211, 238, 0.4);
}
.tag--cyan::before { background: var(--grad-violet); box-shadow: 0 0 8px rgba(139, 92, 246, 0.9); }

/* ---------- layout ---------- */

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 1.5rem; }
.wrap--narrow { max-width: 800px; }
.wrap--prose { max-width: 780px; }
.wrap--prose.prose { max-width: 780px; }

.section { padding-block: 3.6rem; position: relative; }
.section--tight { padding-block: 2.2rem; }

.section--alt {
  background:
    radial-gradient(900px 320px at 12% 0%, rgba(139, 92, 246, 0.09), transparent 70%),
    radial-gradient(700px 300px at 88% 100%, rgba(34, 211, 238, 0.07), transparent 70%),
    rgba(7, 10, 22, 0.66);
  border-block: 1px solid var(--border-soft);
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.9rem; flex-wrap: wrap;
}
.section-head h2 { margin: 0; position: relative; padding-bottom: 0.55rem; }
.section-head h2::after {
  content: ""; position: absolute; inset-inline-start: 0; bottom: 0;
  width: 3.2rem; height: 3px; border-radius: 3px;
  background: var(--grad);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.75);
}
.section-head .more {
  font-size: 0.88rem; font-weight: 600; color: var(--muted);
  padding: 0.35rem 0.8rem; border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.section-head .more:hover {
  color: #fff; text-decoration: none;
  border-color: var(--border-bright); background: rgba(255, 255, 255, 0.05);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; font-weight: 750; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #cbc4ff;
  background: rgba(139, 92, 246, 0.13);
  border: 1px solid rgba(139, 92, 246, 0.33);
  padding: 0.32rem 0.85rem; border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--grad-cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 1);
  animation: pulseDot 2.6s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* ---------- gradient text helper ---------- */

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1,
  .article-hero h1,
  .legal h1,
  .error-page h1,
  .stat b {
    background: var(--grad-soft);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
  /* shrink-wrap short headings so the whole gradient ramp fits the words */
  .article-hero h1, .legal h1 { width: fit-content; }
  .error-page h1 { width: fit-content; margin-inline: auto; }
  .error-page .code {
    background: var(--grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
}

/* ---------- hero ---------- */

.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(760px 380px at 78% 4%, rgba(139, 92, 246, 0.22), transparent 68%),
    radial-gradient(620px 340px at 12% 0%, rgba(34, 211, 238, 0.16), transparent 66%),
    radial-gradient(520px 300px at 52% 110%, rgba(52, 229, 176, 0.1), transparent 70%);
}
.hero::before {
  content: ""; position: absolute; z-index: 0;
  width: 46rem; height: 46rem; border-radius: 50%;
  top: -24rem; inset-inline-end: -14rem;
  background: conic-gradient(from 140deg, rgba(139, 92, 246, 0.5), rgba(34, 211, 238, 0.45), rgba(244, 114, 182, 0.35), rgba(139, 92, 246, 0.5));
  filter: blur(110px);
  opacity: 0.55;
  animation: heroOrb 26s ease-in-out infinite alternate;
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; z-index: 0;
  width: 30rem; height: 30rem; border-radius: 50%;
  bottom: -18rem; inset-inline-start: -10rem;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.38), transparent 68%);
  filter: blur(90px);
  opacity: 0.6;
  animation: heroOrb 32s ease-in-out infinite alternate-reverse;
  pointer-events: none;
}
@keyframes heroOrb {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-3rem, 2rem, 0) scale(1.12); }
}

.hero-inner {
  position: relative; z-index: 1;
  max-width: var(--max); margin: 0 auto;
  padding: 5rem 1.5rem 5.5rem;
}
.hero h1 { max-width: 22ch; margin-bottom: 1.15rem; }
.hero .lede {
  max-width: 60ch; font-size: 1.1rem; line-height: 1.8;
  color: #a8b2cc; margin-bottom: 2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 2rem; }

.entity-line {
  font-size: 0.82rem; color: var(--muted); line-height: 1.75;
  border-top: 1px solid var(--border-soft);
  padding-top: 1.1rem; max-width: 68ch;
}
.entity-line a { color: #a9b4d0; border-bottom: 1px solid rgba(139, 92, 246, 0.45); }
.entity-line a:hover { color: #fff; text-decoration: none; }

.hero-media {
  position: relative; z-index: 2;
  max-width: var(--max); margin: -4.5rem auto 3.5rem;
  padding-inline: 1.5rem;
}
.hero-media img,
.hero-media svg {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border-bright);
  box-shadow:
    0 40px 90px -40px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 24px 80px -40px rgba(139, 92, 246, 0.75);
}

/* ---------- stats strip ---------- */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  border-radius: var(--radius);
  overflow: hidden; margin-block: 2.2rem;
  background-color: rgba(9, 12, 26, 0.6);
}
.stat {
  position: relative;
  background: rgba(255, 255, 255, 0.022);
  padding: 1.4rem 1.45rem;
  transition: background 0.25s var(--ease);
}
.stat:hover { background: rgba(139, 92, 246, 0.12); }
.stat b {
  display: block; font-size: 1.95rem; font-weight: 800;
  line-height: 1.15; letter-spacing: -0.03em;
}
.stat span {
  font-size: 0.82rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600;
}

/* ---------- grids & cards ---------- */

.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow: hidden;
  box-shadow: var(--glow-card);
  transition: transform 0.32s var(--ease), border-color 0.32s var(--ease), box-shadow 0.32s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0; transition: opacity 0.32s var(--ease);
  pointer-events: none;
}
.card::after {
  content: ""; position: absolute; inset-inline: 18%; top: -1px; height: 1px;
  background: var(--grad-line);
  opacity: 0.5; transition: opacity 0.32s var(--ease);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.95), 0 20px 60px -34px rgba(139, 92, 246, 0.85);
}
.card:hover::before { opacity: 1; }
.card:hover::after { opacity: 1; }
.card > h2 { font-size: 1.22rem; margin-bottom: 0.6rem; }
.card > h3 { margin-bottom: 0.55rem; }
.card > p:last-child { margin-bottom: 0; }
.card .tag { margin-bottom: 0.75rem; }

.post-card { display: flex; flex-direction: column; gap: 0.55rem; }
.post-card .meta {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 0.45rem; color: var(--muted);
}
.post-card .meta .when {
  display: flex; gap: 0.45rem; font-size: 0.78rem;
  color: #7d88a4; white-space: nowrap;
}
.post-card .meta .when > * + *::before {
  content: "·"; margin-inline-end: 0.45rem;
  color: rgba(139, 92, 246, 0.7);
}
.post-card h3 { font-size: 1.08rem; margin: 0.35rem 0 0.4rem; line-height: 1.42; }
.post-card h3 a { color: var(--heading); transition: color 0.2s var(--ease); }
.post-card h3 a:hover { color: #c4b5fd; text-decoration: none; }
.post-card p { font-size: 0.92rem; color: var(--muted); margin: 0; }

.feature-card {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  border-radius: var(--radius); overflow: hidden;
}
.feature-card .body {
  padding: 2.2rem; display: flex; flex-direction: column;
  justify-content: center; gap: 0.65rem;
}
.feature-card .media { position: relative; min-height: 280px; }
.feature-card .media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- meta / breadcrumbs ---------- */

.breadcrumbs {
  font-size: 0.8rem; color: var(--muted); margin-bottom: 1.35rem;
}
.breadcrumbs ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center;
}
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before {
  content: "/"; margin-inline-end: 0.45rem;
  color: rgba(139, 92, 246, 0.6);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: #a5b4fc; }
.breadcrumbs [aria-current="page"] { color: #c6cfe4; }

/* ---------- article ---------- */

.article-hero {
  position: relative; overflow: hidden;
  padding-block: 3rem 1.6rem;
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(760px 300px at 82% 0%, rgba(139, 92, 246, 0.19), transparent 68%),
    radial-gradient(560px 280px at 8% 10%, rgba(34, 211, 238, 0.12), transparent 66%);
}
.article-hero h1 { margin: 0.7rem 0 0.9rem; max-width: 26ch; }
.article-hero .lede {
  font-size: 1.06rem; color: #a3adc7; max-width: 66ch; margin-bottom: 1.4rem;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 0.45rem 0.75rem;
  font-size: 0.85rem; color: var(--muted); align-items: center;
}
.article-meta > * + *::before {
  content: "·"; margin-inline-end: 0.75rem;
  color: rgba(139, 92, 246, 0.7);
}
.article-meta time { color: #98a3bf; }

.article-layout {
  max-width: var(--max); margin: 0 auto; padding: 2.8rem 1.5rem 4rem;
  display: grid; grid-template-columns: minmax(0, 1fr) 258px;
  gap: 3.2rem; align-items: start;
}
.article-main { min-width: 0; }
.article-aside { position: sticky; top: calc(var(--header-h) + 1.6rem); }

.toc {
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--glow-card);
}
.toc h2 {
  font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.85rem; font-weight: 750;
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a {
  display: block; font-size: 0.86rem; color: #8f9ab6;
  padding: 0.32rem 0 0.32rem 0.75rem;
  border-inline-start: 2px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
  border-radius: 0 6px 6px 0;
}
.toc a:hover { color: var(--heading); text-decoration: none; background: rgba(255, 255, 255, 0.04); }
.toc a.is-active {
  color: #d8d2ff;
  border-color: var(--violet);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.16), transparent);
}
.toc .toc-sub a { padding-inline-start: 1.6rem; font-size: 0.82rem; }

.takeaway {
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem; margin: 1.8rem 0;
  border-color: rgba(139, 92, 246, 0.35);
  background:
    radial-gradient(400px 200px at 0% 0%, rgba(139, 92, 246, 0.2), transparent 70%),
    rgba(139, 92, 246, 0.08);
  box-shadow: 0 20px 50px -30px rgba(139, 92, 246, 0.9);
}
.takeaway h2, .takeaway h3 {
  font-size: 0.98rem; margin-bottom: 0.65rem;
  letter-spacing: 0.02em; color: #e6e1ff;
}
.takeaway ul { margin: 0; padding-inline-start: 1.2rem; }
.takeaway li { font-size: 0.95rem; }
.takeaway li::marker { color: var(--cyan); }

.author-card {
  display: flex; gap: 1.15rem; align-items: flex-start;
  border-radius: var(--radius); padding: 1.5rem; margin-top: 2.8rem;
}
.author-card .avatar {
  width: 58px; height: 58px; flex: none; border-radius: 50%;
  background: var(--grad);
  color: #05060f;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.12rem;
  box-shadow: 0 12px 30px -14px rgba(139, 92, 246, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.author-card h2 { font-size: 1rem; margin-bottom: 0.3rem; }
.author-card p { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.45rem; }
.author-card .links { font-size: 0.85rem; }

/* ---------- prose ---------- */

.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }

.prose h2 {
  margin-top: 2.9rem; margin-bottom: 0.9rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  scroll-margin-top: calc(var(--header-h) + 1rem);
  font-size: clamp(1.28rem, 1.12rem + 0.55vw, 1.55rem);
  position: relative;
}
.prose h2::before {
  content: ""; position: absolute; top: -1px; inset-inline-start: 0;
  width: 4.5rem; height: 2px; border-radius: 2px;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.8);
}
.prose h3 {
  margin-top: 2rem; margin-bottom: 0.55rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
  color: #eef2ff;
}
.prose h4 { margin-top: 1.5rem; margin-bottom: 0.45rem; }
.prose p, .prose li { font-size: 1.015rem; }
.prose > p:first-of-type { font-size: 1.09rem; color: #dde5f7; }
.prose a {
  color: #7dd3fc;
  text-decoration: underline;
  text-decoration-color: rgba(34, 211, 238, 0.35);
  text-underline-offset: 3px;
  transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease);
}
.prose a:hover { color: #a5f3fc; text-decoration-color: rgba(34, 211, 238, 0.85); }

.prose blockquote {
  position: relative;
  background: rgba(34, 211, 238, 0.06);
  padding: 1rem 1.3rem 1rem 1.55rem; margin: 1.7rem 0;
  color: #cfd8ea;
  border-radius: var(--radius-sm);
  border-start-start-radius: 2px;
  border-end-start-radius: 2px;
}
.prose blockquote::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0;
  width: 3px; border-radius: 3px;
  background: var(--grad-cyan);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.55);
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: var(--mono);
  direction: ltr;
  unicode-bidi: embed;
  font-size: 0.88em;
}
.prose :not(pre) > code {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  padding: 0.14rem 0.45rem; border-radius: 6px;
  color: #ddd6fe;
}
.prose pre {
  direction: ltr; text-align: left;
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(139, 92, 246, 0.14), transparent 70%),
    #05070f;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.3rem; overflow-x: auto; margin: 1.6rem 0;
  position: relative;
  font-size: 0.855rem; line-height: 1.68;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 40px -30px rgba(0, 0, 0, 0.9);
}
.prose pre::before {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 1px;
  background: var(--grad-line); opacity: 0.8;
}
.prose pre code {
  background: none; border: 0; padding: 0;
  color: #d9e4f5; font-family: var(--mono);
}

.copy-code {
  position: absolute; top: 0.55rem; inset-inline-end: 0.55rem; z-index: 2;
  font-family: var(--font); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.07);
  color: #b9c3d9; border: 1px solid var(--border-bright);
  border-radius: 999px; padding: 0.28rem 0.65rem; cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.copy-code:hover {
  color: #fff; border-color: rgba(139, 92, 246, 0.7);
  background: rgba(139, 92, 246, 0.25);
}

.table-wrap {
  overflow-x: auto; margin: 1.7rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(10, 14, 28, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 0; }
.prose th, .prose td {
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: start; vertical-align: top;
}
.prose thead th {
  background: rgba(139, 92, 246, 0.12);
  color: #ece9ff; font-weight: 650; white-space: nowrap;
  border-bottom: 1px solid rgba(139, 92, 246, 0.28);
}
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr { transition: background 0.18s var(--ease); }
.prose tbody tr:hover { background: rgba(139, 92, 246, 0.08); }

.prose figure { margin: 1.9rem 0; }
.prose figure img, .prose figure svg {
  width: 100%; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px -40px rgba(0, 0, 0, 0.95);
}
.prose figcaption {
  font-size: 0.82rem; color: var(--muted); margin-top: 0.6rem; text-align: center;
}
.diagram { background: var(--bg-alt); }

.article-figure { margin: 1.7rem 0 0; }
.article-figure img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.9), 0 20px 60px -50px rgba(139, 92, 246, 0.9);
}

.related { margin-top: 3rem; }
.related h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.related-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.7rem;
}
.related-list li { margin: 0; }
.related-list a {
  display: block; padding: 0.9rem 1.05rem;
  border-radius: var(--radius-sm);
  font-size: 0.93rem; color: #cdd6e8;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease),
    color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.related-list a:hover {
  border-color: rgba(139, 92, 246, 0.6);
  color: #fff; text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -26px rgba(139, 92, 246, 0.9);
}

/* ---------- callouts ---------- */

.callout {
  border-inline-start: 3px solid var(--violet);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem; margin: 1.6rem 0; font-size: 0.96rem;
  background-color: rgba(139, 92, 246, 0.07);
}
.callout > :last-child { margin-bottom: 0; }
.callout .callout-title {
  display: block; font-weight: 750; color: #ede9ff;
  margin-bottom: 0.35rem; letter-spacing: 0.01em;
}
.callout--warn {
  border-inline-start-color: var(--warn);
  background-color: rgba(251, 113, 133, 0.075);
}
.callout--warn .callout-title { color: #fda4af; }
.callout--info {
  border-inline-start-color: var(--cyan);
  background-color: rgba(34, 211, 238, 0.065);
}
.callout--info .callout-title { color: #67e8f9; }

/* ---------- glossary ---------- */

.glossary-nav { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 2.2rem; }
.glossary-nav a {
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 0.22rem 0.75rem;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.glossary-nav a:hover {
  color: #fff; border-color: rgba(139, 92, 246, 0.6);
  background: rgba(139, 92, 246, 0.16); text-decoration: none;
}

.terms { display: grid; gap: 1.15rem; }
.term {
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.35rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
  transition: border-color 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.term:hover {
  border-color: rgba(139, 92, 246, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 20px 46px -32px rgba(139, 92, 246, 0.9);
}
.term dt {
  font-weight: 750; color: var(--heading); font-size: 1.04rem;
  margin-bottom: 0.4rem; letter-spacing: -0.01em;
}
.term dd { margin: 0; font-size: 0.95rem; }
.term .en {
  display: inline-block;
  font-family: var(--mono); font-size: 0.72rem; color: #9aa5c0;
  margin-inline-start: 0.45rem; padding: 0.06rem 0.45rem;
  border: 1px solid var(--border-soft); border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  vertical-align: 0.1em; letter-spacing: 0;
}

/* ---------- faq ---------- */

.faq details {
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem; margin-bottom: 0.75rem;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease);
}
.faq details:hover { border-color: rgba(139, 92, 246, 0.45); }
.faq details[open] {
  border-color: rgba(139, 92, 246, 0.5);
  background-color: rgba(139, 92, 246, 0.09);
  box-shadow: 0 22px 50px -34px rgba(139, 92, 246, 0.95);
}
.faq summary {
  cursor: pointer; font-weight: 650; color: var(--heading);
  list-style: none; display: flex; justify-content: space-between;
  gap: 1rem; align-items: baseline;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none;
  width: 1.55rem; height: 1.55rem; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.9rem;
  color: #d8d2ff; background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.4);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.faq details[open] summary::after {
  content: "–";
  background: var(--grad);
  color: #05060f; border-color: transparent;
}
.faq details p { margin: 0.9rem 0 0; font-size: 0.95rem; color: #b7c2d8; }

/* ---------- contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 3.2rem; align-items: start;
}
.field { margin-bottom: 1.15rem; }
.field label {
  display: block; font-size: 0.86rem; font-weight: 650;
  color: #cfd8ec; margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}
.field input, .field textarea, .field select {
  width: 100%; font-family: var(--font); font-size: 0.95rem;
  color: #e6ecf9;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: #6f7c99; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.75);
  background: rgba(139, 92, 246, 0.07);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
}
.field textarea { min-height: 150px; resize: vertical; }

.hint { font-size: 0.82rem; color: var(--muted); }
.detail-list { list-style: none; padding: 0; margin: 0; }
.detail-list li {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.8rem; align-items: start;
  padding: 0.8rem 0; border-bottom: 1px solid var(--border-soft);
  font-size: 0.94rem;
}
.detail-list li:last-child { border-bottom: 0; }
.detail-list .k {
  color: var(--muted); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 650;
  padding-top: 0.15rem;
}
.detail-list .v { color: #d5deee; text-align: start; }

/* ---------- legal pages ---------- */

.legal { max-width: 820px; margin: 0 auto; padding: 3.2rem 1.5rem 4.5rem; }
.legal h1 { margin-bottom: 0.5rem; }
.legal .updated {
  color: var(--muted); font-size: 0.86rem; margin-bottom: 2.2rem;
  display: inline-block; padding: 0.2rem 0.7rem;
  border: 1px solid var(--border-soft); border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
}
.legal h2 {
  margin-top: 2.4rem; margin-bottom: 0.65rem; font-size: 1.2rem;
  padding-top: 1.3rem; border-top: 1px solid var(--border-soft);
}
.legal p, .legal li { font-size: 0.98rem; }
.legal ul, .legal ol { padding-inline-start: 1.3rem; }
.legal a { color: #7dd3fc; text-decoration: underline; text-decoration-color: rgba(34, 211, 238, 0.35); }
.legal a:hover { text-decoration-color: currentColor; }

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  border-top: 1px solid var(--border-soft);
  background:
    radial-gradient(720px 300px at 50% 0%, rgba(139, 92, 246, 0.13), transparent 70%),
    rgba(5, 7, 15, 0.72);
  padding-block: 3rem 1.6rem;
  margin-top: 3.5rem;
}
.site-footer::before {
  content: ""; position: absolute; inset-inline: 0; top: -1px; height: 1px;
  background: var(--grad-line); opacity: 0.65;
}
.footer-inner {
  max-width: var(--max); margin: 0 auto; padding-inline: 1.5rem;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.25fr; gap: 2.2rem;
}
.footer-brand p {
  font-size: 0.88rem; color: var(--muted);
  max-width: 34ch; margin-top: 0.85rem;
}
.footer-col h2 {
  font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #909bb8; margin-bottom: 0.9rem; font-weight: 750;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.footer-col a { font-size: 0.9rem; color: #bcc6dc; transition: color 0.18s var(--ease); }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  max-width: var(--max); margin: 2.2rem auto 0;
  padding: 1.2rem 1.5rem 0;
  border-top: 1px solid var(--border-soft);
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 0.6rem; font-size: 0.82rem; color: var(--muted);
}

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

.error-page {
  max-width: 660px; margin: 0 auto; padding: 5.5rem 1.5rem;
  text-align: center;
}
.error-page .code {
  font-size: clamp(4.5rem, 3rem + 6vw, 7rem);
  font-weight: 900; line-height: 1; letter-spacing: -0.05em;
  filter: drop-shadow(0 12px 40px rgba(139, 92, 246, 0.55));
}
.error-page h1 { margin: 0.8rem 0 0.9rem; }
.error-page p { color: var(--muted); }
.error-page .links {
  display: flex; gap: 0.8rem; justify-content: center;
  flex-wrap: wrap; margin-top: 1.8rem;
}
.error-page .error-more { margin-top: 2.8rem; }
.error-page .error-links {
  list-style: none; padding: 0; text-align: start;
  max-width: 32rem; margin: 1.1rem auto 0;
}
.error-page .error-links li { margin-bottom: 0.5rem; }
.error-page .error-links li::marker { color: transparent; }

/* ---------- reading progress ---------- */

.read-progress {
  position: fixed; inset-inline: 0; top: 0; height: 2px;
  background: transparent; z-index: 150; pointer-events: none;
}
.read-progress span {
  display: block; height: 100%; width: 0;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.95), 0 0 4px rgba(34, 211, 238, 0.9);
}

/* ---------- scroll reveal (progressive enhancement) ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; padding-top: 1.8rem; }
  .article-aside { position: static; order: -1; }
  .toc ul { max-height: 16rem; overflow: auto; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 2.2rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .feature-card { grid-template-columns: 1fr; }
  .feature-card .media { order: -1; max-height: 260px; }
  .hero-inner { padding-block: 4rem 4.5rem; }
  .hero-media { margin-top: -3.5rem; }
}

@media (max-width: 860px) {
  .nav-links { gap: 0; }
  .nav-links a { padding: 0.45rem 0.55rem; font-size: 0.9rem; }
}

@media (max-width: 768px) {
  body { font-size: 16.5px; }
  .menu-toggle { display: block; }
  .nav { position: static; }
  .nav-links {
    display: none; position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0.15rem;
    background: rgba(7, 10, 22, 0.97);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 1.2rem 1.1rem;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.95);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: block; padding: 0.75rem 0.6rem;
    border-bottom: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
  }
  .nav-links a::after { display: none; }
  .hero-inner { padding: 3.2rem 1.2rem 3.6rem; }
  .hero h1 { max-width: none; }
  .hero-media { margin-top: -2.6rem; margin-bottom: 2.6rem; }
  .section { padding-block: 2.4rem; }
  .wrap, .header-inner, .article-layout, .legal, .footer-inner, .footer-bottom { padding-inline: 1.2rem; }
  .article-hero { padding-block: 2rem 1.1rem; }
  .author-card { flex-direction: column; }
  .stats { grid-template-columns: 1fr 1fr; }
  .article-hero h1 { max-width: none; }
  .stat b { font-size: 1.65rem; }
  .error-page { padding: 4rem 1.2rem; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.8rem; }
  .hero-actions .btn { width: 100%; }
  .detail-list li { grid-template-columns: 1fr; gap: 0.15rem; }
  .read-progress { display: none; }
  .card { padding: 1.25rem; }
  .stats { grid-template-columns: 1fr; }
}

/* ---------- print ---------- */

@media print {
  .site-header, .site-footer, .article-aside, .author-card, .related,
  .read-progress, .skip-link, .copy-code, .hero-media, .glossary-nav { display: none !important; }
  body { background: #fff; color: #111; font-size: 12pt; }
  body::before, body::after { display: none !important; }
  a { color: #111; text-decoration: underline; }
  h1, h2, h3, h4, .prose h2, .prose h3 { color: #000; border-color: #ccc; }
  .article-layout { display: block; padding: 0; }
  .prose { max-width: 100%; }
  .card, .callout, .takeaway, .term, .faq details, .prose pre {
    background: #fff !important; border-color: #ccc !important; box-shadow: none !important;
  }
}

/* ---------- motion & contrast preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  body::before { animation: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

@media (prefers-contrast: more) {
  :root {
    --text: #d7dfef;
    --muted: #a9b3c9;
    --border: rgba(255, 255, 255, 0.28);
    --border-soft: rgba(255, 255, 255, 0.18);
  }
  body::before { opacity: 0.4; }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header { background: #070a15; }
  .card, .toc, .term, .faq details, .related-list a, .author-card,
  .feature-card, .callout, .takeaway, .stats {
    background-color: #0a0e1d;
  }
}
