/* ============================================================
   Real-Time Geofencing — site styles
   Light, professional palette inspired by spatial / map UIs.
   ============================================================ */

:root {
  /* Palette */
  --bg: #f6f8fa;
  --bg-soft: #ffffff;
  --bg-tint: #eef4f6;
  --surface: #ffffff;
  --surface-elev: #ffffff;
  --border: #d8e1e8;
  --border-soft: #e7edf1;

  --ink: #0b1d2a;
  --ink-soft: #1f2d3a;
  --ink-mute: #54657a;
  --ink-faint: #7c8fa3;

  --primary: #0f766e;          /* teal */
  --primary-strong: #0a5b54;
  --primary-soft: #d1f1ec;

  --accent-coral: #ef6c54;
  --accent-coral-soft: #ffe2d8;
  --accent-amber: #d97706;
  --accent-amber-soft: #fde8c4;
  --accent-violet: #7c3aed;
  --accent-violet-soft: #ece4ff;
  --accent-cyan: #0891b2;
  --accent-cyan-soft: #d3eff5;
  --accent-rose: #be185d;
  --accent-lime: #4d7c0f;

  --link: #075e54;
  --link-hover: #0f766e;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.12);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --header-h: 64px;
  --page-max: 1640px;
  --prose-max: 100%;
  --gutter: clamp(16px, 3.5vw, 56px);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --font-display: "Inter", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  border-radius: 0 0 var(--radius) 0;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}
.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius);
  padding: 4px 6px;
  transition: background 0.15s ease;
}
.site-header__brand:hover { background: var(--bg-tint); }
.site-header__brandtext { display: flex; flex-direction: column; line-height: 1.1; }
.site-header__brandtitle {
  font-weight: 700;
  font-size: 1.05rem;
  background: linear-gradient(90deg, var(--primary-strong), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.site-header__brandsub {
  font-size: 0.75rem;
  color: var(--ink-mute);
  margin-top: 2px;
}

.site-header__nav { margin-left: auto; }
.site-header__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.site-header__list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.site-header__list a:hover {
  background: var(--bg-tint);
  color: var(--primary-strong);
}
.site-header__list a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.site-header__list .nav-icon { flex: 0 0 auto; }

.site-header__toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 8px;
  color: var(--ink);
  cursor: pointer;
}
.site-header__toggle:hover { background: var(--bg-tint); }

@media (max-width: 820px) {
  .site-header__toggle { display: inline-flex; }
  .site-header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: var(--shadow-md);
  }
  .site-header__nav.is-open { display: block; }
  .site-header__list {
    flex-direction: column;
    align-items: stretch;
    padding: 8px var(--gutter) 12px;
    gap: 2px;
  }
  .site-header__list a { padding: 12px; }
}

/* ---------- main ---------- */
.site-main {
  flex: 1 0 auto;
  width: 100%;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 64px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-tint) 100%);
  border-top: 1px solid var(--border-soft);
}
.site-footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: grid;
  gap: 24px;
  grid-template-columns: 1.2fr 1fr 1fr;
  align-items: start;
}
.site-footer__brand { display: flex; gap: 12px; align-items: center; }
.site-footer__name { font-weight: 700; color: var(--ink); }
.site-footer__tag { color: var(--ink-mute); font-size: 0.9rem; }
.site-footer__navtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  margin: 0 0 8px;
}
.site-footer__nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer__nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
}
.site-footer__nav a:hover { color: var(--primary-strong); text-decoration: underline; }
.site-footer__meta { color: var(--ink-mute); font-size: 0.9rem; align-self: end; }

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

/* ---------- page shell ---------- */
.page-shell {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px var(--gutter) 48px;
  display: grid;
  gap: 24px;
}
.page-grid { display: block; }
.page-shell--with-toc .page-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 1100px) {
  .page-shell--with-toc .page-grid {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

/* ---------- page meta (reading time chips) ---------- */
.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.page-meta__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-tint);
  color: var(--ink-mute);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-soft);
}
.page-meta__chip svg { color: var(--primary); }

/* ---------- on-this-page TOC ---------- */
.page-toc {
  order: 2;
}
@media (min-width: 1100px) {
  .page-toc { order: 0; }
}
.page-toc__inner {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
}
.page-toc__title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  font-weight: 700;
}
.page-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
  counter-reset: none;
}
.page-toc__item { padding: 0; }
.page-toc__item::before { content: none !important; }
.page-toc__item a {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--ink-mute);
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.page-toc__item a:hover {
  background: var(--bg-tint);
  color: var(--primary-strong);
}
.page-toc__item--l3 a {
  padding-left: 22px;
  font-size: 0.82rem;
}
.page-toc__item a.is-active {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* ---------- inline SVG diagrams ---------- */
.diagram {
  margin: 1.6em 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 10px;
  justify-items: center;
  overflow-x: auto;
}
.diagram > svg { max-width: 100%; height: auto; display: block; }
.diagram__caption {
  font-size: 0.88rem;
  color: var(--ink-mute);
  text-align: center;
  max-width: 80ch;
}

/* ---------- mermaid block restyle ---------- */
.mermaid-block {
  display: grid;
  justify-items: center;
}
.mermaid-block .mermaid { width: 100%; }
.mermaid-block svg { max-width: 100%; height: auto; }

/* ---------- back-to-top floating button ---------- */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 60;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.back-to-top:hover {
  background: var(--primary-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.back-to-top[hidden] { display: none; }

/* ---------- stat callout component ---------- */
.callout {
  margin: 1.4em 0;
  padding: 16px 20px;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
  background: linear-gradient(90deg, var(--primary-soft) 0%, rgba(209, 241, 236, 0) 70%);
  display: grid;
  gap: 6px;
}
.callout--warn {
  border-left-color: var(--accent-amber);
  background: linear-gradient(90deg, var(--accent-amber-soft) 0%, rgba(253, 232, 196, 0) 70%);
}
.callout--danger {
  border-left-color: var(--accent-coral);
  background: linear-gradient(90deg, var(--accent-coral-soft) 0%, rgba(255, 226, 216, 0) 70%);
}
.callout__title {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-strong);
  font-weight: 700;
}
.callout--warn .callout__title { color: #92400e; }
.callout--danger .callout__title { color: var(--accent-rose); }
.callout__body { margin: 0; color: var(--ink-soft); }

.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 1.4em 0;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.stat-card__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  font-weight: 600;
}
.stat-card__value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-strong);
  font-variant-numeric: tabular-nums;
}
.stat-card__note { font-size: 0.82rem; color: var(--ink-mute); }
.stat-card--coral .stat-card__value { color: var(--accent-coral); }
.stat-card--violet .stat-card__value { color: var(--accent-violet); }
.stat-card--cyan .stat-card__value { color: var(--accent-cyan); }

/* ---------- breadcrumbs ---------- */
.breadcrumbs {
  font-size: 0.9rem;
  color: var(--ink-mute);
}
.breadcrumbs__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.breadcrumbs__item {
  display: flex;
  align-items: center;
}
.breadcrumbs__item + .breadcrumbs__item::before {
  content: "›";
  color: var(--ink-faint);
  padding: 0 8px;
}
.breadcrumbs a {
  color: var(--ink-mute);
  text-decoration: none;
  border-radius: 4px;
  padding: 2px 4px;
}
.breadcrumbs a:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
}
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- prose / article ---------- */
.prose {
  max-width: none;
  width: 100%;
  font-size: 1.02rem;
}
.prose > *,
.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose .table-scroll,
.prose .code-block,
.prose .mermaid-block,
.prose .faq-accordion {
  max-width: 100%;
}

.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.2rem + 2vw, 2.8rem);
  line-height: 1.15;
  margin: 0 0 0.25em;
  background: linear-gradient(90deg, var(--primary-strong) 0%, var(--accent-cyan) 60%, var(--accent-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.prose h2 {
  font-size: clamp(1.35rem, 1rem + 1vw, 1.7rem);
  line-height: 1.25;
  margin: 2em 0 0.4em;
  color: var(--ink);
  scroll-margin-top: calc(var(--header-h) + 16px);
  position: relative;
  padding-bottom: 6px;
}
.prose h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
}
.prose h3 {
  font-size: 1.2rem;
  margin: 1.6em 0 0.4em;
  color: var(--ink);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.prose h4 { font-size: 1.05rem; margin: 1.3em 0 0.3em; color: var(--ink-soft); scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h2 a, .prose h3 a, .prose h4 a {
  color: inherit;
  text-decoration: none;
}
.prose h2 .header-anchor,
.prose h3 .header-anchor,
.prose h4 .header-anchor {
  margin-left: 8px;
  color: var(--ink-faint);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.prose h2:hover .header-anchor,
.prose h3:hover .header-anchor,
.prose h4:hover .header-anchor { opacity: 1; }

.prose p {
  margin: 0 0 1em;
  color: var(--ink-soft);
}
.prose strong { color: var(--ink); }
.prose em { color: var(--ink-soft); }
/* ---------- lists ---------- */
.prose ul,
.prose ol {
  margin: 0.6em 0 1.2em;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.prose li {
  position: relative;
  padding: 4px 0 4px 1.7em;
  color: var(--ink-soft);
  line-height: 1.55;
}
.prose ul > li::before {
  content: "";
  position: absolute;
  left: 0.45em;
  top: 0.82em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.prose ol {
  counter-reset: list-counter;
}
.prose ol > li {
  counter-increment: list-counter;
  padding-left: 2.4em;
}
.prose ol > li::before {
  content: counter(list-counter);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.7em;
  height: 1.7em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(15, 118, 110, 0.2);
}
/* Nested lists */
.prose li > ul,
.prose li > ol {
  margin: 6px 0 4px;
}
.prose li > ul > li::before {
  background: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
  width: 6px;
  height: 6px;
  top: 0.9em;
}
.prose li > ul > li > ul > li::before {
  background: var(--accent-coral);
  box-shadow: 0 0 0 3px rgba(239, 108, 84, 0.12);
}
/* Definition lists */
.prose dl { margin: 1em 0; display: grid; gap: 6px; }
.prose dt { font-weight: 700; color: var(--ink); }
.prose dd { margin: 0 0 8px 1em; color: var(--ink-soft); }

.prose blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-soft);
}

.prose a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(15, 118, 110, 0.35);
  text-underline-offset: 3px;
  transition: color 0.15s ease, background 0.15s ease, text-decoration-color 0.15s ease;
  border-radius: 3px;
  padding: 0 2px;
}
.prose a:hover {
  color: var(--link-hover);
  background: var(--primary-soft);
  text-decoration-color: var(--primary-strong);
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--border-soft);
  margin: 2em 0;
}

/* Inline code */
.inline-code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-tint);
  color: var(--primary-strong);
  padding: 1px 6px;
  border-radius: 4px;
  border: none;
}

/* Code blocks */
.code-block {
  position: relative;
  margin: 1.4em 0;
  border-radius: var(--radius);
  background: #f3f7f8;
  border: 1px solid var(--border-soft);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.code-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: linear-gradient(180deg, #eaf2f4 0%, #e1ebee 100%);
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.8rem;
}
.code-block__lang {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  font-weight: 600;
  font-family: var(--font-mono);
}
.code-block__copy {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.code-block__copy:hover { background: var(--primary-soft); color: var(--primary-strong); }
.code-block__copy:active { transform: translateY(1px); }
.code-block__copy.is-copied { background: var(--primary); color: #fff; border-color: var(--primary); }

.code-block__pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  background: transparent;
  color: var(--ink);
}
.code-block__pre code { font-family: var(--font-mono); background: transparent; }

/* Tables */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 1.4em 0;
}
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 480px;
}
.table-scroll thead th {
  text-align: left;
  background: linear-gradient(180deg, #eaf2f4, #dde9ec);
  color: var(--ink);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.table-scroll tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink-soft);
}
.table-scroll tbody tr:nth-child(odd) td { background: #fbfdfe; }
.table-scroll tbody tr:hover td { background: var(--bg-tint); }
.table-scroll tbody tr:last-child td { border-bottom: 0; }

/* Task lists (interactive checkboxes) */
.prose ul.contains-task-list,
.prose ul:has(> .task-list-item) {
  list-style: none;
  padding-left: 0;
}
.prose .task-list-item {
  list-style: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.prose .task-list-item::before { content: none; }
.prose .task-list-item:hover { background: var(--bg-tint); }
.prose .task-list-item > label {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  color: var(--ink-soft);
  width: 100%;
}
.prose .task-list-item input[type="checkbox"] {
  margin-top: 6px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex: 0 0 auto;
}
.prose .task-list-item.is-checked > label {
  text-decoration: line-through;
  color: var(--ink-faint);
}

/* Mermaid */
.mermaid-block {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  margin: 1.4em 0;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

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

/* FAQ accordions */
.faq-accordion { display: grid; gap: 8px; margin: 1.4em 0; }
.faq-item {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.faq-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.15s ease;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 700;
  line-height: 1;
}
.faq-item[open] > summary::after { content: "−"; }
.faq-item > summary:hover { background: var(--bg-tint); }
.faq-answer { padding: 0 18px 16px; color: var(--ink-soft); }
.faq-answer > *:first-child { margin-top: 0; }
.faq-answer > *:last-child { margin-bottom: 0; }

/* ---------- related nav ---------- */
.related-nav {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.related-nav__title {
  margin: 0 0 10px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}
.related-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.related-nav__list a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-tint);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.related-nav__list a:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ============================================================
   Home page
   ============================================================ */
.home {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
}
.hero {
  display: grid;
  gap: 28px;
  padding: 40px 0 20px;
  text-align: center;
}
.hero__logo {
  display: flex;
  justify-content: center;
}
.hero__logo svg {
  width: clamp(160px, 28vw, 280px);
  height: auto;
  filter: drop-shadow(0 16px 32px rgba(15, 23, 42, 0.18));
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem);
  line-height: 1.1;
  margin: 0;
  background: linear-gradient(90deg, var(--primary-strong) 0%, var(--accent-cyan) 45%, var(--accent-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__tag {
  margin: 0 auto;
  max-width: 720px;
  font-size: 1.1rem;
  color: var(--ink-mute);
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  color: #fff;
}
.btn--primary:hover { color: #fff; }
.btn--coral {
  background: linear-gradient(135deg, var(--accent-coral), var(--accent-amber));
  color: #fff;
}
.btn--violet {
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-rose));
  color: #fff;
}
.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--bg-tint); }
.btn .btn-icon { display: inline-flex; }

.intro {
  max-width: 820px;
  margin: 32px auto 0;
  display: grid;
  gap: 1em;
  color: var(--ink-soft);
  font-size: 1.05rem;
  text-align: left;
}

.section-grid {
  margin-top: 48px;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.section-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.section-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.section-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.section-card__icon--teal { background: linear-gradient(135deg, var(--primary), var(--accent-cyan)); }
.section-card__icon--coral { background: linear-gradient(135deg, var(--accent-coral), var(--accent-amber)); }
.section-card__icon--violet { background: linear-gradient(135deg, var(--accent-violet), var(--accent-rose)); }
.section-card__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.section-card__desc { color: var(--ink-mute); margin: 0; }
.section-card__cta {
  margin-top: 4px;
  color: var(--primary-strong);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.section-card__cta::after { content: "→"; transition: transform 0.15s; }
.section-card:hover .section-card__cta::after { transform: translateX(4px); }

.deep-list {
  margin-top: 56px;
}
.deep-list__title {
  font-size: 1.3rem;
  margin: 0 0 16px;
  color: var(--ink);
}
.deep-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.deep-list a {
  display: block;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
  box-shadow: var(--shadow-sm);
}
.deep-list a:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:hover, .section-card:hover { transform: none; }
}
