/* ==========================================================================
   Edge Geospatial — light, professional, geospatial color scheme
   ========================================================================== */

:root {
  /* Palette */
  --c-page: #f6faf9;
  --c-surface: #ffffff;
  --c-surface-2: #f0f6f5;
  --c-ink: #14302d;
  --c-ink-soft: #2b3f3c;
  --c-muted: #57736e;
  --c-primary: #0f766e;
  --c-primary-dark: #0b5d56;
  --c-accent: #14b8a6;
  --c-indigo: #4f46e5;
  --c-sky: #0ea5e9;
  --c-amber: #f59e0b;
  --c-rose: #f43f5e;
  --c-border: #dce7e5;
  --c-border-soft: #e9f1ef;

  /* Code */
  --code-bg: #f2f8f7;
  --code-border: #dcebe8;
  --inline-bg: #e6f1ef;
  --inline-ink: #0b4f49;

  /* Shape & depth */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-sm: 0 1px 2px rgba(15, 60, 56, 0.06), 0 1px 3px rgba(15, 60, 56, 0.08);
  --shadow-md: 0 6px 20px -8px rgba(15, 60, 56, 0.22);
  --shadow-lg: 0 18px 40px -18px rgba(15, 60, 56, 0.32);

  /* Layout */
  --header-h: 4.25rem;
  --container: 1440px;
  --measure: 1180px;

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

  --grad-brand: linear-gradient(120deg, #0f766e 0%, #14b8a6 45%, #0ea5e9 100%);
}

/* ----- Reset / base ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.7;
  color: var(--c-ink);
  background: var(--c-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
svg { height: auto; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }
strong { color: var(--c-ink); font-weight: 650; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 3rem); }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 0.5rem; left: 0.5rem; z-index: 200;
  background: var(--c-primary); color: #fff; padding: 0.6rem 1rem;
  border-radius: var(--radius-sm); transform: translateY(-150%); transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(0); color: #fff; }

/* ----- Header ----------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.site-header__inner {
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 1rem; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--c-ink); }
.brand__logo { width: 40px; height: 40px; transition: transform 0.3s ease; }
.brand:hover .brand__logo { transform: rotate(-8deg) scale(1.06); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-weight: 750; letter-spacing: -0.01em; font-size: 1.07rem; }
.brand__tag { font-size: 0.72rem; color: var(--c-muted); font-weight: 500; }

.primary-nav__list { list-style: none; padding: 0; display: flex; align-items: center; gap: 0.35rem; }
.nav-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.8rem; border-radius: 999px; color: var(--c-ink-soft);
  font-weight: 600; font-size: 0.93rem; line-height: 1.2;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.nav-link:hover { background: var(--c-surface-2); color: var(--c-primary-dark); transform: translateY(-1px); }
.nav-link.is-active { background: var(--c-primary); color: #fff; }
.nav-link.is-active:hover { color: #fff; }
.nav-link__icon { display: inline-flex; }
.nav-link__icon--teal { color: var(--c-primary); }
.nav-link__icon--indigo { color: var(--c-indigo); }
.nav-link__icon--amber { color: var(--c-amber); }
.nav-link__icon--home { color: var(--c-sky); }
.nav-link.is-active .nav-link__icon { color: #fff; }

.nav-toggle {
  display: none; border: 1px solid var(--c-border); background: var(--c-surface);
  color: var(--c-ink); border-radius: var(--radius-sm); padding: 0.4rem; cursor: pointer;
}
.nav-toggle .icon--close { display: none; }
.nav-toggle[aria-expanded="true"] .icon--menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon--close { display: block; }

/* ----- Hero ------------------------------------------------------------- */
.hero { padding: clamp(2.5rem, 6vw, 5.5rem) 0 clamp(2rem, 4vw, 3.5rem); text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% 10% auto; height: 460px; z-index: -1;
  background: radial-gradient(60% 60% at 50% 0%, rgba(20, 184, 166, 0.16), rgba(14, 165, 233, 0.06) 45%, transparent 70%);
}
.hero__inner { display: flex; flex-direction: column; align-items: center; }
.hero__logo-wrap { margin-bottom: 1.4rem; }
.hero__logo {
  width: clamp(120px, 18vw, 168px); height: auto;
  filter: drop-shadow(0 12px 24px rgba(15, 118, 110, 0.22));
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero__title {
  font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.6rem); line-height: 1.08;
  letter-spacing: -0.025em; font-weight: 800; max-width: 18ch;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__title-break { display: inline; }
.hero__lede { margin-top: 1.4rem; max-width: 62ch; font-size: clamp(1.05rem, 1rem + 0.45vw, 1.28rem); color: var(--c-ink-soft); }
.hero__sub { margin-top: 0.9rem; max-width: 60ch; color: var(--c-muted); }

.hero__cta { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.cta {
  display: inline-flex; align-items: center; gap: 0.85rem; text-align: left;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 0.9rem 1.15rem; min-width: 240px;
  box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.cta:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--c-accent); }
.cta__icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; color: #fff; flex: none; }
.cta--teal .cta__icon { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.cta--indigo .cta__icon { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.cta--amber .cta__icon { background: linear-gradient(135deg, #f59e0b, #fb923c); }
.cta__body { display: flex; flex-direction: column; }
.cta__label { font-weight: 700; color: var(--c-ink); line-height: 1.2; }
.cta__hint { font-size: 0.82rem; color: var(--c-muted); display: inline-flex; align-items: center; gap: 0.3rem; }
.cta:hover .cta__hint .icon--arrow { transform: translateX(3px); }
.cta__hint .icon--arrow { transition: transform 0.2s; }

/* ----- Home sections ---------------------------------------------------- */
.intro { padding: clamp(1.5rem, 3vw, 2.5rem) 0; }
.section-title {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); letter-spacing: -0.02em; font-weight: 780;
  color: var(--c-ink); margin-bottom: 0.9rem;
}
.section-text { max-width: 78ch; color: var(--c-ink-soft); }
.pillars { padding: clamp(1.5rem, 3vw, 3rem) 0 clamp(2.5rem, 5vw, 4rem); }
.pillar { margin-top: 2.4rem; }
.pillar__head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.2rem; }
.pillar__icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; color: #fff; flex: none; box-shadow: var(--shadow-sm); }
.pillar__icon--teal { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.pillar__icon--indigo { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.pillar__icon--amber { background: linear-gradient(135deg, #f59e0b, #fb923c); }
.pillar__title { font-size: 1.4rem; letter-spacing: -0.01em; }
.pillar__title a { color: var(--c-ink); }
.pillar__title a:hover { color: var(--c-primary); }
.pillar__desc { color: var(--c-muted); margin-top: 0.25rem; max-width: 80ch; }

/* ----- Card grid -------------------------------------------------------- */
.card-grid { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card-grid--compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card { display: flex; }
.card__link {
  display: flex; flex-direction: column; gap: 0.4rem; width: 100%;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.card__link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--c-accent); }
.card__heading { font-weight: 700; color: var(--c-ink); display: inline-flex; align-items: center; gap: 0.4rem; line-height: 1.3; }
.card__heading .icon--arrow { color: var(--c-primary); transition: transform 0.2s; }
.card__link:hover .card__heading .icon--arrow { transform: translateX(4px); }
.card__desc { font-size: 0.9rem; color: var(--c-muted); }

/* ----- Page grid (content pages) --------------------------------------- */
.page-grid {
  display: grid; gap: clamp(1.8rem, 3.5vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr) 18rem;
  align-items: start; padding-block: clamp(1.4rem, 3vw, 2.4rem) clamp(3rem, 6vw, 5rem);
}
.article { min-width: 0; }
.page-aside { position: sticky; top: calc(var(--header-h) + 1rem); display: flex; flex-direction: column; gap: 1.2rem; }

/* ----- Breadcrumbs ------------------------------------------------------ */
.breadcrumbs { margin-bottom: 1.4rem; }
.breadcrumbs__list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem; font-size: 0.86rem; }
.breadcrumbs__item { display: inline-flex; align-items: center; gap: 0.15rem; color: var(--c-muted); }
.breadcrumbs__item a { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--c-muted); padding: 0.15rem 0.35rem; border-radius: var(--radius-xs); }
.breadcrumbs__item a:hover { color: var(--c-primary); background: var(--c-surface-2); }
.breadcrumbs__item [aria-current="page"] { color: var(--c-ink-soft); font-weight: 600; padding: 0.15rem 0.35rem; }
.breadcrumbs__sep { color: var(--c-border); display: inline-flex; }

/* ----- Prose / article -------------------------------------------------- */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.15rem; }
.prose h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.9rem); line-height: 1.12; letter-spacing: -0.025em;
  font-weight: 820; margin-bottom: 0.4rem;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.prose h2 {
  font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.85rem); line-height: 1.2; letter-spacing: -0.015em;
  font-weight: 740; color: var(--c-ink); margin-top: 2.4rem; padding-top: 0.4rem;
  border-top: 1px solid var(--c-border-soft);
}
.prose h3 { font-size: clamp(1.18rem, 1.05rem + 0.5vw, 1.4rem); font-weight: 700; color: var(--c-ink); margin-top: 1.8rem; }
.prose h4 { font-size: 1.08rem; font-weight: 700; color: var(--c-ink-soft); margin-top: 1.4rem; }
.prose :is(h1, h2, h3, h4) { scroll-margin-top: calc(var(--header-h) + 1rem); position: relative; }
.prose p { color: var(--c-ink-soft); }
.prose ul, .prose ol { padding-left: 1.4rem; color: var(--c-ink-soft); }
.prose li + li { margin-top: 0.35rem; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; padding-left: 1.1rem; }
.prose ul > li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; border-radius: 2px; background: var(--c-accent); transform: rotate(45deg); }
.prose ol { list-style: decimal; }
.prose ol > li::marker { color: var(--c-primary); font-weight: 700; }
.prose blockquote {
  border-left: 4px solid var(--c-accent); background: var(--c-surface-2);
  padding: 0.8rem 1.1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--c-ink-soft);
}
.prose a { color: var(--c-primary); text-decoration: underline; text-decoration-color: rgba(15, 118, 110, 0.35); text-underline-offset: 0.18em; transition: color 0.15s, text-decoration-color 0.15s; }
.prose a:hover { color: var(--c-primary-dark); text-decoration-color: var(--c-primary); }
.heading-anchor { margin-left: 0.4rem; color: var(--c-border); text-decoration: none; opacity: 0; transition: opacity 0.15s, color 0.15s; font-weight: 600; }
.prose :is(h2, h3, h4):hover .heading-anchor { opacity: 1; color: var(--c-accent); }

/* Inline code */
.prose :not(pre) > code {
  font-family: var(--font-mono); font-size: 0.88em; background: var(--inline-bg);
  color: var(--inline-ink); padding: 0.12em 0.4em; border-radius: 6px; border: 0;
  white-space: break-spaces; word-break: break-word;
}

/* ----- Code blocks ------------------------------------------------------ */
.code-block {
  position: relative; margin-block: 1.4rem; border: 1px solid var(--code-border);
  border-radius: var(--radius-sm); background: var(--code-bg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.code-block::before {
  content: attr(data-lang); position: absolute; top: 0; left: 0;
  font: 600 0.68rem/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--c-muted); background: var(--c-surface); padding: 0.4rem 0.7rem;
  border-right: 1px solid var(--code-border); border-bottom: 1px solid var(--code-border);
  border-bottom-right-radius: var(--radius-xs);
}
.code-block pre {
  margin: 0; padding: 2.1rem 1.1rem 1.1rem; overflow-x: auto;
  font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.6; color: #1f3a36;
  tab-size: 4;
}
.code-block code { font-family: inherit; background: none; padding: 0; white-space: pre; }
.copy-btn {
  position: absolute; top: 0.45rem; right: 0.5rem; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.35rem;
  font: 600 0.74rem/1 var(--font-sans); color: var(--c-muted);
  background: var(--c-surface); border: 1px solid var(--code-border);
  border-radius: var(--radius-xs); padding: 0.35rem 0.6rem; cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}
.copy-btn:hover { color: var(--c-primary-dark); border-color: var(--c-accent); transform: translateY(-1px); }
.copy-btn.is-copied { color: #fff; background: var(--c-primary); border-color: var(--c-primary); }
.copy-btn__icon { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Prism light theme tuned to palette */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #7c948f; font-style: italic; }
.token.punctuation { color: #5b716c; }
.token.keyword, .token.boolean, .token.atrule, .token.tag, .token.selector { color: #4338ca; }
.token.string, .token.char, .token.attr-value, .token.inserted { color: #047857; }
.token.function, .token.class-name { color: #0e7490; }
.token.number, .token.constant, .token.symbol { color: #b45309; }
.token.operator, .token.entity, .token.url { color: #475569; background: none; }
.token.builtin, .token.property, .token.attr-name { color: #0369a1; }
.token.regex, .token.important, .token.variable { color: #be123c; }
.token.deleted { color: #be123c; }
.token.important, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }

/* ----- Tables ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin-block: 1.5rem; 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: 34rem; font-size: 0.92rem; }
.table-wrap th, .table-wrap td { text-align: left; padding: 0.7rem 0.95rem; border-bottom: 1px solid var(--c-border-soft); vertical-align: top; }
.table-wrap thead th { background: var(--c-surface-2); color: var(--c-ink); font-weight: 700; position: sticky; top: 0; border-bottom: 2px solid var(--c-border); }
.table-wrap tbody tr:nth-child(even) { background: rgba(15, 118, 110, 0.03); }
.table-wrap tbody tr:hover { background: rgba(20, 184, 166, 0.08); }
.table-wrap td code { white-space: nowrap; }

/* ----- Task lists (interactive checkboxes) ------------------------------ */
.contains-task-list { list-style: none; padding-left: 0; }
.contains-task-list .contains-task-list { padding-left: 1.4rem; }
.task-list-item { list-style: none; padding-left: 0; display: flex; align-items: flex-start; gap: 0.6rem; }
.task-list-item::before { display: none !important; content: none !important; }
.task-list-item > label { display: inline-flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; color: var(--c-ink-soft); }
.task-list-item-checkbox {
  appearance: none; -webkit-appearance: none; flex: none; margin-top: 0.28em;
  width: 1.15em; height: 1.15em; border: 2px solid var(--c-border); border-radius: 5px;
  background: var(--c-surface); cursor: pointer; display: inline-grid; place-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.task-list-item-checkbox::before { content: ""; width: 0.62em; height: 0.62em; transform: scale(0); transform-origin: center; transition: transform 0.12s ease-in-out; 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-primary); border-color: var(--c-primary); }
.task-list-item-checkbox:checked::before { transform: scale(1); }
.task-list-item-checkbox:hover { border-color: var(--c-accent); }
.task-list-item.is-checked > label,
.task-list-item > label:has(> .task-list-item-checkbox:checked) { text-decoration: line-through; color: var(--c-muted); text-decoration-color: var(--c-accent); }

/* ----- Related + aside cards ------------------------------------------- */
.related { margin-top: 3rem; padding-top: 2rem; border-top: 2px solid var(--c-border-soft); }
.related__title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.2rem; font-weight: 740; color: var(--c-ink); margin-bottom: 1rem; margin-top: 1.6rem; }
.related__title:first-child { margin-top: 0; }
.related__title .icon { color: var(--c-accent); }

.aside-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); }
.aside-card__title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--c-muted); font-weight: 700; margin-bottom: 0.7rem; }
.toc__nav { display: flex; flex-direction: column; gap: 0.1rem; }
.toc__nav a { color: var(--c-ink-soft); font-size: 0.9rem; padding: 0.3rem 0.5rem; border-radius: var(--radius-xs); border-left: 2px solid transparent; line-height: 1.35; }
.toc__nav a:hover { background: var(--c-surface-2); color: var(--c-primary-dark); }
.toc__nav a.is-current { color: var(--c-primary-dark); border-left-color: var(--c-primary); background: var(--c-surface-2); font-weight: 600; }
.toc__nav a[data-depth="3"] { padding-left: 1.1rem; font-size: 0.85rem; }

.section-nav__list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.section-nav__list li::before { content: none; }
.section-nav__link, .section-nav__up { display: block; color: var(--c-ink-soft); font-size: 0.9rem; padding: 0.35rem 0.55rem; border-radius: var(--radius-xs); }
.section-nav__link:hover, .section-nav__up:hover { background: var(--c-surface-2); color: var(--c-primary-dark); }
.section-nav__link.is-active { background: var(--c-primary); color: #fff; font-weight: 600; }
.section-nav__link.is-active:hover { color: #fff; }
.section-nav__up { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--c-muted); font-weight: 600; margin-bottom: 0.3rem; }
.section-nav__up .icon--arrow { transform: rotate(180deg); }

/* ----- Mermaid ---------------------------------------------------------- */
.mermaid { margin-block: 0.6rem 1.6rem; text-align: center; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 1.2rem; box-shadow: var(--shadow-sm); overflow-x: auto; }
.mermaid:not([data-processed]) { color: transparent; min-height: 2rem; }
.mermaid svg { display: block; margin-inline: auto; height: auto; }
/* Figure caption: an emphasized paragraph immediately preceding a diagram. */
.prose p:has(+ .mermaid) { margin-top: 1.6rem; margin-bottom: 0; text-align: center; }
.prose p:has(+ .mermaid) em { color: var(--c-muted); font-size: 0.9rem; font-style: italic; }

/* ----- KaTeX ------------------------------------------------------------ */
.katex-display { overflow-x: auto; overflow-y: hidden; padding-block: 0.4rem; }
.katex { font-size: 1.05em; }

/* ----- FAQ accordion ---------------------------------------------------- */
.accordion { border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); overflow: hidden; box-shadow: var(--shadow-sm); }
.accordion + .accordion { margin-top: 0.7rem; }
.accordion > summary { cursor: pointer; list-style: none; padding: 1rem 1.2rem; font-weight: 650; color: var(--c-ink); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary::after { content: "+"; font-size: 1.3rem; color: var(--c-primary); transition: transform 0.2s; }
.accordion[open] > summary::after { transform: rotate(45deg); }
.accordion > summary:hover { background: var(--c-surface-2); }
.accordion__body { padding: 0 1.2rem 1.1rem; color: var(--c-ink-soft); }

.text-link { font-weight: 600; }

/* ----- Footer ----------------------------------------------------------- */
.site-footer { flex-shrink: 0; margin-top: auto; background: #0c2e2b; color: #cfe5e1; }
.site-footer a { color: #cfe5e1; }
.site-footer a:hover { color: #fff; }
.site-footer__inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: clamp(1.5rem, 4vw, 3.5rem); padding-block: clamp(2.5rem, 5vw, 4rem) 2rem; }
.brand--footer .brand__name { color: #fff; }
.brand--footer .brand__tag { color: #8fb8b2; }
.site-footer__blurb { margin-top: 1rem; color: #9cc1bc; font-size: 0.92rem; max-width: 42ch; }
.site-footer__nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; }
.footer-col__title { font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.7rem; }
.footer-col__title a { color: #fff; }
.footer-col__icon { color: var(--c-accent); display: inline-flex; }
.footer-col__icon--indigo { color: #818cf8; }
.footer-col__icon--amber { color: #fbbf24; }
.footer-col__list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.footer-col__list a { color: #a8cdc8; font-size: 0.9rem; }
.footer-col__list a:hover { color: #fff; }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding-block: 1.3rem; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.85rem; color: #8fb8b2; }

/* ----- Responsive ------------------------------------------------------- */
@media (max-width: 1024px) {
  .page-grid { grid-template-columns: minmax(0, 1fr); }
  .page-aside { position: static; order: 2; }
  .toc { display: none; }
}

@media (max-width: 820px) {
  :root { --header-h: 3.9rem; }
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: fixed; inset: var(--header-h) 0 auto; z-index: 90;
    background: var(--c-surface); border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-lg); padding: 0.8rem clamp(1.1rem, 4vw, 3rem) 1.2rem;
    transform: translateY(-130%); transition: transform 0.28s ease; visibility: hidden;
  }
  .primary-nav.is-open { transform: translateY(0); visibility: visible; }
  .primary-nav__list { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .nav-link { font-size: 1rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); }
  .site-footer__inner { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1600px) {
  :root { --measure: 1320px; }
  .page-grid { grid-template-columns: minmax(0, 1fr) 20rem; }
}

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