/* Videalt — shared stylesheet */

/* ---------- fonts (IBM Plex, SIL OFL 1.1 — see /fonts/OFL.txt) ---------- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

:root {
  --navy-950: #0a1826;
  --navy: #10243a;
  --navy-2: #132c44;
  --navy-3: #16334f;
  --ink: #1f2f3f;
  --muted: #536577;
  --line: #e2e8f0;
  --line-strong: #c9d6e4;
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --accent: #2b67c9;
  --accent-dark: #1f4fa0;
  --accent-mid: #3f7ddb;
  --accent-light: #a6c8f4;
  --accent-soft: #ebf2fc;
  /* Teal is the single "node" accent: one marker per view, plus code syntax. */
  --teal: #5ed0c0;
  --on-dark: #dce6f2;
  --on-dark-muted: #b7c6d9;
  --dark-line: rgba(166, 200, 244, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1160px;
  --header-h: 72px;
  --shadow-sm: 0 1px 2px rgba(16, 36, 58, 0.06), 0 2px 8px rgba(16, 36, 58, 0.04);
  --shadow: 0 1px 2px rgba(16, 36, 58, 0.05), 0 14px 34px -10px rgba(16, 36, 58, 0.16);
  --shadow-lg: 0 30px 70px -24px rgba(4, 12, 22, 0.6);
  --grid-dark:
    linear-gradient(rgba(166, 200, 244, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(166, 200, 244, 0.055) 1px, transparent 1px);
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(43, 103, 201, 0.22); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; color: var(--navy); text-wrap: balance; }
h1 { font-size: clamp(2.15rem, 4.6vw, 3.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); font-weight: 700; letter-spacing: -0.025em; margin-bottom: 1rem; }
h3 { font-size: 1.2rem; font-weight: 600; line-height: 1.25; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 0.16em; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}

.skip-link {
  position: fixed;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 200;
  transform: translateY(-160%);
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

/* ---------- logo ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--navy);
  text-decoration: none;
}
.logo-mark { flex: none; }
.logo-mark rect { fill: var(--navy); }
/* The Fold mark: two halves of a V in two blues. */
.logo-mark .fold-a { fill: var(--accent-light); }
.logo-mark .fold-b { fill: var(--accent-mid); }
.logo-word {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(16, 36, 58, 0.08);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.site-header .logo:hover { color: var(--navy); }
.main-nav { display: flex; align-items: center; gap: 0.25rem; }
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.main-nav a:hover { color: var(--navy); background: var(--bg-soft); }
.main-nav a[aria-current] { color: var(--accent-dark); background: var(--accent-soft); }
.main-nav a.btn, .main-nav a.btn[aria-current] {
  color: #fff;
  background: var(--navy);
  padding: 0.55rem 1.1rem;
  margin-left: 0.6rem;
  box-shadow: none;
}
.main-nav a.btn:hover { background: var(--accent); color: #fff; }
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--navy);
  padding: 0.4rem;
  border-radius: 8px;
  cursor: pointer;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 36, 58, 0.2), 0 6px 16px -6px rgba(43, 103, 201, 0.55);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--accent-dark); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line-strong);
  box-shadow: none;
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.on-dark .btn.ghost, .hero .btn.ghost {
  color: var(--on-dark);
  border-color: rgba(220, 230, 242, 0.3);
  background: rgba(255, 255, 255, 0.04);
}
.on-dark .btn.ghost:hover, .hero .btn.ghost:hover {
  border-color: var(--accent-light);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.hero a:focus-visible, .page-hero a:focus-visible, .cta-band a:focus-visible,
.site-footer a:focus-visible, .section.dark a:focus-visible {
  outline-color: var(--accent-light);
}
.cta-row { display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; }

/* ---------- kicker & section heads ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 0.9rem;
}
.kicker::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}
.hero .kicker, .page-hero .kicker, .on-dark .kicker, .section.dark .kicker, .cta-band .kicker { color: var(--accent-light); }
.hero .kicker::before, .page-hero .kicker::before, .section.dark .kicker::before, .cta-band .kicker::before { background: var(--teal); }

.section { padding: 5.5rem 0; }
.section.alt { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section.tight-top { padding-top: 0; }
.section-intro { max-width: 62ch; color: var(--muted); font-size: 1.08rem; margin-bottom: 2.75rem; }
.section-more { margin: 2rem 0 0; font-weight: 600; }
.section-more a { text-decoration: none; }
.section-more a:hover { text-decoration: underline; }
/* A CTA-only section directly after content should not double the gap. */
.section:has(> .container > .cta-band:only-child) { padding-top: 0; padding-bottom: 0; }
.section.alt + .section:has(> .container > .cta-band:only-child) { padding-top: 5.5rem; }

/* Dark band used to break up long light pages. */
.section.dark {
  position: relative;
  isolation: isolate;
  background: linear-gradient(165deg, var(--navy-950), var(--navy) 60%, var(--navy-2));
  color: var(--on-dark-muted);
}
.section.dark::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--grid-dark);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 80% 20%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 90% at 80% 20%, #000 20%, transparent 75%);
}
.section.dark h2, .section.dark h3 { color: #fff; }
.section.dark .section-intro { color: var(--on-dark-muted); }

/* ---------- hero ---------- */
.hero, .page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--on-dark);
  background:
    radial-gradient(820px 460px at 88% 0%, rgba(43, 103, 201, 0.42), transparent 62%),
    radial-gradient(560px 380px at -5% 105%, rgba(94, 208, 192, 0.1), transparent 60%),
    linear-gradient(165deg, var(--navy-950), var(--navy) 55%, var(--navy-2));
}
.hero::before, .page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--grid-dark);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 75% 30%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 85% at 75% 30%, #000 15%, transparent 72%);
  pointer-events: none;
}
.hero { padding: 5.5rem 0 8.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; }
.hero .kicker { margin-bottom: 1.2rem; }
.hero h1 { color: #fff; margin-bottom: 1.4rem; max-width: 19ch; }
.hero h1 em { font-style: normal; color: var(--accent-light); }
.hero .lede { font-size: 1.2rem; line-height: 1.6; max-width: 54ch; color: var(--on-dark-muted); margin-bottom: 2.2rem; }

/* Decorative code-to-chip animation; its own grid column on wide screens.
   The editor window types the snippet, implodes, and leaves the chip. */
.hero-visual { display: none; position: relative; height: 380px; }
@media (min-width: 1100px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 452px; gap: 3.5rem; }
  .hero-visual { display: block; }
}
.hero-window, .hero-flash, .hero-chip {
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
  user-select: none;
}
.hero-window {
  transform: translate(-50%, -50%);
  background: rgba(7, 17, 29, 0.78);
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  visibility: hidden;
}
.hero-window.typing { visibility: visible; }
.hero-window-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--dark-line);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #8ea4bd;
}
.window-dots { display: inline-flex; gap: 6px; }
.window-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(166, 200, 244, 0.22); }
.hero-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #9db4cf;
  white-space: pre;
  /* Fixed box sized to the finished snippet (48 columns x 13 lines), so
     typing never changes the window size. */
  width: calc(48ch + 2.5rem);
  height: calc(13 * 1.7em + 2.2rem);
  padding: 1.1rem 1.25rem;
  overflow: hidden;
}
.hero-code .tok-pre { color: #b79fe6; }
.hero-code .tok-kw { color: #a6c8f4; }
.hero-code .tok-type { color: #5ed0c0; }
.hero-code .tok-num { color: #e8a33d; }
.hero-code .tok-fn { color: #e3ecf7; }
.hero-code .caret {
  display: inline-block;
  width: 0.55ch;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--accent-light);
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.hero-window.zap { animation: code-implode 0.6s cubic-bezier(0.55, 0, 0.85, 0.4) forwards; }
@keyframes code-implode {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; filter: brightness(1); }
  35%  { filter: brightness(2.4); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.03); opacity: 0; filter: brightness(3.5); }
}
.hero-flash {
  display: none;
  width: 280px;
  height: 280px;
  margin: -140px 0 0 -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 195, 255, 0.95) 0%, rgba(43, 103, 201, 0.5) 35%, transparent 65%);
}
.hero-flash.go { display: block; animation: zap-flash 0.5s ease-out forwards; }
@keyframes zap-flash {
  0%   { opacity: 1; transform: scale(0.25); }
  100% { opacity: 0; transform: scale(1.7); }
}
.hero-chip { display: none; margin: -95px 0 0 -95px; }
.hero-chip.show { display: block; animation: chip-pop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
.hero-chip.static { display: block; }
@keyframes chip-pop {
  0%   { opacity: 0; transform: scale(0.5); filter: drop-shadow(0 0 60px rgba(140, 195, 255, 0.9)) brightness(2.5); }
  60%  { opacity: 1; transform: scale(1.07); }
  100% { opacity: 1; transform: scale(1); filter: none; }
}

/* ---------- proof strip (overlaps the hero's lower edge) ---------- */
.proof { position: relative; z-index: 3; margin-top: -3.6rem; }
.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.proof-grid > div { padding: 1.4rem 1.6rem; }
.proof-grid > div + div { border-left: 1px solid var(--line); }
.proof-grid dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.proof-grid dd { color: var(--navy); font-weight: 600; line-height: 1.4; }
@media (max-width: 900px) {
  .proof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-grid > div:nth-child(3) { border-left: 0; }
  .proof-grid > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* ---------- cards ---------- */
@media (min-width: 760px) {
  .card-grid.resource-guides { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.7rem;
}
.card p { color: var(--muted); font-size: 0.97rem; margin-bottom: 0; }
.card p + p { margin-top: 0.9rem; }
.card .kicker { margin-bottom: 0.6rem; }
.card .icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent-soft), #dbe8fa);
  border: 1px solid #d3e2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
  color: var(--accent);
}
.card h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
/* Whole-card links: the heading link stretches over the card. */
.card .stretched { color: inherit; text-decoration: none; }
.card .stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card .stretched:focus-visible { outline: none; }
.card:has(.stretched) { transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease; }
.card:has(.stretched):hover { border-color: #b4c9e6; box-shadow: var(--shadow); transform: translateY(-3px); }
.card:has(.stretched):hover .stretched { color: var(--accent); }
.card:has(.stretched):focus-within { border-color: var(--accent); }
.card:has(.stretched:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.card-cta {
  margin-top: auto;
  padding-top: 1.2rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}
.card-media {
  display: block;
  width: calc(100% + 3.4rem);
  max-width: none;
  height: auto;
  aspect-ratio: 168 / 95;
  object-fit: contain;
  margin: -1.7rem -1.7rem 1.4rem;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-soft);
}
@media (min-width: 900px) {
  .home-services-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.home-guides-grid .card h3 { line-height: 1.3; margin-bottom: 0.7rem; }

/* ---------- worked example ---------- */
.worked-example {
  display: grid;
  gap: 2rem 3rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  margin-bottom: 4.5rem;
  align-items: center;
}
.worked-example h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
.worked-example p { color: var(--muted); max-width: 58ch; }
.worked-example a { font-weight: 600; text-underline-offset: 0.2em; }
.example-calculation {
  padding: 1.5rem 1.7rem;
  border-radius: var(--radius-sm);
  background: var(--navy);
  background-image: var(--grid-dark);
  background-size: 28px 28px;
  color: var(--on-dark-muted);
}
.example-calculation > span { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-light); }
.example-calculation strong { display: block; color: #fff; font-size: 3.2rem; letter-spacing: -0.03em; line-height: 1.15; margin: 0.4rem 0 0.5rem; }
.example-calculation strong span { font-size: 1rem; font-weight: 400; letter-spacing: 0; color: var(--on-dark-muted); }
.worked-example .example-calculation p { font-size: 0.85rem; max-width: 30ch; margin: 0; color: var(--on-dark-muted); }
.resource-example { color: var(--muted); margin: -1rem 0 2rem; max-width: 72ch; }
@media (min-width: 900px) {
  .worked-example { grid-template-columns: minmax(0, 1fr) 320px; }
}

/* ---------- split layout (heading column + content column) ---------- */
.split { display: grid; gap: 2rem 4rem; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr); align-items: start; }
  .split > :first-child { position: sticky; top: calc(var(--header-h) + 2rem); }
}
.split .section-intro { margin-bottom: 0; }

/* ---------- value grid (Why HLS) ---------- */
.value-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}
.value-grid li {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem 1.6rem;
}
.value-grid .num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.value-grid h3 { font-size: 1.12rem; }
.value-grid p { color: var(--muted); font-size: 0.97rem; margin: 0; }
.section.dark .value-grid li {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--dark-line);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.section.dark .value-grid li:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(166, 200, 244, 0.32); }
.section.dark .value-grid .num { color: var(--accent-light); }
.section.dark .value-grid p { color: var(--on-dark-muted); }

/* ---------- timeline (How we work) ---------- */
.timeline { list-style: none; display: grid; gap: 1.6rem; position: relative; }
.timeline li { position: relative; padding-left: 3.8rem; }
.timeline li::before {
  content: attr(data-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--navy);
  color: var(--accent-light);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  z-index: 1;
}
.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1.3rem - 1px);
  top: 2.6rem;
  bottom: -1.6rem;
  width: 2px;
  background: var(--line);
}
.timeline h3 { font-size: 1.1rem; padding-top: 0.45rem; }
.timeline p { color: var(--muted); font-size: 0.97rem; margin: 0; }
@media (min-width: 900px) {
  .timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.2rem; }
  .timeline li { padding-left: 0; padding-top: 3.8rem; }
  .timeline li:not(:last-child)::after {
    left: 3.2rem;
    right: -1.6rem;
    top: calc(1.3rem - 1px);
    bottom: auto;
    width: auto;
    height: 2px;
    background: linear-gradient(90deg, var(--line-strong), var(--line));
  }
  .timeline h3 { padding-top: 0; }
}

/* ---------- deliverables panel ---------- */
.deliverables {
  display: grid;
  gap: 2rem 4rem;
  align-items: center;
  margin-top: 5rem;
  padding-top: 5rem;
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) { .deliverables { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.deliverables .section-intro { margin-bottom: 0; }
.file-tree {
  background: var(--navy-950);
  color: var(--on-dark-muted);
  border: 1px solid rgba(166, 200, 244, 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0 1.6rem 1.4rem;
  font-size: 0.95rem;
}
.file-tree-title {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  color: #8ea4bd;
  font-size: 0.8rem;
  padding: 0.8rem 1.6rem;
  margin: 0 -1.6rem 1rem;
  border-bottom: 1px solid var(--dark-line);
}
.file-tree-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(166, 200, 244, 0.22);
  box-shadow: 16px 0 0 rgba(166, 200, 244, 0.22), 32px 0 0 rgba(166, 200, 244, 0.22);
  margin-right: 32px;
}
.file-tree ul { list-style: none; }
.file-tree li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.45rem 0 0.45rem 1.4rem;
  position: relative;
}
.file-tree li::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(166, 200, 244, 0.3);
}
.file-tree li:last-child::before { bottom: 50%; }
.file-tree li::after {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 50%;
  width: 0.7rem;
  border-top: 1px solid rgba(166, 200, 244, 0.3);
}
.file-tree code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--teal);
  font-size: 0.9rem;
}
@media (max-width: 480px) {
  .file-tree li { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
}

/* ---------- services ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 1.4rem;
}
.service-grid .featured { grid-column: 1 / -1; }
.service-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem 1.8rem;
  margin-top: 1.3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.service-lists h3 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.check-list { list-style: none; margin-bottom: 0.8rem; }
.check-list li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.45em;
  width: 0.45rem;
  height: 0.75rem;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}
.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-top: auto;
  padding-top: 1rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.card-links a { text-decoration: none; }
.card-links a:hover { text-decoration: underline; }

.service-chooser { margin: 0 0 2.5rem; }
.service-chooser h2 { font-size: 1.3rem; }
.service-chooser ul { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.service-chooser ul { gap: 0.8rem; }
.service-chooser a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.2rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.service-chooser a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.start-options { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; margin-bottom: 1.4rem; }
.start-options li { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.5rem 1.6rem; }
.start-options h3 { font-size: 1.1rem; }
.start-options h3 a { color: var(--navy); text-underline-offset: 0.2em; }
.start-options p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.engagement-next { border-left: 3px solid var(--accent); padding-left: 1.2rem; margin-bottom: 4rem; max-width: 72ch; }
@media (max-width: 900px) {
  .service-chooser ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .service-chooser ul, .start-options { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- service detail pages: prose + sticky side rail ---------- */
.service-layout { display: grid; gap: 3rem 4.5rem; align-items: start; }
.service-aside { display: grid; gap: 1.2rem; }
@media (min-width: 1000px) {
  .service-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .service-aside { position: sticky; top: calc(var(--header-h) + 2rem); }
}
.side-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.4rem 1.5rem;
}
.side-card h2 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.8rem;
}
.side-card ul { list-style: none; }
.side-card li a {
  display: block;
  padding: 0.4rem 0 0.4rem 0.9rem;
  border-left: 2px solid var(--line);
  color: var(--ink);
  font-size: 0.95rem;
  text-decoration: none;
}
.side-card li a:hover { border-color: var(--accent); color: var(--accent); }
.side-card.side-cta {
  background: linear-gradient(165deg, var(--navy-950), var(--navy-2));
  border-color: transparent;
  color: var(--on-dark-muted);
  box-shadow: var(--shadow);
}
.side-cta h2 { color: var(--accent-light); }
.side-cta p { font-size: 0.95rem; }
.side-cta .side-title { color: #fff; font-size: 1.15rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.5rem; }
.side-cta .btn { width: 100%; margin-bottom: 0.9rem; }
.side-cta > a:not(.btn) { color: var(--accent-light); font-size: 0.92rem; font-weight: 600; text-decoration: none; }
.side-cta > a:not(.btn):hover { text-decoration: underline; }
.side-cta a:focus-visible { outline-color: var(--accent-light); }

/* ---------- about principles ---------- */
.principles {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0 2.5rem;
}
.principles li {
  background: var(--bg);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.4rem 1.5rem;
}
.principles h3 { font-size: 1.05rem; }
.principles p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* ---------- contact ---------- */
.contact-layout { display: grid; gap: 2.5rem 4rem; align-items: start; }
@media (min-width: 960px) {
  .contact-layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .contact-layout .contact-card { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-h) + 2rem); }
  .contact-layout .prose { grid-column: 1; grid-row: 1; }
}
.contact-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
}
.contact-card h2 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.contact-card p { color: var(--muted); font-size: 0.95rem; }
.contact-address {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--navy);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  user-select: all;
  overflow-wrap: anywhere;
}
.contact-card .cta-row .btn { flex: 1 1 auto; }
.copy-status { display: block; min-height: 1.4em; margin-top: 0.6rem; font-size: 0.9rem; color: var(--muted); }

.prose .contact-essentials { list-style: none; margin: 1.5rem 0; }
.contact-essentials li { border-top: 1px solid var(--line); padding: 0.85rem 0; }
.contact-essentials strong { color: var(--navy); }
.contact-context { margin: 1.5rem 0 2rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contact-context summary { padding: 1rem 0; color: var(--navy); font-weight: 600; cursor: pointer; }
.context-content { padding: 0.3rem 0 1rem; }
.context-content h3:first-child { margin-top: 0; }

/* ---------- prose (long-form pages) ---------- */
.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(1.45rem, 2.6vw, 1.8rem); margin-top: 3rem; }
.prose h3 { margin-top: 1.8rem; }
.prose ul, .prose ol { margin: 0 0 1rem 1.4rem; }
.prose li { margin-bottom: 0.4rem; }
.prose .principles, .prose .check-list { margin-left: 0; }
.prose .check-list li { font-size: 1rem; color: var(--ink); margin-bottom: 0.5rem; }
.prose > h2:first-child { margin-top: 0; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.6rem;
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }
.prose .note {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.3rem;
  color: var(--muted);
  font-size: 0.97rem;
  margin: 1.4rem 0;
}
.article-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 1.4rem 0;
  padding: 0.75rem 0;
  border-block: 1px solid var(--line);
}
.article-diagram {
  /* Give chart labels room while retaining the article's left alignment. */
  width: min(calc(100vw - 3rem), calc(var(--maxw) - 3rem));
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.8rem 0 2.2rem;
  overflow: hidden;
}
.article-diagram img {
  display: block;
  width: 100%;
  height: auto;
}
.diagram-image-link { display: block; cursor: zoom-in; }
.diagram-image-link:focus-visible { outline-offset: -4px; }
/* One semantic transcript serves desktop, mobile and readers without scripts. */
.diagram-transcript { border-top: 1px solid var(--line); background: var(--bg-soft); }
.diagram-transcript summary { padding: 1rem 1.2rem; color: var(--navy); font-weight: 600; cursor: pointer; }
.diagram-text { padding: 0.2rem 1.2rem 1.3rem; }
.diagram-text-title { color: var(--navy); font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.prose .diagram-steps { margin: 1.3rem 0 0 1.8rem; list-style: decimal-leading-zero; }
.diagram-steps li { padding: 0 0 1rem 0.65rem; border-left: 1px solid #b9cfee; }
.diagram-steps li:last-child { padding-bottom: 0; border-left-color: transparent; }
.diagram-steps li::marker { color: var(--accent-dark); font-family: var(--font-mono); font-size: 0.85rem; }
.diagram-steps strong { display: block; color: var(--navy); font-size: 1rem; }
.diagram-steps span { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.prose .diagram-outcomes { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.25rem 0 0; list-style: none; }
.diagram-outcomes li { flex: 1; margin: 0; border: 1px solid; border-radius: 6px; padding: 0.4rem 0.65rem; text-align: center; font-size: 0.9rem; font-weight: 600; }
.outcome-go { color: #116759; background: #eaf7f2; }
.outcome-refine { color: #805715; background: #fff7e6; }
.outcome-stop { color: #9e3547; background: #fff0f2; }
.diagram-fullsize {
  display: block;
  width: fit-content;
  margin-top: 0.65rem;
  padding: 0.35rem 0;
  font-weight: 600;
}
.article-diagram figcaption {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 0.8rem 1rem 0.9rem;
}
@media (max-width: 600px) {
  /* Reflow the same evidence chain as text instead of shrinking image labels. */
  .article-diagram { width: 100%; }
  .diagram-image-link { display: none; }

}
.toc {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0 2.2rem;
}
.toc h2 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.8rem;
}
.toc a { text-decoration: none; font-weight: 600; }
.toc a:hover { text-decoration: underline; }
.toc ul {
  columns: 2;
  column-gap: 2rem;
  margin: 0;
  list-style: none;
}
.toc li { break-inside: avoid; margin-bottom: 0.4rem; }
.sources {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding-top: 1.5rem;
}
.sources h2 { margin-top: 0; }
.sources li { overflow-wrap: anywhere; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.table-wrap tr:last-child td { border-bottom: 0; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  min-width: 560px;
}
caption {
  text-align: left;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
th, td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { background: var(--bg-soft); color: var(--navy); font-weight: 600; }
td:first-child { font-weight: 600; color: var(--navy); }

/* ---------- FAQ ---------- */
.faq { max-width: 76ch; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 0.7rem;
  background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.faq details:hover { border-color: var(--line-strong); }
.faq details[open] { border-color: #b4c9e6; box-shadow: var(--shadow-sm); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  padding: 1.05rem 3.2rem 1.05rem 1.3rem;
  list-style: none;
  position: relative;
  border-radius: var(--radius-sm);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 1.4rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 1.3rem 1.1rem; color: var(--muted); margin: 0; }
.faq-layout { display: grid; gap: 2rem 4rem; }
@media (min-width: 900px) {
  .faq-layout { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); align-items: start; }
  .faq-layout > :first-child { position: sticky; top: calc(var(--header-h) + 2rem); }
}
.faq-layout .section-intro { margin-bottom: 1.2rem; }
.faq-layout .faq { max-width: none; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(520px 300px at 95% 0%, rgba(43, 103, 201, 0.5), transparent 65%),
    linear-gradient(150deg, var(--navy-950), var(--navy) 60%, var(--navy-2));
  color: var(--on-dark);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: clamp(1.75rem, 4.5vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem 3rem;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--grid-dark);
  background-size: 40px 40px;
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000);
  mask-image: linear-gradient(100deg, transparent 30%, #000);
}
.cta-band .kicker { color: var(--accent-light); }
.cta-band h2 { color: #fff; margin: 0; }
.cta-band p { color: var(--on-dark-muted); max-width: 58ch; margin: 0.65rem 0 0; }
.cta-band > .btn { justify-self: start; }
@media (min-width: 900px) {
  .cta-band { grid-template-columns: minmax(0, 1fr) auto; }
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--navy-950);
  color: #93a7bd;
  padding: 4rem 0 2rem;
  margin-top: 5.5rem;
  font-size: 0.92rem;
}
.site-footer .cols {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 2.5rem 3rem;
  margin-bottom: 2.5rem;
}
.site-footer .logo { color: #fff; margin-bottom: 0.9rem; }
.site-footer .logo:hover { color: #fff; }
.site-footer .logo-mark rect { fill: var(--navy-3); }
.site-footer .logo-word { font-size: 1.3rem; }
.site-footer .footer-brand p { max-width: 34ch; }
.site-footer h2 {
  color: #8ba1b8;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.9rem;
}
@media (max-width: 900px) {
  .site-footer .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-footer .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .site-footer .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
}
.site-footer a { color: var(--on-dark-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent-light); }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer .legal {
  border-top: 1px solid rgba(147, 167, 189, 0.25);
  padding-top: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

/* ---------- page hero (subpages; shares the hero background) ---------- */
.page-hero { color: var(--on-dark-muted); padding: 4.25rem 0 3.75rem; }
.page-hero h1 { color: #fff; font-size: clamp(2rem, 4.2vw, 3rem); margin-bottom: 1rem; max-width: 22ch; }
.page-hero p { max-width: 60ch; margin: 0; font-size: 1.15rem; line-height: 1.6; }

/* ---------- error page ---------- */
.error-page { text-align: center; padding: 7rem 0; }
.error-page .kicker { justify-content: center; }
.error-page p { color: var(--muted); max-width: 48ch; margin: 1rem auto 2rem; }
.error-page .cta-row { justify-content: center; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; }
  .site-header.nav-open .main-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 0.8rem 1rem 1.4rem;
    box-shadow: 0 14px 28px rgba(16, 36, 58, 0.12);
  }
  .site-header.nav-open .main-nav a { font-size: 1.05rem; padding: 0.7rem 0.8rem; }
  .site-header.nav-open .main-nav a.btn { margin: 0.6rem 0 0; padding: 0.8rem 1.2rem; }
  .section { padding: 3.75rem 0; }
  .section.alt + .section:has(> .container > .cta-band:only-child) { padding-top: 3.75rem; }
  .hero { padding: 3.5rem 0 6.5rem; }
  .page-hero { padding: 3rem 0 2.75rem; }
  .deliverables { margin-top: 3.5rem; padding-top: 3.5rem; }
  .worked-example { margin-bottom: 3.25rem; }
  .site-footer { margin-top: 3.75rem; }
  .toc ul { columns: 1; }
}
