/* ==========================================================================
   microhuv.live — Design System
   A single, dependency-free stylesheet. No web fonts, no images.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --font-sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Cascadia Code", "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;

  /* Light theme */
  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  --bg-elev: #ffffff;
  --bg-sunken: #eef2f8;
  --text: #0d1526;
  --text-soft: #3d4a60;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --brand: #1152f0;
  --brand-strong: #0a3ec2;
  --brand-soft: #e8effe;
  --brand-ink: #0a3ec2;
  --teal: #0891b2;
  --teal-soft: #e0f5fb;
  --amber: #b45309;
  --amber-soft: #fdf3e3;
  --green: #047857;
  --green-soft: #e3f6ee;
  --red: #be123c;
  --red-soft: #fdeaef;

  --shadow-sm: 0 1px 2px rgba(13, 21, 38, 0.06), 0 1px 3px rgba(13, 21, 38, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(13, 21, 38, 0.06), 0 12px 24px -8px rgba(13, 21, 38, 0.1);
  --shadow-lg: 0 8px 12px -4px rgba(13, 21, 38, 0.07), 0 28px 56px -16px rgba(13, 21, 38, 0.16);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --container: 1180px;
  --container-narrow: 780px;
  --header-h: 68px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #080c17;
  --bg-soft: #0d1322;
  --bg-elev: #111827;
  --bg-sunken: #161f33;
  --text: #e9eef7;
  --text-soft: #c3cddd;
  --text-muted: #8d9bb3;
  --border: #1f2b42;
  --border-strong: #2c3a56;

  --brand: #6f9dff;
  --brand-strong: #8fb4ff;
  --brand-soft: #16233f;
  --brand-ink: #a9c5ff;
  --teal: #38bdf8;
  --teal-soft: #0d2735;
  --amber: #fbbf24;
  --amber-soft: #2b2011;
  --green: #34d399;
  --green-soft: #0c2a22;
  --red: #fb7185;
  --red-soft: #2e1420;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 10px -2px rgba(0, 0, 0, 0.5), 0 16px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 20px -6px rgba(0, 0, 0, 0.55), 0 32px 64px -20px rgba(0, 0, 0, 0.7);
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  overflow-x: clip;
}

@supports not (overflow: clip) {
  html { overflow-x: hidden; }
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.68;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

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

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

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

h1, h2, h3, h4, h5 {
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -0.022em;
  color: var(--text);
  text-wrap: balance;
}

p { text-wrap: pretty; }

ul, ol { padding-left: 1.25rem; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

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

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

@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;
  }
}

/* ---------- 3. Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(3.25rem, 7vw, 6rem); }
.section--soft { background: var(--bg-soft); }
.section--tight { padding-block: clamp(2.25rem, 5vw, 4rem); }

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

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: var(--brand);
  color: #fff;
  padding: 0.7rem 1.25rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus-visible { transform: translate(-50%, 0); text-decoration: none; }

.text-gradient {
  background: linear-gradient(100deg, var(--brand) 0%, var(--teal) 55%, var(--brand) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 9s linear infinite;
}
@keyframes gradientShift { to { background-position: 200% center; } }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
html[data-theme="dark"] .eyebrow { color: var(--brand-ink); }

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.45rem); margin-bottom: 0.75rem; }
.section-head p { color: var(--text-muted); font-size: clamp(1rem, 1.6vw, 1.1rem); }

.lead { font-size: clamp(1.02rem, 1.7vw, 1.16rem); color: var(--text-soft); }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.96rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease),
    border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), color 0.18s var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 70%, var(--teal)) 100%);
  color: #fff;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 65%, transparent);
}
.btn--primary:hover { box-shadow: 0 14px 28px -10px color-mix(in srgb, var(--brand) 70%, transparent); }

.btn--ghost {
  background: var(--bg-elev);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn--sm { padding: 0.55rem 1.05rem; font-size: 0.88rem; }
.btn--block { width: 100%; }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.site-header.is-stuck { box-shadow: var(--shadow-md); }

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
  color: var(--text);
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px;
  padding: 5px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--teal));
  color: #fff;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 70%, transparent);
  flex-shrink: 0;
}
.brand-text em { font-style: normal; color: var(--brand); }

.nav { margin-inline-start: auto; }
.nav ul {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 560;
  color: var(--text-soft);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}
.nav a:hover { background: var(--bg-sunken); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }

.header-actions { display: flex; align-items: center; gap: 0.4rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.icon-btn svg { width: 19px; height: 19px; }

.nav-toggle { display: none; }

.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Mobile drawer */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 11, 24, 0.5);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s;
  z-index: 98;
}
body.nav-open .nav-backdrop { opacity: 1; visibility: visible; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-grid; }
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    width: min(320px, 84vw);
    background: var(--bg-elev);
    border-inline-start: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: calc(var(--header-h) + 1rem) 1.25rem 2rem;
    transform: translateX(102%);
    visibility: hidden;
    transition: transform 0.32s var(--ease), visibility 0.32s;
    overflow-y: auto;
    margin: 0;
    z-index: 99;
  }
  body.nav-open .nav {
    transform: translateX(0);
    visibility: visible;
  }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .nav a { padding: 0.8rem 1rem; border-radius: var(--radius); font-size: 1.02rem; }
  .nav .nav-cta { margin-top: 0.9rem; }
}
@media (min-width: 901px) {
  .nav-backdrop { display: none; }
}

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3rem, 8vw, 6.5rem) clamp(3rem, 7vw, 5.5rem);
  background:
    radial-gradient(1000px 460px at 78% -10%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 62%),
    radial-gradient(760px 420px at 8% 8%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 60%),
    var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 80% 62% at 50% 32%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 62% at 50% 32%, #000 25%, transparent 78%);
  pointer-events: none;
  opacity: 0.85;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.7rem);
  letter-spacing: -0.035em;
  margin-bottom: 1.1rem;
}
.hero-sub { font-size: clamp(1.02rem, 1.9vw, 1.2rem); color: var(--text-muted); max-width: 36rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.25rem, 4vw, 2.75rem);
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px dashed var(--border-strong);
}
.hero-stat b {
  display: block;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand);
  line-height: 1.15;
}
.hero-stat span { font-size: 0.85rem; color: var(--text-muted); }

.hero-art { position: relative; }
.hero-art svg { width: 100%; filter: drop-shadow(0 24px 48px rgba(10, 30, 80, 0.16)); }

.float-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.9rem;
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
  backdrop-filter: blur(8px);
  animation: floaty 6s ease-in-out infinite;
}
.float-chip svg { width: 16px; height: 16px; flex-shrink: 0; }
.float-chip--1 { top: 8%; left: -4%; animation-delay: 0s; }
.float-chip--2 { bottom: 12%; right: -3%; animation-delay: 1.6s; }
.float-chip--3 { bottom: 42%; left: -7%; animation-delay: 3.1s; }
.float-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot--green { background: var(--green); }
.dot--amber { background: var(--amber); }
.dot--red { background: var(--red); }
.dot--brand { background: var(--brand); }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .hero-art { order: -1; max-width: 440px; margin-inline: auto; }
  /* decorative chips overlap the diagram once it scales down */
  .float-chip { display: none; }
}
@media (max-width: 560px) {
  .hero-art { max-width: 100%; }
}

/* ---------- 7. Cards & grids ---------- */
.grid { display: grid; gap: clamp(1rem, 2.2vw, 1.5rem); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.4vw, 1.75rem);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
  position: relative;
  display: flex;
  flex-direction: column;
}
.card--link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  text-decoration: none;
}
.card__icon {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 1rem;
  flex-shrink: 0;
}
.card__icon svg { width: 23px; height: 23px; }
.card__icon--teal { background: var(--teal-soft); color: var(--teal); }
.card__icon--amber { background: var(--amber-soft); color: var(--amber); }
.card__icon--green { background: var(--green-soft); color: var(--green); }
.card__icon--red { background: var(--red-soft); color: var(--red); }

.card h3 { font-size: 1.1rem; margin-bottom: 0.45rem; }
.card p { color: var(--text-muted); font-size: 0.94rem; }
.card__more {
  margin-top: auto;
  padding-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--brand);
}
.card__more svg { width: 15px; height: 15px; transition: transform 0.2s var(--ease); }
.card--link:hover .card__more svg { transform: translateX(4px); }

/* ---------- 8. Guide / blog cards ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--text-muted);
}
.tag--brand { background: var(--brand-soft); color: var(--brand-ink); }
.tag--teal { background: var(--teal-soft); color: var(--teal); }
.tag--amber { background: var(--amber-soft); color: var(--amber); }
.tag--green { background: var(--green-soft); color: var(--green); }
.tag--red { background: var(--red-soft); color: var(--red); }

.guide-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.guide-card__time { font-size: 0.78rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 0.3rem; }
.guide-card__time svg { width: 13px; height: 13px; }
.guide-card h3 { font-size: 1.08rem; margin-bottom: 0.5rem; }
.guide-card h3 a { color: inherit; }
.guide-card p { font-size: 0.92rem; color: var(--text-muted); flex: 1; }

/* Numbered list of guides */
.guide-list { display: grid; gap: 1rem; }
.guide-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(0.9rem, 2vw, 1.5rem);
  padding: clamp(1rem, 2.2vw, 1.4rem);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
  color: inherit;
}
.guide-row:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  text-decoration: none;
}
.guide-row__num {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.guide-row h3 { font-size: 1.04rem; margin-bottom: 0.3rem; }
.guide-row p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }
.guide-row__meta { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.6rem; }
.guide-row__arrow { color: var(--brand); flex-shrink: 0; display: grid; place-items: center; }
.guide-row__arrow svg { width: 20px; height: 20px; }
@media (max-width: 700px) {
  .guide-row { grid-template-columns: auto 1fr; }
  .guide-row__arrow { display: none; }
}

/* ---------- 9. Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 1.25rem; list-style: none; padding: 0; }
.steps--split { counter-reset: step2; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 1.15rem 1.25rem 1.15rem 1.25rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 1.05rem;
  left: -0.7rem;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--teal));
  color: #fff;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 0 0 5px var(--bg);
  z-index: 1;
}
.steps li > strong { display: block; margin-bottom: 0.25rem; color: var(--text); }
.steps li p, .steps li ul, .steps li ol { color: var(--text-soft); font-size: 0.95rem; }
.steps li ul, .steps li ol { margin-top: 0.5rem; }

/* ---------- 10. Callouts ---------- */
.callout {
  display: flex;
  gap: 0.9rem;
  padding: 1.05rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--brand);
  background: var(--brand-soft);
  margin-block: 1.5rem;
}
.callout__icon { flex-shrink: 0; color: var(--brand); }
.callout__icon svg { width: 20px; height: 20px; }
.callout__body { font-size: 0.94rem; color: var(--text-soft); }
.callout strong { color: var(--text); display: block; margin-bottom: 0.15rem; }
.callout p + p { margin-top: 0.5rem; }
.callout ul, .callout ol { margin-top: 0.4rem; }

.callout--tip { background: var(--green-soft); border-inline-start-color: var(--green); }
.callout--tip .callout__icon { color: var(--green); }
.callout--warn { background: var(--amber-soft); border-inline-start-color: var(--amber); }
.callout--warn .callout__icon { color: var(--amber); }
.callout--stop { background: var(--red-soft); border-inline-start-color: var(--red); }
.callout--stop .callout__icon { color: var(--red); }
.callout--plain { background: var(--bg-sunken); border-inline-start-color: var(--border-strong); }
.callout--plain .callout__icon { color: var(--text-muted); }

/* ---------- 11. Article layout ---------- */
.article-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 210px;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
  padding-block: clamp(2rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
}
@media (max-width: 1100px) { .article-shell { grid-template-columns: minmax(0, 1fr); } }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-block: 1.25rem 0;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs svg { width: 13px; height: 13px; opacity: 0.6; }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 600; }

.toc {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding: 1.1rem 1rem 1.2rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.86rem;
}
.toc__title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}
.toc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.1rem; }
.toc a {
  display: block;
  padding: 0.42rem 0.6rem;
  border-radius: 8px;
  color: var(--text-muted);
  border-inline-start: 2px solid transparent;
  transition: color 0.16s, background-color 0.16s, border-color 0.16s;
  line-height: 1.4;
}
.toc a:hover { color: var(--text); background: var(--bg-sunken); text-decoration: none; }
.toc a.is-active { color: var(--brand); font-weight: 650; border-inline-start-color: var(--brand); background: var(--brand-soft); }

/* On narrow screens the TOC collapses so the headline is seen first. */
.toc__toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
}
.toc__toggle svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.toc__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

@media (max-width: 1100px) {
  .toc { position: static; max-height: none; padding: 0.85rem 1rem; }
  .toc__title { display: none; }
  .toc__toggle { display: flex; }
  .toc.is-collapsed ul { display: none; }
  .toc ul { margin-top: 0.85rem; }
  .toc__toggle[aria-expanded="false"] + ul { margin-top: 0; }
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.1rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-block: 0.9rem 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.article-meta span { display: inline-flex; align-items: center; gap: 0.38rem; }
.article-meta svg { width: 14px; height: 14px; }

.article h1 { font-size: clamp(1.75rem, 4vw, 2.65rem); letter-spacing: -0.032em; margin-bottom: 0.75rem; }
.article__intro { font-size: clamp(1.02rem, 1.8vw, 1.14rem); color: var(--text-muted); margin-bottom: 1.75rem; }

.article h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.62rem);
  margin-top: 2.75rem;
  margin-bottom: 0.9rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.article h3 { font-size: 1.1rem; margin-top: 1.75rem; margin-bottom: 0.55rem; scroll-margin-top: calc(var(--header-h) + 20px); }
.article p { margin-bottom: 1.1rem; color: var(--text-soft); }
.article ul, .article ol { margin-bottom: 1.2rem; color: var(--text-soft); }
.article li { margin-bottom: 0.45rem; }
.article li::marker { color: var(--brand); font-weight: 700; }
.article strong { color: var(--text); font-weight: 680; }

.article a { font-weight: 560; }

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  padding: 0.12em 0.42em;
  border-radius: 6px;
  color: var(--text);
  word-break: break-word;
}
kbd {
  box-shadow: 0 1.5px 0 var(--border-strong);
  font-weight: 600;
  white-space: nowrap;
}

.pathbox {
  position: relative;
  margin-block: 1.25rem;
}
.pathbox__label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}
.pathbox__label svg { width: 14px; height: 14px; }
.pathbox code {
  display: block;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-sunken);
  line-height: 1.6;
  font-size: 0.86rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin-block: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 480px; }
caption {
  caption-side: top;
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
}
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.02em; color: var(--text); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-soft); }

/* FAQ */
.faq { display: grid; gap: 0.75rem; }
.faq details {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s var(--ease);
}
.faq details[open] { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.15rem;
  font-weight: 650;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.98rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  margin-inline-start: auto;
  width: 18px; height: 18px;
  flex-shrink: 0;
  background: currentColor;
  color: var(--brand);
  -webkit-mask: var(--icon-chevron) center / contain no-repeat;
  mask: var(--icon-chevron) center / contain no-repeat;
  transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(180deg); }
.faq summary:hover { color: var(--brand); }
.faq__body { padding: 0 1.15rem 1.15rem; color: var(--text-soft); font-size: 0.94rem; }
.faq__body > *:first-child { margin-top: 0; }

/* ---------- 12. Side widgets ---------- */
.widget {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  display: grid;
  gap: 1rem;
}
.widget__card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
}
.widget__card h4 { font-size: 0.8rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.85rem; }
.widget__card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.15rem; }
.widget__card li a {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.87rem;
  color: var(--text-soft);
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  line-height: 1.4;
}
.widget__card li a:hover { background: var(--bg-elev); color: var(--brand); text-decoration: none; }
.widget__card li a::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
  margin-top: 0.5rem;
  flex-shrink: 0;
}
.widget__card li a:hover::before { background: var(--brand); }
.widget__card li a.is-active { color: var(--brand); font-weight: 650; }
.widget__card li a.is-active::before { background: var(--brand); }
@media (max-width: 1100px) { .widget { display: none; } }

.progress-line {
  position: fixed;
  top: var(--header-h);
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--teal));
  z-index: 101;
  transition: width 0.1s linear;
  border-radius: 0 3px 3px 0;
}

/* ---------- 13. Page header ---------- */
.page-head {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem);
  background:
    radial-gradient(720px 320px at 85% 0%, color-mix(in srgb, var(--teal) 14%, transparent), transparent 65%),
    radial-gradient(620px 300px at 5% 10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 62%),
    var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.page-head h1 { font-size: clamp(1.85rem, 4.4vw, 2.9rem); letter-spacing: -0.033em; margin-bottom: 0.85rem; }
.page-head p { color: var(--text-muted); max-width: 44rem; font-size: clamp(1rem, 1.7vw, 1.1rem); }

/* ---------- 14. Forms ---------- */
.form-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(1.35rem, 3vw, 2rem);
  box-shadow: var(--shadow-md);
}
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 650; font-size: 0.9rem; margin-bottom: 0.4rem; color: var(--text); }
.field .hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; }
.input, .textarea, .select {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.textarea { min-height: 150px; resize: vertical; }
.select { appearance: none; background-image: var(--icon-chevron-svg); background-repeat: no-repeat; background-position: right 0.9rem center; background-size: 16px; padding-right: 2.4rem; }
html[data-theme="dark"] .select { background-image: var(--icon-chevron-svg-light); }

.form-note { font-size: 0.82rem; color: var(--text-muted); margin-top: 1rem; }

.form-status {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  display: none;
  gap: 0.6rem;
  align-items: flex-start;
}
.form-status.is-visible { display: flex; }
.form-status--ok { background: var(--green-soft); color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); }
.form-status--err { background: var(--red-soft); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }
.form-status svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

/* ---------- 15. Misc blocks ---------- */
.note-strip {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.93rem;
}
.note-strip svg { width: 20px; height: 20px; color: var(--brand); flex-shrink: 0; margin-top: 2px; }
.note-strip strong { color: var(--text); }

.checklist { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.checklist li {
  position: relative;
  padding-left: 1.9rem;
  color: var(--text-soft);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--green-soft);
  border: 1.5px solid color-mix(in srgb, var(--green) 45%, transparent);
}
.checklist li::after {
  content: "";
  position: absolute;
  left: 6px; top: 9.5px;
  width: 5px; height: 9px;
  border: solid var(--green);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 5vw, 3.25rem);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 92%, #000) 0%, color-mix(in srgb, var(--teal) 80%, #000) 100%);
  color: #fff;
  text-align: center;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.22) 1px, transparent 0);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000, transparent 72%);
  mask-image: radial-gradient(ellipse at center, #000, transparent 72%);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; font-size: clamp(1.45rem, 3.2vw, 2.1rem); margin-bottom: 0.75rem; }
.cta-band p { color: rgba(255,255,255,0.88); max-width: 40rem; margin-inline: auto; margin-bottom: 1.75rem; }
.cta-band .btn--primary { background: #fff; color: var(--brand-strong); box-shadow: 0 10px 26px -10px rgba(0,0,0,0.5); }
.cta-band .btn--ghost { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.4); }
.cta-band .btn--ghost:hover { background: rgba(255,255,255,0.22); color: #fff; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* Feature split */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.split--reverse > *:first-child { order: 2; }
@media (max-width: 900px) { .split--reverse > *:first-child { order: 0; } }

/* Timeline / how it works */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2.5vw, 2rem); position: relative; }
@media (max-width: 820px) { .flow { grid-template-columns: 1fr; } }
.flow__step { text-align: center; position: relative; padding-inline: 0.5rem; }
.flow__num {
  width: 54px; height: 54px;
  margin: 0 auto 1rem;
  display: grid; place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), var(--teal));
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--brand) 75%, transparent);
}
.flow__step h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.flow__step p { font-size: 0.93rem; color: var(--text-muted); }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1.75rem;
  padding: 0.85rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.filter-chip {
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.filter-chip:hover { border-color: var(--brand); color: var(--brand); }
.filter-chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.filter-search {
  flex: 1 1 220px;
  min-width: 180px;
  padding: 0.5rem 0.9rem 0.5rem 2.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.9rem;
  color: var(--text);
  position: relative;
}
.filter-search-wrap { position: relative; flex: 1 1 220px; display: flex; }
.filter-search-wrap svg {
  position: absolute;
  left: 0.85rem; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.no-results { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }

/* Definition rows */
.deflist { display: grid; gap: 0.6rem; }
.deflist > div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
}
@media (max-width: 600px) { .deflist > div { grid-template-columns: 1fr; gap: 0.25rem; } }
.deflist dt, .deflist b { font-weight: 700; color: var(--text); }
.deflist dd { margin: 0; color: var(--text-soft); }

/* ---------- 16. Footer ---------- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: 2.5rem;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-col h4 {
  font-size: 0.75rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.95rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.footer-col a { font-size: 0.92rem; color: var(--text-soft); }
.footer-col a:hover { color: var(--brand); }
.footer-about p { font-size: 0.92rem; color: var(--text-muted); margin-top: 0.9rem; max-width: 34ch; }

.social { display: flex; gap: 0.5rem; margin-top: 1.15rem; }
.social a {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-soft);
  transition: color 0.18s, border-color 0.18s, transform 0.18s var(--ease);
}
.social a:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.social svg { width: 17px; height: 17px; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-block: 1.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--brand); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; }

.independence-note {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.independence-note svg { width: 17px; height: 17px; color: var(--teal); flex-shrink: 0; margin-top: 2px; }

/* ---------- 17. Scroll reveal / misc ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-soft);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s var(--ease);
  z-index: 90;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--brand); border-color: var(--brand); }
.to-top svg { width: 18px; height: 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 150%);
  background: var(--text);
  color: var(--bg);
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: transform 0.3s var(--ease);
  max-width: 90vw;
  text-align: center;
}
.toast.is-visible { transform: translate(-50%, 0); }

/* ---------- 18. Print ---------- */
@media print {
  .site-header, .site-footer, .toc, .widget, .to-top, .nav-backdrop, .progress-line, .hero-cta { display: none !important; }
  body { background: #fff; color: #000; }
  .article-shell { grid-template-columns: 1fr; }
  a { color: #000; text-decoration: underline; }
}