/* =========================================================================
   Geospatial Compliance & Metadata Automation Hub — styles
   Light, professional, geospatial-themed palette.
   ========================================================================= */

:root {
  --bg: #f4f9f8;
  --surface: #ffffff;
  --surface-2: #eef5f4;
  --surface-3: #e4efed;
  --border: #d7e6e3;
  --border-strong: #c2d8d4;

  --text: #122d34;
  --text-muted: #4d6b71;
  --text-soft: #6b868b;

  --primary: #0e7c86;
  --primary-strong: #0a5d65;
  --primary-soft: #d7efef;
  --secondary: #1f5fb0;
  --secondary-strong: #18488a;
  --accent: #e07b2a;
  --success: #1fa971;

  --code-bg: #f3f8f8;
  --code-border: #dcebe9;
  --inline-code-bg: #e7f1f0;

  --grad: linear-gradient(120deg, #0e7c86 0%, #15909b 45%, #1f5fb0 100%);
  --grad-soft: linear-gradient(120deg, #e6f5f4 0%, #eaf1fb 100%);

  --header-h: 64px;
  --container: 1480px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(18, 45, 52, .06), 0 1px 3px rgba(18, 45, 52, .08);
  --shadow-md: 0 6px 18px rgba(18, 45, 52, .08), 0 2px 6px rgba(18, 45, 52, .06);
  --shadow-lg: 0 18px 40px rgba(18, 45, 52, .12);

  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Fira Code", Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(16px, 0.55vw + 14.5px, 18px);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

img { max-width: 100%; height: auto; }

a {
  color: var(--secondary);
  text-decoration: none;
  transition: color .18s var(--ease);
}
a:hover { color: var(--primary); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--primary);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------ Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--text);
  font-weight: 700;
}
.brand__logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease);
}
.brand:hover .brand__logo { transform: rotate(-6deg) scale(1.05); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-size: 1.02rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand__sub { font-size: .72rem; color: var(--text-soft); font-weight: 600; letter-spacing: .02em; }

.icon { width: 1.25em; height: 1.25em; flex: none; }

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: .35rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .8rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .94rem;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.nav-link__icon { color: var(--primary); }
.nav-link:hover { background: var(--surface-2); color: var(--text); transform: translateY(-1px); }
.nav-link.is-active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.nav-link.is-active .nav-link__icon { color: var(--primary-strong); }

.nav-toggle {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .45rem;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle__close { display: none; }
.nav-toggle .icon { width: 1.5em; height: 1.5em; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
  }
  .primary-nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .primary-nav__list { flex-direction: column; align-items: stretch; padding: .75rem clamp(1rem, 3vw, 2.5rem) 1rem; gap: .25rem; }
  .nav-link { padding: .8rem 1rem; border-radius: 12px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__close { display: block; }
}

/* -------------------------------------------------------------------- Hero */
.hero {
  background: var(--grad-soft);
  border-bottom: 1px solid var(--border);
  padding-block: clamp(2.5rem, 6vw, 5rem);
}
.hero__inner { text-align: center; }
.hero__logo-row { display: block; margin-bottom: 1.5rem; }
.hero__logo {
  width: clamp(120px, 16vw, 168px);
  height: auto;
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  transition: transform .4s var(--ease);
}
.hero__logo:hover { transform: translateY(-4px) rotate(-3deg); }
.hero__title {
  margin: 0 auto .6rem;
  font-size: clamp(1.9rem, 4.5vw, 3.3rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  max-width: 26ch;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lede {
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  color: var(--text);
  max-width: 60rem;
  margin: 0 auto 1.5rem;
}
.hero__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 3rem;
  text-align: left;
  margin: 0 0 1rem;
}
.hero__text { color: var(--text-muted); margin: 0; }
@media (max-width: 760px) {
  .hero__cols { grid-template-columns: 1fr; gap: 1rem; text-align: center; }
}

.hero__cta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 2.25rem;
  text-align: left;
}
.cta-btn {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .9rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.cta-btn__icon { width: 1.9em; height: 1.9em; flex: none; }
.cta-btn__label { flex: 1; }
.cta-btn__arrow { color: var(--primary); transition: transform .2s var(--ease); flex: none; }
.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  color: var(--text);
}
.cta-btn:hover .cta-btn__arrow { transform: translateX(4px); }

/* ----------------------------------------------------------- Home sections */
.sections { padding-block: clamp(2.5rem, 5vw, 4rem); }
.sections__heading {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0 0 .4rem;
  text-align: center;
}
.sections__intro {
  text-align: center;
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 auto 2.5rem;
}
.section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.section-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.section-card__head { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.section-card__icon { width: 2.4em; height: 2.4em; }
.section-card__title { margin: 0; font-size: 1.18rem; line-height: 1.25; }
.section-card__title a { color: var(--text); }
.section-card__title a:hover { color: var(--primary); }
.section-card__text { color: var(--text-muted); margin: 0 0 1rem; }
.section-card__links {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  border-top: 1px solid var(--border);
  padding-top: .9rem;
  display: grid;
  gap: .35rem;
}
.section-card__links a {
  display: inline-block;
  font-weight: 600;
  font-size: .95rem;
}
.section-card__links a::before {
  content: "›";
  color: var(--primary);
  margin-right: .45rem;
  font-weight: 700;
}
.section-card__more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 700;
  color: var(--primary);
}
.section-card__more:hover { gap: .7rem; }

/* ------------------------------------------------------------ Page layout */
.page-top { padding-top: 1.75rem; }
.page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-block: 1rem 3.5rem;
}
@media (min-width: 1080px) {
  .page-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
    align-items: start;
  }
}

.prose { min-width: 0; max-width: 80ch; }
@media (min-width: 1080px) { .prose { max-width: none; } }

/* Breadcrumbs */
.breadcrumbs { margin-bottom: .25rem; }
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .15rem;
  list-style: none;
  margin: 0; padding: 0;
  font-size: .86rem;
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: .15rem; }
.breadcrumbs a { color: var(--text-muted); font-weight: 600; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs__sep { width: .9em; height: .9em; color: var(--text-soft); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 700; }

/* Prose typography */
.prose > h1:first-of-type, .prose > h1 {
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: .2rem 0 1.1rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.prose h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  margin: 2.4rem 0 .9rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--surface-3);
  color: var(--primary-strong);
}
.prose h3 {
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  margin: 1.8rem 0 .6rem;
  color: var(--secondary-strong);
}
.prose h4 { font-size: 1.08rem; margin: 1.4rem 0 .5rem; color: var(--text); }
.prose :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: calc(var(--header-h) + 1.25rem); }

.prose p { margin: 0 0 1.15rem; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.prose li { margin-bottom: .4rem; }
.prose li::marker { color: var(--primary); }

.prose blockquote {
  margin: 1.5rem 0;
  padding: .25rem 1.25rem;
  border-left: 4px solid var(--primary);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}

.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* Heading anchor link (markdown-it-anchor) */
.heading-anchor {
  float: left;
  margin-left: -1.1em;
  padding-right: .35em;
  color: var(--border-strong);
  opacity: 0;
  text-decoration: none;
  transition: opacity .15s var(--ease), color .15s var(--ease);
}
.prose :is(h2, h3, h4):hover .heading-anchor { opacity: 1; }
.heading-anchor:hover { color: var(--primary); }
@media (max-width: 720px) { .heading-anchor { display: none; } }

/* Inline code — subtle, no border, blends with text */
.prose :not(pre) > code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--inline-code-bg);
  color: var(--primary-strong);
  padding: .12em .4em;
  border-radius: 5px;
  word-break: break-word;
}

/* Links inside prose */
.prose a {
  color: var(--secondary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(31, 95, 176, .32);
  text-underline-offset: 2px;
  transition: color .18s var(--ease), text-decoration-color .18s var(--ease);
}
.prose a:hover { color: var(--primary); text-decoration-color: var(--primary); }

/* ------------------------------------------------------------ Code blocks */
.code-block {
  position: relative;
  margin: 1.5rem 0;
}
pre[class*="language-"], .prose pre {
  margin: 1.5rem 0;
  padding: 1.1rem 1.2rem;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
  overflow: auto;
  font-family: var(--font-mono);
  font-size: .9rem;
  line-height: 1.6;
  tab-size: 2;
  box-shadow: var(--shadow-sm);
}
.code-block pre { margin: 0; }
.prose pre code { font-family: inherit; font-size: inherit; background: none; padding: 0; color: var(--text); }

.code-copy {
  position: absolute;
  top: .55rem;
  right: .55rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .6rem;
  font: 600 .76rem/1 var(--font-sans);
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.code-block:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.code-copy.is-copied { background: var(--success); color: #fff; border-color: var(--success); opacity: 1; }

/* PrismJS light token theme tuned to palette */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6f8b90; font-style: italic; }
.token.punctuation { color: #5b757a; }
.token.namespace { opacity: .7; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { color: #c2410c; }
.token.boolean, .token.number { color: #b5532a; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #157f5b; }
.token.operator, .token.entity, .token.url { color: #50666b; }
.token.atrule, .token.attr-value, .token.keyword { color: #0a5d65; font-weight: 600; }
.token.function, .token.class-name { color: #1f5fb0; }
.token.regex, .token.important, .token.variable { color: #7c3aed; }
.token.important, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }

/* ----------------------------------------------------------------- Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--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: 480px; font-size: .94rem; }
.table-wrap th, .table-wrap td {
  text-align: left;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table-wrap thead th {
  background: var(--surface-2);
  color: var(--primary-strong);
  font-weight: 700;
  white-space: nowrap;
}
.table-wrap tbody tr { transition: background .15s var(--ease); }
.table-wrap tbody tr:nth-child(even) { background: var(--surface); }
.table-wrap tbody tr:hover { background: var(--primary-soft); }
.table-wrap td code { white-space: nowrap; }

/* ---------------------------------------------------------------- Mermaid */
.mermaid-wrap {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  text-align: center;
}
.mermaid { line-height: normal; }
.mermaid:not([data-processed]) { color: transparent; min-height: 2rem; }

/* ------------------------------------------------------------- Task lists */
.prose ul:has(> li > input[type="checkbox"]),
.prose ul.contains-task-list { list-style: none; padding-left: .2rem; }
.prose li:has(> input[type="checkbox"]),
.prose li.task-list-item { list-style: none; margin-left: 0; }
.prose li.task-list-item::marker { content: ""; }
.prose li input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15em;
  height: 1.15em;
  margin-right: .55em;
  vertical-align: -.18em;
  border: 2px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.prose li input[type="checkbox"]:hover { border-color: var(--primary); }
.prose li input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.prose li input[type="checkbox"]:checked::after {
  content: "";
  display: block;
  width: .32em; height: .6em;
  margin: .02em auto 0;
  border: solid #fff;
  border-width: 0 .16em .16em 0;
  transform: translateY(.05em) rotate(45deg);
}
.prose li.task-list-item.is-checked > label,
.prose li:has(> input:checked) { color: var(--text-soft); }
.prose li.is-checked > label, .prose li:has(> input:checked) > label { text-decoration: line-through; }

/* -------------------------------------------------------- FAQ / accordion */
.faq-item, .prose details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: .75rem 0;
  background: var(--surface);
  overflow: hidden;
}
.faq-item__btn, .prose summary {
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 1rem 1.2rem;
  font-weight: 700;
  color: var(--primary-strong);
  background: var(--surface-2);
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  list-style: none;
}
.prose summary::-webkit-details-marker { display: none; }
.faq-item__btn::after, .prose summary::after {
  content: "+";
  font-size: 1.3rem;
  line-height: 1;
  color: var(--primary);
  transition: transform .2s var(--ease);
}
.faq-item.is-open .faq-item__btn::after, .prose details[open] summary::after { transform: rotate(45deg); }
.faq-item__panel { padding: 0 1.2rem; max-height: 0; overflow: hidden; transition: max-height .25s var(--ease), padding .25s var(--ease); }
.faq-item.is-open .faq-item__panel { padding: 1rem 1.2rem; max-height: 1000px; }
.prose details[open] { padding-bottom: .25rem; }
.prose details > :not(summary) { margin-inline: 1.2rem; }

/* ------------------------------------------------------------- Related nav */
.related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.related__title { font-size: 1.25rem; margin: 0 0 1rem; color: var(--text); }
.related__grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .85rem;
}
.related__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-weight: 600;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.related__card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); color: var(--primary-strong); }
.related__arrow { color: var(--primary); transition: transform .2s var(--ease); flex: none; }
.related__card:hover .related__arrow { transform: translateX(4px); }

/* --------------------------------------------------------------- TOC aside */
.sidebar { display: none; }
@media (min-width: 1080px) {
  .sidebar { display: block; position: sticky; top: calc(var(--header-h) + 1.5rem); }
}
.toc {
  border-left: 2px solid var(--surface-3);
  padding-left: 1rem;
  font-size: .9rem;
}
.toc__title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-soft); margin: 0 0 .75rem; }
.toc__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.toc__list a {
  display: block;
  padding: .25rem .5rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.35;
}
.toc__list a:hover { background: var(--surface-2); color: var(--primary); }
.toc__list a.is-active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 700; }
.toc__list .toc-h3 a { padding-left: 1.1rem; font-size: .85rem; }

/* ------------------------------------------------------------------ Footer */
.site-footer { flex-shrink: 0; margin-top: auto; background: var(--surface); border-top: 1px solid var(--border); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 2.5rem;
}
.site-footer__brand { max-width: 42ch; }
.site-footer__logo { width: 36px; height: 36px; border-radius: 9px; }
.site-footer__tagline { color: var(--text-muted); margin: .75rem 0 0; font-size: .95rem; }
.site-footer__heading { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-soft); margin: 0 0 .75rem; }
.site-footer__nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.site-footer__nav a { color: var(--text-muted); font-weight: 600; }
.site-footer__nav a:hover { color: var(--primary); }
.site-footer__bar { border-top: 1px solid var(--border); background: var(--surface-2); }
.site-footer__bar p { margin: 0; padding-block: 1rem; font-size: .85rem; color: var(--text-soft); }

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