/* =========================================================================
   Geospatial Data Testing & QA Automation — global styles
   Light, professional, earthy teal/green palette with blue + purple accents.
   ========================================================================= */

:root {
  /* Surfaces & ink */
  --bg: #f6faf8;
  --surface: #ffffff;
  --surface-2: #eef6f3;
  --code-bg: #f0f7f5;
  --ink: #12302b;
  --ink-soft: #3a554f;
  --muted: #6a817b;
  --border: #d8e7e2;
  --border-strong: #b9d3cc;

  /* Brand & accents */
  --brand: #0f766e;
  --brand-strong: #0b5b54;
  --brand-2: #15803d;
  --accent-blue: #2563eb;
  --accent-purple: #9333ea;
  --accent-amber: #b45309;
  --accent: var(--brand);

  --link: #0c726a;
  --link-hover: #0b5b54;

  /* Geometry */
  --header-h: 4.25rem;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1280px;
  --maxw-text: 1180px;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(15, 60, 55, 0.06), 0 1px 3px rgba(15, 60, 55, 0.08);
  --shadow-md: 0 6px 18px rgba(15, 60, 55, 0.10);
  --shadow-lg: 0 18px 48px rgba(11, 60, 55, 0.16);
  --ring: 0 0 0 3px rgba(15, 118, 110, 0.28);
  --t: 0.18s ease;

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

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 0.4rem + 2.6vw, 2.75rem);
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---- Links --------------------------------------------------------------- */
a {
  color: var(--link);
  text-decoration: none;
}
.article a,
.intro a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(15, 118, 110, 0.35);
  transition: color var(--t), text-decoration-color var(--t),
    background-color var(--t);
  border-radius: 3px;
}
.article a:hover,
.intro a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
  background: rgba(15, 118, 110, 0.07);
}
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 1000;
  background: var(--brand);
  color: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: 0 0 10px 10px;
  transition: top var(--t);
}
.skip-link:focus {
  top: 0;
}

/* ---- Icons --------------------------------------------------------------- */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  vertical-align: -0.18em;
}

/* ---- Brand --------------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.1;
}
.brand-logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  flex: none;
  filter: drop-shadow(0 2px 6px rgba(15, 60, 55, 0.22));
  transition: transform var(--t), filter var(--t);
}
.brand:hover .brand-logo {
  transform: translateY(-1px) rotate(-3deg);
  filter: drop-shadow(0 4px 12px rgba(15, 60, 55, 0.3));
}
.brand__text {
  display: flex;
  flex-direction: column;
}
.brand__name {
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.brand__tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
}

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

.primary-nav__list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}
.nav-link {
  --accent: var(--brand);
  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;
  position: relative;
  transition: color var(--t), background-color var(--t), transform var(--t);
}
.nav-link__icon {
  color: var(--accent);
  transition: transform var(--t);
}
.nav-link:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.nav-link:hover .nav-link__icon {
  transform: scale(1.12);
}
.nav-link.is-active {
  color: var(--brand-strong);
  background: color-mix(in srgb, var(--accent) 14%, white);
}
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.18rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  color: var(--brand);
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.nav-toggle:hover {
  background: var(--surface-2);
}
.nav-toggle .icon {
  width: 1.5rem;
  height: 1.5rem;
}
.nav-toggle__close {
  display: none;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }
  .primary-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 0.6rem clamp(1rem, 4vw, 2rem) 1rem;
    display: none;
  }
  .primary-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }
  .nav-link {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 1rem;
  }
  .nav-link.is-active::after {
    display: none;
  }
  .site-header.nav-open .primary-nav {
    display: block;
    animation: navDrop 0.18s ease;
  }
  .site-header.nav-open .nav-toggle__open {
    display: none;
  }
  .site-header.nav-open .nav-toggle__close {
    display: inline-flex;
  }
  .brand__tag {
    display: none;
  }
}
@keyframes navDrop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 500px at 12% -10%, rgba(21, 128, 61, 0.10), transparent 60%),
    radial-gradient(1100px 460px at 100% 0%, rgba(37, 99, 235, 0.09), transparent 55%),
    linear-gradient(180deg, #eef7f4 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.hero__inner {
  text-align: center;
  padding-block: clamp(2.75rem, 1.5rem + 6vw, 5.5rem);
}
.hero__logo {
  display: block;
}
.hero__brand {
  width: clamp(5rem, 3rem + 9vw, 7.5rem);
  height: clamp(5rem, 3rem + 9vw, 7.5rem);
  border-radius: 26px;
  filter: drop-shadow(0 12px 30px rgba(15, 60, 55, 0.28));
  transition: transform var(--t);
}
.hero__logo:hover .hero__brand {
  transform: translateY(-3px) scale(1.02);
}
.hero__title {
  margin: 1.4rem auto 0;
  font-size: clamp(2rem, 1.2rem + 3.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
  max-width: 16ch;
  background: linear-gradient(100deg, var(--brand-strong), var(--brand) 45%, var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__amp {
  color: var(--accent-blue);
  -webkit-text-fill-color: var(--accent-blue);
}
.hero__lede {
  margin: 1.25rem auto 0;
  max-width: 60ch;
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
  color: var(--ink-soft);
}
.hero__cta {
  margin-top: 2.25rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  text-align: left;
}

.cta-btn {
  --accent: var(--brand);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.cta-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  flex: none;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(140deg,
    color-mix(in srgb, var(--accent) 88%, white),
    var(--accent));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 38%, transparent);
}
.cta-btn__icon .icon {
  width: 1.6rem;
  height: 1.6rem;
}
.cta-btn__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cta-btn__label {
  font-weight: 700;
  font-size: 1.05rem;
}
.cta-btn__sub {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cta-btn__arrow {
  margin-left: auto;
  color: var(--accent);
  transition: transform var(--t);
}
.cta-btn:hover .cta-btn__arrow {
  transform: translateX(4px);
}

.error-code {
  margin: 1.4rem 0 -0.6rem;
  font-size: clamp(2.5rem, 1.5rem + 5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
  color: transparent;
  background: linear-gradient(100deg, var(--brand), var(--accent-blue));
  -webkit-background-clip: text;
  background-clip: text;
}

/* ---- Intro --------------------------------------------------------------- */
.intro__inner {
  max-width: var(--maxw-text);
  padding-block: clamp(2rem, 1rem + 3vw, 3.25rem);
}
.intro p {
  margin: 0 0 1.1rem;
  font-size: 1.08rem;
  color: var(--ink-soft);
}
.intro strong {
  color: var(--ink);
}

/* ---- Section cards (home) ------------------------------------------------ */
.sections {
  padding-bottom: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
}
.section-heading {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
  color: var(--ink);
}
.section-cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}
.section-card {
  --accent: var(--brand);
  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;
  border-top: 4px solid var(--accent);
  transition: transform var(--t), box-shadow var(--t);
}
.section-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.section-card__head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}
.section-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, white);
}
.section-card__icon .icon {
  width: 1.5rem;
  height: 1.5rem;
}
.section-card__title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
}
.section-card__title a {
  color: var(--ink);
}
.section-card__title a:hover {
  color: var(--accent);
}
.section-card__blurb {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.section-card__links {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}
.section-card__links a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.4rem;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  transition: background var(--t), color var(--t);
}
.section-card__links a:hover {
  background: var(--surface-2);
  color: var(--brand-strong);
}
.section-card__bullet {
  width: 0.95em;
  height: 0.95em;
  color: var(--accent);
}
.section-card__more {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--accent);
}
.section-card__more .icon {
  transition: transform var(--t);
}
.section-card__more:hover .icon {
  transform: translateX(4px);
}

/* ---- Content layout ------------------------------------------------------ */
.content-layout {
  padding-block: 1.5rem clamp(2.5rem, 1.5rem + 3vw, 4rem);
  display: grid;
  gap: 1.5rem 2.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 1080px) {
  .content-layout {
    grid-template-columns: minmax(0, 1fr) 19rem;
    grid-template-areas:
      "crumbs crumbs"
      "article aside";
    align-items: start;
  }
  .breadcrumbs {
    grid-area: crumbs;
  }
  .article {
    grid-area: article;
  }
  .sidebar {
    grid-area: aside;
    position: sticky;
    top: calc(var(--header-h) + 1.25rem);
    max-height: calc(100vh - var(--header-h) - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ---- Breadcrumbs --------------------------------------------------------- */
.breadcrumbs {
  margin-top: 0.5rem;
}
.breadcrumbs__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.1rem;
  margin: 0;
  padding: 0;
  font-size: 0.86rem;
  color: var(--muted);
}
.breadcrumbs__item {
  display: inline-flex;
  align-items: center;
}
.breadcrumbs__item a {
  color: var(--ink-soft);
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  transition: background var(--t), color var(--t);
}
.breadcrumbs__item a:hover {
  background: var(--surface-2);
  color: var(--brand-strong);
}
.breadcrumbs__item [aria-current="page"] {
  color: var(--brand-strong);
  font-weight: 600;
  padding: 0.15rem 0.35rem;
}
.breadcrumbs__sep {
  width: 1em;
  height: 1em;
  color: var(--border-strong);
  margin-inline: 0.1rem;
}

/* ---- Article typography -------------------------------------------------- */
.article {
  min-width: 0;
}
.article h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 2.85rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0.2rem 0 0.4rem;
  background: linear-gradient(100deg, var(--brand-strong), var(--brand) 50%, var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.article h1::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 4px;
  margin-top: 0.85rem;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent-blue));
}
.article h2 {
  font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 2.4rem 0 0.9rem;
  padding-left: 0.85rem;
  border-left: 4px solid var(--brand);
  color: var(--ink);
}
.article h3 {
  font-size: clamp(1.18rem, 1.05rem + 0.5vw, 1.4rem);
  margin: 1.9rem 0 0.7rem;
  color: var(--brand-strong);
}
.article h4 {
  font-size: 1.08rem;
  margin: 1.5rem 0 0.6rem;
  color: var(--ink);
}
.article h2,
.article h3,
.article h4 {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.article p,
.article li {
  color: var(--ink-soft);
}
.article p {
  margin: 0 0 1.15rem;
}
.article > p:first-of-type {
  font-size: 1.1rem;
  color: var(--ink);
}
.article strong {
  color: var(--ink);
  font-weight: 700;
}
.article ul,
.article ol {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
}
.article li {
  margin: 0.35rem 0;
}
.article li::marker {
  color: var(--brand);
}
.article blockquote {
  margin: 1.5rem 0;
  padding: 0.6rem 1.2rem;
  border-left: 4px solid var(--brand);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
}
.article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Header anchor links (markdown-it-anchor headerLink) */
.article :is(h2, h3, h4) > a {
  color: inherit;
  text-decoration: none;
}
.article :is(h2, h3, h4) > a:hover {
  color: var(--brand);
}

/* ---- Inline code --------------------------------------------------------- */
.article :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  color: var(--brand-strong);
  padding: 0.12em 0.4em;
  border-radius: 6px;
  border: none;
  white-space: break-spaces;
}

/* ---- Code blocks --------------------------------------------------------- */
.code-block {
  position: relative;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.code-block::before {
  content: attr(data-lang);
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--brand) 9%, white);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0 0 9px 0;
  padding: 0.25rem 0.7rem;
}
.code-block pre {
  margin: 0;
  padding: 2.3rem 1.1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.65;
  tab-size: 4;
}
.code-block code {
  font-family: var(--font-mono);
  color: #1f3d38;
  background: none;
  padding: 0;
}
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--brand-strong);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity var(--t), transform var(--t), background var(--t),
    color var(--t);
}
.code-block:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
  transform: translateY(0);
}
.copy-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.code-block.is-copied .copy-btn {
  opacity: 1;
  background: var(--brand-2);
  color: #fff;
  border-color: var(--brand-2);
}
@media (max-width: 640px) {
  .copy-btn {
    opacity: 1;
    transform: none;
  }
}

/* Prism light theme — tuned to the site palette */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6a8a84;
  font-style: italic;
}
.token.punctuation {
  color: #51736c;
}
.token.keyword,
.token.atrule {
  color: #8b2fc9;
}
.token.boolean,
.token.constant,
.token.symbol {
  color: #b45309;
}
.token.number {
  color: #b4530b;
}
.token.string,
.token.char,
.token.attr-value {
  color: #0f766e;
}
.token.builtin,
.token.class-name,
.token.tag {
  color: #0e7490;
}
.token.function {
  color: #2563eb;
}
.token.operator,
.token.entity,
.token.url {
  color: #4a6c65;
}
.token.property,
.token.attr-name {
  color: #b4530b;
}
.token.decorator,
.token.annotation {
  color: #9333ea;
}
.token.important {
  color: #be185d;
  font-weight: 700;
}

/* ---- Tables -------------------------------------------------------------- */
.table-wrap {
  margin: 1.5rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  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 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table-wrap thead th {
  background: color-mix(in srgb, var(--brand) 10%, white);
  color: var(--brand-strong);
  font-weight: 700;
  border-bottom: 2px solid var(--border-strong);
  white-space: nowrap;
}
.table-wrap tbody tr:nth-child(even) {
  background: var(--surface-2);
}
.table-wrap tbody tr:hover {
  background: color-mix(in srgb, var(--brand) 6%, white);
}
.table-wrap td {
  color: var(--ink-soft);
}

/* ---- Task lists (interactive checkboxes) --------------------------------- */
.article .contains-task-list {
  list-style: none;
  padding-left: 0.2rem;
}
.article .task-list-item {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.15rem 0;
}
.article .task-list-item::marker {
  content: "";
}
.article .task-list-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.18rem;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background var(--t), border-color var(--t);
}
.article .task-list-item input[type="checkbox"]::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  transform: scale(0);
  transition: transform var(--t);
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 18%, 84% 4%, 38% 70%);
  background: #fff;
}
.article .task-list-item input[type="checkbox"]:checked {
  background: var(--brand);
  border-color: var(--brand);
}
.article .task-list-item input[type="checkbox"]:checked::before {
  transform: scale(1);
}
.article .task-list-item.is-checked {
  color: var(--muted);
}
.article .task-list-item.is-checked > label,
.article .task-list-item.is-checked {
  text-decoration: line-through;
  text-decoration-color: var(--border-strong);
}

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

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

/* ---- FAQ accordions ------------------------------------------------------ */
.faq {
  margin: 1.5rem 0;
  display: grid;
  gap: 0.7rem;
}
.faq__item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq__q {
  cursor: pointer;
  list-style: none;
  padding: 0.95rem 1.1rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background var(--t);
}
.faq__q::-webkit-details-marker {
  display: none;
}
.faq__q::before {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2.5px solid var(--brand);
  border-bottom: 2.5px solid var(--brand);
  transform: rotate(-45deg);
  transition: transform var(--t);
}
.faq__item[open] .faq__q::before {
  transform: rotate(45deg);
}
.faq__q:hover {
  background: var(--surface-2);
}
.faq__a {
  padding: 0 1.1rem 1.1rem;
  color: var(--ink-soft);
}
.faq__a > :first-child {
  margin-top: 0;
}

/* ---- Related sidebar ----------------------------------------------------- */
.related {
  min-width: 0;
}
.related__heading {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.related__heading + .related__heading {
  margin-top: 1.5rem;
}
.related__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.related__card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.related__card:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  color: var(--brand-strong);
}
.related__card-title {
  flex: 1;
}
.related__card-arrow {
  color: var(--brand);
  width: 1em;
  height: 1em;
}
.related__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.1rem;
}
.related__list a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  transition: background var(--t), color var(--t);
}
.related__list a:hover {
  background: var(--surface-2);
  color: var(--brand-strong);
}
.related__bullet {
  width: 0.9em;
  height: 0.9em;
  color: var(--brand);
  flex: none;
}

/* ---- Article reading-time meta ------------------------------------------ */
.article__meta {
  margin: 0 0 1.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.article__meta::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--brand-2);
}

/* ---- On-page table of contents ------------------------------------------ */
.toc {
  display: none;
}
@media (min-width: 1080px) {
  .toc {
    display: block;
  }
}
.toc[hidden] {
  display: none !important;
}
.toc__heading {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.6rem;
}
.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}
.toc__item a {
  display: block;
  padding: 0.3rem 0.4rem 0.3rem 0.85rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.4;
  transition: color var(--t), border-color var(--t), background var(--t);
}
.toc__item--h3 a {
  padding-left: 1.6rem;
  font-size: 0.84rem;
  color: var(--muted);
}
.toc__item a:hover {
  color: var(--brand-strong);
  background: var(--surface-2);
}
.toc__item a.is-current {
  color: var(--brand-strong);
  border-left-color: var(--brand);
  font-weight: 600;
}

/* ---- Back to top --------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: clamp(1rem, 2vw, 2rem);
  bottom: clamp(1rem, 2vw, 2rem);
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--t), transform var(--t), background var(--t);
  z-index: 90;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.back-to-top:hover {
  background: var(--brand-strong);
  transform: translateY(-2px);
}
.back-to-top .icon {
  width: 1.4rem;
  height: 1.4rem;
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background: #0c2f2b;
  color: #cfe6e0;
}
.site-footer__inner {
  display: grid;
  gap: 2rem;
  padding-block: clamp(2.25rem, 1.5rem + 2.5vw, 3.5rem);
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .site-footer__inner {
    grid-template-columns: 1.5fr 1fr;
  }
}
.brand--footer .brand__name,
.brand--footer {
  color: #f3fbf9;
}
.brand--footer .brand__tag {
  color: #6fd8c4;
}
.site-footer__blurb {
  margin: 1rem 0 0;
  max-width: 48ch;
  color: #a9cfc7;
  font-size: 0.95rem;
}
.site-footer__heading {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6fd8c4;
  margin: 0 0 0.9rem;
}
.site-footer__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.site-footer__nav a {
  --accent: #6fd8c4;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #cfe6e0;
  padding: 0.25rem 0;
  transition: color var(--t), transform var(--t);
}
.site-footer__nav a:hover {
  color: #fff;
  transform: translateX(3px);
}
.footer-icon {
  color: var(--accent);
  width: 1.1em;
  height: 1.1em;
}
.site-footer__bar {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-block: 1rem;
  font-size: 0.84rem;
  color: #8fb6ae;
}
.site-footer__bar p {
  margin: 0;
}

/* ---- Wide screens -------------------------------------------------------- */
@media (min-width: 1600px) {
  :root {
    --maxw: 1440px;
    --maxw-text: 1320px;
  }
}
