/* =========================================================
   Geospatial-Processing.com — Stylesheet
   Light, professional palette inspired by topography & sky.
   ========================================================= */

:root {
  /* Earth & sky palette */
  --c-bg: #f7f9fb;
  --c-surface: #ffffff;
  --c-surface-2: #eef3f7;
  --c-border: #d8e0e8;
  --c-border-strong: #b7c3d0;

  --c-ink: #1f2a35;          /* deep slate ink */
  --c-ink-soft: #455463;
  --c-muted: #6e7d8b;

  --c-primary: #0d6e7f;      /* deep teal — water/coast */
  --c-primary-600: #0b5c6b;
  --c-primary-100: #d6ebef;
  --c-accent: #d97706;       /* warm topo orange */
  --c-accent-100: #fde7c8;
  --c-success: #2f8f5e;      /* forest */
  --c-success-100: #d6efe1;
  --c-info: #2a6fbf;         /* sky */
  --c-info-100: #dbe8f8;
  --c-warn: #c2832b;
  --c-warn-100: #f7ecd1;
  --c-violet: #6f56d6;
  --c-violet-100: #e3dcfa;

  --c-code-bg: #f1f5f9;
  --c-code-ink: #20364a;
  --c-inline-bg: #ecf2f7;

  --shadow-sm: 0 1px 2px rgba(20, 40, 60, 0.06);
  --shadow-md: 0 4px 12px rgba(20, 40, 60, 0.08);
  --shadow-lg: 0 12px 32px rgba(20, 40, 60, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --header-height: 64px;

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

  --content-max: 1440px;
  --reading-max: 78ch;
}

/* Reset / base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--c-ink);
  background: var(--c-bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(13, 110, 127, 0.06), transparent 50%),
    radial-gradient(at 100% 0%, rgba(217, 119, 6, 0.05), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--c-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
a:hover,
a:focus-visible {
  color: var(--c-primary-600);
  border-bottom-color: var(--c-primary);
}
a:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.25;
  margin: 2.2em 0 0.6em;
  letter-spacing: -0.01em;
  color: var(--c-ink);
  scroll-margin-top: calc(var(--header-height) + 16px);
}
h1 {
  font-size: clamp(1.9rem, 1.6rem + 1.4vw, 2.6rem);
  margin-top: 0.2em;
  background: linear-gradient(110deg, var(--c-primary) 0%, var(--c-violet) 55%, var(--c-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 {
  font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.75rem);
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 0.3em;
  color: var(--c-primary-600);
}
h3 {
  font-size: 1.25rem;
  color: var(--c-ink);
}
h4 {
  font-size: 1.05rem;
  color: var(--c-ink-soft);
}

p {
  margin: 0 0 1.1em;
}

strong {
  color: var(--c-ink);
}

/* Selection */
::selection {
  background: var(--c-primary-100);
  color: var(--c-primary-600);
}

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

/* ============== HEADER ============== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--c-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}
.site-header__inner {
  width: min(100% - 2rem, var(--content-max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: space-between;
}
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--c-ink);
  font-weight: 700;
  font-size: 1.02rem;
  border-bottom: none;
}
.site-logo:hover {
  color: var(--c-primary);
}
.site-logo__mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.site-logo__title {
  white-space: nowrap;
}
.site-logo__sub {
  display: block;
  font-size: 0.7rem;
  color: var(--c-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--c-ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
  border-bottom: none;
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--c-surface-2);
  color: var(--c-primary-600);
}
.site-nav a[aria-current="page"],
.site-nav a.is-active {
  background: var(--c-primary-100);
  color: var(--c-primary-600);
}
.site-nav__icon {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--c-border);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--c-ink);
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
  }
  .site-nav {
    position: absolute;
    top: var(--header-height);
    right: 1rem;
    flex-direction: column;
    align-items: stretch;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 240px;
    display: none;
  }
  .site-nav.is-open {
    display: flex;
  }
  .site-logo__sub {
    display: none;
  }
}

/* ============== HERO ============== */
.hero {
  padding: clamp(2.5rem, 4vw, 5rem) 0 clamp(2rem, 3vw, 3.5rem);
  position: relative;
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 980px) {
  .hero__inner {
    grid-template-columns: 1.2fr 0.8fr;
  }
}
.hero__eyebrow {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--c-primary-100);
  color: var(--c-primary-600);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero h1 {
  margin: 0 0 1rem;
}
.hero__lead {
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  color: var(--c-ink-soft);
  max-width: 64ch;
}
.hero__ctas {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 1.8rem;
}
.cta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  color: var(--c-ink);
  font-weight: 600;
  border-bottom: none;
  transition: transform 0.15s ease, box-shadow 0.18s ease,
    border-color 0.15s ease;
}
.cta:hover,
.cta:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-primary);
  color: var(--c-ink);
}
.cta__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cta__icon svg {
  width: 22px;
  height: 22px;
}
.cta__icon--event {
  background: var(--c-info-100);
  color: var(--c-info);
}
.cta__icon--architecture {
  background: var(--c-primary-100);
  color: var(--c-primary-600);
}
.cta__icon--package {
  background: var(--c-accent-100);
  color: var(--c-accent);
}
.cta__title {
  display: block;
  font-size: 1rem;
}
.cta__sub {
  display: block;
  font-size: 0.84rem;
  color: var(--c-muted);
  font-weight: 500;
}

.hero__art {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 460px;
  margin-inline: auto;
}
.hero__art svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 14px 28px rgba(13, 110, 127, 0.18));
}

/* ============== HOMEPAGE SECTIONS ============== */
.section {
  padding: clamp(2rem, 3.5vw, 4rem) 0;
}
.section h2 {
  margin-top: 0;
}
.intro-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.intro-grid p {
  background: var(--c-surface);
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  margin: 0;
  box-shadow: var(--shadow-sm);
}

.topic-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.topic-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.4rem 1.4rem 1.2rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.15s ease;
}
.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-primary);
  color: var(--c-ink);
}
.topic-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 0.4rem;
}
.topic-card__icon svg {
  width: 24px;
  height: 24px;
}
.topic-card__icon--event {
  background: var(--c-info-100);
  color: var(--c-info);
}
.topic-card__icon--architecture {
  background: var(--c-primary-100);
  color: var(--c-primary-600);
}
.topic-card__icon--package {
  background: var(--c-accent-100);
  color: var(--c-accent);
}
.topic-card h3 {
  margin: 0;
  font-size: 1.15rem;
}
.topic-card p {
  margin: 0;
  color: var(--c-ink-soft);
  font-size: 0.95rem;
}
.topic-card__more {
  margin-top: auto;
  padding-top: 0.6rem;
  font-weight: 600;
  color: var(--c-primary);
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.topic-card__more svg,
.topic-card__more-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.topic-card:hover .topic-card__more-icon {
  transform: translateX(3px);
  transition: transform 0.18s ease;
}

/* ============== CONTENT PAGE ============== */
.page {
  padding: 2rem 0 4rem;
}
.page__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1100px) {
  .page__grid {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}
.prose {
  font-size: 1.02rem;
  max-width: 100%;
}
.prose > * {
  max-width: 100%;
}
.prose ul,
.prose ol {
  padding-left: 1.4rem;
}
.prose li {
  margin-bottom: 0.45em;
}
.prose blockquote {
  border-left: 4px solid var(--c-primary);
  background: var(--c-primary-100);
  margin: 1.4em 0;
  padding: 0.9em 1.2em;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--c-ink-soft);
}

/* Inline code */
.prose :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--c-inline-bg);
  padding: 0.08em 0.4em;
  border-radius: 4px;
  color: var(--c-primary-600);
  border: 0;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  align-items: center;
  font-size: 0.86rem;
  color: var(--c-muted);
  margin-bottom: 1.2rem;
}
.breadcrumbs a {
  color: var(--c-muted);
  border-bottom: none;
}
.breadcrumbs a:hover {
  color: var(--c-primary);
}
.breadcrumbs__sep {
  color: var(--c-border-strong);
}
.breadcrumbs__current {
  color: var(--c-ink-soft);
  font-weight: 600;
}

/* Related links sidebar */
.related {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  box-shadow: var(--shadow-sm);
  height: fit-content;
}
.related h3 {
  margin: 0 0 0.7rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
}
.related ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.related li {
  margin-bottom: 0.45rem;
}
.related a {
  display: block;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  color: var(--c-ink-soft);
  border-bottom: none;
}
.related a:hover {
  background: var(--c-primary-100);
  color: var(--c-primary-600);
}

/* ============== CODE BLOCKS ============== */
.code-block {
  position: relative;
  background: var(--c-code-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  margin: 1.4em 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.code-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.7rem;
  background: linear-gradient(180deg, #eaf0f5, #dbe5ed);
  border-bottom: 1px solid var(--c-border);
  font-size: 0.78rem;
  color: var(--c-ink-soft);
}
.code-block__lang {
  font-family: var(--font-mono);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: var(--c-primary-600);
  font-weight: 600;
}
.code-block__copy {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-ink-soft);
  padding: 0.18rem 0.65rem;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.code-block__copy:hover {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.code-block__copy.is-copied {
  background: var(--c-success);
  color: #fff;
  border-color: var(--c-success);
}
.code-block__pre {
  margin: 0;
  padding: 1em 1.1em;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--c-code-ink);
  background: transparent;
}
.code-block__pre code {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  padding: 0;
}

/* Syntax tokens (light theme) */
.code-block .tok-kw   { color: #6f56d6; font-weight: 600; }
.code-block .tok-str  { color: #0b7a5b; }
.code-block .tok-num  { color: #c2832b; }
.code-block .tok-com  { color: #6e7d8b; font-style: italic; }
.code-block .tok-fn   { color: #2a6fbf; }
.code-block .tok-bi   { color: #0d6e7f; }
.code-block .tok-op   { color: #455463; }
.code-block .tok-pn   { color: #455463; }
.code-block .tok-var  { color: #d97706; }
.code-block .tok-tag  { color: #6f56d6; }
.code-block .tok-attr { color: #2a6fbf; }

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

/* ============== TASK LISTS (checkboxes) ============== */
.prose .task-list {
  list-style: none;
  padding-left: 0;
}
.prose .task-list-item {
  padding-left: 0;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.45em;
}
.prose .task-list-item::marker {
  content: "";
}
.prose .task-list-item input[type="checkbox"] {
  margin-top: 0.35em;
  width: 1.05em;
  height: 1.05em;
  cursor: pointer;
  accent-color: var(--c-primary);
  flex-shrink: 0;
}
.prose .task-list-item.is-checked,
.prose .task-list-item:has(input:checked) {
  color: var(--c-muted);
  text-decoration: line-through;
  text-decoration-color: var(--c-border-strong);
}

/* ============== TABLES ============== */
.table-wrap {
  overflow-x: auto;
  margin: 1.4em 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}
.table-wrap th,
.table-wrap td {
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  font-size: 0.95rem;
  vertical-align: top;
}
.table-wrap thead th {
  background: var(--c-surface-2);
  color: var(--c-primary-600);
  font-weight: 600;
  white-space: nowrap;
}
.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}
.table-wrap tbody tr:hover {
  background: var(--c-primary-100);
}

/* ============== ACCORDION (FAQ) ============== */
.faq {
  margin: 1.5em 0;
}
.faq details {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.faq details[open] {
  border-color: var(--c-primary);
}
.faq summary {
  cursor: pointer;
  padding: 0.95rem 1.1rem;
  font-weight: 600;
  color: var(--c-ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  font-size: 1.4em;
  color: var(--c-primary);
  transition: transform 0.2s ease;
  line-height: 1;
}
.faq details[open] summary::after {
  content: "−";
}
.faq__body {
  padding: 0 1.1rem 1rem;
  color: var(--c-ink-soft);
}

/* ============== FOOTER ============== */
.site-footer {
  margin-top: auto;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 2rem 0 1.4rem;
  color: var(--c-ink-soft);
}
.site-footer__inner {
  width: min(100% - 2rem, var(--content-max));
  margin-inline: auto;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .site-footer__inner {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}
.site-footer h4 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer li {
  margin-bottom: 0.35rem;
}
.site-footer a {
  color: var(--c-ink-soft);
  border-bottom: none;
  font-size: 0.95rem;
}
.site-footer a:hover {
  color: var(--c-primary);
}
.site-footer__bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--c-muted);
}

/* Page structure for sticky footer */
html,
body {
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
}
main {
  flex: 1 0 auto;
}

/* Print */
@media print {
  .site-header,
  .site-footer,
  .code-block__copy {
    display: none;
  }
  body {
    background: #fff;
  }
}
