/* =========================================================================
   Geospatial Data Mesh — design system
   Light, professional palette: deep teal/azure with earth-green & amber accents
   ========================================================================= */

:root {
  /* Palette */
  --c-teal: #0e7490;
  --c-teal-dark: #155e75;
  --c-teal-darker: #134e5e;
  --c-teal-50: #ecfeff;
  --c-teal-100: #cffafe;
  --c-azure: #0ea5e9;
  --c-green: #2f9e44;
  --c-green-600: #1a7f37;
  --c-amber: #e8590c;
  --c-amber-bright: #f08c00;
  --c-pink: #db2777;
  --c-violet: #7c3aed;

  /* Neutrals */
  --c-bg: #f5fafb;
  --c-bg-grad-1: #f0f9fb;
  --c-bg-grad-2: #eef6f4;
  --c-surface: #ffffff;
  --c-surface-2: #f3f8f9;
  --c-ink: #15323b;
  --c-text: #25434c;
  --c-text-soft: #51707a;
  --c-border: #d8e6e9;
  --c-border-soft: #e7f0f2;

  --c-link: #0e7490;
  --c-link-hover: #0b566b;

  /* Code */
  --c-code-bg: #f1f8fa;
  --c-code-inline-bg: #e4f3f6;
  --c-code-border: #d3e7eb;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Code", "JetBrains Mono", "Fira Code", Menlo, Consolas, "Liberation Mono", monospace;

  /* Metrics */
  --header-h: 72px;
  --content-max: 1320px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 60, 70, .06), 0 2px 6px rgba(16, 60, 70, .05);
  --shadow-md: 0 6px 20px rgba(16, 60, 70, .09), 0 2px 6px rgba(16, 60, 70, .06);
  --shadow-lg: 0 18px 48px rgba(16, 60, 70, .14);
}

/* ----------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-sans);
  color: var(--c-text);
  background: linear-gradient(170deg, var(--c-bg-grad-1), var(--c-bg-grad-2) 60%, var(--c-bg));
  line-height: 1.7;
  font-size: 1.02rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--c-link); text-decoration: none; }

.container {
  width: min(100% - 2.5rem, var(--content-max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -120px;
  z-index: 200;
  background: var(--c-teal);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  transition: top .2s ease;
}
.skip-link:focus { top: .75rem; }

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

/* ---------------------------------------------------------------- Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--c-border-soft);
  box-shadow: var(--shadow-sm);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--c-ink);
}
.brand__mark {
  width: 40px; height: 40px;
  filter: drop-shadow(0 2px 4px rgba(16, 60, 70, .18));
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.06); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-weight: 750; letter-spacing: -.01em; font-size: 1.06rem; }
.brand__sub { font-size: .74rem; color: var(--c-text-soft); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }

.primary-nav__list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .85rem;
  border-radius: 999px;
  color: var(--c-text);
  font-weight: 600;
  font-size: .95rem;
  position: relative;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.nav-icon {
  width: 19px; height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--c-teal);
  transition: transform .2s ease;
}
.nav-link:hover { background: var(--c-teal-50); color: var(--c-teal-dark); transform: translateY(-1px); }
.nav-link:hover .nav-icon { transform: scale(1.12); }
.nav-link.is-active {
  background: linear-gradient(135deg, var(--c-teal), var(--c-teal-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(14, 116, 144, .32);
}
.nav-link.is-active .nav-icon { color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 40px;
  padding: 0 9px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle__bar {
  height: 2.5px; width: 100%;
  background: var(--c-teal-dark);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ------------------------------------------------------------------ Main */
.site-main { flex: 1 0 auto; }

/* ------------------------------------------------------------------ Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem);
  background:
    radial-gradient(1100px 460px at 78% -8%, rgba(14, 165, 233, .14), transparent 60%),
    radial-gradient(900px 420px at 8% 0%, rgba(47, 158, 68, .12), transparent 55%);
}
.hero__inner { text-align: center; }
.hero__logo {
  width: clamp(108px, 16vw, 168px);
  height: auto;
  margin: 0 auto 1.4rem;
  filter: drop-shadow(0 14px 30px rgba(16, 60, 70, .26));
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.hero__title {
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  font-weight: 800;
  color: var(--c-ink);
  text-wrap: balance;
}
.hero__title span {
  display: block;
  background: linear-gradient(100deg, var(--c-teal), var(--c-azure) 55%, var(--c-green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: .62em;
  margin-top: .35rem;
}
.hero__tagline {
  font-size: 1.2rem;
  color: var(--c-teal-dark);
  font-weight: 600;
  margin-top: 1rem;
}
.hero__lede {
  max-width: 760px;
  margin: 1.5rem auto 0;
  color: var(--c-text);
}
.hero__lede p + p { margin-top: .9rem; }
.hero__lede strong { color: var(--c-teal-dark); }

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.2rem;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  text-align: left;
  padding: .85rem 1.3rem .85rem .9rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--c-ink);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, border-color .22s ease;
}
.cta:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cta__icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  flex: none;
}
.cta__icon svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cta--teal .cta__icon { background: linear-gradient(135deg, var(--c-teal), var(--c-azure)); }
.cta--green .cta__icon { background: linear-gradient(135deg, var(--c-green), #12b886); }
.cta--amber .cta__icon { background: linear-gradient(135deg, var(--c-amber-bright), #f76707); }
.cta--teal:hover { border-color: var(--c-teal); }
.cta--green:hover { border-color: var(--c-green); }
.cta--amber:hover { border-color: var(--c-amber-bright); }
.cta__text { display: flex; flex-direction: column; line-height: 1.25; }
.cta__text strong { font-size: 1.02rem; }
.cta__text small { color: var(--c-text-soft); font-size: .82rem; }

/* --------------------------------------------------------- Home sections */
.home-intro { margin-top: clamp(2rem, 5vw, 3.5rem); text-align: center; }
.section-heading {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--c-ink);
  letter-spacing: -.01em;
}
.section-heading__lede { max-width: 720px; margin: .8rem auto 0; color: var(--c-text-soft); }

.sections {
  margin-top: 2rem;
  margin-bottom: clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1.5rem;
}
.section-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.section-card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 4px;
}
.section-card--teal::before { background: linear-gradient(90deg, var(--c-teal), var(--c-azure)); }
.section-card--green::before { background: linear-gradient(90deg, var(--c-green), #12b886); }
.section-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.section-card__head { display: flex; gap: 1rem; align-items: flex-start; }
.section-card__icon {
  flex: none;
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  color: #fff;
}
.section-card--teal .section-card__icon { background: linear-gradient(135deg, var(--c-teal), var(--c-azure)); }
.section-card--green .section-card__icon { background: linear-gradient(135deg, var(--c-green), #12b886); }
.section-card__icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.section-card__title { font-size: 1.28rem; line-height: 1.2; color: var(--c-ink); }
.section-card__title a { color: inherit; }
.section-card__title a:hover { color: var(--c-teal); }
.section-card__desc { margin-top: .5rem; color: var(--c-text-soft); font-size: .95rem; }
.section-card__topics {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  display: grid;
  gap: .15rem;
  border-top: 1px dashed var(--c-border);
  padding-top: 1rem;
}
.section-card__topics a {
  display: block;
  padding: .4rem .6rem;
  border-radius: 8px;
  color: var(--c-text);
  font-weight: 550;
  font-size: .94rem;
  transition: background .18s ease, color .18s ease, padding-left .18s ease;
}
.section-card__topics a:hover { background: var(--c-teal-50); color: var(--c-teal-dark); padding-left: .95rem; }
.section-card__more {
  margin-top: 1.2rem;
  font-weight: 700;
  color: var(--c-teal);
  align-self: flex-start;
}
.section-card__more span { transition: transform .2s ease; display: inline-block; }
.section-card__more:hover span { transform: translateX(4px); }

/* ----------------------------------------------------- Content + sidebar */
.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
  padding: 2rem 0 4rem;
}
.prose { min-width: 0; }

/* Breadcrumbs */
.breadcrumbs { margin-bottom: 1.3rem; }
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .1rem;
  padding: 0;
  font-size: .85rem;
  color: var(--c-text-soft);
}
.breadcrumbs li { display: inline-flex; align-items: center; }
.breadcrumbs li + li::before {
  content: "›";
  margin: 0 .5rem;
  color: var(--c-border);
  font-weight: 700;
}
.breadcrumbs a {
  color: var(--c-text-soft);
  border-radius: 6px;
  padding: .1rem .25rem;
  transition: color .18s ease, background .18s ease;
}
.breadcrumbs a:hover { color: var(--c-teal); background: var(--c-teal-50); }
.breadcrumbs [aria-current="page"] { color: var(--c-teal-dark); font-weight: 650; }

/* Section navigation (sidebar) */
.section-nav { position: sticky; top: calc(var(--header-h) + 1.2rem); }
.section-nav__inner {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.2rem 1.1rem;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - var(--header-h) - 3rem);
  overflow: auto;
}
.section-nav__title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-text-soft); margin-bottom: .8rem; }
.section-nav__title a { color: var(--c-teal-dark); }
.section-nav__list, .section-nav__list ul { list-style: none; padding: 0; }
.section-nav__list { display: grid; gap: .12rem; }
.section-nav__list a {
  display: block;
  padding: .45rem .7rem;
  border-radius: 8px;
  color: var(--c-text);
  font-size: .92rem;
  font-weight: 550;
  border-left: 3px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.section-nav__list a:hover { background: var(--c-teal-50); color: var(--c-teal-dark); }
.section-nav__list a.is-current {
  background: var(--c-teal-50);
  color: var(--c-teal-dark);
  border-left-color: var(--c-teal);
  font-weight: 700;
}
.section-nav__list ul { margin: .15rem 0 .35rem .55rem; padding-left: .55rem; border-left: 1px solid var(--c-border); }
.section-nav__list ul a { font-size: .87rem; padding: .35rem .6rem; }

/* ----------------------------------------------------------- Prose typography */
.prose h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 800;
  margin-bottom: 1.1rem;
  background: linear-gradient(100deg, var(--c-teal-dark), var(--c-teal) 45%, var(--c-azure));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}
.prose h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  color: var(--c-ink);
  letter-spacing: -.01em;
  margin-top: 2.6rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--c-border-soft);
  position: relative;
}
.prose h2::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 64px; height: 2px;
  background: linear-gradient(90deg, var(--c-teal), var(--c-azure));
}
.prose h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); color: var(--c-teal-dark); margin-top: 1.9rem; }
.prose h4 { font-size: 1.1rem; color: var(--c-teal-darker); margin-top: 1.5rem; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { scroll-margin-top: calc(var(--header-h) + 16px); }
.prose p { margin-top: 1rem; }
.prose > p:first-of-type, .prose .breadcrumbs + p { font-size: 1.08rem; }
.prose ul, .prose ol { margin-top: 1rem; padding-left: 1.4rem; }
.prose li { margin-top: .4rem; }
.prose li::marker { color: var(--c-teal); }
.prose strong { color: var(--c-teal-darker); font-weight: 700; }
.prose blockquote {
  margin: 1.4rem 0;
  padding: .8rem 1.2rem;
  border-left: 4px solid var(--c-teal);
  background: var(--c-teal-50);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--c-teal-darker);
}
.prose hr { border: 0; height: 1px; background: var(--c-border); margin: 2.5rem 0; }

/* Heading anchors */
.heading-anchor {
  color: var(--c-border);
  text-decoration: none;
  margin-left: -1.1em;
  padding-right: .25em;
  opacity: 0;
  font-weight: 600;
  transition: opacity .15s ease, color .15s ease;
}
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor { opacity: 1; }
.heading-anchor:hover { color: var(--c-teal); }

/* Links in prose */
.prose a:not(.related__card):not(.heading-anchor) {
  color: var(--c-link);
  font-weight: 550;
  text-decoration: underline;
  text-decoration-color: rgba(14, 116, 144, .35);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color .18s ease, text-decoration-color .18s ease, background .18s ease;
  border-radius: 3px;
}
.prose a:not(.related__card):not(.heading-anchor):hover {
  color: var(--c-link-hover);
  text-decoration-color: var(--c-link-hover);
  background: var(--c-teal-50);
}
.prose a.external-link::after {
  content: "↗";
  font-size: .8em;
  margin-left: .15em;
  color: var(--c-text-soft);
  vertical-align: super;
  line-height: 0;
}

/* --------------------------------------------------------- Inline code */
:not(pre) > code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--c-code-inline-bg);
  color: var(--c-teal-darker);
  padding: .12em .4em;
  border-radius: 5px;
  word-break: break-word;
}

/* --------------------------------------------------------- Code blocks */
.code-block {
  margin: 1.6rem 0;
  background: var(--c-code-bg);
  border: 1px solid var(--c-code-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.code-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .55rem .4rem .9rem;
  background: linear-gradient(180deg, #eaf4f6, #e3eff1);
  border-bottom: 1px solid var(--c-code-border);
}
.code-block__lang {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--c-teal-dark);
}
.code-block__copy {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .76rem;
  font-weight: 650;
  font-family: var(--font-sans);
  color: var(--c-teal-dark);
  background: var(--c-surface);
  border: 1px solid var(--c-code-border);
  border-radius: 7px;
  padding: .28rem .6rem;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .12s ease;
}
.code-block__copy:hover { background: var(--c-teal); color: #fff; border-color: var(--c-teal); }
.code-block__copy:active { transform: scale(.96); }
.code-block__copy.is-copied { background: var(--c-green); color: #fff; border-color: var(--c-green); }
.code-block__pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: .85rem;
  line-height: 1.6;
}
.code-block__code { font-family: var(--font-mono); color: #21424b; tab-size: 2; }

/* Prism light theme — tuned to site palette */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6b8089; font-style: italic; }
.token.punctuation { color: #51707a; }
.token.namespace { opacity: .7; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { color: #0369a1; }
.token.boolean, .token.number { color: #b5530f; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #1a7f37; }
.token.operator, .token.entity, .token.url { color: #6d28a8; }
.token.atrule, .token.attr-value, .token.keyword { color: var(--c-teal); font-weight: 600; }
.token.function, .token.class-name { color: #b3411f; }
.token.regex, .token.important, .token.variable { color: #be185d; }
.token.important, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }

/* ---------------------------------------------------------- Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.6rem 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.table-wrap table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: .92rem;
}
.table-wrap thead th {
  background: linear-gradient(180deg, var(--c-teal), var(--c-teal-dark));
  color: #fff;
  text-align: left;
  font-weight: 650;
  padding: .7rem .95rem;
  white-space: nowrap;
}
.table-wrap th, .table-wrap td {
  padding: .65rem .95rem;
  border-bottom: 1px solid var(--c-border-soft);
  vertical-align: top;
}
.table-wrap tbody tr:nth-child(even) { background: var(--c-surface-2); }
.table-wrap tbody tr:hover { background: var(--c-teal-50); }
.table-wrap tbody tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------- Task lists (checkboxes) */
.contains-task-list { list-style: none; padding-left: .2rem; }
.contains-task-list .contains-task-list { padding-left: 1.4rem; }
.task-list-item { display: flex; align-items: flex-start; gap: .6rem; margin-top: .5rem; }
.task-list-item::marker { content: ""; }
.task-list-item label { display: inline; cursor: pointer; }
.task-list-item-checkbox {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 1.15em; height: 1.15em;
  margin-top: .28em;
  border: 2px solid var(--c-teal);
  border-radius: 5px;
  background: var(--c-surface);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background .15s ease, border-color .15s ease;
}
.task-list-item-checkbox::before {
  content: "";
  width: .62em; height: .62em;
  transform: scale(0);
  transform-origin: center;
  transition: transform .15s ease;
  box-shadow: inset 1em 1em #fff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.task-list-item-checkbox:checked { background: var(--c-teal); border-color: var(--c-teal); }
.task-list-item-checkbox:checked::before { transform: scale(1); }
.task-list-item:has(.task-list-item-checkbox:checked) {
  text-decoration: line-through;
  text-decoration-color: var(--c-text-soft);
  color: var(--c-text-soft);
}

/* ------------------------------------------------------------ FAQ accordion */
.prose details, details.faq {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  margin: .8rem 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.prose details[open] { box-shadow: var(--shadow-md); }
.prose summary {
  cursor: pointer;
  padding: .95rem 1.1rem;
  font-weight: 650;
  color: var(--c-teal-dark);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: background .18s ease;
}
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--c-teal);
  transition: transform .2s ease;
  line-height: 1;
}
.prose details[open] summary::after { transform: rotate(45deg); }
.prose summary:hover { background: var(--c-teal-50); }
.prose details > *:not(summary) { padding: 0 1.1rem; }
.prose details > *:not(summary):last-child { padding-bottom: 1rem; }

/* --------------------------------------------------------------- Mermaid */
.mermaid-wrap {
  margin: 1.6rem 0;
  padding: 1.2rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  text-align: center;
}
.mermaid { visibility: hidden; }
.mermaid[data-processed="true"] { visibility: visible; }

/* ----------------------------------------------------------------- KaTeX */
.katex-display { overflow-x: auto; overflow-y: hidden; padding: .5rem 0; }

/* ----------------------------------------------------------- Related links */
.related { margin-top: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--c-border-soft); }
.related__title { font-size: 1.3rem; color: var(--c-ink); margin-bottom: 1rem; }
.related__grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: .9rem;
}
.related__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .95rem 1.1rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  color: var(--c-ink);
  font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.related__card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--c-teal); }
.related__card-arrow { color: var(--c-teal); transition: transform .2s ease; }
.related__card:hover .related__card-arrow { transform: translateX(4px); }

/* ---------------------------------------------------------------- Footer */
.site-footer {
  margin-top: auto;
  background: linear-gradient(180deg, var(--c-teal-dark), var(--c-teal-darker));
  color: #d7eef2;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr;
  gap: 2.5rem;
  padding: 3rem 0 2.2rem;
}
.site-footer__brand { display: flex; gap: 1rem; align-items: flex-start; }
.site-footer__brand .brand__mark { width: 44px; height: 44px; }
.site-footer__tagline { font-size: .95rem; line-height: 1.5; color: #b7dde3; }
.site-footer__nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.6rem;
}
.footer-col__title { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: #8fd3dd; margin-bottom: .7rem; }
.footer-col__title a { color: #fff; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: .35rem; }
.footer-col a { color: #cfeaef; font-size: .9rem; transition: color .18s ease, padding-left .18s ease; }
.footer-col a:hover { color: #fff; padding-left: 4px; }
.site-footer__base {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 1.1rem 0;
}
.site-footer__base p { font-size: .82rem; color: #9fcfd6; text-align: center; }

/* --------------------------------------------------------------- Responsive */
@media (max-width: 1080px) {
  .content-layout { grid-template-columns: 1fr; }
  .section-nav { position: static; order: -1; }
  .section-nav__inner { max-height: none; }
}

@media (max-width: 820px) {
  :root { --header-h: 62px; }
  .nav-toggle { display: flex; }
  .brand__sub { display: none; }
  .primary-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: rgba(255, 255, 255, .98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-130%);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    max-height: calc(100vh - var(--header-h));
    overflow: auto;
  }
  .primary-nav.is-open { transform: translateY(0); }
  .primary-nav__list { flex-direction: column; align-items: stretch; padding: 1rem; gap: .3rem; }
  .nav-link { padding: .8rem 1rem; font-size: 1.02rem; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 2rem; }
}

@media (min-width: 1600px) {
  :root { --content-max: 1480px; }
}

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

@media print {
  .site-header, .site-footer, .section-nav, .nav-toggle, .code-block__copy, .hero__cta { display: none !important; }
  body { background: #fff; }
  .content-layout { grid-template-columns: 1fr; }
  a { color: #000; }
}
