/* ==========================================================================
   PixOrbital — Stylesheet
   Design system: Steampunk Vitoriano (see design.md)
   Brass / mahogany / copper / parchment palette, IM Fell English display+body,
   JetBrains Mono for technical/data values, forged-metal borders, spring motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Colors — De Stijl: primary red/blue/yellow + black/white/grey, flat only */
  --color-brass: #CC0000;               /* was ornamental brass; now a mid-strength decorative red */
  --color-brass-light: #FFFF00;          /* was light brass; now yellow — used on dark (black) surfaces */
  --color-brass-dark: #990000;
  --color-mahogany: #111111;             /* was mahogany ink; now near-black (never pure #000 per spec) */
  --color-mahogany-light: #333333;
  --color-sepia: #333333;                /* was warm brown; now dark grey for secondary text */
  --color-parchment: #FFFFFF;            /* was parchment tan; now flat white */
  --color-copper: #0000FF;               /* was copper; now primary blue accent */
  --color-copper-text: #0000FF;          /* pure blue already meets WCAG AA (8.6:1) on white — no separate darken needed */
  --color-teal: #0000FF;                 /* was teal; now blue, unifying all accent usage */
  --color-teal-dark: #0000FF;
  --color-clockwork-orange: #CC0000;     /* was CTA orange; now AA-safe red (#FF0000 fails white-text AA — darkened, matches Don'ts' 80% saturation cap) */
  --color-ivory: #FFFFFF;

  /* Semantic aliases */
  --color-bg: var(--color-parchment);
  --color-surface: var(--color-ivory);
  --color-surface-raised: #F2F2F2;
  --color-text: #111111;                 /* off-black per Don'ts ("no pure black") */
  --color-text-muted: #595959;           /* AA-safe grey for body-sized muted text (design.md's #808080 fails AA at text size, reserved for borders instead) */
  --color-border: rgba(17, 17, 17, 0.2);
  --color-border-strong: var(--color-mahogany); /* bold black lines, not colored — the De Stijl signature */
  --color-accent: var(--color-teal);
  --color-cta: var(--color-clockwork-orange);
  --color-error: #B00020;
  --color-success: #2F6B3A;

  /* Typography — Helvetica is a system font, no web-font load needed */
  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --fs-hero: clamp(2.5rem, 5vw, 4rem);
  --fs-h1: 2.25rem;
  --fs-h2: 1.5rem;
  --fs-h3: 1.25rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --lh-body: 1.6;
  --measure: 72ch;

  /* Spacing (8px base unit) — unchanged; design.md specifies the same rhythm */
  --space-unit: 0.5rem;
  --space-1: 0.5rem;   /* 8px  */
  --space-2: 1rem;     /* 16px */
  --space-3: 1.5rem;   /* 24px */
  --space-4: 2rem;     /* 32px */
  --space-5: 3rem;     /* 48px */
  --space-6: 4rem;     /* 64px */
  --space-8: 6rem;     /* 96px */
  --section-gap: clamp(4rem, 8vw, 8rem);

  /* Layout — unchanged; design.md specifies the same container/grid rules */
  --container-max: 1280px;
  --container-pad: 1.5rem;

  /* Shape — sharp corners throughout, per De Stijl's explicit "no curves" rule */
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;

  /* Elevation — capped per Don'ts: "No shadows heavier than 0 2px 8px rgba(0,0,0,0.08)" */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lift: 0 2px 8px rgba(0, 0, 0, 0.08);

  /* Motion — ease-out only, no spring/overshoot ("smooth and predictable" per spec) */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 200ms;
  --dur-entry: 420ms;

  /* z-index contract — unchanged; design.md specifies the same contract */
  --z-base: 0;
  --z-sticky-nav: 100;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 500;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

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

@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;
    scroll-behavior: auto !important;
  }
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img, picture, svg { display: block; max-width: 100%; }

input, button, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

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

ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

p { text-wrap: pretty; }

/* Focus visibility — never suppressed */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 0;
}

/* --------------------------------------------------------------------------
   3. Base typography
   -------------------------------------------------------------------------- */
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h1); }
h3 { font-size: var(--fs-h2); }
h4 { font-size: var(--fs-h3); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-copper-text);
}

.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: var(--color-copper);
}

.mono { font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

section {
  padding-block: var(--section-gap);
  scroll-margin-top: 84px;
}

.section-header {
  max-width: 640px;
  margin-bottom: var(--space-5);
}

.section-header p {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
  max-width: var(--measure);
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: transform var(--dur-fast) var(--ease-spring),
              background-color var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-fast) var(--ease-standard);
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-cta);
  color: var(--color-ivory);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: #A30000; /* ~8% darken of new clockwork-orange base */
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  border-color: var(--color-mahogany);
  color: var(--color-mahogany);
}

.btn-secondary:hover {
  background: rgba(17, 17, 17, 0.06);
}

/* --------------------------------------------------------------------------
   5b. Accessibility utilities
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-2);
  z-index: var(--z-toast);
  background: var(--color-mahogany);
  color: var(--color-ivory);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  transition: top var(--dur-fast) var(--ease-standard);
}

.skip-link:focus {
  top: var(--space-2);
}

/* --------------------------------------------------------------------------
   6. Header / Navbar
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky-nav);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--dur-fast) var(--ease-standard);
}

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

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-mahogany);
  flex-shrink: 0;
}

.brand img { width: 32px; height: 32px; }

/* Desktop nav */
.nav { flex: 1; display: flex; justify-content: center; }

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-link {
  position: relative;
  padding-block: 0.35rem;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--dur-fast) var(--ease-standard);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease-standard);
}

.nav-link:hover { color: var(--color-mahogany); }
.nav-link:hover::after { transform: scaleX(1); }

.nav-link.is-active {
  color: var(--color-mahogany);
  font-weight: 500;
}
.nav-link.is-active::after { transform: scaleX(1); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.nav-cta { padding: 0.6rem 1.25rem; font-size: var(--fs-small); }

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.nav-toggle-bar {
  width: 18px;
  height: 2px;
  background: var(--color-mahogany);
  transition: transform var(--dur-fast) var(--ease-standard),
              opacity var(--dur-fast) var(--ease-standard);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu panel */
.mobile-menu {
  position: fixed;
  inset: 0;
  top: 64px;
  z-index: var(--z-overlay);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-4) var(--container-pad);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity var(--dur-entry) var(--ease-standard),
              transform var(--dur-entry) var(--ease-standard),
              visibility 0s linear var(--dur-entry);
}

.mobile-menu[data-state="open"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity var(--dur-entry) var(--ease-standard),
              transform var(--dur-entry) var(--ease-standard),
              visibility 0s linear 0s;
}

.mobile-menu nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.mobile-nav-link {
  display: block;
  padding: 0.85rem 0.25rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible { color: var(--color-mahogany); }

.mobile-nav-cta { width: 100%; }

@media (max-width: 900px) {
  .nav { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: flex; }
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero { padding-block: var(--space-8); overflow: hidden; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-6);
}

.hero-content .eyebrow { margin-bottom: var(--space-2); }

.hero-content h1 {
  color: var(--color-mahogany);
  max-width: 14ch;
}

.hero-lead {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
  max-width: 48ch;
  font-size: 1.0625rem;
}

.hero-actions {
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.hero-engine {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.hero-plate {
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-copper-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 1rem;
  background: var(--color-surface);
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content h1 { max-width: 100%; margin-inline: auto; }
  .hero-lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-engine { max-width: 320px; }
}

/* --------------------------------------------------------------------------
   11. About
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.about-copy h2 { color: var(--color-mahogany); margin-top: var(--space-1); max-width: 20ch; }

.about-lead {
  margin-top: var(--space-3);
  font-size: 1.0625rem;
  max-width: var(--measure);
}

.about-copy p + p {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
  max-width: var(--measure);
}

.about-plate {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.about-plate__eyebrow {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-copper-text);
  margin-bottom: var(--space-3);
}

.about-plate__quote {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-mahogany);
  line-height: 1.3;
}

.about-plate__sub {
  display: block;
  margin-top: var(--space-3);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-copy h2 { max-width: 100%; }
}

/* --------------------------------------------------------------------------
   12. Why PixOrbital — asymmetric bento grid (no equal 3-col layout)
   -------------------------------------------------------------------------- */
.why { background: var(--color-surface-raised); }

.why-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(140px, auto);
  gap: var(--space-3);
}

.why-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-standard);
}

.why-card:hover {
  transform: scale(1.015);
  box-shadow: var(--shadow-lift);
}

.why-card h3 { margin-top: var(--space-2); color: var(--color-mahogany); }

.why-card p {
  margin-top: var(--space-1);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.why-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 255, 0.08);
  color: var(--color-copper-text);
}

.why-icon svg { width: 22px; height: 22px; }

.why-card--feature {
  grid-column: span 2;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.why-card--feature h3 { font-size: 1.375rem; }
.why-card--feature p { font-size: 1rem; max-width: 42ch; }

.why-card--wide { grid-column: span 2; }

.why-card--full { grid-column: span 4; }

@media (max-width: 900px) {
  .why-grid { grid-template-columns: 1fr; }
  .why-card,
  .why-card--feature,
  .why-card--wide,
  .why-card--full {
    grid-column: span 1;
    grid-row: auto;
  }
}

/* --------------------------------------------------------------------------
   13. Services — zig-zag alternating rows (deliberately not a card grid)
   -------------------------------------------------------------------------- */
.service-list {
  display: flex;
  flex-direction: column;
}

.service-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: var(--space-5);
  align-items: center;
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: 84px;
}

.service-list .service-row:first-child { padding-top: 0; }
.service-list .service-row:last-child { border-bottom: none; padding-bottom: 0; }

.service-row--reverse { grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.7fr); }
.service-row--reverse .service-visual { order: 2; }
.service-row--reverse .service-content { order: 1; }

.service-visual { display: flex; justify-content: center; }

.service-dial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 128px;
  height: 128px;
  border-radius: 0;
  background: var(--color-surface);
  border: 3px solid var(--color-copper);
  box-shadow: var(--shadow-sm);
  color: var(--color-mahogany);
}

.service-dial svg { width: 52px; height: 52px; }

.service-content h3 { color: var(--color-mahogany); }

.service-content > p {
  margin-top: var(--space-1);
  color: var(--color-text-muted);
  max-width: 52ch;
}

.capability-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--space-3);
}

.capability-tags li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--color-sepia);
  border: 1px solid var(--color-border);
  border-radius: 0;
  padding: 0.35rem 0.85rem;
  background: var(--color-surface-raised);
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--space-3);
  font-weight: 600;
  color: var(--color-teal-dark);
}

.service-link span {
  transition: transform var(--dur-fast) var(--ease-spring);
  display: inline-block;
}

.service-link:hover span { transform: translateX(4px); }

@media (max-width: 900px) {
  .service-row,
  .service-row--reverse {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-3);
  }
  .service-row--reverse .service-visual,
  .service-row--reverse .service-content {
    order: initial;
  }
  .service-content > p { margin-inline: auto; }
  .capability-tags { justify-content: center; }
}

/* --------------------------------------------------------------------------
   14. Solutions — asymmetric grid, Problem / Approach / Outcome
   -------------------------------------------------------------------------- */
.solutions { background: var(--color-surface-raised); }

.solutions-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
}

.solution-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-standard);
}

.solution-card:hover {
  transform: scale(1.012);
  box-shadow: var(--shadow-lift);
}

.solution-card--span4 { grid-column: span 4; }
.solution-card--span3 { grid-column: span 3; }
.solution-card--span2 { grid-column: span 2; }

.solution-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 255, 0.08);
  color: var(--color-teal-dark);
}

.solution-icon svg { width: 22px; height: 22px; }

.solution-card h3 {
  margin-top: var(--space-2);
  color: var(--color-mahogany);
  font-size: 1.2rem;
}

.solution-desc {
  margin-top: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.solution-flow {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-top: 2px solid var(--color-mahogany);
  padding-top: var(--space-3);
}

.solution-flow dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-copper-text);
}

.solution-flow dd {
  margin-top: 0.2rem;
  font-size: 0.9375rem;
  color: var(--color-text);
}

@media (max-width: 1024px) {
  .solutions-grid { grid-template-columns: repeat(2, 1fr); }
  .solution-card--span4,
  .solution-card--span3,
  .solution-card--span2 { grid-column: span 1; }
}

@media (max-width: 640px) {
  .solutions-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   15. Technology — manifest ledger (no logo wall)
   -------------------------------------------------------------------------- */
.tech-panel {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.tech-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  background: var(--color-mahogany);
  color: var(--color-parchment);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tech-panel__count { color: rgba(255, 255, 255, 0.65); }

.tech-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 2px solid var(--color-mahogany);
}

.tech-row:nth-child(even) { background: var(--color-surface-raised); }

.tech-row__label {
  flex: 0 0 200px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-mahogany);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.tech-tags li {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-sepia);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.7rem;
  background: var(--color-ivory);
}

@media (max-width: 640px) {
  .tech-row { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .tech-row__label { flex-basis: auto; }
}

/* --------------------------------------------------------------------------
   16. Projects — case files (1 featured + 2 half-width)
   -------------------------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.case-file {
  grid-column: span 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.case-file--featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--space-5);
  align-items: start;
  padding: var(--space-5);
}

.case-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-copper-text);
  border: 1px solid var(--color-border);
  border-radius: 0;
  padding: 0.3rem 0.75rem 0.3rem 0.6rem;
  background: var(--color-surface-raised);
}

.case-tag svg { width: 14px; height: 14px; }

.case-file__head h3 {
  margin-top: var(--space-2);
  color: var(--color-mahogany);
}

.case-file__summary {
  margin-top: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.case-flow {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.case-file--featured .case-flow {
  margin-top: 0;
  border-top: none;
}

.case-file:not(.case-file--featured) .case-flow {
  border-top: 2px solid var(--color-mahogany);
  padding-top: var(--space-3);
}

.case-flow dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-copper-text);
}

.case-flow dd {
  margin-top: 0.2rem;
  font-size: 0.9375rem;
  color: var(--color-text);
}

@media (max-width: 900px) {
  .projects-grid { grid-template-columns: 1fr; }
  .case-file,
  .case-file--featured {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   17. Process — zig-zag drive rail with numbered brass nodes
   -------------------------------------------------------------------------- */
.process-rail {
  display: flex;
  position: relative;
  padding-block: var(--space-5);
}

.process-rail::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-mahogany);
  transform: translateY(-50%);
  z-index: 0;
}

.process-step {
  flex: 1;
  position: relative;
  height: 260px;
}

.process-step__node {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 0;
  background: var(--color-surface);
  border: 3px solid var(--color-mahogany);
  color: var(--color-mahogany);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9375rem;
  box-shadow: var(--shadow-sm);
}

/* De Stijl: cycle the six nodes through the primary palette — blocks of primary colors */
.process-step:nth-of-type(6n+1) .process-step__node,
.process-step:nth-of-type(6n+4) .process-step__node { background: var(--color-brass); color: var(--color-ivory); }
.process-step:nth-of-type(6n+2) .process-step__node,
.process-step:nth-of-type(6n+5) .process-step__node { background: var(--color-copper); color: var(--color-ivory); }
.process-step:nth-of-type(6n+3) .process-step__node,
.process-step:nth-of-type(6n) .process-step__node { background: var(--color-brass-light); color: var(--color-mahogany); }

.process-step__card {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 220px;
  text-align: center;
  z-index: 1;
}

.process-step__card h3 { color: var(--color-mahogany); font-size: 1.05rem; }

.process-step__card p {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.process-step--up .process-step__card { bottom: calc(50% + 46px); }
.process-step--down .process-step__card { top: calc(50% + 46px); }

@media (max-width: 900px) {
  .process-rail {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
    padding-block: var(--space-2);
  }

  .process-rail::before {
    top: 0;
    bottom: 0;
    left: 27px;
    right: auto;
    width: 3px;
    height: auto;
    background: var(--color-mahogany);
    transform: none;
  }

  .process-step {
    height: auto;
    padding-left: 70px;
    min-height: 56px;
  }

  .process-step__node {
    position: absolute;
    top: 0;
    left: 28px;
    transform: translateX(-50%);
  }

  .process-step__card {
    position: static;
    transform: none;
    width: 100%;
    max-width: none;
    text-align: left;
    inset: auto;
  }
}

/* --------------------------------------------------------------------------
   18. Insights — featured card + masonry column flow
   -------------------------------------------------------------------------- */
.insight-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-standard);
}

.insight-card:hover {
  transform: scale(1.012);
  box-shadow: var(--shadow-lift);
}

.insight-category {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-teal-dark);
  background: rgba(0, 0, 255, 0.08);
  border-radius: 0;
  padding: 0.3rem 0.7rem;
}

.insight-card h3 {
  margin-top: var(--space-2);
  color: var(--color-mahogany);
  font-size: 1.15rem;
}

.insight-card p {
  margin-top: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.insight-meta {
  margin-top: var(--space-3);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.insight-card--featured {
  margin-bottom: var(--space-3);
  padding: var(--space-5);
}

.insight-card--featured h3 { font-size: 1.6rem; max-width: 32ch; }
.insight-card--featured p { max-width: 65ch; font-size: 1rem; }

.insights-columns {
  column-count: 3;
  column-gap: var(--space-3);
}

.insights-columns .insight-card {
  break-inside: avoid;
  margin-bottom: var(--space-3);
  display: inline-block;
  width: 100%;
}

@media (max-width: 1024px) {
  .insights-columns { column-count: 2; }
}

@media (max-width: 640px) {
  .insights-columns { column-count: 1; }
  .insight-card--featured { padding: var(--space-4); }
  .insight-card--featured h3 { font-size: 1.35rem; }
}

/* --------------------------------------------------------------------------
   19. Contact
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: var(--space-6);
  align-items: start;
}

.contact-intro h2 {
  color: var(--color-mahogany);
  margin-top: var(--space-1);
  max-width: 16ch;
}

.contact-intro p {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
  max-width: 42ch;
}

.contact-email {
  display: inline-block;
  margin-top: var(--space-4);
  font-size: 1.125rem;
  color: var(--color-teal-dark);
  border-bottom: 1px solid var(--color-teal);
  padding-bottom: 2px;
}

.contact-panel {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.contact-panel__header {
  padding: var(--space-2) var(--space-4);
  background: var(--color-mahogany);
  color: var(--color-parchment);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.contact-form {
  padding: var(--space-4);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: var(--space-3);
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--color-text);
}

.form-field input,
.form-field select,
.form-field textarea {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  background: var(--color-ivory);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--dur-fast) var(--ease-standard);
}

.form-field textarea { resize: vertical; min-height: 110px; }

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-color: var(--color-accent);
}

.form-field input[aria-invalid="true"],
.form-field select[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
  border-color: var(--color-error);
}

.form-error {
  min-height: 1.1em;
  font-size: 0.8125rem;
  color: var(--color-error);
}

.form-submit { width: 100%; margin-top: var(--space-1); }

.form-success {
  margin-top: var(--space-3);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(47, 107, 58, 0.12);
  color: var(--color-success);
  font-size: 0.9375rem;
}

.form-note {
  margin-top: var(--space-3);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
}

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-intro h2 { max-width: 100%; }
  .contact-intro p { max-width: 100%; }
}

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-mahogany);
  color: var(--color-parchment);
  padding-block: var(--space-6) var(--space-4);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.footer-brand .brand { margin-bottom: var(--space-2); color: var(--color-parchment); }

.footer-desc {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9375rem;
  max-width: 34ch;
}

.footer-col h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-brass-light);
  margin-bottom: var(--space-2);
}

.footer-col ul { display: flex; flex-direction: column; gap: 0.55rem; }

.footer-col a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9375rem;
  transition: color var(--dur-fast) var(--ease-standard);
}

.footer-col a:hover { color: var(--color-brass-light); }

.footer-bottom {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.site-footer .copyright {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4) var(--space-3);
  }
  .footer-brand { grid-column: span 2; }
}

@media (max-width: 500px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
}

/* --------------------------------------------------------------------------
   10. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root { --container-pad: 1.25rem; }
}

@media (max-width: 430px) {
  .btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   20. Scroll reveal (progressive enhancement — only applied via JS)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-entry) var(--ease-standard),
              transform var(--dur-entry) var(--ease-standard);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   21. Back to top
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: var(--color-cta);
  border: 3px solid var(--color-mahogany);
  color: var(--color-ivory);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-standard),
              transform var(--dur-fast) var(--ease-spring),
              visibility 0s linear var(--dur-fast);
}

.back-to-top--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition: opacity var(--dur-fast) var(--ease-standard),
              transform var(--dur-fast) var(--ease-spring),
              visibility 0s linear 0s;
}

.back-to-top:hover {
  transform: translateY(-2px) scale(1.03);
}

.back-to-top svg { width: 20px; height: 20px; }

@media (max-width: 430px) {
  .back-to-top { right: 1rem; bottom: 1rem; width: 44px; height: 44px; }
}
