/* =========================================================================
   Aviation Flight Operations & Crew Scheduling Compliance — stylesheet
   Light, professional aviation palette. Wide on desktop, elegant on mobile.
   ========================================================================= */

:root {
  /* Palette */
  --navy: #0b2c41;
  --ink: #163143;
  --slate: #5b7186;
  --slate-2: #7d91a3;
  --line: #e2ebf2;
  --line-soft: #eef3f8;
  --bg: #f5f8fb;
  --bg-elev: #ffffff;
  --primary: #0b5d8f;
  --primary-600: #0a527e;
  --primary-300: #1b8fd0;
  --teal: #34c6c2;
  --green: #16b364;
  --amber: #f5a623;
  --primary-tint: #e8f3fb;
  --teal-tint: #e3f7f6;
  --green-tint: #e4f6ec;
  --code-bg: #f4f7fa;
  --code-border: #e4ecf3;

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

  /* Layout */
  --maxw: 1320px;
  --gap: clamp(1rem, 2vw, 2rem);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(11, 44, 65, 0.05), 0 2px 8px rgba(11, 44, 65, 0.05);
  --shadow-md: 0 6px 24px rgba(11, 44, 65, 0.09);
  --shadow-lg: 0 14px 44px rgba(11, 44, 65, 0.13);
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
a:hover { color: var(--primary-300); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 3vw, 2.6rem);
}

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

.icn { width: 1.25em; height: 1.25em; flex: none; }
.icn-sm { width: 1em; height: 1em; flex: none; vertical-align: -0.12em; }

/* ----------------------------------------------------------------- Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding-block: 0.5rem;
}
.brand { display: inline-flex; align-items: center; }
.brand-logo {
  height: clamp(34px, 4.4vw, 44px);
  width: auto;
  transition: transform 0.25s var(--ease), filter 0.25s var(--ease);
}
.brand:hover .brand-logo { transform: translateY(-1px); filter: drop-shadow(0 4px 10px rgba(11, 93, 143, 0.25)); }

.primary-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}
.navlink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: var(--slate);
  font-weight: 600;
  font-size: 0.96rem;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.navlink .icn { color: var(--primary-300); transition: transform 0.2s var(--ease); }
.navlink:hover { background: var(--primary-tint); color: var(--primary-600); }
.navlink:hover .icn { transform: translateY(-1px) scale(1.05); }
.navlink.is-active {
  background: var(--primary-tint);
  color: var(--primary-600);
  border-color: #cfe6f6;
}
.navlink.is-active .icn { color: var(--primary); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--primary);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--primary-tint); }

/* ------------------------------------------------------------------ Main */
.site-main { flex: 1 0 auto; padding-bottom: 3.5rem; }

/* ------------------------------------------------------------------ Hero */
.hero {
  position: relative;
  background:
    radial-gradient(1200px 480px at 78% -10%, var(--teal-tint), transparent 60%),
    radial-gradient(900px 420px at 8% 0%, var(--primary-tint), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-inner {
  padding-block: clamp(2.6rem, 6vw, 5rem);
  text-align: center;
}
.hero-logo {
  display: block;
  margin: 0 auto clamp(1.4rem, 3vw, 2.2rem);
  width: min(560px, 88%);
  height: auto;
  filter: drop-shadow(0 10px 26px rgba(11, 93, 143, 0.16));
}
.hero-title {
  font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 auto 1rem;
  max-width: 22ch;
  background: linear-gradient(120deg, var(--navy), var(--primary) 55%, var(--primary-300));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
  color: var(--slate);
  max-width: 62ch;
  margin: 0 auto 2.2rem;
}

/* CTA buttons */
.cta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.8rem, 1.6vw, 1.2rem);
  text-align: left;
}
.cta {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: 1.05rem 1.15rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}
.cta:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #cfe6f6; }
.cta-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  color: #fff;
}
.cta-icon .icn { width: 1.5em; height: 1.5em; }
.cta-blueprint .cta-icon, .card-icon.cta-blueprint { background: linear-gradient(135deg, var(--primary), var(--primary-300)); }
.cta-gauge .cta-icon, .card-icon.cta-gauge { background: linear-gradient(135deg, #5b3fd8, #1b8fd0); }
.cta-sync .cta-icon, .card-icon.cta-sync { background: linear-gradient(135deg, var(--teal), var(--green)); }
.cta-title { display: block; font-weight: 750; color: var(--navy); line-height: 1.2; }
.cta-sub { display: block; font-size: 0.85rem; color: var(--slate); margin-top: 0.2rem; }
.cta-arrow { color: var(--primary-300); transition: transform 0.22s var(--ease); }
.cta:hover .cta-arrow { transform: translateX(4px); }

/* --------------------------------------------------------------- Home blocks */
.home-about { padding-block: clamp(2.4rem, 5vw, 3.6rem); }
.home-about h2,
.section-band-title,
.child-grid-title { font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); color: var(--navy); letter-spacing: -0.01em; }
.home-col { max-width: 100%; }
.home-col p { color: #324a5c; }

.home-sections { padding-block: clamp(1rem, 3vw, 2rem) 3.5rem; }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(1rem, 2vw, 1.6rem);
  margin-top: 1.6rem;
}
.cards-lg { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.4rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
  color: inherit;
}
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cfe6f6; }
.card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-tint);
  color: var(--primary);
}
.card-static .card-icon { color: #fff; }
.card-title, .card-title-link h3 { font-weight: 750; color: var(--navy); margin: 0.3rem 0 0; font-size: 1.15rem; line-height: 1.25; }
.card-title-link { display: inline-block; }
.card-title-link:hover h3 { color: var(--primary); }
.card-excerpt { color: var(--slate); font-size: 0.95rem; }
.card-links { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.3rem; }
.card-links a { font-weight: 600; font-size: 0.94rem; display: inline-flex; }
.card-links a::before { content: "›"; color: var(--teal); margin-right: 0.45rem; font-weight: 700; }
.card-more {
  margin-top: auto;
  padding-top: 0.4rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.card-more .icn-sm { transition: transform 0.2s var(--ease); }
.card:hover .card-more .icn-sm, .card-more:hover .icn-sm { transform: translateX(3px); }

/* -------------------------------------------------------------- Breadcrumbs */
.breadcrumbs { padding-top: 1.6rem; }
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.55rem;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  color: var(--slate-2);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.55rem; }
.breadcrumbs li:not(:first-child)::before { content: "/"; color: var(--line); }
.breadcrumbs a { color: var(--slate); font-weight: 600; display: inline-flex; align-items: center; gap: 0.35rem; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs li[aria-current] { color: var(--navy); font-weight: 700; }

/* ------------------------------------------------------------------ Prose */
/* The article carries the shared .wrap class, so it sits in the same 1320px
   container as the header and breadcrumbs — wide, but not edge-to-edge. */
.prose {
  padding-top: 1.4rem;
}

.prose > h1:first-child,
.prose h1 {
  font-size: clamp(1.85rem, 1.4rem + 2vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0.2rem 0 1.1rem;
  background: linear-gradient(115deg, var(--navy), var(--primary) 60%, var(--primary-300));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.prose h2 {
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.85rem);
  color: var(--navy);
  letter-spacing: -0.01em;
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--line-soft);
}
.prose h3 { font-size: 1.3rem; color: var(--primary-600); margin: 1.9rem 0 0.7rem; }
.prose h4 { font-size: 1.1rem; color: var(--ink); margin: 1.5rem 0 0.5rem; }
.prose p { margin: 0 0 1.1rem; }
.prose strong { color: var(--navy); font-weight: 700; }

/* Header anchor links + sticky-aware in-page jumps */
.prose :is(h1,h2,h3,h4,h5,h6) { scroll-margin-top: calc(var(--header-h) + 1rem); }
.prose :is(h2,h3,h4) > a.header-anchor { color: inherit; text-decoration: none; }
.prose :is(h2,h3,h4) > a.header-anchor:hover { color: var(--primary); }

/* Links in prose */
.prose a:not(.header-anchor) {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #bfe0f3;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease), background 0.18s var(--ease);
  border-radius: 3px;
}
.prose a:not(.header-anchor):hover {
  color: var(--primary-600);
  text-decoration-color: var(--primary-300);
  background: var(--primary-tint);
}

/* Lists */
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.1rem; }
.prose li { margin: 0.3rem 0; }
.prose li::marker { color: var(--teal); }

/* Inline code — subtle, borderless, blends with text */
.prose :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--primary-tint);
  color: #0a4c74;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  white-space: break-spaces;
}

/* Blockquotes */
.prose blockquote {
  margin: 1.4rem 0;
  padding: 0.6rem 1.2rem;
  border-left: 4px solid var(--teal);
  background: var(--teal-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #2b4456;
}
.prose blockquote p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- Code blocks */
.code-block {
  margin: 1.5rem 0;
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--code-bg);
}
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.5rem 0.4rem 0.9rem;
  background: #eef3f8;
  border-bottom: 1px solid var(--code-border);
}
.code-lang { font: 700 0.72rem/1 var(--font-mono); letter-spacing: 0.08em; color: var(--slate); }
.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: 600 0.78rem/1 var(--font-sans);
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.code-copy:hover { background: var(--primary-tint); border-color: #cfe6f6; }
.code-copy.is-copied { color: var(--green); border-color: #bfe7cf; background: var(--green-tint); }

.code-block pre[class*="language-"],
.prose pre[class*="language-"] {
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--code-bg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  tab-size: 4;
}
/* Standalone pre that didn't get language class */
.prose pre:not([class*="language-"]) {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
}
.prose pre code { background: none; padding: 0; color: #1f3445; font-size: inherit; }

/* Prism light token theme tuned to palette */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #8294a4; font-style: italic; }
.token.punctuation { color: #5b7186; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: #b5377d; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin { color: #1a7f5a; }
.token.operator, .token.entity, .token.url, .token.variable { color: #3a5161; }
.token.atrule, .token.attr-value, .token.keyword { color: #0a6dab; font-weight: 600; }
.token.function, .token.class-name { color: #6b40c4; }
.token.regex, .token.important { color: var(--amber); }
.token.important, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }

/* --------------------------------------------------------------- Tables */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}
.table-scroll table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 0.95rem; }
.table-scroll th, .table-scroll td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
.table-scroll thead th { background: var(--primary-tint); color: var(--navy); font-weight: 700; white-space: nowrap; }
.table-scroll tbody tr:nth-child(even) { background: var(--line-soft); }
.table-scroll tbody tr:hover { background: #eaf4fb; }

/* ------------------------------------------------------- Task checkboxes */
.prose ul.contains-task-list { list-style: none; padding-left: 0.2rem; }
.prose li.task-list-item { list-style: none; display: flex; align-items: flex-start; gap: 0.6rem; }
.prose li.task-list-item::marker { content: ""; }
.prose li.task-list-item > input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 1.2em;
  height: 1.2em;
  margin-top: 0.22em;
  border: 2px solid var(--primary-300);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.prose li.task-list-item > input[type="checkbox"]:hover { border-color: var(--primary); background: var(--primary-tint); }
.prose li.task-list-item > input[type="checkbox"]:checked { background: var(--primary); border-color: var(--primary); }
.prose li.task-list-item > input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 0.32em;
  top: 0.12em;
  width: 0.3em;
  height: 0.6em;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}
.prose li.task-list-item.is-checked { color: var(--slate-2); text-decoration: line-through; text-decoration-color: var(--slate-2); }

/* ------------------------------------------------------------ FAQ accordion */
.faq { display: grid; gap: 0.7rem; margin: 1.2rem 0 1.8rem; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq-item > summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.2rem;
  font-weight: 700;
  color: var(--navy);
  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.4rem;
  color: var(--primary-300);
  transition: transform 0.2s var(--ease);
  line-height: 1;
}
.faq-item[open] > summary::after { transform: rotate(45deg); }
.faq-item > summary:hover { background: var(--primary-tint); }
.faq-item > *:not(summary) { padding-inline: 1.2rem; }
.faq-item > *:last-child { padding-bottom: 1.1rem; }

/* ------------------------------------------------------------ Mermaid / math */
/* Bare diagram (before JS enhancement / if JS disabled) */
.mermaid {
  margin: 1.6rem 0;
  padding: 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
  overflow-x: auto;
}

/* Enhanced diagram figure */
.viz {
  position: relative;
  margin: 1.9rem 0;
  padding: 1.2rem 1.2rem 1.4rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}
.viz:hover { box-shadow: var(--shadow-md); border-color: #cfe6f6; }
.viz .mermaid {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
  overflow-x: auto;
  cursor: zoom-in;
  border-radius: var(--radius-sm);
}
.viz .mermaid svg { max-width: 100%; height: auto; }
.viz .mermaid:focus-visible { outline: 2px solid var(--primary-300); outline-offset: 3px; }
.viz-caption { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--slate); text-align: center; }
.viz-expand {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: 600 0.76rem/1 var(--font-sans);
  color: var(--primary);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.viz:hover .viz-expand,
.viz-expand:focus-visible { opacity: 1; }
.viz-expand:hover { background: var(--primary-tint); border-color: #cfe6f6; }
.viz-expand svg { width: 1.05em; height: 1.05em; }
@media (hover: none) { .viz-expand { opacity: 1; } }

/* Fullscreen lightbox */
.viz-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  grid-template: 1fr / 1fr;
  padding: clamp(1rem, 3vw, 2.6rem);
  background: rgba(11, 44, 65, 0.82);
  backdrop-filter: blur(4px);
  animation: viz-fade 0.18s var(--ease);
}
.viz-lightbox.is-open { display: grid; }
@keyframes viz-fade { from { opacity: 0; } to { opacity: 1; } }
.viz-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 2.6rem);
  box-shadow: var(--shadow-lg);
}
.viz-stage svg { width: 100%; height: 100%; }
.viz-close {
  position: fixed;
  top: 1rem;
  right: 1.2rem;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.viz-close:hover { background: rgba(255, 255, 255, 0.3); }
body.viz-lock { overflow: hidden; }

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

/* ------------------------------------------------------------- Child grid / related */
.child-grid { margin-top: 3rem; }
.related {
  margin-top: 2.4rem;
  padding: 1.4rem 1.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.related h2 { margin: 0 0 0.8rem; font-size: 1.15rem; color: var(--navy); }
.related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.related-list a { font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem; }
.related-list a:not(.related-up)::before { content: "›"; color: var(--teal); font-weight: 700; }
.related-up { color: var(--primary-600); }

/* ------------------------------------------------------------------ Footer */
.site-footer {
  flex: none;
  margin-top: auto;
  background: linear-gradient(180deg, #0e3a57, var(--navy));
  color: #cfe0ec;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  padding-block: 2.6rem 1.8rem;
}
.footer-brand { display: flex; gap: 1rem; align-items: flex-start; }
.footer-brand img { width: 44px; height: 44px; border-radius: 11px; }
.footer-brand strong { color: #fff; font-size: 1.05rem; }
.footer-brand p { margin: 0.4rem 0 0; color: #a9c2d4; font-size: 0.92rem; max-width: 52ch; }
.footer-heading { display: block; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.74rem; color: #80a0b8; margin-bottom: 0.7rem; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.footer-nav a { color: #cfe0ec; font-weight: 600; }
.footer-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-base { border-top: 1px solid rgba(255,255,255,0.12); padding-block: 1.1rem; }
.footer-base p { margin: 0; font-size: 0.84rem; color: #8fabc1; }

/* ------------------------------------------------------------- Responsive */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s var(--ease);
  }
  .primary-nav.is-open { max-height: 70vh; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 0.2rem; padding: 0.7rem clamp(1.1rem, 3vw, 2.6rem) 1rem; }
  .navlink { padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); }
  .cta-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .cta { grid-template-columns: auto 1fr; }
  .cta-arrow { display: none; }
}

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