:root {
  --navy: #0e2a47;
  --navy-2: #163a5f;
  --ink: #17202b;
  --body: #2c3642;
  --muted: #5d6874;
  --paper: #f7f6f2;
  --card: #ffffff;
  --line: #e2dfd6;
  --green: #0b8a60;
  --green-lit: #34d399;
  --amber: #b7791f;
  --radius: 10px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --head: "Sora", "IBM Plex Sans", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--paper); color: var(--body); font: 16px/1.6 var(--sans); }
img, svg { max-width: 100%; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- header + nav ---------- */
.site-head { position: sticky; top: 0; z-index: 50; background: var(--navy); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.head-row { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 600 18px/1 var(--head); letter-spacing: -.01em; white-space: nowrap; }
.brand b { color: var(--green-lit); font-weight: 700; }
.brand:hover { color: inherit; }
.mark { width: 30px; height: 30px; flex: none; }
.mark rect { fill: var(--navy-2); }
.mark path { fill: none; stroke: var(--green-lit); stroke-width: 2.6; }
.site-foot .mark rect { fill: var(--navy); }

.menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; position: relative; }
.menu-btn span:first-child, .menu-btn span:first-child::before, .menu-btn span:first-child::after {
  position: absolute; left: 11px; width: 22px; height: 2px; background: #fff; content: ""; transition: transform .2s;
}
.menu-btn span:first-child { top: 21px; }
.menu-btn span:first-child::before { left: 0; top: -7px; }
.menu-btn span:first-child::after { left: 0; top: 7px; }
.menu-btn[aria-expanded="true"] span:first-child { background: transparent; }
.menu-btn[aria-expanded="true"] span:first-child::before { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:first-child::after { transform: translateY(-7px) rotate(-45deg); }

.site-nav { margin-left: auto; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; }
.dd { position: relative; }
.dd > button {
  display: flex; align-items: center; gap: 5px; height: 64px; padding: 0 8px; border: 0; background: none;
  color: #dbe6f1; font: 500 13.5px/1 var(--sans); cursor: pointer; white-space: nowrap;
}
.dd > button svg { width: 9px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.6; opacity: .7; }
.dd > button:hover, .dd.open > button { color: #fff; }
.panel {
  display: none; position: absolute; top: 100%; left: 0; min-width: 270px; max-height: calc(100vh - 80px); overflow-y: auto;
  background: var(--card); color: var(--ink); border-radius: 0 0 var(--radius) var(--radius); padding: 14px 8px 12px;
  box-shadow: 0 18px 40px rgba(14,42,71,.22); border-top: 3px solid var(--green-lit);
}
.panel-h { margin: 0 10px 6px; font: 600 11px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.panel ul { list-style: none; margin: 0; padding: 0; }
.panel a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.35; }
.panel a:hover, .panel a:focus { background: #eef6f2; color: var(--green); }
.dd.mid .panel { min-width: 520px; }
.dd.mid .panel ul { columns: 2; column-gap: 8px; }
.head-row { position: relative; }
@media (min-width: 1181px) {
  .dd.wide { position: static; }
  .dd.wide .panel { left: 16px; right: 16px; min-width: 0; }
}
.dd.wide .panel ul { columns: 4; column-gap: 8px; }
.panel li { break-inside: avoid; }
.dd:nth-last-child(-n+7) .panel { left: auto; right: 0; }
.dd.open .panel { display: block; }
@media (hover: hover) and (min-width: 1181px) {
  .dd:hover .panel { display: block; }
}

@media (max-width: 1180px) {
  .menu-btn { display: block; }
  .site-nav {
    display: none; position: fixed; inset: 64px 0 0 0; background: var(--navy); overflow-y: auto; padding: 8px 16px 40px;
  }
  .site-nav.open { display: block; }
  .nav-list { display: block; }
  .dd { border-bottom: 1px solid rgba(255,255,255,.1); }
  .dd > button { width: 100%; justify-content: space-between; height: 52px; padding: 0 4px; font-size: 16px; }
  .dd.open > button svg { transform: rotate(180deg); }
  .panel, .dd.mid .panel, .dd.wide .panel, .dd:nth-last-child(-n+7) .panel {
    position: static; min-width: 0; max-height: none; box-shadow: none; border: 0; border-radius: 8px; margin-bottom: 12px;
  }
  .dd.mid .panel ul, .dd.wide .panel ul { columns: 1; }
  .panel-h { display: none; }
  body.nav-open { overflow: hidden; }
}
@media (min-width: 640px) and (max-width: 1180px) {
  .dd.mid .panel ul, .dd.wide .panel ul { columns: 2; }
}

/* ---------- page hero + layout ---------- */
.page-hero { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 28px 0 40px; }
.crumbs ol { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 13px; color: #a9bdd1; }
.crumbs li:not(:last-child)::after { content: "/"; margin: 0 8px; opacity: .5; }
.crumbs a { color: #cfe0ef; text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.kicker { margin: 0 0 8px; font: 600 12px/1.4 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--green-lit); }
h1, h2, h3 { font-family: var(--head); color: var(--ink); letter-spacing: -.015em; }
.page-hero h1 { color: #fff; font-size: clamp(28px, 4.4vw, 44px); line-height: 1.15; margin: 0; max-width: 860px; font-weight: 700; }
.byline { margin: 14px 0 0; font-size: 14px; color: #a9bdd1; }

.page-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding-top: 40px; padding-bottom: 24px; }
.page-grid.no-toc { grid-template-columns: minmax(0, 1fr); }
.page-grid.no-toc .prose { max-width: 760px; }
.toc { position: sticky; top: 88px; align-self: start; font-size: 14px; max-height: calc(100vh - 110px); overflow-y: auto; }
.toc p { margin: 0 0 10px; font: 600 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover, .toc a.on { color: var(--green); border-left-color: var(--green); }
@media (max-width: 900px) {
  .page-grid { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 24px; }
  .toc { position: static; max-height: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 28px; }
}

/* ---------- prose ---------- */
.prose { max-width: 760px; font: 18px/1.7 var(--serif); color: var(--body); min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose .lede { font-size: 20px; line-height: 1.6; color: var(--ink); }
.prose h2 { font-size: clamp(23px, 2.6vw, 29px); line-height: 1.25; margin: 2em 0 .6em; font-weight: 700; }
.prose h3 { font-size: 20px; line-height: 1.35; margin: 1.6em 0 .5em; font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--green); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code { font: .86em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: #eceae3; padding: .12em .35em; border-radius: 4px; }
.prose pre { background: #12202f; color: #e3edf7; padding: 16px; border-radius: var(--radius); overflow-x: auto; font-size: 14px; line-height: 1.55; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--green-lit); color: var(--ink); font-style: italic; }
.prose .table-wrap, .prose table { margin: 1.4em 0; }
.prose .table-wrap { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font: 15px/1.5 var(--sans); background: var(--card); }
.prose .table-wrap table { margin: 0; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: #eef3f0; color: var(--ink); font-weight: 600; }
.prose .callout { font: 16px/1.6 var(--sans); background: #eaf6f0; border: 1px solid #c6e8d7; border-radius: var(--radius); padding: 14px 18px; margin: 1.6em 0; color: var(--ink); }
.prose .callout.warn { background: #fdf5e7; border-color: #f0dcb4; }
.prose .callout > :last-child { margin-bottom: 0; }
.prose details { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); margin: 0 0 10px; font-family: var(--sans); font-size: 16px; }
.prose summary { cursor: pointer; padding: 14px 44px 14px 16px; font-weight: 600; color: var(--ink); list-style: none; position: relative; }
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after { content: "+"; position: absolute; right: 16px; top: 10px; font-size: 22px; color: var(--green); }
.prose details[open] summary::after { content: "\2212"; }
.prose details > :not(summary) { padding: 0 16px; }
.prose details > :last-child { padding-bottom: 14px; margin-bottom: 0; }
.prose .steps { counter-reset: s; list-style: none; padding: 0; }
.prose .steps > li { counter-increment: s; position: relative; padding-left: 46px; margin: 0 0 1em; }
.prose .steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 2px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy); color: #fff; font: 600 14px/30px var(--sans); text-align: center;
}

/* ---------- related + cards ---------- */
.related { margin: 24px 0 56px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.related h2 { margin: 0 0 14px; font-size: 18px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 24px; }
.related a { text-decoration: none; font-size: 15px; }
.related a:hover { text-decoration: underline; }
.intro { padding-top: 32px; }
.cards { list-style: none; margin: 8px 0 64px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card a { display: flex; flex-direction: column; height: 100%; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--body); transition: border-color .15s, transform .15s; }
.card a:hover { border-color: var(--green); transform: translateY(-2px); }
.card h2 { font-size: 19px; line-height: 1.3; margin: 0 0 10px; }
.card p { margin: 0 0 14px; font-size: 15px; flex: 1; }
.card .more { color: var(--green); font-weight: 600; font-size: 14px; }

/* ---------- home ---------- */
.home-hero { background: radial-gradient(1200px 500px at 85% -10%, #1f5a7d 0%, transparent 60%), var(--navy); color: #fff; padding: 64px 0 72px; }
.home-hero h1 { color: #fff; font-size: clamp(32px, 5.4vw, 56px); line-height: 1.08; margin: 0 0 18px; max-width: 900px; font-weight: 700; }
.home-hero p { font-size: 19px; line-height: 1.6; color: #cfe0ef; max-width: 680px; margin: 0 0 28px; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 8px; font-weight: 600; text-decoration: none; font-size: 15px; }
.btn.primary { background: var(--green-lit); color: var(--navy); }
.btn.primary:hover { background: #6ee7b7; color: var(--navy); }
.btn.ghost { border: 1px solid rgba(255,255,255,.35); color: #fff; }
.btn.ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.home section.band { padding: 64px 0; }
.home section.band.alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.home h2 { font-size: clamp(25px, 3.2vw, 34px); line-height: 1.2; margin: 0 0 12px; }
.home .sub { max-width: 720px; color: var(--muted); font-size: 17px; margin: 0 0 32px; }
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.topic { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 16px; scroll-margin-top: 84px; }
.band.alt .topic { background: var(--paper); }
.topic h3 { margin: 0 0 10px; font-size: 18px; }
.topic ul { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.topic li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.topic li:last-child { border-bottom: 0; }
.topic a { text-decoration: none; color: var(--body); }
.topic a:hover { color: var(--green); }
.topic .count { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.grid3 h3 { font-size: 18px; margin: 0 0 8px; }
.grid3 p { margin: 0; }
.grid3 .num { font: 700 13px/1 var(--sans); color: var(--green); letter-spacing: .08em; display: block; margin-bottom: 10px; }
.home .prose { max-width: 820px; }
.home .faq { max-width: 820px; }

/* ---------- footer ---------- */
.site-foot { background: #0b2038; color: #b6c7d8; padding: 52px 0 0; font-size: 14.5px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin: 0 0 7px; }
.foot-grid a { color: #dbe6f1; text-decoration: none; }
.foot-grid a:hover { color: var(--green-lit); }
.foot-about p { max-width: 380px; margin: 16px 0 0; line-height: 1.6; }
.foot-about .brand { color: #fff; }
.foot-h { margin: 0 0 12px; color: #fff; font-weight: 600; }
.foot-base { border-top: 1px solid rgba(255,255,255,.08); margin-top: 40px; padding-top: 18px; padding-bottom: 28px; font-size: 13px; color: #8ea3b8; }
.foot-base p { margin: 0; }
@media (max-width: 760px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-about { grid-column: 1 / -1; }
  .prose { font-size: 17px; }
  .prose .lede { font-size: 18.5px; }
  .home-hero { padding: 44px 0 52px; }
  .home section.band { padding: 44px 0; }
}
@media (max-width: 640px) {
  .prose .table-wrap table { min-width: 560px; }
}
.prose a, .prose code { overflow-wrap: anywhere; }
