/* ==========================================================================
   Aipusun — "Ledger" design system (Hebrew / RTL, investor education)
   Ink-navy ground, gold hairlines, tabular figures, statement-style tables.
   RTL-first, no external fonts, no libraries.
   ========================================================================== */

:root {
  /* surfaces */
  --bg: #08111b;
  --bg-alt: #0b1723;
  --bg-card: #0f1f2d;
  --bg-card-hi: #132636;
  --bg-deep: #050c14;
  --panel: #0d1a26;

  /* lines */
  --border: #1c3143;
  --border-soft: #152634;
  --border-hi: #2c4761;
  --gold-line: rgba(216, 171, 90, 0.38);

  /* type */
  --text: #c6d5e2;
  --muted: #8299ab;
  --heading: #f6fafd;

  /* accents */
  --gold: #d8ab5a;
  --gold-deep: #b8863a;
  --gold-light: #f3e3c3;
  --sky: #5fa8ff;
  --rose: #ef8080;

  --accent: var(--gold);
  --accent-soft: rgba(216, 171, 90, 0.09);
  --accent-line: rgba(216, 171, 90, 0.36);
  --sky-soft: rgba(95, 168, 255, 0.09);
  --warn-soft: rgba(239, 128, 128, 0.08);

  /* geometry */
  --radius: 4px;
  --radius-sm: 3px;
  --max: 1130px;
  --measure: 700px;
  --header-h: 68px;

  --font: "Heebo", "Assistant", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "Courier New", monospace;

  --ease: cubic-bezier(0.2, 0.62, 0.3, 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-color: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.85;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* faint ledger grid + a warm gold wash and a cold sky wash */
body::before,
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
}
body::before {
  background:
    radial-gradient(780px 420px at 88% -10%, rgba(216, 171, 90, 0.12), transparent 70%),
    radial-gradient(700px 400px at 4% 6%, rgba(95, 168, 255, 0.07), transparent 72%);
}
body::after {
  background-image:
    linear-gradient(to bottom, rgba(120, 150, 175, 0.055) 1px, transparent 1px);
  background-size: 100% 96px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}

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

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

a {
  color: var(--sky);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.16s var(--ease);
}
a:hover { color: var(--gold); }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  color: var(--heading);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.85rem); line-height: 1.2; }
h2 { font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.72rem); }
h3 { font-size: 1.13rem; }
h4 { font-size: 1rem; }

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

ul, ol { padding-inline-start: 1.3rem; margin-bottom: 1rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--gold-deep); }
li > ul, li > ol { margin-top: 0.4rem; margin-bottom: 0.4rem; }

hr {
  border: none; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
  margin: 2.2rem 0;
}

::selection { background: rgba(216, 171, 90, 0.32); 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: -60px; z-index: 300;
  background: var(--gold); color: #101a24;
  font-weight: 700; padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

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

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8, 17, 27, 0.94);
  border-bottom: 1px solid var(--border);
  transition: background 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.site-header.is-stuck {
  background: rgba(6, 13, 21, 0.98);
  box-shadow: 0 12px 30px -24px #000;
}
.site-header::after {
  content: "";
  position: absolute; inset-inline: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.35;
}

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

.logo {
  display: inline-flex; align-items: center; gap: 0.55rem;
  color: var(--heading); font-weight: 800; font-size: 1.08rem;
  text-decoration: none; flex: none;
}
.logo:hover { color: #fff; }
.logo-mark { display: inline-flex; flex: none; }
.logo svg { width: 34px; height: 34px; display: block; border-radius: 7px; }
.logo-text {
  font-family: var(--mono);
  letter-spacing: 0.03em;
  unicode-bidi: isolate;
}

.nav { margin-inline-start: auto; }
.nav-links {
  display: flex; align-items: center; gap: 0.1rem;
  list-style: none; padding: 0; margin: 0;
}
.nav-links a {
  position: relative; display: inline-block;
  color: var(--text); font-size: 0.94rem; font-weight: 600;
  padding: 0.4rem 0.62rem;
  transition: color 0.16s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute;
  inset-inline: 0.62rem; bottom: 0.14rem; height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.22s var(--ease);
}
.nav-links a:hover { color: var(--heading); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--gold); }
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

.menu-toggle {
  display: none; margin-inline-start: auto;
  background: var(--bg-card); border: 1px solid var(--border-hi);
  color: var(--heading); width: 42px; height: 42px;
  border-radius: var(--radius-sm); font-size: 1.05rem;
  cursor: pointer; line-height: 1;
}

/* ---------- buttons & tags ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; font-weight: 700;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--gold);
  color: #101a24;
  border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold-light); border-color: var(--gold-light); color: #101a24; }

.btn-ghost {
  background: transparent;
  color: var(--heading);
  border-color: var(--border-hi);
}
.btn-ghost:hover {
  color: var(--gold);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem; font-weight: 700;
  color: var(--gold-light);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 0.16rem 0.55rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.tag::before {
  content: ""; width: 5px; height: 5px; flex: none;
  background: var(--gold);
}
.tag--cyan {
  color: #cfe6ff;
  background: var(--sky-soft);
  border-color: rgba(95, 168, 255, 0.32);
}
.tag--cyan::before { background: var(--sky); }

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

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

main { counter-reset: sec; }

.section { padding-block: 3.3rem; }
.section--tight { padding-block: 2rem; }

.section--alt {
  background: linear-gradient(180deg, rgba(216, 171, 90, 0.03), transparent 55%), var(--bg-alt);
  border-block: 1px solid var(--border-soft);
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.section-head::after {
  content: "";
  position: absolute; inset-inline: 0; bottom: -3px; height: 1px;
  background: var(--gold-line);
  opacity: 0.5;
}
.section-head h2 { margin: 0; display: flex; align-items: baseline; gap: 0.6rem; }
.section-head h2::before {
  counter-increment: sec;
  content: counter(sec, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.76rem; font-weight: 700;
  color: var(--gold-deep);
  direction: ltr;
  letter-spacing: 0.06em;
}
.section-head .more {
  font-size: 0.9rem; font-weight: 700; color: var(--muted);
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.section-head .more:hover { color: var(--gold); border-bottom-color: var(--gold); text-decoration: none; }

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem; font-weight: 700;
  color: var(--gold);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-inline-start: 3px solid var(--gold);
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

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

.hero {
  position: relative;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(720px 340px at 86% 0%, rgba(216, 171, 90, 0.13), transparent 68%),
    linear-gradient(180deg, #0a1522, var(--bg));
}
.hero::after {
  content: "";
  position: absolute; inset-inline: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.45;
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: var(--max); margin-inline: auto;
  padding: 4.1rem 1.5rem 4.3rem;
}
.hero h1 {
  max-width: 22ch; margin-bottom: 1.1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--gold);
}
.hero .lede {
  max-width: 62ch; font-size: 1.06rem; color: #a9bccd;
  margin-bottom: 1.9rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 1.9rem; }

.entity-line {
  font-size: 0.83rem; color: var(--muted);
  border-top: 1px dashed var(--border);
  padding-top: 0.85rem; max-width: 74ch;
}
.entity-line a { color: var(--text); border-bottom: 1px solid var(--accent-line); }
.entity-line a:hover { color: var(--gold); }

.hero-media {
  max-width: var(--max);
  margin: -2.2rem auto 3.1rem;
  padding-inline: 1.5rem;
  position: relative; z-index: 2;
}
.hero-media img,
.hero-media svg {
  width: 100%;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  box-shadow: 0 26px 60px -36px #000;
}

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

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-block: 2.2rem;
}
.stat { background: var(--panel); padding: 1.05rem 1.2rem; }
.stat b {
  display: block;
  font-family: var(--mono);
  font-size: 1.65rem; font-weight: 700;
  color: var(--gold);
  line-height: 1.3;
  direction: ltr;
}
.stat span { font-size: 0.84rem; color: var(--muted); }

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

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

.card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-card-hi), var(--bg-card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}
.card::after {
  content: "";
  position: absolute; inset-inline: 1rem; top: 0; height: 1px;
  background: var(--gold-line);
  opacity: 0.5;
  transition: opacity 0.18s var(--ease);
}
.card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -32px #000;
}
.card:hover::after { opacity: 1; }
.card > h2 { font-size: 1.2rem; margin-bottom: 0.55rem; }
.card > h3 { margin-bottom: 0.5rem; }
.card > p:last-child { margin-bottom: 0; }
.card .tag { margin-bottom: 0.7rem; }

.post-card { display: flex; flex-direction: column; gap: 0.5rem; }
.post-card .meta {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 0.4rem; color: var(--muted);
}
.post-card .meta .when {
  display: flex; gap: 0.4rem; font-size: 0.78rem;
  color: #78909f; white-space: nowrap;
}
.post-card .meta .when > * + *::before {
  content: "·"; margin-inline-end: 0.4rem; color: var(--border-hi);
}
.post-card h3 { font-size: 1.05rem; margin: 0.3rem 0 0.35rem; line-height: 1.45; }
.post-card h3 a { color: var(--heading); }
.post-card h3 a:hover { color: var(--gold); }
.post-card p { font-size: 0.92rem; color: var(--muted); margin: 0; }

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

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

.breadcrumbs { font-size: 0.81rem; color: var(--muted); margin-bottom: 1.2rem; }
.breadcrumbs ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
}
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before {
  content: "‹"; margin-inline-end: 0.4rem; color: var(--border-hi);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--gold); }
.breadcrumbs [aria-current="page"] { color: #b7cadb; }

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

.article-hero {
  position: relative;
  padding-block: 2.5rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(620px 260px at 86% 0%, rgba(216, 171, 90, 0.1), transparent 70%),
    var(--bg);
}
.article-hero h1 { margin: 0.6rem 0 0.8rem; max-width: 26ch; }
.article-hero .lede {
  font-size: 1.04rem; color: #a6bacb; max-width: 68ch; margin-bottom: 1.2rem;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.7rem;
  font-size: 0.85rem; color: var(--muted); align-items: center;
}
.article-meta > * + *::before {
  content: "·"; margin-inline-end: 0.7rem; color: var(--border-hi);
}

.article-layout {
  max-width: var(--max); margin-inline: auto;
  padding: 2.5rem 1.5rem 3.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 3rem; align-items: start;
}
.article-main { min-width: 0; }
.article-aside { position: sticky; top: calc(var(--header-h) + 1.4rem); }

.toc {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
}
.toc h2 {
  font-family: var(--mono);
  font-size: 0.75rem; color: var(--muted);
  margin-bottom: 0.7rem; font-weight: 700;
  letter-spacing: 0.04em;
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a {
  display: block; font-size: 0.86rem; color: #93a9ba;
  padding: 0.3rem 0;
  border-inline-start: 1px solid var(--border-soft);
  padding-inline-start: 0.7rem;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.toc a:hover { color: var(--heading); text-decoration: none; }
.toc a.is-active { color: var(--gold); border-color: var(--gold); }
.toc .toc-sub a { padding-inline-start: 1.5rem; font-size: 0.82rem; }

.takeaway {
  border: 1px solid var(--accent-line);
  border-inline-start: 3px solid var(--gold);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.3rem; margin: 1.7rem 0;
}
.takeaway h2, .takeaway h3 {
  font-size: 0.96rem; margin-bottom: 0.6rem; color: var(--gold-light);
}
.takeaway ul { margin: 0; padding-inline-start: 1.2rem; }
.takeaway li { font-size: 0.95rem; }
.takeaway li::marker { color: var(--gold); }

.author-card {
  display: flex; gap: 1.05rem; align-items: flex-start;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.3rem; margin-top: 2.4rem;
}
.author-card .avatar {
  width: 52px; height: 52px; flex: none;
  background: var(--gold);
  color: #101a24;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 0.95rem;
  border-radius: var(--radius-sm);
  direction: ltr;
}
.author-card h2 { font-size: 1rem; margin-bottom: 0.25rem; }
.author-card p { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.4rem; }
.author-card .links { font-size: 0.85rem; }

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

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

.prose h2 {
  margin-top: 2.5rem; margin-bottom: 0.8rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border-soft);
  scroll-margin-top: calc(var(--header-h) + 1rem);
  font-size: clamp(1.22rem, 1.08rem + 0.5vw, 1.46rem);
  position: relative;
}
.prose h2::before {
  content: "";
  position: absolute; top: -1px; inset-inline-start: 0;
  width: 3rem; height: 2px;
  background: var(--gold);
}
.prose h3 {
  margin-top: 1.8rem; margin-bottom: 0.5rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
  color: #e8f2f9;
}
.prose h4 { margin-top: 1.35rem; margin-bottom: 0.4rem; }
.prose p, .prose li { font-size: 1.015rem; }
.prose > p:first-of-type { font-size: 1.07rem; color: #dbe7f1; }
.prose a {
  color: var(--sky);
  text-decoration: underline;
  text-decoration-color: rgba(95, 168, 255, 0.4);
}
.prose a:hover { text-decoration-color: var(--gold); color: var(--gold); }

.prose blockquote {
  position: relative;
  background: rgba(95, 168, 255, 0.055);
  border: 1px solid rgba(95, 168, 255, 0.16);
  border-inline-start: 3px solid var(--sky);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.15rem;
  margin: 1.6rem 0;
  color: #cfe0ee;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: var(--mono);
  direction: ltr;
  unicode-bidi: embed;
}
.prose :not(pre) > code {
  background: rgba(216, 171, 90, 0.09);
  border: 1px solid var(--accent-line);
  border-radius: 2px;
  padding: 0.08rem 0.36rem;
  font-size: 0.86em;
  color: var(--gold-light);
}
.prose pre {
  direction: ltr; text-align: left;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold-deep);
  border-radius: var(--radius-sm);
  padding: 1.05rem 1.15rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
  font-size: 0.855rem; line-height: 1.65;
}
.prose pre code {
  background: none; border: 0; padding: 0;
  color: #d5e3ee;
  font-family: var(--mono);
}

.copy-code {
  position: absolute; top: 0.5rem; inset-inline-end: 0.5rem; z-index: 2;
  font-family: var(--font); font-size: 0.72rem; font-weight: 700;
  background: #12212f; color: var(--muted);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  padding: 0.22rem 0.55rem;
  cursor: pointer;
}
.copy-code:hover { color: #101a24; background: var(--gold); border-color: var(--gold); }

/* statement-style tables */
.table-wrap {
  overflow-x: auto; margin: 1.6rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 0; }
.prose th, .prose td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: start; vertical-align: top;
}
.prose thead th {
  background: var(--bg-card-hi);
  color: var(--heading); font-weight: 700;
  border-bottom: 1px solid var(--gold-line);
  white-space: nowrap;
  font-size: 0.88rem;
}
.prose tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover { background: rgba(216, 171, 90, 0.05); }
.prose td:last-child { font-variant-numeric: tabular-nums; }

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

.article-figure { margin: 1.6rem 0 0; }
.article-figure img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.related { margin-top: 2.6rem; }
.related h2 { font-size: 1.08rem; margin-bottom: 0.9rem; }
.related-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}
.related-list li { margin: 0; }
.related-list a {
  display: block; padding: 0.8rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.93rem; color: var(--text);
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.related-list a:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }

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

.callout {
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--gold);
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin: 1.5rem 0;
  font-size: 0.96rem;
}
.callout > :last-child { margin-bottom: 0; }
.callout .callout-title {
  display: block; font-weight: 700; color: var(--gold-light);
  margin-bottom: 0.3rem;
}
.callout--warn {
  border-inline-start-color: var(--rose);
  background: var(--warn-soft);
  border-color: rgba(239, 128, 128, 0.22);
}
.callout--warn .callout-title { color: #f3b0b0; }
.callout--info {
  border-inline-start-color: var(--sky);
  background: var(--sky-soft);
  border-color: rgba(95, 168, 255, 0.2);
}
.callout--info .callout-title { color: #9cc8ff; }

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

.glossary-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 2rem; }
.glossary-nav a {
  font-size: 0.82rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.18rem 0.6rem;
  background: var(--panel);
}
.glossary-nav a:hover { color: var(--gold); border-color: var(--accent-line); text-decoration: none; }
.terms { display: grid; gap: 1rem; }
.term {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  padding: 1.05rem 1.2rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.term dt {
  font-weight: 700; color: var(--heading); font-size: 1.02rem;
  margin-bottom: 0.35rem;
}
.term dd { margin: 0; font-size: 0.95rem; }
.term .en {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.73rem; color: #8aa0b1;
  margin-inline-start: 0.45rem;
  padding: 0.02rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  direction: ltr;
}

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

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.6rem;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.faq details:hover { border-color: var(--border-hi); }
.faq details[open] { border-color: var(--accent-line); background: rgba(216, 171, 90, 0.04); }
.faq summary {
  cursor: pointer; font-weight: 700; 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;
  font-family: var(--mono); font-weight: 700;
  color: var(--gold); font-size: 1.1rem; line-height: 1;
}
.faq details[open] summary::after { content: "−"; color: var(--sky); }
.faq details p { margin: 0.75rem 0 0; font-size: 0.95rem; color: #bed0e0; }

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

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 3rem; align-items: start;
}
.field { margin-bottom: 1.1rem; }
.field label {
  display: block; font-size: 0.88rem; font-weight: 700;
  color: #dbe7f1; margin-bottom: 0.35rem;
}
.field input, .field textarea, .field select {
  width: 100%;
  font-family: var(--font); font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.66rem 0.8rem;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(216, 171, 90, 0.12);
}
.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.7rem; align-items: start;
  padding: 0.65rem 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.85rem; }
.detail-list .v { color: #dbe7f1; text-align: right; }

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

.legal { max-width: 800px; margin-inline: auto; padding: 3rem 1.5rem 4rem; }
.legal h1 { margin-bottom: 0.4rem; }
.legal .updated {
  color: var(--muted); font-size: 0.85rem; margin-bottom: 2rem;
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.legal h2 {
  margin-top: 2.2rem; margin-bottom: 0.6rem; font-size: 1.15rem;
  padding-top: 1.1rem; border-top: 1px solid var(--border-soft);
}
.legal p, .legal li { font-size: 0.98rem; }
.legal ul, .legal ol { padding-inline-start: 1.25rem; }

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

.site-footer {
  position: relative;
  background: #060e17;
  border-top: 1px solid var(--border);
  padding-block: 2.6rem 1.4rem;
  margin-top: 3rem;
}
.site-footer::before {
  content: "";
  position: absolute; inset-inline: 0; top: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.45;
}
.footer-inner {
  max-width: var(--max); margin-inline: auto;
  padding-inline: 1.5rem;
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr 1.25fr;
  gap: 2rem;
}
.footer-brand p {
  font-size: 0.88rem; color: var(--muted);
  max-width: 38ch; margin-top: 0.75rem;
}
.footer-brand .footer-risk {
  font-size: 0.78rem; line-height: 1.7;
  color: #b9a179;
  border-inline-start: 2px solid var(--gold-deep);
  padding-inline-start: 0.7rem;
  margin-top: 0.8rem;
  max-width: 42ch;
}
.footer-brand .footer-operator {
  font-size: 0.8rem;
  color: #78909f;
  border-top: 1px dashed var(--border);
  padding-top: 0.6rem;
  margin-top: 0.9rem;
  max-width: 42ch;
}
.footer-col h2 {
  font-family: var(--mono);
  font-size: 0.75rem; color: #78909f;
  margin-bottom: 0.8rem; font-weight: 700;
  letter-spacing: 0.04em;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.45rem; font-size: 0.9rem; color: var(--muted); }
.footer-col a { font-size: 0.9rem; color: var(--text); }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  max-width: var(--max); margin: 2rem auto 0;
  padding: 1rem 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: 650px; margin-inline: auto;
  padding: 5rem 1.5rem; text-align: center;
}
.error-page .code {
  font-family: var(--mono);
  font-size: clamp(4rem, 3rem + 5vw, 6rem);
  font-weight: 700; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px var(--gold);
  letter-spacing: 0.02em;
  direction: ltr;
}
.error-page h1 { margin: 0.7rem 0 0.8rem; }
.error-page p { color: var(--muted); }
.error-page .links {
  display: flex; gap: 0.8rem; justify-content: center;
  flex-wrap: wrap; margin-top: 1.6rem;
}
.error-page .error-more { margin-top: 2.5rem; }
.error-page .error-links {
  list-style: none; padding: 0; text-align: start;
  max-width: 32rem; margin: 1rem auto 0;
}
.error-page .error-links li { margin-bottom: 0.45rem; }
.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: linear-gradient(90deg, var(--gold), var(--gold-light));
}

/* ---------- scroll reveal ---------- */

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

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

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

@media (max-width: 860px) {
  .nav-links { gap: 0; }
  .nav-links a { padding: 0.4rem 0.46rem; font-size: 0.88rem; }
}

@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;
    background: #0a1521;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.2rem 0.9rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: block; padding: 0.7rem 0.4rem;
    border-bottom: 1px solid var(--border-soft);
  }
  .nav-links a::after { display: none; }
  .hero-inner { padding: 2.7rem 1.2rem 3.1rem; }
  .hero h1 { max-width: none; }
  .hero-media { margin-top: -1.3rem; margin-bottom: 2.3rem; }
  .section { padding-block: 2.2rem; }
  .wrap, .header-inner, .article-layout, .legal, .footer-inner, .footer-bottom {
    padding-inline: 1.2rem;
  }
  .article-hero { padding-block: 1.9rem 1rem; }
  .author-card { flex-direction: column; }
  .stats { grid-template-columns: 1fr 1fr; }
  .article-hero h1 { max-width: none; }
  .error-page { padding: 3.6rem 1.2rem; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.7rem; }
  .hero-actions .btn { width: 100%; }
  .detail-list li { grid-template-columns: 1fr; gap: 0.1rem; }
  .read-progress { display: none; }
  .card { padding: 1.2rem; }
  .stats { grid-template-columns: 1fr; }
  .section-head h2::before { font-size: 0.7rem; }
}

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

@media print {
  .site-header, .site-footer, .article-aside, .author-card, .related,
  .read-progress, .skip-link, .copy-code, .hero-media, .glossary-nav,
  .menu-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  body::before, body::after { display: none !important; }
  a { color: #000; text-decoration: underline; }
  h1, h2, h3, h4, .prose h2, .prose h3 { color: #000; border-color: #999; }
  .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;
  }
  .prose pre, .prose pre code { background: #f4f4f4 !important; color: #111 !important; }
}

/* ---------- 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;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

@media (prefers-contrast: more) {
  :root {
    --text: #e6eff7;
    --muted: #b3c6d6;
    --border: #3d5b75;
    --border-soft: #2d4659;
    --border-hi: #567494;
  }
  body::after { opacity: 0.35; }
}
