/* ==========================================================================
   Security Audit Trail — site styles
   ========================================================================== */

:root {
  --navy-950: #07131f;
  --navy-900: #0b1f33;
  --navy-800: #102a42;
  --navy-700: #173a58;
  --ink: #16202b;
  --ink-soft: #33475b;
  --muted: #5b6b7c;
  --muted-2: #7b8a99;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #fbfcfe;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --teal: #0f766e;
  --teal-600: #0d9488;
  --teal-400: #2dd4bf;
  --teal-100: #d9f2ee;
  --teal-50: #effaf8;
  --amber: #b45309;
  --amber-50: #fff7ed;
  --red: #b42318;
  --red-50: #fef3f2;
  --blue: #1d4ed8;
  --blue-50: #eff6ff;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container: 1180px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 35, 55, .06);
  --shadow: 0 10px 30px -12px rgba(15, 35, 55, .18);
  --shadow-lg: 0 30px 60px -30px rgba(7, 19, 31, .45);
  --header-h: 68px;
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-600); }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin: .35em 0; }
strong { color: var(--navy-900); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

::selection { background: rgba(20, 184, 166, .22); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--surface);
  color: var(--navy-900);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, .9);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy-900);
  font-weight: 700;
  letter-spacing: -.01em;
  flex-shrink: 0;
}
.brand:hover { color: var(--navy-900); }
.brand img { width: 30px; height: 33px; }
.brand span { font-size: 15px; }
.brand small {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  line-height: 1.2;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav a {
  display: inline-block;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.site-nav a:hover { background: var(--teal-50); color: var(--teal); }
body[data-page="index"] .site-nav a[data-page="index"],
body[data-page="architecture"] .site-nav a[data-page="architecture"],
body[data-page="integrity"] .site-nav a[data-page="integrity"],
body[data-page="requirements"] .site-nav a[data-page="requirements"],
body[data-page="integration"] .site-nav a[data-page="integration"],
body[data-page="operations"] .site-nav a[data-page="operations"] {
  background: var(--teal-50);
  color: var(--teal);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--navy-900);
  border-radius: 2px;
  position: relative;
  transition: transform .2s ease;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* --------------------------------------------------------------------------
   Buttons & badges
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--teal-600), var(--teal));
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(13, 148, 136, .7);
}
.btn-primary:hover { color: #fff; box-shadow: 0 14px 28px -10px rgba(13, 148, 136, .8); }
.btn-ghost {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .22);
  color: #e6fffb;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn-outline {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--navy-900);
}
.btn-outline:hover { border-color: var(--teal-600); color: var(--teal); }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  background: var(--teal-50);
  color: var(--teal);
  border: 1px solid var(--teal-100);
  white-space: nowrap;
}
.badge-neutral { background: #f1f5f9; color: var(--ink-soft); border-color: var(--line); }
.badge-amber { background: var(--amber-50); color: var(--amber); border-color: #fed7aa; }
.badge-red { background: var(--red-50); color: var(--red); border-color: #fecdca; }
.badge-blue { background: var(--blue-50); color: var(--blue); border-color: #dbeafe; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

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

.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(1200px 600px at 78% -10%, #164e63 0%, transparent 55%),
              radial-gradient(900px 500px at 8% 110%, #0f3d3a 0%, transparent 60%),
              linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 55%, #0a2436 100%);
  color: #e6eef5;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .10) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), transparent 85%);
  opacity: .5;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94, 234, 212, .35), transparent);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 56px;
  align-items: center;
  padding-top: 76px;
  padding-bottom: 76px;
}

.hero-copy h1 {
  margin: 0 0 22px;
  font-size: clamp(2.25rem, 4.2vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -.03em;
  font-weight: 700;
  color: #fff;
}
.hero-copy h1 .accent {
  background: linear-gradient(90deg, #5eead4, #7dd3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy .eyebrow { color: #5eead4; }
.hero-lead {
  margin: 0 0 30px;
  max-width: 560px;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.7;
  color: #b9c9d6;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 34px; }

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hero-points li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: #9fb3c4;
}
.hero-points svg { flex-shrink: 0; }

.hero-visual { position: relative; }
.hero-visual img { width: 100%; height: auto; filter: drop-shadow(0 40px 60px rgba(0, 0, 0, .35)); }

/* --------------------------------------------------------------------------
   Stats
   -------------------------------------------------------------------------- */

.stats {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 26px 0;
}
.stat {
  padding: 6px 26px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--navy-900);
  line-height: 1.2;
}
.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Generic sections
   -------------------------------------------------------------------------- */

.section { padding: 78px 0; }
.section-sm { padding: 56px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--navy-950), var(--navy-900));
  color: #dce7f0;
}
.section-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .4;
  pointer-events: none;
}
.section-dark .section-head h2 { color: #fff; }
.section-dark .section-head p { color: #a9bccb; }

.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head h2 {
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--navy-900);
}
.section-head p { margin: 0; color: var(--muted); font-size: 16.5px; }

.hero-inner > *,
.page-layout > *,
.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.two-col > *,
.stats-grid > *,
.flow > *,
.requirement-grid > * { min-width: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card h3 {
  margin: 0 0 8px;
  font-size: 16.5px;
  letter-spacing: -.01em;
  color: var(--navy-900);
}
.card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.65; }
.card .card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--teal-50);
  color: var(--teal);
  margin-bottom: 16px;
  border: 1px solid var(--teal-100);
}
.card .card-icon svg { width: 21px; height: 21px; }
.feature-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.feature-card:hover {
  transform: translateY(-3px);
  border-color: #c7ddd9;
  box-shadow: var(--shadow);
}

.card-dark {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .1);
  box-shadow: none;
}
.card-dark h3 { color: #fff; }
.card-dark p { color: #a9bccb; }
.card-dark .card-icon { background: rgba(20, 184, 166, .12); border-color: rgba(94, 234, 212, .2); color: #5eead4; }

/* Page link cards */
.link-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  height: 100%;
}
.link-card:hover { color: var(--ink); transform: translateY(-3px); border-color: #c7ddd9; box-shadow: var(--shadow); }
.link-card .link-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.link-card h3 { margin: 0; font-size: 16px; color: var(--navy-900); }
.link-card p { margin: 0; font-size: 13.5px; color: var(--muted); flex: 1; }
.link-card .go { color: var(--teal); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.link-card .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: .08em;
}

/* Flow / steps */
.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: flow;
}
.flow li {
  position: relative;
  margin: 0;
  padding: 22px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.flow li::before {
  counter-increment: flow;
  content: "0" counter(flow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--navy-900);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.flow li::after {
  content: "";
  position: absolute;
  top: 39px;
  right: -19px;
  width: 18px;
  height: 1px;
  background: var(--line-strong);
}
.flow li:last-child::after { display: none; }
.flow h3 { margin: 0 0 6px; font-size: 15px; color: var(--navy-900); }
.flow p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* Compliance strip */
.compliance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.compliance-item {
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
}
.compliance-item strong { display: block; color: #fff; font-size: 15px; margin-bottom: 4px; }
.compliance-item span { display: block; font-size: 13px; color: #9fb3c4; line-height: 1.55; }
.compliance-item .tag { font-family: var(--font-mono); font-size: 11px; color: #5eead4; letter-spacing: .08em; margin-bottom: 10px; display: block; }

/* --------------------------------------------------------------------------
   Inner page hero
   -------------------------------------------------------------------------- */

.page-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 320px at 85% -40%, rgba(20, 184, 166, .14), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f2f7f7 100%);
  border-bottom: 1px solid var(--line);
  padding: 46px 0 52px;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(15, 35, 55, .075) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(105deg, transparent 35%, #000 100%);
  -webkit-mask-image: linear-gradient(105deg, transparent 35%, #000 100%);
  pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 12.5px;
  color: var(--muted);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--teal); }
.breadcrumbs span.sep { color: var(--line-strong); }
.page-hero h1 {
  margin: 0 0 14px;
  max-width: 900px;
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -.028em;
  color: var(--navy-900);
}
.page-lead {
  margin: 0;
  max-width: 760px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

/* --------------------------------------------------------------------------
   Page layout / prose
   -------------------------------------------------------------------------- */

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 56px;
  padding-top: 52px;
  padding-bottom: 84px;
  align-items: start;
}
.prose { min-width: 0; max-width: 820px; }
.prose > h2 {
  margin: 52px 0 18px;
  padding-top: 10px;
  font-size: clamp(1.45rem, 2.2vw, 1.8rem);
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--navy-900);
}
.prose > h2:first-child { margin-top: 0; }
.prose > h3 {
  margin: 34px 0 12px;
  font-size: 1.16rem;
  letter-spacing: -.01em;
  color: var(--navy-900);
}
.prose > h4 {
  margin: 26px 0 10px;
  font-size: 1rem;
  color: var(--navy-900);
}
.prose p, .prose li { color: var(--ink-soft); }
.prose > p { font-size: 16px; line-height: 1.75; }
.prose ul, .prose ol { margin: 0 0 1.2em; }
.prose li { font-size: 15.5px; line-height: 1.7; }
.prose li::marker { color: var(--teal-600); }
.prose strong { color: var(--navy-900); }
.prose code {
  font-family: var(--font-mono);
  font-size: .86em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--teal-50);
  color: #0b5c55;
  border: 1px solid #d5ece8;
  white-space: nowrap;
}
.prose a { text-decoration: underline; text-decoration-color: rgba(15, 118, 110, .35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }

.prose .lead-note {
  font-size: 17px;
  color: var(--ink-soft);
}

/* TOC */
.page-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.toc {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.toc-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 6px 0 6px 10px;
  margin-left: -19px;
  border-left: 2px solid transparent;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  transition: color .15s ease, border-color .15s ease;
}
.toc a:hover { color: var(--teal); }
.toc a.active { color: var(--teal); border-left-color: var(--teal); font-weight: 600; background: linear-gradient(90deg, var(--teal-50), transparent); }

/* --------------------------------------------------------------------------
   Figures
   -------------------------------------------------------------------------- */

.figure {
  margin: 26px 0 30px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.figure-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #fff;
  border-radius: 10px;
  cursor: zoom-in;
  overflow: hidden;
}
.figure-media img { width: 100%; height: auto; margin: 0 auto; }
.figure-media::after {
  content: "Увеличить";
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(11, 31, 51, .78);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .03em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.figure-media:hover::after { opacity: 1; transform: translateY(0); }
.figure figcaption {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrap {
  margin: 22px 0 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 560px;
}
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #eef2f6;
  vertical-align: top;
  color: var(--ink-soft);
  line-height: 1.55;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfdfe; }
td code, th code { white-space: nowrap; }
.table-compact { font-size: 13px; }
.table-compact tbody td { padding: 10px 14px; }
.table-compact thead th { padding: 10px 14px; }

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

.code-block {
  position: relative;
  margin: 20px 0 26px;
  border-radius: var(--radius);
  background: #0a1a2a;
  border: 1px solid #132c43;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  background: #0d2135;
  border-bottom: 1px solid #17324a;
}
.code-head .file {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #7f9ab0;
  letter-spacing: .02em;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid #24445f;
  background: transparent;
  color: #9fb8cb;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.copy-btn:hover { background: #17324a; color: #e2f2ef; }
.copy-btn.copied { color: #5eead4; border-color: #0f766e; }
.code-block pre {
  margin: 0;
  padding: 18px 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.8px;
  line-height: 1.72;
  color: #cfe0ec;
  tab-size: 2;
}
.code-block code { font-family: inherit; padding: 0; background: none; border: 0; color: inherit; font-size: inherit; white-space: pre; }
.code-block .c { color: #6f8ba1; }
.code-block .k { color: #7dd3fc; }
.code-block .s { color: #86efac; }
.code-block .n { color: #fcd34d; }
.code-block .p { color: #c4b5fd; }

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

.callout {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  margin: 24px 0 28px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal-600);
  background: var(--teal-50);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.callout .callout-icon { color: var(--teal); margin-top: 1px; }
.callout p { margin: 0 0 .6em; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--navy-900); }
.callout-title {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal);
}
.callout-warn { border-left-color: var(--amber); background: var(--amber-50); border-color: #fde3c6; }
.callout-warn .callout-icon, .callout-warn .callout-title { color: var(--amber); }
.callout-danger { border-left-color: var(--red); background: var(--red-50); border-color: #fbd5d1; }
.callout-danger .callout-icon, .callout-danger .callout-title { color: var(--red); }
.callout-blue { border-left-color: var(--blue); background: var(--blue-50); border-color: #d9e7fd; }
.callout-blue .callout-icon, .callout-blue .callout-title { color: var(--blue); }
.callout-neutral { border-left-color: var(--muted); background: #f8fafc; }
.callout-neutral .callout-icon, .callout-neutral .callout-title { color: var(--muted); }

/* --------------------------------------------------------------------------
   Misc content components
   -------------------------------------------------------------------------- */

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 22px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-600); }

.kv-list {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px 18px;
  margin: 18px 0 24px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.kv-list dt { font-size: 13px; font-weight: 600; color: var(--navy-900); }
.kv-list dd { margin: 0; font-size: 13.5px; color: var(--muted); }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 22px 0 28px;
}
.two-col .card { height: 100%; }

.checklist { list-style: none; padding: 0; margin: 20px 0 26px; display: grid; gap: 10px; }
.checklist li {
  position: relative;
  padding: 12px 16px 12px 44px;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 15px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--teal-600);
  background: var(--teal-50);
}
.checklist li::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 19px;
  width: 8px;
  height: 4px;
  border-left: 1.6px solid var(--teal);
  border-bottom: 1.6px solid var(--teal);
  transform: rotate(-45deg);
}

.requirement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 24px 0 30px; }
.req-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.req-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.req-num { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); letter-spacing: .08em; }
.req-card h3 { margin: 0; font-size: 14.5px; line-height: 1.4; color: var(--navy-900); }
.req-card p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.req-card .badge { align-self: flex-start; font-size: 10.5px; padding: 3px 8px; }

.next-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.next-nav a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: var(--muted);
}
.next-nav a:hover { color: var(--teal); }
.next-nav a strong { font-size: 14.5px; color: var(--navy-900); font-weight: 600; }
.next-nav a:hover strong { color: var(--teal); }
.next-nav .next { text-align: right; margin-left: auto; }

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

.site-footer {
  background: var(--navy-950);
  color: #8fa3b5;
  padding: 56px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.footer-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; margin-bottom: 14px; }
.footer-brand img { width: 28px; height: 31px; }
.footer-about { margin: 0; max-width: 360px; font-size: 13px; line-height: 1.7; color: #8fa3b5; }
.footer-col h4 {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #c8d6e2;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0 0 7px; }
.footer-col a { color: #8fa3b5; font-size: 13px; }
.footer-col a:hover { color: #5eead4; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 22px;
  font-size: 12px;
  color: #6c8193;
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: rgba(4, 12, 20, .86);
  backdrop-filter: blur(4px);
  overflow: auto;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  width: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, .5);
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .16); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .site-nav a { padding: 8px 8px; font-size: 13px; }
  .page-layout { grid-template-columns: minmax(0, 1fr) 220px; gap: 36px; }
  .hero-inner { gap: 36px; }
}

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 56px; padding-bottom: 56px; }
  .hero-visual { max-width: 560px; margin: 0 auto; width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 18px 0; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow li::after { display: none; }
  .compliance-grid { grid-template-columns: 1fr; }
  .page-layout { grid-template-columns: 1fr; gap: 32px; }
  .page-aside { position: static; order: -1; }
  .toc {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    background: var(--surface);
  }
  .toc ul { display: flex; flex-wrap: wrap; gap: 4px 6px; }
  .toc a { margin: 0; border: 0; padding: 5px 10px; border-radius: 999px; background: #f4f7fa; font-size: 12.5px; }
  .toc a.active { background: var(--teal-50); border: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .requirement-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 30px -20px rgba(15, 35, 55, .25);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 12px; font-size: 14px; }
  .header-inner { position: relative; }
  .lightbox { display: none; padding: 72px 16px 30px; align-items: flex-start; }
  .lightbox.open { display: block; }
  .lightbox img { max-width: none; max-height: none; width: auto; margin: 0 auto; }
  .lightbox-close { position: fixed; }
}

@media (max-width: 680px) {
  .container { padding: 0 18px; }
  .section { padding: 56px 0; }
  .page-hero { padding: 34px 0 38px; }
  .page-layout { padding-top: 32px; padding-bottom: 56px; }
  .grid-2, .grid-3, .grid-4, .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; padding: 18px 0; }
  .stat { padding: 4px 16px; }
  .stat-value { font-size: 18px; }
  .flow { grid-template-columns: 1fr; }
  .hero-copy h1 { font-size: 2rem; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .figcaption { font-size: 12px; }
  .kv-list { grid-template-columns: 1fr; gap: 4px; }
  .kv-list dd { margin-bottom: 10px; }
  .next-nav { flex-direction: column; }
  .next-nav .next { text-align: left; margin-left: 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; }
  .code-block pre { font-size: 11.8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  .site-header, .site-footer, .page-aside, .next-nav, .lightbox { display: none !important; }
  .page-layout { display: block; }
  body { background: #fff; }
  .figure, .card, .code-block { break-inside: avoid; }
}
