/* =========================================================================
   Broadcast Traffic & Advertising Scheduling Automation
   Light, professional design system.
   ========================================================================= */

/* ---- Design tokens ---- */
:root {
  /* Palette — light, professional, easy on the eyes */
  --c-primary: #1f6feb;
  --c-primary-dark: #1657c4;
  --c-primary-soft: #e9f1ff;
  --c-accent: #7c3aed;        /* violet */
  --c-pillar-1: #1f6feb;      /* ingestion — blue */
  --c-pillar-2: #7c3aed;      /* architecture — violet */
  --c-pillar-3: #0d9488;      /* scheduling — teal */
  --c-amber: #f59e0b;
  --c-green: #22a06b;
  --c-cyan: #0bb4c4;

  --c-bg: #f7f9fc;
  --c-surface: #ffffff;
  --c-surface-2: #f1f5fb;
  --c-border: #e2e8f2;
  --c-border-strong: #cdd7e6;

  --c-text: #1f2a3d;
  --c-text-soft: #475467;
  --c-text-muted: #6b7891;
  --c-heading: #142037;

  --c-code-bg: #f6f8fc;
  --c-code-border: #e4eaf3;
  --c-inline-code-bg: #eef2fb;
  --c-inline-code-text: #1657c4;

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

  /* Layout */
  --header-h: 68px;
  --container-max: 1280px;
  --content-max: 1100px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 55, 0.06), 0 1px 3px rgba(20, 32, 55, 0.05);
  --shadow-md: 0 6px 20px rgba(20, 32, 55, 0.08), 0 2px 6px rgba(20, 32, 55, 0.05);
  --shadow-lg: 0 18px 48px rgba(20, 32, 55, 0.14);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.65;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { display: block; max-width: 100%; }
svg { height: auto; }
a { color: var(--c-primary); text-decoration: none; }

/* ---- Utilities ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2.5rem);
}
.icon { width: 1.25em; height: 1.25em; flex: none; }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--c-primary); color: #fff; padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 3px;
}

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--c-border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--c-heading);
  transition: transform 0.25s var(--ease);
}
.brand:hover { transform: translateY(-1px); }
.brand__logo { width: 40px; height: 40px; filter: drop-shadow(0 3px 6px rgba(31, 111, 235, 0.28)); transition: transform 0.4s var(--ease); }
.brand:hover .brand__logo { transform: rotate(-4deg) scale(1.05); }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-weight: 750; font-size: 1.08rem; letter-spacing: -0.01em; }
.brand__tag { font-size: 0.72rem; color: var(--c-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: var(--c-text-soft);
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.nav-link .icon { color: var(--c-primary); transition: transform 0.2s var(--ease); }
.nav-link:hover { background: var(--c-primary-soft); color: var(--c-primary-dark); transform: translateY(-1px); }
.nav-link:hover .icon { transform: scale(1.12); }
.nav-link.is-current { background: var(--c-primary); color: #fff; }
.nav-link.is-current .icon { color: #fff; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface);
  border-radius: 11px;
  color: var(--c-heading);
  cursor: pointer;
}
.nav-toggle__close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: block; }

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

/* =========================================================================
   Typography helpers
   ========================================================================= */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--c-primary);
  background: var(--c-primary-soft); padding: 0.35rem 0.8rem; border-radius: 999px;
}

/* =========================================================================
   Hero (home)
   ========================================================================= */
.hero {
  position: relative;
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124, 58, 237, 0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(31, 111, 235, 0.12), transparent 55%);
  overflow: hidden;
}
.hero__logo-wrap { text-align: center; margin-bottom: 1.75rem; }
.hero__logo {
  width: clamp(96px, 16vw, 148px);
  height: auto;
  margin-inline: auto;
  filter: drop-shadow(0 14px 34px rgba(31, 111, 235, 0.32));
  transition: transform 0.5s var(--ease);
}
.hero__logo:hover { transform: translateY(-4px) scale(1.03); }
.hero__inner { max-width: 920px; margin-inline: auto; text-align: center; }
.hero h1 {
  font-size: clamp(2rem, 1.3rem + 3.2vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--c-heading);
  margin: 1rem 0 0.4rem;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--c-primary), var(--c-accent) 55%, var(--c-cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lede { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem); color: var(--c-text-soft); max-width: 760px; margin: 0.5rem auto 0; }

.cta-row {
  display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center;
  margin-top: 2rem;
}
.cta {
  display: inline-flex; align-items: center; gap: 0.7rem;
  padding: 0.85rem 1.3rem;
  border-radius: 999px;
  font-weight: 650;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-heading);
  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(-3px); box-shadow: var(--shadow-md); border-color: var(--c-border-strong); }
.cta__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px; color: #fff;
}
.cta__icon .icon { width: 1.35em; height: 1.35em; }
.cta--1 { } .cta--1 .cta__icon { background: linear-gradient(135deg, #2b7cff, #1f6feb); }
.cta--2 .cta__icon { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.cta--3 .cta__icon { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.cta--primary { background: var(--c-primary); color: #fff; border-color: transparent; }
.cta--primary .cta__icon { background: rgba(255,255,255,0.18); }
.cta--primary:hover { background: var(--c-primary-dark); }

/* =========================================================================
   Sections + cards
   ========================================================================= */
.section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section--alt { background: var(--c-surface); border-block: 1px solid var(--c-border); }
.section__head { max-width: 760px; margin-bottom: 2rem; }
.section__head.center { margin-inline: auto; text-align: center; }
.section h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); color: var(--c-heading); letter-spacing: -0.01em; }
.section__intro { color: var(--c-text-soft); margin-top: 0.6rem; }

.prose-block { max-width: 100%; }
.prose-block p + p { margin-top: 1rem; }
.prose-block p { color: var(--c-text-soft); }

.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--card-accent, var(--c-primary)); opacity: 0.9;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--c-border-strong); }
.card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 1rem;
  color: #fff; background: var(--card-accent, var(--c-primary));
}
.card__icon .icon { width: 1.5em; height: 1.5em; }
.card h3 { color: var(--c-heading); font-size: 1.2rem; letter-spacing: -0.01em; }
.card p { color: var(--c-text-soft); margin-top: 0.5rem; font-size: 0.96rem; flex: 1; }
.card__link {
  margin-top: 1rem; display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 650; color: var(--c-primary);
}
.card__link .icon { transition: transform 0.2s var(--ease); }
.card:hover .card__link .icon { transform: translateX(4px); }

/* Pillar accent helpers */
.accent-1 { --card-accent: var(--c-pillar-1); }
.accent-2 { --card-accent: var(--c-pillar-2); }
.accent-3 { --card-accent: var(--c-pillar-3); }

/* =========================================================================
   Content pages
   ========================================================================= */
.content-shell { padding: clamp(1.25rem, 3vw, 2.25rem) 0 clamp(3rem, 6vw, 5rem); }
/* .content-wrap shares the element with .container, which governs max-width;
   no extra constraint here so content aligns with the header and homepage. */

.breadcrumbs { font-size: 0.86rem; margin-bottom: 1.25rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; padding: 0; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--c-text-muted); }
.breadcrumbs a { color: var(--c-text-soft); font-weight: 600; border-radius: 5px; padding: 0.1rem 0.2rem; }
.breadcrumbs a:hover { color: var(--c-primary); }
.breadcrumbs .sep { color: var(--c-border-strong); }
.breadcrumbs [aria-current="page"] { color: var(--c-text); font-weight: 650; }

/* Article body */
.content-body { max-width: 100%; }
.content-body > * + * { margin-top: 1.1rem; }

.content-body h1 {
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem);
  line-height: 1.12; letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  background: linear-gradient(100deg, var(--c-primary), var(--c-accent) 60%, var(--c-cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.content-body h2 {
  font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.85rem);
  color: var(--c-heading); letter-spacing: -0.01em;
  margin-top: 2.4rem; padding-top: 0.4rem;
  border-top: 1px solid var(--c-border);
}
.content-body h3 { font-size: 1.3rem; color: var(--c-heading); margin-top: 1.8rem; }
.content-body h4 { font-size: 1.1rem; color: var(--c-heading); margin-top: 1.4rem; }

/* In-page anchor offset so headings clear the sticky header */
.content-body :is(h1, h2, h3, h4, h5, h6)[id] { scroll-margin-top: calc(var(--header-h) + 1.25rem); }

.content-body p { color: var(--c-text-soft); }
.content-body strong { color: var(--c-text); font-weight: 700; }

.content-body ul, .content-body ol { padding-left: 1.4rem; color: var(--c-text-soft); }
.content-body li + li { margin-top: 0.35rem; }
.content-body li::marker { color: var(--c-primary); }

.content-body blockquote {
  border-left: 4px solid var(--c-primary);
  background: var(--c-primary-soft);
  padding: 0.9rem 1.2rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--c-text-soft);
}

/* Heading anchor link */
.heading-anchor {
  margin-left: 0.4rem; color: var(--c-border-strong);
  opacity: 0; transition: opacity 0.18s var(--ease), color 0.18s var(--ease);
  font-weight: 600; text-decoration: none;
}
.content-body :is(h2, h3, h4):hover .heading-anchor { opacity: 1; }
.heading-anchor:hover { color: var(--c-primary); }

/* Content links */
.content-body a:not(.heading-anchor) {
  color: var(--c-primary); font-weight: 550;
  text-decoration: underline; text-decoration-color: rgba(31,111,235,0.32);
  text-underline-offset: 3px; transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease);
}
.content-body a:not(.heading-anchor):hover { color: var(--c-primary-dark); text-decoration-color: var(--c-primary); }

/* =========================================================================
   Inline code
   ========================================================================= */
:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--c-inline-code-bg);
  color: var(--c-inline-code-text);
  padding: 0.12em 0.4em;
  border-radius: 6px;
  border: 0;
  white-space: break-spaces;
}

/* =========================================================================
   Code blocks + copy button (light theme)
   ========================================================================= */
.code-block {
  margin: 1.4rem 0;
  border: 1px solid var(--c-code-border);
  border-radius: var(--radius-sm);
  background: var(--c-code-bg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.code-block__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.5rem 0.4rem 0.95rem;
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-code-border);
}
.code-block__lang {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-muted);
}
.code-block__copy {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font: inherit; font-size: 0.78rem; font-weight: 600;
  color: var(--c-text-soft); cursor: pointer;
  background: var(--c-surface); border: 1px solid var(--c-border-strong);
  padding: 0.3rem 0.65rem; border-radius: 7px;
  transition: all 0.18s var(--ease);
}
.code-block__copy:hover { color: var(--c-primary-dark); border-color: var(--c-primary); background: var(--c-primary-soft); }
.code-block__copy.is-copied { color: #fff; background: var(--c-green); border-color: var(--c-green); }

.code-block pre {
  margin: 0; padding: 1.05rem 1.15rem; overflow-x: auto;
  font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.6;
  background: var(--c-code-bg) !important; color: #2b3a52;
  tab-size: 4;
}
.code-block pre code { font-family: inherit; }

/* Prism — light syntax theme matching palette */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #8a94a6; font-style: italic; }
.token.punctuation { color: #5b6b85; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #b5277d; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #1a8a5a; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #1657c4; }
.token.atrule, .token.attr-value, .token.keyword { color: #7c3aed; font-weight: 600; }
.token.function, .token.class-name { color: #1f6feb; }
.token.regex, .token.important, .token.variable { color: #d97706; }
.token.important, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }

/* =========================================================================
   Tables (responsive scroll)
   ========================================================================= */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin: 1.4rem 0;
}
.table-scroll table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 0.92rem; }
.table-scroll thead th {
  background: var(--c-surface-2); color: var(--c-heading);
  text-align: left; font-weight: 700; padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--c-border-strong); white-space: nowrap;
}
.table-scroll td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--c-border); color: var(--c-text-soft); vertical-align: top; }
.table-scroll tbody tr { background: var(--c-surface); transition: background 0.15s var(--ease); }
.table-scroll tbody tr:nth-child(even) { background: var(--c-bg); }
.table-scroll tbody tr:hover { background: var(--c-primary-soft); }
.table-scroll tr:last-child td { border-bottom: 0; }

/* =========================================================================
   Task-list checkboxes (toggleable; bullet removed; line-through when checked)
   ========================================================================= */
.content-body ul.contains-task-list { list-style: none; padding-left: 0.2rem; }
.content-body ul.contains-task-list .task-list-item { display: flex; align-items: flex-start; gap: 0.6rem; }
.content-body ul.contains-task-list .task-list-item::marker { content: ""; }
.task-list-item-checkbox {
  appearance: none; -webkit-appearance: none;
  width: 1.2em; height: 1.2em; margin-top: 0.28em; flex: none;
  border: 2px solid var(--c-border-strong); border-radius: 5px;
  background: var(--c-surface); cursor: pointer; position: relative;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.task-list-item-checkbox:hover { border-color: var(--c-primary); }
.task-list-item-checkbox:checked { background: var(--c-primary); border-color: var(--c-primary); }
.task-list-item-checkbox:checked::after {
  content: ""; position: absolute; left: 0.32em; top: 0.12em;
  width: 0.32em; height: 0.62em; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.task-list-item.is-checked > label,
.task-list-item.is-checked { color: var(--c-text-muted); text-decoration: line-through; text-decoration-color: var(--c-border-strong); }

/* =========================================================================
   FAQ accordions
   ========================================================================= */
.faq-accordion {
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-surface); margin: 0.7rem 0; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.faq-accordion > summary {
  list-style: none; cursor: pointer; padding: 1rem 1.2rem;
  font-weight: 650; color: var(--c-heading);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transition: background 0.18s var(--ease);
}
.faq-accordion > summary::-webkit-details-marker { display: none; }
.faq-accordion > summary:hover { background: var(--c-primary-soft); }
.faq-accordion > summary::after {
  content: ""; width: 0.7em; height: 0.7em; flex: none;
  border-right: 2px solid var(--c-primary); border-bottom: 2px solid var(--c-primary);
  transform: rotate(45deg); transition: transform 0.22s var(--ease);
}
.faq-accordion[open] > summary::after { transform: rotate(-135deg); }
.faq-accordion__body { padding: 0 1.2rem 1.1rem; color: var(--c-text-soft); }
.faq-accordion__body > *:first-child { margin-top: 0; }

/* =========================================================================
   Mermaid
   ========================================================================= */
pre.mermaid {
  background: var(--c-surface) !important;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  padding: 1.25rem; text-align: center; box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
pre.mermaid:not([data-processed]) { color: transparent; min-height: 60px; }
pre.mermaid svg { max-width: 100%; height: auto; }

/* Zoomable diagram + expand affordance */
pre.mermaid.is-zoomable {
  position: relative; cursor: zoom-in;
  transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
pre.mermaid.is-zoomable:hover { box-shadow: var(--shadow-md); border-color: var(--c-border-strong); }
pre.mermaid.is-zoomable:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; }
.diagram-expand {
  position: absolute; top: 0.6rem; right: 0.6rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; cursor: zoom-in;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--c-border-strong);
  color: var(--c-primary); box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateY(-2px); transition: all 0.18s var(--ease);
}
.diagram-expand svg { width: 1.05rem; height: 1.05rem; }
pre.mermaid.is-zoomable:hover .diagram-expand,
pre.mermaid.is-zoomable:focus-within .diagram-expand { opacity: 1; transform: translateY(0); }
.diagram-expand:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
@media (hover: none) { .diagram-expand { opacity: 1; } }

p.diagram-caption {
  text-align: center; font-size: 0.88rem; color: var(--c-text-muted);
  margin-top: 0.5rem !important;
}
p.diagram-caption em { font-style: italic; }

/* Fullscreen lightbox */
body.has-lightbox { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  padding: clamp(0.75rem, 3vw, 2.5rem);
}
.lightbox.is-open { display: flex; }
.lightbox__backdrop {
  position: absolute; inset: 0;
  background: rgba(16, 26, 46, 0.72); backdrop-filter: blur(4px);
  animation: lb-fade 0.2s var(--ease);
}
.lightbox__panel {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: min(1400px, 100%); max-height: 100%;
  background: var(--c-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: lb-pop 0.22s var(--ease);
}
.lightbox__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 0.8rem 0.7rem 1.2rem; border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-2);
}
.lightbox__caption { font-size: 0.9rem; color: var(--c-text-soft); margin: 0; font-weight: 600; }
.lightbox__close {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  background: var(--c-surface); border: 1px solid var(--c-border-strong); color: var(--c-heading);
  transition: all 0.18s var(--ease);
}
.lightbox__close svg { width: 1.2rem; height: 1.2rem; }
.lightbox__close:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.lightbox__stage {
  flex: 1; min-height: 0; overflow: auto; padding: clamp(1rem, 3vw, 2.25rem);
  display: flex; align-items: center; justify-content: center; cursor: zoom-in;
  background:
    radial-gradient(circle at 1px 1px, var(--c-border) 1px, transparent 0) 0 0 / 22px 22px,
    var(--c-bg);
}
.lightbox__stage svg { width: 100%; height: auto; max-height: 78vh; }
.lightbox__stage.is-actual-size { cursor: zoom-out; align-items: flex-start; justify-content: flex-start; }
.lightbox__stage.is-actual-size svg { width: auto; max-height: none; }

@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-pop { from { opacity: 0; transform: scale(0.97) translateY(8px); } to { opacity: 1; transform: none; } }

/* =========================================================================
   Related content / page nav
   ========================================================================= */
.related {
  margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--c-border);
}
.related h2 { font-size: 1.3rem; color: var(--c-heading); margin-bottom: 1rem; border: 0; padding: 0; }
.related__grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.related__item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 1.1rem; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-heading); font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.related__item .icon { color: var(--c-primary); flex: none; }
.related__item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--c-border-strong); }
.related__item .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-muted); display: block; font-weight: 700; }

/* Child page list (pillar / cluster index) */
.subpages { margin-top: 1.6rem; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { flex-shrink: 0; background: #101a2e; color: #c7d2e4; margin-top: 3rem; }
.site-footer__inner {
  display: grid; gap: 2rem; padding-block: 2.8rem 2rem;
  grid-template-columns: 1.4fr 1fr;
}
.site-footer__logo { width: 44px; height: 44px; margin-bottom: 0.9rem; }
.site-footer__desc { color: #94a3bd; max-width: 46ch; font-size: 0.94rem; }
.site-footer__heading { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: #7c8aa6; margin-bottom: 0.9rem; }
.site-footer__nav ul { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.site-footer__nav a {
  display: inline-flex; align-items: center; gap: 0.5rem; color: #c7d2e4; font-weight: 550;
  transition: color 0.18s var(--ease), transform 0.18s var(--ease);
}
.site-footer__nav a .icon { color: #5b8cff; }
.site-footer__nav a:hover { color: #fff; transform: translateX(3px); }
.site-footer__bar { border-top: 1px solid rgba(255,255,255,0.08); padding-block: 1.1rem; }
.site-footer__bar p { color: #7c8aa6; font-size: 0.84rem; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 860px) {
  :root { --header-h: 62px; }
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .primary-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .primary-nav__list { flex-direction: column; align-items: stretch; gap: 0.2rem; padding: 1rem clamp(1rem, 3vw, 2.5rem); }
  .nav-link { padding: 0.8rem 1rem; border-radius: 11px; }
  .site-footer__inner { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .brand__tag { display: none; }
  .cta { width: 100%; justify-content: flex-start; }
  .cta-row { flex-direction: column; }
}

/* Wide screens — use the real estate */
@media (min-width: 1440px) {
  :root { --container-max: 1440px; --content-max: 1180px; }
}
@media (min-width: 1800px) {
  :root { --container-max: 1640px; }
}

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