/* =====================================================================
   Location Intelligence — design system
   Light, professional, geospatial-inspired palette.
   ===================================================================== */

:root {
  /* Palette */
  --teal-900: #0b3b39;
  --teal-800: #0b5c55;
  --teal-700: #0f766e;
  --teal-600: #12897f;
  --teal-100: #d7efea;
  --teal-50:  #ecf8f5;
  --blue-700: #0369a1;
  --blue-600: #0284c7;
  --blue-500: #0ea5e9;
  --green-600: #059669;
  --green-500: #10b981;
  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --rose-600: #e11d48;
  --rose-500: #f43f5e;

  --ink:        #16282e;
  --ink-soft:   #38505a;
  --muted:      #5f7682;
  --line:       #dde7e6;
  --line-soft:  #eaf1f0;
  --bg:         #f5faf8;
  --bg-alt:     #eef5f4;
  --surface:    #ffffff;
  --surface-2:  #f1f7f6;

  --primary:    var(--teal-700);
  --primary-ink: var(--teal-900);
  --accent:     var(--blue-500);

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

  /* Layout */
  --container: 75rem;
  --container-wide: 82rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(11, 59, 57, 0.06), 0 1px 3px rgba(11, 59, 57, 0.08);
  --shadow-md: 0 6px 18px -6px rgba(11, 59, 57, 0.18), 0 2px 6px rgba(11, 59, 57, 0.06);
  --shadow-lg: 0 24px 48px -18px rgba(11, 59, 57, 0.28);

  --header-height: 72px;
  --transition: 180ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* ---- Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(14,165,233,0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(16,185,129,0.07), transparent 55%);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img, svg { max-width: 100%; height: auto; vertical-align: middle; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { line-height: 1.22; font-weight: 700; color: var(--primary-ink); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

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

/* ---- Links --------------------------------------------------------- */
a { color: var(--teal-700); text-decoration: none; }
a:hover { color: var(--blue-600); }

/* =====================================================================
   Header
   ===================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
  padding-block: 0.6rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.brand__logo { width: 40px; height: 40px; transition: transform var(--transition); }
.brand:hover .brand__logo { transform: rotate(-6deg) scale(1.06); }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-weight: 800; font-size: 1.05rem; color: var(--primary-ink); letter-spacing: -0.01em; }
.brand__sub { font-size: 0.74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.primary-nav__list { list-style: none; display: flex; align-items: center; gap: 0.3rem; margin: 0; padding: 0; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.nav-link:hover { background: var(--teal-50); color: var(--primary-ink); }
.nav-link.is-active { background: var(--teal-100); color: var(--primary-ink); box-shadow: inset 0 0 0 1px rgba(15,118,110,0.25); }
.nav-link .ui-icon { width: 1.15rem; height: 1.15rem; }
.nav-icon { width: 1.2rem; height: 1.2rem; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--primary-ink);
}
.nav-toggle__close { display: none; }
.ui-icon { width: 1.4rem; height: 1.4rem; }

/* =====================================================================
   Hero / homepage
   ===================================================================== */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3rem); }
.hero__inner { text-align: center; max-width: 60rem; }
.hero__logo-row { display: flex; justify-content: center; margin-bottom: 1.4rem; }
.hero__logo {
  width: clamp(120px, 18vw, 168px);
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(11,59,57,0.22));
  transition: transform var(--transition);
}
.hero__logo:hover { transform: translateY(-4px) rotate(-3deg); }
.hero__title {
  font-size: clamp(1.75rem, 5vw, 3.25rem);
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  overflow-wrap: break-word;
  text-wrap: balance;
}
.hero__title-accent {
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-right: 0.06em;
  background: linear-gradient(100deg, var(--teal-700), var(--blue-500) 55%, var(--green-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--ink-soft); margin: 0 auto 1rem; max-width: 52rem; font-weight: 500; }
.hero__body { color: var(--muted); margin: 0 auto 1rem; max-width: 50rem; }

.hero__ctas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  margin-top: 2rem;
  text-align: left;
}

/* CTA buttons */
.cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.cta:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--teal-100); }
.cta__icon {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 13px;
  background: var(--surface-2);
}
.cta-icon { width: 30px; height: 30px; }
.cta__text { display: flex; flex-direction: column; gap: 0.1rem; }
.cta__label { font-weight: 700; color: var(--primary-ink); }
.cta__go { font-size: 0.9rem; color: var(--teal-700); font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; }
.cta__arrow { width: 1rem; height: 1rem; transition: transform var(--transition); }
.cta:hover .cta__arrow { transform: translateX(4px); }

.cta--teal .cta__icon { background: linear-gradient(135deg, var(--teal-50), var(--teal-100)); }
.cta--blue .cta__icon { background: linear-gradient(135deg, #e0f2fe, #cfeafe); }
.cta--amber .cta__icon { background: linear-gradient(135deg, #fef3c7, #fde2c0); }

/* Section heading block */
.home-sections { padding-block: clamp(2rem, 5vw, 4rem); }
.section-head { max-width: 46rem; margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0 0 0.5rem; }
.section-head p { color: var(--muted); margin: 0; font-size: 1.1rem; }

/* Topic cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1.4rem;
}
.topic-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.topic-card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--teal-700), var(--blue-500), var(--green-500));
  opacity: 0.9;
}
.topic-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.topic-card__icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 0.9rem; }
.topic-card__title { font-size: 1.25rem; margin: 0 0 0.5rem; }
.topic-card__title a { color: var(--primary-ink); }
.topic-card__title a:hover { color: var(--blue-600); }
.topic-card__desc { color: var(--muted); margin: 0 0 1rem; }
.topic-card__links { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: 0.3rem; }
.topic-card__links a { display: flex; align-items: center; gap: 0.35rem; color: var(--ink-soft); font-weight: 600; font-size: 0.95rem; padding: 0.25rem 0; border-radius: 8px; }
.topic-card__links a:hover { color: var(--teal-700); }
.topic-card__chev { width: 1rem; height: 1rem; color: var(--teal-600); flex: 0 0 auto; transition: transform var(--transition); }
.topic-card__links a:hover .topic-card__chev { transform: translateX(3px); }
.topic-card__more { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--teal-700); }
.topic-card__more:hover .cta__arrow { transform: translateX(4px); }

/* =====================================================================
   Article layout
   ===================================================================== */
.article-shell {
  max-width: var(--container-wide);
  padding-block: 2rem 3.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}
.article-sidebar { display: none; }

@media (min-width: 1024px) {
  .article-shell { grid-template-columns: 17rem minmax(0, 1fr); gap: 3rem; align-items: start; }
  .article-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--header-height) + 1.25rem);
    max-height: calc(100vh - var(--header-height) - 2.5rem);
    overflow-y: auto;
    padding-right: 0.5rem;
  }
}
.article-sidebar__title {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 800; color: var(--primary-ink);
  font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.04em;
  margin: 0 0 0.9rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line);
}
.sectiontree__list { list-style: none; margin: 0; padding: 0 0 0 0.2rem; }
.sectiontree__list .sectiontree__list { margin-left: 0.55rem; padding-left: 0.7rem; border-left: 1px solid var(--line-soft); }
.sectiontree__item > a {
  display: block; padding: 0.32rem 0.55rem; border-radius: 8px;
  color: var(--ink-soft); font-size: 0.92rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.sectiontree__item > a:hover { background: var(--teal-50); color: var(--primary-ink); }
.sectiontree__item.is-ancestor > a { color: var(--primary-ink); font-weight: 700; }
.sectiontree__item.is-current > a { background: var(--teal-100); color: var(--primary-ink); font-weight: 700; box-shadow: inset 0 0 0 1px rgba(15,118,110,0.2); }

/* Breadcrumbs */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem; margin: 0 0 1.2rem; padding: 0; font-size: 0.9rem; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.15rem; }
.breadcrumbs a { color: var(--muted); font-weight: 600; padding: 0.15rem 0.3rem; border-radius: 6px; }
.breadcrumbs a:hover { color: var(--teal-700); background: var(--teal-50); }
.breadcrumbs span[aria-current] { color: var(--primary-ink); font-weight: 700; padding: 0.15rem 0.3rem; }
.breadcrumbs__sep { width: 0.85rem; height: 0.85rem; color: var(--line); }

/* =====================================================================
   Prose
   ===================================================================== */
.prose { max-width: none; }
.prose > h1:first-child { margin-top: 0; }
.prose h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  letter-spacing: -0.02em;
  margin: 0 0 1.1rem;
  overflow-wrap: break-word;
  padding-right: 0.06em;
  background: linear-gradient(100deg, var(--teal-800), var(--blue-600) 60%, var(--green-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.prose h2 {
  font-size: clamp(1.45rem, 2.8vw, 1.9rem);
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--line);
  color: var(--teal-800);
}
.prose h3 { font-size: clamp(1.2rem, 2.2vw, 1.45rem); margin: 1.8rem 0 0.7rem; color: var(--teal-700); }
.prose h4 { font-size: 1.12rem; margin: 1.4rem 0 0.5rem; color: var(--ink); }
.prose :is(h1,h2,h3,h4) { scroll-margin-top: calc(var(--header-height) + 1.2rem); }
.prose p { margin: 0 0 1.1rem; color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 700; }

.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.4rem; color: var(--ink-soft); }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--teal-600); }

.prose a:not(.header-anchor) {
  color: var(--blue-700);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(2,132,199,0.35);
  text-underline-offset: 0.18em;
  transition: color var(--transition), text-decoration-color var(--transition), background var(--transition);
  border-radius: 3px;
}
.prose a:not(.header-anchor):hover {
  color: var(--teal-700);
  text-decoration-color: var(--teal-600);
  background: var(--teal-50);
}

.prose blockquote {
  margin: 1.4rem 0;
  padding: 0.6rem 1.2rem;
  border-left: 4px solid var(--teal-600);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
}
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.2rem 0; }

/* Header anchors */
.header-anchor {
  margin-left: 0.4rem;
  color: var(--teal-600);
  opacity: 0;
  font-weight: 700;
  text-decoration: none;
  transition: opacity var(--transition);
}
:is(h1,h2,h3,h4):hover .header-anchor, .header-anchor:focus { opacity: 0.7; }

/* Inline code */
.prose :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--teal-50);
  color: #0b5e57;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  word-break: break-word;
}

/* =====================================================================
   Code blocks
   ===================================================================== */
.code-block {
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.code-block__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.5rem 0.4rem 0.9rem;
  background: linear-gradient(180deg, #eaf3f1, #e3eeec);
  border-bottom: 1px solid var(--line);
}
.code-block__lang {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-700);
}
.code-block__copy {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.78rem; font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  transition: all var(--transition);
}
.code-block__copy:hover { color: var(--teal-700); border-color: var(--teal-100); background: var(--teal-50); }
.code-block__copy.is-copied { color: #fff; background: var(--green-600); border-color: var(--green-600); }
.code-block__pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  color: #243b53;
  tab-size: 2;
}
.code-block__code { font-family: inherit; background: none; padding: 0; }

/* Prism light theme */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6b7a90; font-style: italic; }
.token.punctuation { color: #51647a; }
.token.namespace { opacity: 0.7; }
.token.property, .token.attr-name, .token.symbol { color: #0e7490; }
.token.tag, .token.class-name, .token.builtin, .token.constant { color: #9333ea; }
.token.boolean, .token.number { color: #be123c; }
.token.selector, .token.string, .token.char, .token.attr-value, .token.inserted { color: #b45309; }
.token.operator, .token.entity, .token.url { color: #475569; background: none; }
.token.atrule, .token.keyword { color: var(--teal-700); font-weight: 600; }
.token.function, .token.function-name { color: #2563eb; }
.token.regex, .token.important, .token.variable { color: #c2410c; }
.token.deleted { color: #dc2626; }
.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(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.table-wrap table { border-collapse: collapse; width: 100%; min-width: 32rem; font-size: 0.94rem; }
.table-wrap th, .table-wrap td { padding: 0.7rem 0.95rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
.table-wrap thead th { background: var(--teal-50); color: var(--primary-ink); font-weight: 700; border-bottom: 2px solid var(--teal-100); white-space: nowrap; }
.table-wrap tbody tr { transition: background var(--transition); }
.table-wrap tbody tr:nth-child(even) { background: var(--surface-2); }
.table-wrap tbody tr:hover { background: var(--teal-50); }

/* =====================================================================
   Task list checkboxes
   ===================================================================== */
.contains-task-list { list-style: none; padding-left: 0.2rem; }
.task-list-item { display: flex; align-items: flex-start; gap: 0.55rem; margin-bottom: 0.5rem; }
.task-list-item::marker { content: ""; }
.task-list-item-checkbox {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 auto;
  width: 1.2em; height: 1.2em;
  margin-top: 0.2em;
  border: 2px solid var(--teal-600);
  border-radius: 6px;
  background: var(--surface);
  display: grid; place-content: center;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.task-list-item-checkbox::before {
  content: "";
  width: 0.62em; height: 0.62em;
  transform: scale(0);
  transform-origin: center;
  transition: transform var(--transition);
  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(--teal-600); border-color: var(--teal-600); }
.task-list-item-checkbox:checked::before { transform: scale(1); }
.task-list-item-checkbox:focus-visible { outline: 3px solid rgba(14,165,233,0.4); outline-offset: 2px; }
.task-list-item.is-checked { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--teal-600); }

/* =====================================================================
   FAQ accordions
   ===================================================================== */
.faq-list { display: grid; gap: 0.75rem; margin: 1.4rem 0; }
.faq {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq__q {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.2rem;
  font-weight: 700;
  color: var(--primary-ink);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { content: "+"; font-size: 1.4rem; color: var(--teal-600); transition: transform var(--transition); }
.faq[open] .faq__q::after { transform: rotate(45deg); }
.faq__q:hover { background: var(--teal-50); }
.faq__a { padding: 0 1.2rem 1rem; color: var(--ink-soft); }
.faq__a > :first-child { margin-top: 0; }

/* Mermaid */
.mermaid-wrap { margin: 1.5rem 0; overflow-x: auto; text-align: center; }
.mermaid { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }

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

/* =====================================================================
   Related content
   ===================================================================== */
.related { margin-top: 2.8rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.related__group { margin-bottom: 1.8rem; }
.related__heading { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 0.9rem; }
.related__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.related__list:not(.related__list--compact) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.related__card {
  display: flex; flex-direction: column; gap: 0.25rem;
  position: relative;
  padding: 1rem 2.2rem 1rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.related__card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--teal-100); }
.related__card-title { font-weight: 700; color: var(--primary-ink); }
.related__card-desc { font-size: 0.9rem; color: var(--muted); }
.related__card-arrow { position: absolute; right: 1rem; top: 1.1rem; width: 1.1rem; height: 1.1rem; color: var(--teal-600); transition: transform var(--transition); }
.related__card:hover .related__card-arrow { transform: translateX(4px); }

.related__list--compact { flex-wrap: wrap; display: flex; gap: 0.6rem; }
.related__pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
  font-weight: 600; font-size: 0.92rem; color: var(--ink-soft);
  transition: all var(--transition);
}
.related__pill:hover { background: var(--teal-50); color: var(--teal-700); border-color: var(--teal-100); }
.related__pill-arrow { width: 0.9rem; height: 0.9rem; color: var(--teal-600); }
.related__up a { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; color: var(--teal-700); }
.related__up .ui-icon { width: 1.1rem; height: 1.1rem; }

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer { flex-shrink: 0; margin-top: 3rem; background: var(--teal-900); color: #cfe8e3; }
.site-footer__inner { display: grid; gap: 2rem; padding-block: 2.6rem; grid-template-columns: 1fr; }
.site-footer__brand { display: flex; gap: 1rem; align-items: flex-start; }
.site-footer__logo { width: 44px; height: 44px; }
.site-footer__name { font-weight: 800; color: #fff; margin: 0 0 0.3rem; font-size: 1.05rem; }
.site-footer__desc { margin: 0; color: #9ec9c2; font-size: 0.95rem; max-width: 40rem; }
.site-footer__heading { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: #6fb3aa; margin: 0 0 0.8rem; }
.site-footer__nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer__nav a { display: inline-flex; align-items: center; gap: 0.5rem; color: #cfe8e3; font-weight: 600; }
.site-footer__nav a:hover { color: #fff; }
.footer-icon { width: 1.2rem; height: 1.2rem; }
.site-footer__bar { border-top: 1px solid rgba(255,255,255,0.12); }
.site-footer__bar p { margin: 0; padding-block: 1rem; font-size: 0.85rem; color: #8fbcb5; }

@media (min-width: 720px) {
  .site-footer__inner { grid-template-columns: 1.6fr 1fr; }
}

/* =====================================================================
   Status pages (404 / offline)
   ===================================================================== */
.status-page { text-align: center; padding-block: clamp(3rem, 8vw, 6rem); max-width: 42rem; }
.status-page__code { font-size: clamp(3rem, 10vw, 5rem); font-weight: 800; margin: 0; background: linear-gradient(100deg, var(--teal-700), var(--blue-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.status-page__title { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0.4rem 0 0.8rem; }
.status-page__text { color: var(--muted); margin: 0 auto 1.6rem; max-width: 32rem; }
.status-page__actions { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.status-page__actions .cta { display: inline-flex; }
.status-page__links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.status-page__links a { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; color: var(--teal-700); }

/* =====================================================================
   Mobile navigation
   ===================================================================== */
@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
  }
  body.nav-open .primary-nav { max-height: 75vh; }
  .primary-nav__list { flex-direction: column; align-items: stretch; gap: 0.2rem; padding: 0.8rem var(--gutter) 1.2rem; }
  .nav-link { font-size: 1.05rem; padding: 0.7rem 0.9rem; }
  body.nav-open .nav-toggle__open { display: none; }
  body.nav-open .nav-toggle__close { display: block; }
}

/* =====================================================================
   Accessibility
   ===================================================================== */
:where(a, button, input, summary):focus-visible {
  outline: 3px solid rgba(14,165,233,0.5);
  outline-offset: 2px;
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
