/* =========================================================================
   Automated Map Visual Regression & Web Mapping Testing
   Light, cartography-inspired theme.
   ========================================================================= */

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, "Apple Color Emoji", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Fira Code",
    Menlo, Consolas, "Liberation Mono", monospace;

  /* Surfaces & ink */
  --bg: #f5f8f7;
  --surface: #ffffff;
  --surface-2: #eef4f2;
  --surface-3: #e4eeeb;
  --ink: #13343b;
  --ink-soft: #41575c;
  --muted: #6a7c80;
  --border: #d6e3e0;
  --border-strong: #c2d4d0;

  /* Accents */
  --accent-teal: #0e7a6f;
  --accent-teal-bright: #14b8a6;
  --accent-blue: #2563eb;
  --accent-amber: #d97706;
  --accent: var(--accent-teal); /* overridden per-section inline */

  --link: #0e7a6f;
  --link-hover: #0a5d54;

  /* Code */
  --code-bg: #f3f7f5;
  --code-inline-bg: #eaf2f0;
  --code-border: #dbe7e4;

  /* Layout */
  --shell-max: 1320px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --header-h: 66px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(19, 52, 59, 0.06), 0 2px 8px rgba(19, 52, 59, 0.05);
  --shadow-md: 0 6px 22px rgba(19, 52, 59, 0.1);
  --shadow-lg: 0 18px 48px rgba(19, 52, 59, 0.16);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(
      ellipse 80% 60% at 100% -10%,
      rgba(20, 184, 166, 0.08),
      transparent 60%
    ),
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(37, 99, 235, 0.06), transparent 55%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 0.18em;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -100%;
  z-index: 200;
  background: var(--accent-teal);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
  color: #fff;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 700;
}
.brand:hover {
  text-decoration: none;
  color: var(--ink);
}
.brand .logo-mark {
  width: 40px;
  height: 40px;
  flex: none;
  filter: drop-shadow(0 2px 5px rgba(14, 122, 111, 0.28));
  transition: transform 0.25s ease;
}
.brand:hover .logo-mark {
  transform: rotate(-4deg) scale(1.05);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-name {
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.primary-nav .nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
  border: 1px solid transparent;
  position: relative;
}
.nav-link .nav-ico {
  display: inline-flex;
  width: 22px;
  height: 22px;
}
.nav-link .nav-ico svg {
  width: 22px;
  height: 22px;
}
.nav-link:hover {
  text-decoration: none;
  color: var(--ink);
  background: var(--surface-2);
}
.nav-link.is-active {
  color: var(--accent, var(--accent-teal));
  background: color-mix(in srgb, var(--accent, var(--accent-teal)) 12%, #fff);
  border-color: color-mix(in srgb, var(--accent, var(--accent-teal)) 30%, transparent);
}
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.5rem;
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent, var(--accent-teal));
  transform: translateX(-50%);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle-bar {
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.site-header.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.site-header.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.site-header.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

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

/* ---------- Hero / Home --------------------------------------------------- */
.hero {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 5rem) var(--gutter) clamp(2rem, 4vw, 3.5rem);
  text-align: center;
}
.hero-logo {
  display: block;
  margin: 0 auto 1.4rem;
}
.hero-logo .logo-mark {
  width: clamp(96px, 16vw, 156px);
  height: clamp(96px, 16vw, 156px);
  filter: drop-shadow(0 12px 28px rgba(14, 122, 111, 0.32));
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
.hero-title {
  font-size: clamp(2rem, 1.3rem + 3vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 auto 1rem;
  max-width: 24ch;
  background: linear-gradient(100deg, var(--accent-teal), var(--accent-blue) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.45rem);
  color: var(--ink);
  max-width: 74ch;
  margin: 0 auto 1.8rem;
  font-weight: 500;
}
.hero-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 2.6rem;
  text-align: left;
  margin: 0 auto;
}
.hero-text {
  color: var(--ink-soft);
  margin: 0 0 1.1rem;
  text-align: left;
}
@media (max-width: 760px) {
  .hero-detail {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 65ch;
  }
}

.hero-cta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 2.4rem;
}
.cta-button {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-align: left;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.cta-button:hover {
  text-decoration: none;
  color: var(--ink);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.cta-ico {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 14%, #fff);
}
.cta-ico svg {
  width: 28px;
  height: 28px;
}
.cta-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.cta-title {
  font-weight: 700;
  color: var(--accent);
}
.cta-sub {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.3;
}
.cta-arrow {
  margin-left: auto;
  font-size: 1.3rem;
  color: var(--accent);
  transition: transform 0.2s ease;
}
.cta-button:hover .cta-arrow {
  transform: translateX(4px);
}

.home-sections {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 3rem) var(--gutter) clamp(3rem, 6vw, 5rem);
}
.section-intro {
  text-align: center;
  max-width: 60ch;
  margin: 0 auto 2.4rem;
}
.section-intro h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem);
  margin: 0 0 0.6rem;
}
.section-intro p {
  color: var(--ink-soft);
  margin: 0;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.4rem;
}
.section-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.section-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.section-card-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}
.section-card-ico {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 14%, #fff);
}
.section-card-ico svg {
  width: 28px;
  height: 28px;
}
.section-card h3 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.25;
}
.section-card h3 a {
  color: var(--ink);
}
.section-card h3 a:hover {
  color: var(--accent);
}
.section-card-desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 1rem;
}
.section-card-links {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.section-card-links a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--ink-soft);
  border: 1px solid transparent;
}
.section-card-links a:hover {
  text-decoration: none;
  color: var(--accent);
  background: var(--surface-2);
}
.section-card-more {
  margin-top: auto;
  font-weight: 700;
  color: var(--accent);
}

/* ---------- Article ------------------------------------------------------- */
.article {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: clamp(1.2rem, 2.5vw, 2.2rem) var(--gutter) clamp(2.5rem, 5vw, 4rem);
}

.breadcrumbs {
  margin-bottom: 1.4rem;
  font-size: 0.88rem;
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.1rem;
  margin: 0;
  padding: 0.55rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}
.breadcrumbs li:not(:first-child)::before {
  content: "›";
  margin: 0 0.5rem;
  color: var(--border-strong);
}
.breadcrumbs a {
  color: var(--ink-soft);
  font-weight: 600;
}
.breadcrumbs a:hover {
  color: var(--accent);
}
.breadcrumbs [aria-current="page"] span {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Article body typography -------------------------------------- */
.article-body {
  font-size: 1.06rem;
}
.article-body > * {
  margin-block: 0 1.15rem;
}
.article-body > h1:first-child {
  margin-top: 0;
}

.article-body h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
  background: linear-gradient(100deg, var(--accent), var(--accent-blue) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.article-body h2 {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.95rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-top: 2.4rem;
  padding-bottom: 0.4rem;
  color: var(--ink);
  border-bottom: 2px solid var(--surface-3);
}
.article-body h3 {
  font-size: clamp(1.18rem, 1.05rem + 0.6vw, 1.45rem);
  margin-top: 1.9rem;
  color: var(--accent);
}
.article-body h4 {
  font-size: 1.1rem;
  margin-top: 1.4rem;
  color: var(--ink);
}
.article-body :is(h1, h2, h3, h4)[id] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.article-body p {
  color: var(--ink);
}
.article-body strong {
  color: var(--ink);
  font-weight: 700;
}

.article-body a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
}
.article-body a:hover {
  text-decoration-color: var(--link-hover);
}
.article-body a.external-link::after {
  content: "↗";
  font-size: 0.78em;
  margin-left: 0.15em;
  color: var(--muted);
  text-decoration: none;
}

/* Heading anchors — inline, revealed on hover */
.article-body :is(h2, h3, h4) .heading-anchor {
  opacity: 0;
  margin-left: 0.4rem;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.78em;
  text-decoration: none;
  vertical-align: middle;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.article-body :is(h2, h3, h4):hover .heading-anchor,
.article-body .heading-anchor:focus {
  opacity: 1;
}
.article-body .heading-anchor:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Lists */
.article-body ul,
.article-body ol {
  padding-left: 1.4rem;
}
.article-body li {
  margin-bottom: 0.4rem;
}
.article-body li::marker {
  color: var(--accent);
}

/* Blockquote */
.article-body blockquote {
  margin-inline: 0;
  padding: 0.6rem 1.2rem;
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
}

/* ---------- Inline code --------------------------------------------------- */
.article-body :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-inline-bg);
  color: #0c5f57;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  border: none;
  white-space: break-spaces;
  word-break: break-word;
}

/* ---------- Code blocks --------------------------------------------------- */
.code-block {
  margin: 0 0 1.4rem;
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--code-bg);
  box-shadow: var(--shadow-sm);
}
.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.45rem 0.4rem 0.9rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--code-border);
}
.code-lang {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.code-copy {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--accent-teal);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 0.28rem 0.7rem;
  border-radius: 7px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.code-copy:hover {
  background: var(--accent-teal);
  color: #fff;
  border-color: var(--accent-teal);
}
.code-copy.is-copied {
  background: var(--accent-teal-bright);
  color: #06302b;
  border-color: var(--accent-teal-bright);
}
.article-body pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #234;
  tab-size: 2;
}
/* Bare <pre> not yet wrapped (e.g. before JS runs) */
.article-body > pre:not(.mermaid) {
  margin: 0 0 1.4rem;
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
}
.article-body pre code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
  border: none;
  color: inherit;
}

/* Prism light theme — tuned to the palette */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #7b938e;
  font-style: italic;
}
.token.punctuation {
  color: #5a6b6f;
}
.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
  color: #b5246b;
}
.token.boolean,
.token.number {
  color: #b5530a;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #0c7a6f;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #5a6b6f;
}
.token.atrule,
.token.attr-value,
.token.keyword {
  color: #2563eb;
}
.token.function,
.token.class-name {
  color: #7c3aed;
}
.token.regex,
.token.important,
.token.variable {
  color: #b5530a;
}
.token.important,
.token.bold {
  font-weight: 700;
}
.token.italic {
  font-style: italic;
}

/* ---------- Tables -------------------------------------------------------- */
.table-scroll {
  margin: 0 0 1.4rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  border-collapse: collapse;
  width: 100%;
  min-width: 540px;
  font-size: 0.95rem;
}
.table-scroll th,
.table-scroll td {
  padding: 0.7rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table-scroll thead th {
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: var(--ink);
  font-weight: 700;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}
.table-scroll tbody tr:nth-child(even) {
  background: var(--surface-2);
}
.table-scroll tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 7%, #fff);
}

/* ---------- Task lists (togglable checkboxes) ----------------------------- */
.article-body ul.contains-task-list {
  list-style: none;
  padding-left: 0.25rem;
}
.article-body ul.contains-task-list ul.contains-task-list {
  padding-left: 1.5rem;
}
.task-list-item {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.task-list-item::marker {
  content: "";
}
.task-list-item:hover {
  background: var(--surface-2);
}
.task-list-item-checkbox {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  margin: 0.2em 0 0;
  width: 1.2em;
  height: 1.2em;
  border: 2px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.task-list-item-checkbox::before {
  content: "";
  width: 0.62em;
  height: 0.62em;
  transform: scale(0);
  transition: transform 0.12s ease-in-out;
  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(--accent-teal);
  border-color: var(--accent-teal);
}
.task-list-item-checkbox:checked::before {
  transform: scale(1);
}
.task-list-item-checkbox:hover {
  border-color: var(--accent-teal);
}
.task-list-item label,
.task-list-item-label {
  cursor: pointer;
}
.task-list-item.is-done,
.task-list-item.is-done > label,
.task-list-item:has(.task-list-item-checkbox:checked),
.task-list-item:has(.task-list-item-checkbox:checked) > label {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent);
}

/* ---------- Mermaid ------------------------------------------------------- */
pre.mermaid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  margin: 0 0 1.4rem;
  text-align: center;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  color: transparent; /* hide raw source until rendered */
  line-height: 0;
}
pre.mermaid svg {
  max-width: 100%;
  height: auto;
}
pre.mermaid[data-processed] {
  color: var(--ink);
  line-height: normal;
}

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

/* ---------- FAQ accordions ------------------------------------------------ */
.faq {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1.4rem;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 1.1rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--accent);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
}
.faq-item summary:hover {
  color: var(--accent);
}
.faq-answer {
  padding: 0 1.1rem 1rem;
  color: var(--ink-soft);
}

/* ---------- Related content ----------------------------------------------- */
.related {
  margin-top: 3rem;
  padding-top: 1.8rem;
  border-top: 2px solid var(--surface-3);
}
.related-group + .related-group {
  margin-top: 1.8rem;
}
.related-title {
  font-size: 1.2rem;
  margin: 0 0 1rem;
  color: var(--ink);
}
.related-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.related-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 100%;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.related-card:hover {
  text-decoration: none;
  color: var(--ink);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.related-card-title {
  font-weight: 700;
  color: var(--accent);
}
.related-card-desc {
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.related-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.related-links a {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.related-links a:hover {
  text-decoration: none;
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.related-up {
  margin-top: 1.6rem;
  font-weight: 600;
}

.button-link {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  background: var(--accent-teal);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.button-link:hover {
  text-decoration: none;
  color: #fff;
  background: var(--link-hover);
  box-shadow: var(--shadow-md);
}
.offline-page {
  text-align: center;
  max-width: 60ch;
  margin: 3rem auto;
}

/* ---------- Footer -------------------------------------------------------- */
.site-footer {
  flex-shrink: 0;
  margin-top: 3rem;
  background: #0f2e33;
  color: #cfe3df;
}
.footer-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: clamp(2.2rem, 4vw, 3.4rem) var(--gutter);
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 2rem 1.5rem;
}
.footer-brand .footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}
.footer-brand .footer-logo:hover {
  color: #fff;
}
.footer-logo .logo-mark {
  width: 38px;
  height: 38px;
}
.footer-tagline {
  margin: 0.9rem 0 0;
  color: #9fbcb6;
  font-size: 0.92rem;
  max-width: 42ch;
}
.footer-nav .footer-heading {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent, #7fd8c9);
  margin: 0 0 0.8rem;
}
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.footer-nav a {
  color: #bfd6d1;
  font-size: 0.9rem;
}
.footer-nav a:hover {
  color: #fff;
}
.footer-base {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-base p {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  font-size: 0.84rem;
  color: #8fb0aa;
}

/* ---------- Responsive ---------------------------------------------------- */
@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .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);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
  }
  .site-header.nav-open .primary-nav {
    max-height: 70vh;
  }
  .primary-nav .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem var(--gutter) 1rem;
    gap: 0.25rem;
  }
  .nav-link {
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.8rem;
  }
  .nav-link.is-active::after {
    display: none;
  }
  .nav-link.is-active {
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  }
}

@media (max-width: 560px) {
  .brand-sub {
    display: none;
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .hero-cta {
    grid-template-columns: 1fr;
  }
}

/* Widescreen: let the shell breathe a little more. */
@media (min-width: 1600px) {
  :root {
    --shell-max: 1500px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
