/* ===================== DESIGN TOKENS ===================== */
:root {
  color-scheme: light dark;
  --surface: #F7F9FC;
  --surface-raised: #FFFFFF;
  --border: #E2E8F0;
  --text-primary: #0F172A;
  --text-muted: #64748B;
  --accent: #2563EB;
  --accent-rgb: 37, 99, 235;
  --accent-muted: #DBEAFE;
  --success: #15803D;
  --success-bg: #DCFCE7;
  --alert: #DC2626;
  --alert-bg: #FEE2E2;
  --hue-2: #7C3AED;
  --hue-2-rgb: 124, 58, 237;
  --hue-2-bg: #EDE4FE;
  --hue-3: #0D9488;
  --hue-3-rgb: 13, 148, 136;
  --hue-3-bg: #CCFBF1;
  --on-accent: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max-width: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #0B1220;
    --surface-raised: #121B2E;
    --border: #1E293B;
    --text-primary: #F1F5F9;
    --text-muted: #94A3B8;
    --accent: #60A5FA;
    --accent-rgb: 96, 165, 250;
    --accent-muted: #1E3A5F;
    --success: #4ADE80;
    --success-bg: #123522;
    --alert: #F87171;
    --alert-bg: #3B1616;
    --hue-2: #A78BFA;
    --hue-2-rgb: 167, 139, 250;
    --hue-2-bg: #271C4A;
    --hue-3: #2DD4BF;
    --hue-3-rgb: 45, 212, 191;
    --hue-3-bg: #0F3B37;
    --on-accent: #0B1220;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  --surface: #0B1220;
  --surface-raised: #121B2E;
  --border: #1E293B;
  --text-primary: #F1F5F9;
  --text-muted: #94A3B8;
  --accent: #60A5FA;
  --accent-rgb: 96, 165, 250;
  --accent-muted: #1E3A5F;
  --success: #4ADE80;
  --success-bg: #123522;
  --alert: #F87171;
  --alert-bg: #3B1616;
  --hue-2: #A78BFA;
  --hue-2-rgb: 167, 139, 250;
  --hue-2-bg: #271C4A;
  --hue-3: #2DD4BF;
  --hue-3-rgb: 45, 212, 191;
  --hue-3-bg: #0F3B37;
  --on-accent: #0B1220;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.45);
}

/* ===================== RESET / BASE ===================== */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 150ms ease, color 150ms ease;
}

a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible {
  border-radius: 8px;
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3, h4, p { margin-top: 0; }

.icon {
  display: block;
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 20px;
}

main { position: relative; z-index: 1; }

/* ===================== ANIMATED BACKGROUND ===================== */
.bg-fx {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

.bg-aurora {
  animation: aurora-drift 30s ease-in-out infinite alternate;
  background:
    radial-gradient(closest-side, rgba(var(--accent-rgb), 0.22), transparent 72%) 12% 14% / 58% 58% no-repeat,
    radial-gradient(closest-side, rgba(var(--hue-2-rgb), 0.16), transparent 72%) 88% 10% / 52% 52% no-repeat,
    radial-gradient(closest-side, rgba(var(--hue-3-rgb), 0.15), transparent 72%) 62% 88% / 56% 56% no-repeat;
  filter: blur(28px);
  inset: -20%;
  position: absolute;
}

.bg-grid {
  animation: grid-pan 44s linear infinite;
  background-image:
    linear-gradient(to right, rgba(var(--accent-rgb), 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--accent-rgb), 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  inset: 0;
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 10%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 85% 65% at 50% 10%, #000 35%, transparent 100%);
  position: absolute;
}

.bg-spark i {
  animation: spark-run 12s linear infinite;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px 2px rgba(var(--accent-rgb), 0.55);
  height: 3px;
  opacity: 0;
  position: absolute;
  width: 3px;
}

.bg-spark i:nth-child(1) { left: 12%; animation-delay: 0s; animation-duration: 11s; }
.bg-spark i:nth-child(2) { left: 34%; animation-delay: 3.5s; animation-duration: 15s; }
.bg-spark i:nth-child(3) { left: 61%; animation-delay: 6s; animation-duration: 13s; }
.bg-spark i:nth-child(4) { left: 84%; animation-delay: 1.5s; animation-duration: 17s; }

@keyframes aurora-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2%, -1.5%, 0) scale(1.06); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.03); }
}

@keyframes grid-pan {
  from { background-position: 0 0, 0 0; }
  to { background-position: 64px 64px, 64px 64px; }
}

@keyframes spark-run {
  0% { top: -4%; opacity: 0; }
  10% { opacity: 0.85; }
  90% { opacity: 0.85; }
  100% { top: 104%; opacity: 0; }
}

.section {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 88px 24px;
  position: relative;
}

.section:not(.hero) { border-top: 1px solid var(--border); }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible { opacity: 1; transform: translateY(0); }

.eyebrow {
  color: var(--text-muted);
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.eyebrow b { color: var(--accent); font-weight: 700; }

.section-heading { margin-bottom: 32px; }

.section-heading h2,
.leadership-card h2,
.contact-card h2 {
  font-size: clamp(1.65rem, 2.7vw, 2.25rem);
  letter-spacing: -0.02em;
  line-height: 1.18;
  font-weight: 800;
  margin: 0 0 12px;
  text-wrap: balance;
}

h1, .case-hero h1 { text-wrap: balance; }

.section-heading p,
.leadership-card p,
.contact-card p {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0;
  max-width: 70ch;
}

.grid { display: grid; gap: 16px; }

.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.card h3 { font-size: 1.05rem; letter-spacing: -0.01em; margin-bottom: 8px; }
.card p, .card li { color: var(--text-muted); }

.badge-icon {
  align-items: center;
  border-radius: 10px;
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: center;
}

.button {
  align-items: center;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 650;
  gap: 8px;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.button:hover { transform: translateY(-1px); }

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.28);
}

.button-secondary {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

/* ===================== HEADER / NAV ===================== */
.site-header {
  background: rgba(var(--accent-rgb), 0);
  background: var(--surface);
  border-bottom: 1px solid transparent;
  position: sticky;
  top: 0;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  z-index: 20;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 16px 24px;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 11px;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: inline-flex;
  flex: 0 0 auto;
  filter: drop-shadow(0 4px 10px rgba(var(--accent-rgb), 0.35));
  height: 38px;
  transition: transform 200ms ease;
  width: 38px;
}

.brand:hover .brand-mark { transform: translateY(-1px) scale(1.03); }

.brand-mark svg { height: 100%; width: 100%; }
.brand-grad-a { stop-color: var(--accent); }
.brand-grad-b { stop-color: var(--hue-3); }
.brand-tile { fill: url(#brand-grad); }
.brand-wire { fill: none; stroke: var(--on-accent); stroke-width: 1.3; stroke-linecap: round; opacity: 0.75; }
.brand-node { fill: var(--on-accent); opacity: 0.92; }
.brand-node-lg { opacity: 1; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1rem; font-weight: 750; }

.brand-role {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  border-radius: 999px;
  color: var(--text-muted);
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 12px;
  transition: background 150ms ease, color 150ms ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  background: var(--accent-muted);
  color: var(--accent);
}

.theme-toggle {
  align-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
  flex: 0 0 auto;
}

.theme-toggle .theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-dark { display: block; }

/* ===================== HERO + DATA-FLOW DIAGRAM ===================== */
.hero {
  display: grid;
  gap: 44px;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  padding-bottom: 64px;
  padding-top: 56px;
}

.hero-identity { align-items: center; display: flex; gap: 12px; margin-bottom: 18px; }
.hero-identity .eyebrow { margin: 0; }

.hero-avatar {
  border: 2px solid var(--border);
  border-radius: 50%;
  display: block;
  flex: 0 0 auto;
  height: 56px;
  object-fit: cover;
  width: 56px;
}

h1 {
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin: 0 0 18px;
}

.hero-title {
  color: var(--accent);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  font-weight: 700;
  margin: 0 0 14px;
  max-width: 46ch;
}

.hero-statement {
  color: var(--text-primary);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.5;
  margin: 0 0 12px;
  max-width: 56ch;
}

.hero-support {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0 0 28px;
  max-width: 50ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.hero-meta span {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.hero-meta .icon { color: var(--text-muted); width: 16px; height: 16px; }

.email-link {
  color: var(--text-muted);
  display: inline-flex;
  font-size: 0.95rem;
  gap: 8px;
}

.email-link span { color: var(--accent); font-weight: 700; }

.dataflow {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px;
}

.df-grid {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto 1fr;
  position: relative;
}

.df-lines {
  color: var(--accent);
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
  z-index: 0;
}

.df-lines path {
  fill: none;
  opacity: 0.35;
  stroke: currentColor;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* Running light points. Paths are assigned in px by main.js from the same
   normalised curves as the SVG lines, so the dots stay circular at any width. */
.df-dots {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.df-dots span {
  animation: df-dot-run 3.6s linear infinite;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px 2px rgba(var(--accent-rgb), 0.5);
  height: 6px;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  width: 6px;
}

.df-dots span:nth-child(1) { animation-duration: 3.4s; animation-delay: 0s; }
.df-dots span:nth-child(2) { animation-duration: 4s; animation-delay: 0.7s; }
.df-dots span:nth-child(3) { animation-duration: 3.7s; animation-delay: 1.4s; }
.df-dots span:nth-child(4) { animation-duration: 4.3s; animation-delay: 2.1s; }
.df-dots span:nth-child(5) { animation-duration: 3.2s; animation-delay: 1s; background: var(--hue-3); box-shadow: 0 0 8px 2px rgba(var(--hue-3-rgb), 0.5); }
.df-dots span:nth-child(6) { animation-duration: 3.6s; animation-delay: 1.9s; background: var(--hue-3); box-shadow: 0 0 8px 2px rgba(var(--hue-3-rgb), 0.5); }
.df-dots span:nth-child(7) { animation-duration: 3.9s; animation-delay: 2.6s; background: var(--hue-3); box-shadow: 0 0 8px 2px rgba(var(--hue-3-rgb), 0.5); }

@keyframes df-dot-run {
  0% { offset-distance: 0%; opacity: 0; }
  12% { opacity: 1; }
  85% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

.df-col, .df-center { position: relative; z-index: 1; }

.df-col { display: grid; gap: 10px; }

.df-node {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  font-size: 0.82rem;
  font-weight: 650;
  gap: 9px;
  padding: 9px 11px;
}

.df-node .badge-icon { width: 28px; height: 28px; }
.df-node .icon { width: 16px; height: 16px; }

.df-center {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.df-center-icon {
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.32);
  color: var(--on-accent);
  display: grid;
  height: 68px;
  justify-content: center;
  width: 68px;
}

.df-center-icon .icon { width: 30px; height: 30px; }

.df-center-label {
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* ===================== STAT ROW (snapshot) ===================== */
.stat-row { grid-template-columns: repeat(4, 1fr); }

.stat-card {
  align-items: center;
  display: flex;
  gap: 14px;
}

.stat-card .badge-icon { width: 44px; height: 44px; }
.stat-card .badge-icon .icon { width: 22px; height: 22px; }

.stat-value {
  color: var(--text-primary);
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-label { color: var(--text-muted); display: block; font-size: 0.82rem; }

/* ===================== CAPABILITIES ===================== */
.capability-grid { grid-template-columns: repeat(3, 1fr); }

.capability-card .badge-icon { width: 42px; height: 42px; margin-bottom: 16px; }
.capability-card .badge-icon .icon { width: 21px; height: 21px; }

/* ===================== FEATURED WORK (reduced card) ===================== */
.work-list { display: grid; gap: 20px; }

.project-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  padding: 26px 28px;
}

.project-card:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: var(--shadow-md);
}

.project-number {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 750;
  margin-bottom: 6px;
}

.project-card h2,
.project-card h3 { font-size: 1.3rem; letter-spacing: -0.015em; margin-bottom: 8px; }
.project-card p.project-summary { color: var(--text-muted); font-size: 0.96rem; line-height: 1.6; margin: 0 0 20px; max-width: 88ch; }

.metric-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 16px;
}

.metric-highlight {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.metric-highlight strong {
  color: var(--text-primary);
  display: block;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  letter-spacing: -0.02em;
  line-height: 1;
}

.metric-highlight span { color: var(--text-muted); display: block; font-size: 0.76rem; margin-top: 6px; }

.project-link {
  align-items: center;
  color: var(--accent);
  display: inline-flex;
  font-weight: 700;
  gap: 6px;
}

.back-link { color: var(--accent); display: inline-flex; font-weight: 700; margin-top: 18px; }
.project-link:hover, .back-link:hover { color: var(--text-primary); }

/* capability / keyword tags: visible chip row is primary; prose duplicate is screen-reader-only */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tag-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.tag-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 11px;
}

/* ===================== EXPERIENCE (vertical alternating timeline) ===================== */
.timeline {
  display: grid;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  position: relative;
}

.timeline::before {
  background: linear-gradient(to bottom, transparent, var(--accent), rgba(var(--accent-rgb), 0.25), transparent);
  bottom: 0;
  content: "";
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 2px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}

.timeline-item:nth-child(odd) .timeline-card { grid-column: 1; margin-right: 38px; }
.timeline-item:nth-child(even) .timeline-card { grid-column: 2; margin-left: 38px; }

.timeline-marker {
  background: var(--accent);
  border: 3px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.16);
  height: 16px;
  left: 50%;
  position: absolute;
  top: 20px;
  transform: translateX(-50%);
  width: 16px;
}

.timeline-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.timeline-card:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.timeline-period {
  color: var(--accent);
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.timeline-card h3 { font-size: 1.02rem; letter-spacing: -0.01em; margin-bottom: 4px; }
.timeline-org { color: var(--text-primary); font-size: 0.88rem; font-weight: 650; margin: 0 0 8px; }
.timeline-summary { color: var(--text-muted); font-size: 0.88rem; margin: 0; }

/* ===================== LEADERSHIP ===================== */
.leadership-wrap { align-items: stretch; grid-template-columns: 0.85fr 1.15fr; display: grid; gap: 20px; }

.leadership-card {
  background: var(--accent-muted);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.leadership-list { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }

.leadership-list li {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.92rem;
  padding: 14px 16px;
}

/* ===================== TECH STACK ===================== */
.tech-grid { grid-template-columns: repeat(2, 1fr); }

.tech-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 14px 0 0; padding: 0; }

.tech-list li {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-primary);
  display: inline-flex;
  font-size: 0.86rem;
  gap: 7px;
  padding: 7px 12px;
}

.tool-logo { background: #fff; border: 1px solid var(--border); border-radius: 5px; display: inline-block; height: 16px; object-fit: contain; padding: 2px; width: 16px; }
.tool-icon { align-items: center; color: var(--accent); display: inline-flex; }
.tool-icon .icon { width: 14px; height: 14px; }

/* ===================== CERTIFICATIONS (tiered) ===================== */
.cert-tier-label {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 40px 0 18px;
  padding-top: 26px;
  text-transform: uppercase;
}

.cert-strip { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 0; padding: 0; }

.cert-badge {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 190px;
  padding: 14px 16px;
}

.cert-badge strong { color: var(--text-primary); font-size: 0.94rem; letter-spacing: -0.005em; }
.cert-badge span { color: var(--text-muted); font-size: 0.8rem; }

.cert-strip-secondary .cert-badge {
  background: transparent;
  box-shadow: none;
  min-width: 0;
  padding: 8px 12px;
}

.cert-strip-secondary .cert-badge strong { font-size: 0.84rem; font-weight: 650; }
.cert-strip-secondary .cert-badge span { font-size: 0.76rem; }

/* ===================== CONTACT ===================== */
.contact-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 32px;
}

.contact-links { align-items: flex-start; display: flex; flex-direction: column; gap: 10px; }
.contact-links a { width: 220px; }

.looking-for {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 20px;
  padding: 18px 20px;
}

.looking-for h3 { font-size: 0.9rem; margin-bottom: 10px; }

.looking-for ul { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }

.looking-for li {
  align-items: flex-start;
  color: var(--text-muted);
  display: flex;
  font-size: 0.9rem;
  gap: 8px;
}

.looking-for li .icon { color: var(--accent); flex: 0 0 auto; margin-top: 3px; width: 15px; height: 15px; }

/* ===================== FOOTER ===================== */
.scroll-top {
  bottom: 22px;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: fixed;
  right: 22px;
  height: 44px;
  width: 44px;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 30;
}

.scroll-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding: 28px 24px 40px;
  position: relative;
  z-index: 1;
}

.footer-inner {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--max-width);
  font-size: 0.88rem;
}

/* ===================== CASE STUDY PAGES ===================== */
.case-study { max-width: 900px; padding-top: 130px; }

.case-hero {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-top: 18px;
  padding: 30px;
}

.case-index .section-heading h1,
.case-hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 10px 0 16px;
}

.case-hero p { color: var(--text-muted); font-size: 1.05rem; max-width: 760px; }

.case-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.case-metrics { margin: 22px 0; }

.case-content {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 30px;
}

.case-content h2 { color: var(--text-primary); font-size: clamp(1.3rem, 2.2vw, 1.7rem); letter-spacing: -0.015em; margin: 26px 0 10px; }
.case-content h2:first-child { margin-top: 0; }
.case-content p, .case-content li { color: var(--text-muted); }
.case-content ul { padding-left: 1.2rem; }

.case-nav-footer { border-top: 1px solid var(--border); margin-top: 36px; padding-top: 26px; }

.case-more { margin-top: 20px; }

.case-more-label {
  color: var(--text-muted);
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.case-more-links { display: flex; flex-direction: column; gap: 8px; }
.case-more-links a { color: var(--text-primary); font-weight: 650; }
.case-more-links a:hover { color: var(--accent); }

.case-tags { margin-top: 22px; }

/* figure/diagram block */
.case-figures { margin-top: 30px; }
.case-figures .eyebrow { margin-bottom: 4px; }

.case-figure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 26px 0;
  overflow: hidden;
}

.case-figure-media {
  align-items: center;
  display: flex;
  justify-content: center;
}

/* only the empty state needs a reserved box; real screenshots keep their own ratio */
.case-figure-media:has(.case-figure-placeholder) { aspect-ratio: 16 / 9; }

/* never upscale past natural size (portrait phone shots would blur); cap very tall ones */
.case-figure-media img {
  display: block;
  height: auto;
  max-height: 640px;
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.case-figure-placeholder {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.86rem;
}

.case-figure-placeholder .icon { width: 28px; height: 28px; }

.case-figure figcaption {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.86rem;
  padding: 12px 16px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 980px) {
  .nav { flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; }

  .hero,
  .project-top,
  .leadership-wrap,
  .contact-card { grid-template-columns: 1fr; }

  .hero { padding-top: 32px; }

  .stat-row,
  .capability-grid,
  .tech-grid { grid-template-columns: repeat(2, 1fr); }

  .contact-links { flex-direction: row; flex-wrap: wrap; }
  .contact-links a { width: auto; flex: 1 1 140px; }
}

@media (max-width: 780px) {
  .timeline::before { left: 7px; }
  .timeline-item { grid-template-columns: 1fr; }
  .timeline-item:nth-child(odd) .timeline-card,
  .timeline-item:nth-child(even) .timeline-card {
    grid-column: 1;
    margin: 0 0 0 34px;
  }
  .timeline-marker { left: 7px; }
}

@media (max-width: 640px) {
  .nav { padding: 12px 18px; }
  .section { padding: 56px 18px; }
  .hero { padding-top: 24px; }

  /* lighter background effects on small screens (battery / weaker GPUs) */
  .bg-aurora { animation: none; filter: blur(22px); }
  .bg-grid { animation: none; opacity: 0.55; }
  .bg-spark { display: none; }

  .cta-row, .button { width: 100%; }
  .cta-row .button { flex: 1 1 auto; }

  .stat-row,
  .capability-grid,
  .tech-grid,
  .metric-strip,
  .df-grid { grid-template-columns: 1fr; }

  .df-grid { justify-items: stretch; }
  .df-center { order: -1; }

  .project-top { flex-direction: column; }

  .case-study { padding-top: 88px; }
  .case-hero, .case-content { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .bg-spark, .df-dots { display: none; }
  .bg-aurora, .bg-grid { animation: none !important; }
}
