/* ==========================================================
   ARTIFACT INTERNALS — MUTED1 VARIANT STYLESHEET
   Palette derived from images/logo.png (source files in planning/aint logos/)
   ========================================================== */

:root {
  --forest:        #1C5928;   /* deep green — sunflower seed centre    */
  --forest-dark:   #133D1B;   /* darker green for footer               */
  --amber:         #C4A830;   /* muted warm gold — petal colour        */
  --amber-light:   #EEE7BC;   /* pale amber tint                       */
  --blue:          #3B5CA6;   /* slate blue — seed-head squares        */
  --blue-light:    #DDE3F4;   /* pale blue tint                        */
  --white:         #FFFFFF;
  --off-white:     #F3F0E5;   /* warm cream — petal-light              */
  --text:          #181E14;   /* near-black with green cast            */
  --text-muted:    #596250;   /* warm grey-green                       */
  --text-inv:      rgba(255,255,255,0.80); /* body text on dark bg     */
  --border:        #D1C9B6;   /* warm border                           */

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --nav-height:     72px;
  --section-pad:    100px;
  --container-max:  1100px;
  --container-pad:  40px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

/* ==========================================================
   TYPOGRAPHY
   ========================================================== */

h1 {
  font-size: clamp(44px, 7vw, 80px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--white);
}

h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--forest);
}

h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 10px;
}

p {
  line-height: 1.75;
  color: var(--text-muted);
}

/* ==========================================================
   LAYOUT
   ========================================================== */

.section-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--section-pad) var(--container-pad);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 52px;
}

/* ==========================================================
   NAVIGATION
   ========================================================== */

#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

#site-header.scrolled {
  border-bottom-color: var(--border);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--forest);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity 0.2s;
}

.nav-logo:hover { opacity: 0.75; }

.logo-img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.nav-links a:hover {
  color: var(--forest);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-cta {
  color: var(--forest) !important;
  font-weight: 600 !important;
  padding: 7px 18px !important;
  border: 1.5px solid var(--forest);
  transition: background 0.2s, color 0.2s !important;
}

.nav-cta::after { display: none !important; }

.nav-cta:hover {
  background: var(--forest) !important;
  color: var(--white) !important;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  width: 36px;
  height: 36px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--forest);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ==========================================================
   HERO — deep forest green, light text
   ========================================================== */

#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  background: var(--forest);
  position: relative;
  overflow: hidden;
}

/* Subtle pixel-grid watermark echoing the seed-head pattern */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.hero-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 80px var(--container-pad);
  position: relative;
  display: flex;
  align-items: center;
  gap: 80px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-logo-wrap {
  flex-shrink: 0;
}

.hero-logo-img {
  width: 340px;
  height: auto;
  filter: drop-shadow(0 8px 40px rgba(0,0,0,0.35));
}

.hero-content h1 {
  color: var(--white);
  margin-bottom: 32px;
}

.hero-content h1 .accent {
  position: relative;
  display: inline-block;
}

.hero-content h1 .accent::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--amber);
  opacity: 0.7;
}

.hero-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 28px;
  opacity: 0.9;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-inv);
  max-width: 520px;
  margin-bottom: 48px;
  line-height: 1.75;
}

/* ==========================================================
   BUTTONS
   ========================================================== */

.btn-primary {
  display: inline-block;
  background: var(--amber);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  padding: 14px 28px;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background: var(--forest-dark);
  transform: translateY(-2px);
}

/* ==========================================================
   SERVICES
   ========================================================== */

#services {
  background: var(--off-white);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
}

.service-card {
  background: var(--off-white);
  padding: 52px 44px;
  border-left: 3px solid transparent;
  transition: border-left-color 0.25s ease, background 0.25s ease;
}

.service-card:hover {
  border-left-color: var(--amber);
  background: var(--white);
}

.service-icon {
  color: var(--forest);
  margin-bottom: 24px;
  line-height: 1;
}

.service-card h3 { margin-bottom: 14px; }
.service-card p  { font-size: 15px; }

/* Services — performance diagram */
.services-diagram {
  background: var(--white);
  margin-top: 2px;
  padding: 44px 44px 40px;
}

.services-diagram .fi-title { margin-bottom: 20px; }

.services-diagram .diagram-svg-wrap {
  max-width: 740px;
}

.perf-axis { stroke: var(--border); stroke-width: 1; }

.perf-axis-label {
  font-size: 11px;
  fill: var(--text-muted);
}

.perf-label-baseline {
  font-size: 11px;
  font-style: italic;
  fill: var(--text-muted);
}

.perf-line {
  fill: none;
  stroke: var(--forest);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.perf-line-cont {
  fill: none;
  stroke: var(--forest);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 3 5;
  opacity: 0;
}

.perf-line-log {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 6 5;
  opacity: 0;
}

.perf-connector {
  stroke: var(--amber);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0;
}

.perf-fan {
  opacity: 0;
}

.perf-fan path {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  opacity: 0.55;
}

.perf-fan-risk {
  opacity: 0;
}

.perf-fan-risk path {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1;
  stroke-dasharray: 1.5 3;
  opacity: 0.4;
}

.perf-dot { fill: var(--amber); opacity: 0; }

.perf-event-label {
  font-size: 10px;
  font-weight: 500;
  fill: var(--text);
  opacity: 0;
}

.services-diagram.animate .perf-line {
  animation: diagram-draw 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.services-diagram.animate .perf-line-cont {
  animation: diagram-fade 0.6s ease forwards;
  animation-delay: 1.5s;
}

.services-diagram.animate .perf-line-log {
  animation: diagram-fade 0.8s ease forwards;
  animation-delay: 1.8s;
}

.services-diagram.animate .perf-fan {
  animation: diagram-fade 0.5s ease forwards;
  animation-delay: var(--delay, 0s);
}

.services-diagram.animate .perf-fan-risk {
  animation: diagram-fade 0.5s ease forwards;
  animation-delay: var(--delay, 0s);
}

.perf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 12px;
}

.perf-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
}

.perf-legend-swatch {
  display: inline-block;
  width: 20px;
  height: 0;
  border-top-width: 2.5px;
  border-top-style: solid;
}

.perf-legend-swatch--step {
  border-top-color: var(--forest);
}

.perf-legend-swatch--smooth {
  border-top-width: 2px;
  border-top-style: dashed;
  border-top-color: var(--blue);
}

.perf-legend-swatch--fan {
  border-top-width: 1.5px;
  border-top-style: dotted;
  border-top-color: var(--amber);
}

.perf-legend-swatch--risk {
  border-top-width: 1.5px;
  border-top-style: dotted;
  border-top-color: var(--text-muted);
}

.services-diagram.animate .perf-connector,
.services-diagram.animate .perf-dot,
.services-diagram.animate .perf-event-label {
  animation: diagram-fade 0.4s ease forwards;
  animation-delay: var(--delay, 0s);
}

/* ==========================================================
   REACH / DEPLOYMENTS
   ========================================================== */

#reach {
  background: var(--forest);
  position: relative;
  overflow: hidden;
}

#reach::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.reach-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--section-pad) var(--container-pad);
  position: relative;
}

.reach-inner .section-label {
  margin-bottom: 28px;
}

.reach-statement {
  margin-bottom: 60px;
}

.reach-statement p {
  font-size: clamp(24px, 3.5vw, 38px);
  font-weight: 300;
  color: var(--white);
  line-height: 1.4;
  max-width: 720px;
}

.reach-poles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: rgba(255,255,255,0.08);
  margin-bottom: 52px;
}

.reach-pole {
  background: var(--forest);
  padding: 44px 40px;
}

.reach-pole-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 16px;
}

.reach-pole p {
  font-size: 15px;
  color: var(--text-inv);
  line-height: 1.75;
}

.reach-regions {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 32px;
}

.reach-regions span {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  padding-right: 28px;
  margin-right: 28px;
  border-right: 1px solid rgba(255,255,255,0.1);
  line-height: 2;
}

.reach-regions span:last-child {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}

/* ==========================================================
   DOMAIN CARDS — clickable link cards
   ========================================================== */

a.portfolio-card {
  display: block;
  text-decoration: none;
}

.card-more {
  display: inline-block;
  margin-top: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  transition: color 0.2s;
}

a.portfolio-card:hover .card-more { color: var(--forest); }

/* ==========================================================
   DOMAIN DETAIL PAGES
   ========================================================== */

.domain-hero {
  padding-top: var(--nav-height);
  background: var(--forest);
  position: relative;
  overflow: hidden;
}

.domain-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.domain-hero-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 60px var(--container-pad) 72px;
  position: relative;
}

.domain-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  margin-bottom: 40px;
  transition: color 0.2s;
}

.domain-back:hover { color: var(--amber); }

.domain-hero h1 {
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 300;
  color: var(--white);
  margin-bottom: 20px;
}

.domain-tagline {
  font-size: 18px;
  color: var(--text-inv);
  max-width: 560px;
  margin-bottom: 32px;
  line-height: 1.75;
}

.domain-hero-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.domain-hero-tags .tag {
  background: rgba(255,255,255,0.08);
  color: var(--amber-light);
  border: 1px solid rgba(255,255,255,0.12);
}

/* Overview */
.domain-overview {
  background: var(--white);
}

.domain-overview-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--section-pad) var(--container-pad);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 100px;
  align-items: start;
}

.domain-overview-label {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.domain-overview-label h2 {
  font-size: 26px;
  line-height: 1.3;
}

.domain-overview-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.domain-lead {
  font-size: 20px;
  font-weight: 400;
  color: var(--forest);
  line-height: 1.65;
}

.domain-overview-body p { font-size: 16px; }

/* Methodology */
.domain-steps-section {
  background: var(--off-white);
}

.domain-steps-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--section-pad) var(--container-pad);
}

.domain-steps {
  border-top: 1px solid var(--border);
}

.domain-step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 36px;
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.domain-step-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber);
  padding-top: 4px;
}

.domain-step h3 { font-size: 17px; margin-bottom: 10px; }
.domain-step p  { font-size: 15px; }

/* Diagram */
.domain-diagram-section {
  background: var(--white);
}

.domain-diagram-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--section-pad) var(--container-pad);
}

/* Domain CTA */
.domain-cta {
  background: var(--forest);
  position: relative;
  overflow: hidden;
}

.domain-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.domain-cta-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 80px var(--container-pad);
  position: relative;
  text-align: center;
}

.domain-cta h2 {
  color: var(--white);
  font-weight: 300;
  margin-bottom: 16px;
}

.domain-cta p {
  color: var(--text-inv);
  font-size: 17px;
  margin-bottom: 40px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Feature importance chart */
.fi-chart {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 620px;
}

.fi-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 12px;
}

.fi-row {
  display: grid;
  grid-template-columns: 170px 1fr 42px;
  gap: 16px;
  align-items: center;
}

.fi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.fi-track {
  height: 6px;
  background: var(--amber-light);
}

.fi-fill {
  height: 100%;
  background: var(--forest);
  width: 0;
}

.fi-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.fi-caption {
  margin-top: 28px;
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
}

@keyframes fi-grow {
  to { width: var(--bar-w); }
}

.domain-diagram-section.animate .fi-fill {
  animation: fi-grow 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: var(--delay);
}

/* Shared diagram scaffolding */
.diagram-svg-wrap {
  max-width: 640px;
}

.diagram-caption {
  margin-top: 24px;
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
}

.diagram-svg-wrap svg { width: 100%; height: auto; display: block; }

/* Time-series diagram */
.ts-line {
  fill: none;
  stroke: var(--forest);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.ts-cone { fill: var(--amber); fill-opacity: 0.22; stroke: var(--amber); stroke-opacity: 0.5; stroke-width: 1.5; opacity: 0; }
.ts-cone2 { fill: var(--blue); fill-opacity: 0.16; stroke: var(--blue); stroke-opacity: 0.45; stroke-width: 1.5; opacity: 0; }
.ts-period1 { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0; }
.ts-period2 { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; }
.ts-period1-label, .ts-period2-label, .ts-legend text { font-size: 11px; fill: var(--text-muted); }

@keyframes diagram-draw { to { stroke-dashoffset: 0; } }
@keyframes diagram-fade { to { opacity: 1; } }

.domain-diagram-section.animate .ts-line { animation: diagram-draw 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.domain-diagram-section.animate .ts-cone { animation: diagram-fade 0.8s ease forwards 1.1s; }
.domain-diagram-section.animate .ts-period1 { animation: diagram-fade 0.5s ease forwards 1.3s; }
.domain-diagram-section.animate .ts-period2 { animation: diagram-fade 0.5s ease forwards 1.5s; }
.domain-diagram-section.animate .ts-cone2 { animation: diagram-fade 0.8s ease forwards 1.7s; }

/* Computer vision diagram */
.cv-box { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 300; stroke-dashoffset: 300; }
.cv-chip { opacity: 0; transition: opacity 0.4s ease; }
.cv-chip text { font-size: 11px; font-weight: 600; fill: var(--white); }
.cv-chip rect { fill: var(--blue); }
.cv-grid { stroke: var(--border); stroke-width: 1; }

.domain-diagram-section.animate .cv-box  { animation: diagram-draw 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards; animation-delay: var(--delay); }
.domain-diagram-section.animate .cv-chip { animation: diagram-fade 0.4s ease forwards; animation-delay: calc(var(--delay) + 0.5s); opacity: 0; }

/* Causal inference diagram */
.ci-treatment { fill: none; stroke: var(--forest); stroke-width: 2.5; stroke-dasharray: 700; stroke-dashoffset: 700; }
.ci-control   { fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-dasharray: 700; stroke-dashoffset: 700; }
.ci-split     { stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0; }
.ci-legend text { font-size: 11px; fill: var(--text-muted); }
.ci-legend .ci-swatch-t { fill: var(--forest); }
.ci-legend .ci-swatch-c { fill: var(--text-muted); }

.domain-diagram-section.animate .ci-treatment { animation: diagram-draw 1.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.domain-diagram-section.animate .ci-control   { animation: diagram-draw 1.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.domain-diagram-section.animate .ci-split     { animation: diagram-fade 0.5s ease forwards 0.6s; }

/* Production ML pipeline diagram */
.pml-node circle { fill: var(--white); stroke: var(--forest); stroke-width: 2; }
.pml-node text { font-size: 11px; font-weight: 600; fill: var(--text); text-anchor: middle; }
.pml-node { opacity: 0; transform: translateY(6px); transition: none; }
.pml-link { stroke: var(--border); stroke-width: 2; }
.pml-alert circle { fill: var(--amber); }

@keyframes pml-in { to { opacity: 1; transform: translateY(0); } }
@keyframes pml-pulse {
  0%, 100% { r: 20; opacity: 1; }
  50% { r: 24; opacity: 0.7; }
}

.domain-diagram-section.animate .pml-node  { animation: pml-in 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; animation-delay: var(--delay); }
.domain-diagram-section.animate .pml-alert circle { animation: pml-pulse 1.6s ease-in-out infinite; animation-delay: 1.4s; }

/* Dataset curation pipeline diagram */
.dc-stage rect { fill: var(--off-white); stroke: var(--blue); stroke-width: 1.5; }
.dc-stage text { font-size: 12px; font-weight: 600; fill: var(--text); text-anchor: middle; }
.dc-stage { opacity: 0; }
.dc-arrow { stroke: var(--text-muted); stroke-width: 1.5; opacity: 0; }

.domain-diagram-section.animate .dc-stage { animation: diagram-fade 0.5s ease forwards; animation-delay: var(--delay); opacity: 0; }
.domain-diagram-section.animate .dc-arrow { animation: diagram-fade 0.4s ease forwards; animation-delay: var(--delay); opacity: 0; }

/* Gamification leaderboard diagram */
.lb-row { display: grid; grid-template-columns: 32px 140px 1fr 42px; gap: 16px; align-items: center; }
.lb-rank { font-size: 13px; font-weight: 700; color: var(--amber); text-align: center; }
.lb-label { font-size: 13px; font-weight: 500; color: var(--text); text-align: right; white-space: nowrap; }
.lb-track { height: 6px; background: var(--amber-light); }
.lb-fill  { height: 100%; background: var(--blue); width: 0; }
.lb-val   { font-size: 12px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.domain-diagram-section.animate .lb-fill {
  animation: fi-grow 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: var(--delay);
}

/* Reinforcement learning loop diagram */
.rl-box rect { fill: var(--off-white); stroke: var(--forest); stroke-width: 2; }
.rl-box text { font-size: 13px; font-weight: 700; fill: var(--text); text-anchor: middle; }
.rl-arrow { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 320; stroke-dashoffset: 320; }
.rl-arrow.reward { stroke: var(--amber); }
.rl-arrow-label { font-size: 11px; fill: var(--text-muted); }

.domain-diagram-section.animate .rl-arrow { animation: diagram-draw 1s cubic-bezier(0.4, 0, 0.2, 1) forwards; animation-delay: var(--delay); }

/* Domain page responsive */
@media (max-width: 900px) {
  .domain-overview-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .domain-overview-label { position: static; }

  .domain-step {
    grid-template-columns: 40px 1fr;
    gap: 24px;
  }

  .fi-row { grid-template-columns: 130px 1fr 38px; gap: 12px; }
  .fi-label { font-size: 12px; }
}

@media (max-width: 600px) {
  .domain-hero-inner { padding: 48px var(--container-pad) 56px; }

  .domain-step {
    grid-template-columns: 36px 1fr;
    gap: 16px;
  }

  .fi-row { grid-template-columns: 100px 1fr 34px; gap: 10px; }
  .fi-label { font-size: 11px; }
}

/* ==========================================================
   DOMAINS
   ========================================================== */

#domains {
  background: var(--off-white);
}

.section-label + .domains-note {
  margin-top: -36px;
  margin-bottom: 48px;
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
}

.portfolio-card {
  background: var(--off-white);
  padding: 40px 36px;
  border-bottom: 3px solid transparent;
  transition: border-bottom-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.portfolio-card:hover {
  border-bottom-color: var(--forest);
  background: var(--white);
  transform: translateY(-3px);
}

.portfolio-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

/* Tags use the blue from the seed-head squares */
.tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-light);
  padding: 4px 10px;
}

.portfolio-card h3 {
  font-size: 17px;
  margin-bottom: 14px;
  line-height: 1.4;
}

.portfolio-card p { font-size: 14px; }

/* ==========================================================
   CONTACT
   ========================================================== */

#contact {
  background: var(--white);
}

.contact-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 100px;
  align-items: start;
}

.contact-intro h2  { margin-bottom: 20px; }
.contact-intro > p { font-size: 16px; margin-bottom: 16px; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--forest);
}

.form-group input,
.form-group textarea {
  border: none;
  border-bottom: 1.5px solid var(--border);
  padding: 10px 0;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  outline: none;
  width: 100%;
  resize: vertical;
  transition: border-bottom-color 0.2s;
  -webkit-appearance: none;
  border-radius: 0;
}

.form-group input:focus,
.form-group textarea:focus {
  border-bottom-color: var(--forest);
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  font-size: 14px;
  min-height: 20px;
}

.form-status.success { color: var(--forest); }
.form-status.error   { color: #A3402A; }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================
   FOOTER
   ========================================================== */

#footer {
  background: var(--forest-dark);
  padding: 40px 0;
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo-img {
  height: 28px;
  width: auto;
  opacity: 0.85;
}

.footer-copy {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--amber); }

/* ==========================================================
   RESPONSIVE — TABLET  (≤900px)
   ========================================================== */

@media (max-width: 900px) {
  :root {
    --section-pad:   72px;
    --container-pad: 28px;
  }

  .hero-content     { flex-direction: column; gap: 48px; text-align: center; }
  .hero-sub         { margin-left: auto; margin-right: auto; }
  .hero-logo-img    { width: 220px; }

  .services-grid    { grid-template-columns: 1fr; }

  .reach-poles      { grid-template-columns: 1fr; }

  .portfolio-grid   { grid-template-columns: repeat(2, 1fr); }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 52px;
  }
}

/* ==========================================================
   RESPONSIVE — MOBILE  (≤600px)
   ========================================================== */

@media (max-width: 600px) {
  :root {
    --section-pad:   56px;
    --container-pad: 20px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 20px;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.07);
  }

  .nav-links.open { display: flex; }
  .nav-toggle     { display: flex; }

  .nav-cta {
    border: none !important;
    padding: 0 !important;
    font-size: 16px !important;
  }

  .portfolio-grid { grid-template-columns: 1fr; }

  .reach-pole     { padding: 36px 28px; }
  .service-card   { padding: 36px 28px; }
  .services-diagram { padding: 32px 24px 28px; }

  .footer-container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
