/* ============================================================
   Adaptive AMS — Stylesheet
   Editorial sophistication with visual craft.
   ============================================================ */

:root {
  --color-text: #1A1A1A;
  --color-text-secondary: #525252;
  --color-text-tertiary: #8A8A8A;
  --color-bg: #FAFAF7;
  --color-bg-warm: #F3F1EB;
  --color-surface: #FFFFFF;
  --color-accent: #2D4A3E;
  --color-accent-light: #3D6354;
  --color-accent-faint: rgba(45, 74, 62, 0.07);
  --color-accent-glow: rgba(45, 74, 62, 0.12);
  --color-border: #E0DDD7;
  --color-border-light: #ECEAE4;
  --color-line: rgba(45, 74, 62, 0.15);
  --color-dot: rgba(45, 74, 62, 0.25);

  --font-display: 'Newsreader', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;

  --size-body: 1.0625rem;
  --size-body-lg: 1.1875rem;
  --size-small: 0.9375rem;
  --size-xs: 0.8125rem;
  --size-xxs: 0.6875rem;
  --size-h1: 2.75rem;
  --size-h2: 1.5rem;
  --size-nav: 0.875rem;
  --size-opening: 2.125rem;

  --leading-body: 1.75;
  --leading-tight: 1.4;
  --leading-heading: 1.22;
  --leading-opening: 1.42;

  --measure: 36em;
  --measure-wide: 42em;
  --space-page-x: 2.5rem;
  --space-page-y: 5rem;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.2s;
  --duration-med: 0.45s;
  --duration-slow: 0.75s;
  --duration-xl: 1.2s;
}

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

html {
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--leading-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  font-weight: 400;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--color-accent-faint);
  color: var(--color-text);
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
}

h1 {
  font-size: var(--size-h1);
  line-height: var(--leading-heading);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--size-h2);
  line-height: var(--leading-tight);
  margin-bottom: 1.1em;
  letter-spacing: -0.01em;
}

p { margin-bottom: 1.5em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }

em {
  font-style: italic;
  font-family: var(--font-display);
  font-size: 1.02em;
}

a { color: var(--color-accent); text-decoration: none; }

/* --- Scroll Progress Bar --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--color-accent);
  z-index: 200;
  width: 0%;
  transition: none;
  opacity: 0.7;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--duration-slow) var(--ease-out-expo),
    transform var(--duration-slow) var(--ease-out-expo);
}

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

.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.24s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.36s; }

/* Reveal from left */
.reveal-left {
  opacity: 0;
  transform: translateX(-20px);
  transition:
    opacity var(--duration-slow) var(--ease-out-expo),
    transform var(--duration-slow) var(--ease-out-expo);
}

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

/* --- Layout --- */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.page-content {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--space-page-y) var(--space-page-x);
  position: relative;
  z-index: 1;
}

.content-measure { max-width: var(--measure); }

/* --- Navigation --- */
.site-header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--color-border-light);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.03);
}

.nav-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.2rem var(--space-page-x);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.nav-wordmark {
  font-family: var(--font-body);
  font-size: var(--size-nav);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--duration-fast) ease;
}

.nav-wordmark:hover { color: var(--color-accent); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: var(--size-nav);
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0.02em;
  position: relative;
  padding-bottom: 2px;
  transition: color var(--duration-fast) ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-accent);
  transition: width 0.4s var(--ease-out-expo);
}

.nav-links a:hover { color: var(--color-text); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--color-text); }
.nav-links a.active::after { width: 100%; background: var(--color-text); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--color-text);
  transition: color var(--duration-fast) ease;
}

.nav-toggle:hover { color: var(--color-accent); }
.nav-toggle svg { display: block; width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle.is-active .icon-open { display: none; }
.nav-toggle.is-active .icon-close { display: block; }

/* ============================================================
   HOME PAGE
   ============================================================ */

.home-hero {
  position: relative;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Abstract systems graphic — positioned right */
.hero-graphic {
  position: absolute;
  top: 50%;
  right: -4rem;
  transform: translateY(-50%);
  width: 620px;
  height: 620px;
  pointer-events: none;
  opacity: 0;
  animation: graphicFadeIn 2s var(--ease-out-expo) 0.3s forwards;
}

@keyframes graphicFadeIn {
  to { opacity: 1; }
}

.hero-graphic svg {
  width: 100%;
  height: 100%;
}

/* Concentric rings — each rotates at its own speed and direction */
.ring {
  transform-origin: 280px 280px;
  opacity: 0;
  animation:
    ringFadeIn 1.2s var(--ease-out-expo) forwards;
}

.ring-1 {
  animation:
    ringFadeIn 1.2s var(--ease-out-expo) 0.4s forwards,
    ringRotateCW 12s linear 1.6s infinite;
}
.ring-2 {
  animation:
    ringFadeIn 1.2s var(--ease-out-expo) 0.6s forwards,
    ringRotateCCW 20s linear 1.8s infinite;
}
.ring-3 {
  animation:
    ringFadeIn 1.2s var(--ease-out-expo) 0.9s forwards,
    ringRotateCW 35s linear 2.1s infinite;
}
.ring-4 {
  animation:
    ringFadeIn 1.2s var(--ease-out-expo) 1.2s forwards,
    ringRotateCCW 55s linear 2.4s infinite;
}

@keyframes ringFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ringRotateCW {
  to { transform: rotate(360deg); }
}

@keyframes ringRotateCCW {
  to { transform: rotate(-360deg); }
}

/* Arc draw-in */
.draw-arc {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: arcDraw 2.2s var(--ease-out-expo) forwards;
}

.arc-1 { animation-delay: 0.8s; }
.arc-2 { animation-delay: 1.0s; }
.arc-3 { animation-delay: 1.2s; }
.arc-4 { animation-delay: 1.4s; }
.arc-5 { animation-delay: 1.6s; }
.arc-6 { animation-delay: 1.8s; }
.arc-inner-1 { animation-delay: 1.1s; }
.arc-inner-2 { animation-delay: 1.3s; }
.arc-inner-3 { animation-delay: 1.5s; }

@keyframes arcDraw {
  to { stroke-dashoffset: 0; }
}

/* Radial lines fade in */
.radial-line {
  opacity: 0;
  animation: lineFadeIn 0.8s var(--ease-out-expo) forwards;
}

.radial-line:nth-of-type(1) { animation-delay: 0.9s; }
.radial-line:nth-of-type(2) { animation-delay: 1.05s; }
.radial-line:nth-of-type(3) { animation-delay: 1.2s; }
.radial-line:nth-of-type(4) { animation-delay: 1.35s; }
.radial-line:nth-of-type(5) { animation-delay: 1.5s; }
.radial-line:nth-of-type(6) { animation-delay: 1.65s; }

@keyframes lineFadeIn {
  to { opacity: 1; }
}

/* Cross-connection dashed lines */
.cross-line {
  opacity: 0;
  animation: lineFadeIn 1s var(--ease-out-expo) 1.8s forwards;
}

/* Radial group — slow counter-rotation for parallax against rings */
.radial-group {
  transform-origin: 280px 280px;
  animation: radialRotate 90s linear 2s infinite;
}

@keyframes radialRotate {
  to { transform: rotate(-360deg); }
}

/* Orbital node pulse — gentle breathing */
.orbital-node {
  animation: nodePulse 5s ease-in-out infinite;
}

.orbital-node:nth-child(2n) { animation-delay: -1.5s; }
.orbital-node:nth-child(3n) { animation-delay: -3s; }
.orbital-node:nth-child(5n) { animation-delay: -0.8s; }

@keyframes nodePulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Tertiary dot pulse — subtler */
.orbital-dot {
  animation: dotFloat 6s ease-in-out infinite;
}

.orbital-dot:nth-child(2n) { animation-delay: -2s; }
.orbital-dot:nth-child(3n) { animation-delay: -4s; }

@keyframes dotFloat {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.85; }
}

/* Slow ambient drift — entire graphic breathes */
.hero-graphic-inner {
  animation: gentleDrift 30s ease-in-out infinite;
}

@keyframes gentleDrift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(3px, -4px) rotate(0.5deg); }
  50% { transform: translate(-2px, -6px) rotate(0deg); }
  75% { transform: translate(4px, -2px) rotate(-0.5deg); }
}

/* Opening statement */
.hero-content {
  position: relative;
  z-index: 2;
}

.opening-statement {
  margin-bottom: 3.5rem;
}

.opening-line {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 2.25rem);
  line-height: var(--leading-opening);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.015em;
  margin-bottom: 0.5em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(18px);
  animation: lineReveal var(--duration-slow) var(--ease-out-expo) forwards;
}

.opening-line:nth-child(1) { animation-delay: 0.2s; }
.opening-line:nth-child(2) { animation-delay: 0.45s; }
.opening-line:nth-child(3) { animation-delay: 0.7s; }
.opening-line:last-child { margin-bottom: 0; }

@keyframes lineReveal {
  to { opacity: 1; transform: translateY(0); }
}

.home-bridge {
  position: relative;
  font-size: var(--size-body-lg);
  font-weight: 500;
  color: var(--color-text);
  max-width: var(--measure);
  padding-left: 1.75rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: lineReveal var(--duration-slow) var(--ease-out-expo) 1s forwards;
}

.home-bridge::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.1em;
  bottom: 0.1em;
  width: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

.home-body {
  max-width: var(--measure);
  opacity: 0;
  animation: lineReveal var(--duration-slow) var(--ease-out-expo) 1.2s forwards;
}

.home-body p { color: var(--color-text-secondary); }

/* --- Pillar Section --- */
.pillar-section {
  padding: 5rem 0 3rem;
  border-top: 1px solid var(--color-border);
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.pillar-card {
  position: relative;
  display: block;
  padding: 2rem 2rem 1.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition:
    border-color 0.3s ease,
    box-shadow 0.4s var(--ease-out-expo),
    transform 0.4s var(--ease-out-expo);
}

.pillar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out-expo);
}

.pillar-card:hover {
  border-color: var(--color-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
  transform: translateY(-3px);
}

.pillar-card:hover::before {
  transform: scaleX(1);
}

.pillar-card h2 {
  font-size: 1.375rem;
  margin-bottom: 0.5em;
  transition: color var(--duration-fast) ease;
}

.pillar-card:hover h2 { color: var(--color-accent); }

.pillar-card p {
  color: var(--color-text-secondary);
  font-size: var(--size-small);
  line-height: 1.6;
  margin-bottom: 1.25em;
}

.pillar-link {
  font-size: var(--size-small);
  font-weight: 500;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  letter-spacing: 0.02em;
  transition: gap 0.3s var(--ease-out-expo), color var(--duration-fast) ease;
}

.pillar-card:hover .pillar-link { gap: 0.7em; }

.pillar-link .arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-out-expo);
}

.pillar-card:hover .pillar-link .arrow { transform: translateX(3px); }

/* Home Closing */
.home-closing {
  padding: 3rem 0 2.5rem;
  border-top: 1px solid var(--color-border);
}

.closing-layout {
  position: relative;
  min-height: 300px;
}

/* Leaflet map as ambient background */
.closing-map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.50;
}

.closing-map .leaflet-container {
  background: transparent;
  width: 100%;
  height: 100%;
}

.closing-map .leaflet-control-container { display: none; }

/* Gradient overlay — fades map out toward the bottom where text sits */
.closing-layout::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 20%, var(--color-bg) 75%);
  z-index: 1;
  pointer-events: none;
}

.closing-text {
  position: relative;
  z-index: 2;
  padding: 8rem 0 3rem 2rem;
}

.closing-text p {
  color: var(--color-text-secondary);
  font-size: var(--size-body);
  line-height: 1.7;
}

.closing-text p + p { margin-top: 0.75em; }

/* ============================================================
   INTERIOR PAGES
   ============================================================ */

.page-header {
  padding-top: 2.5rem;
  padding-bottom: 3.5rem;
  position: relative;
  opacity: 0;
  animation: lineReveal var(--duration-slow) var(--ease-out-expo) 0.1s forwards;
}

.page-header h1 { max-width: 18em; }

/* Accent bar */
.page-header::before {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

/* Decorative side lines on interior pages */
.page-sidebar-graphic {
  position: fixed;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 0;
  background: var(--color-line);
  z-index: 0;
  transition: height 1.5s var(--ease-out-expo);
}

.page-sidebar-graphic.is-active {
  height: 200px;
}

.page-sidebar-graphic::before,
.page-sidebar-graphic::after {
  content: '';
  position: absolute;
  left: -2.5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-dot);
}

.page-sidebar-graphic::before { top: 0; }
.page-sidebar-graphic::after { bottom: 0; }

/* --- Page-specific right-side abstract graphics --- */
.page-abstract {
  position: absolute;
  right: 25%;
  top: 12rem;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: abstractFadeIn 2s var(--ease-out-expo) 0.5s forwards;
}

@keyframes abstractFadeIn {
  to { opacity: 1; }
}

.page-abstract svg {
  width: 100%;
  height: 100%;
}

/* People — interconnected nodes (human network) */
.abstract-people {
  width: 220px;
  height: 340px;
}

/* Process — flowing pipeline */
.abstract-process {
  width: 180px;
  height: 420px;
}

/* Technology — layered architecture blocks */
.abstract-technology {
  width: 200px;
  height: 380px;
}

/* Origins — vertical timeline */
.abstract-origins {
  width: 160px;
  height: 400px;
}

/* Abstract node pulse */
.abs-node {
  animation: absNodePulse 5s ease-in-out infinite;
}
.abs-node:nth-child(2n) { animation-delay: -1.5s; }
.abs-node:nth-child(3n) { animation-delay: -3s; }

@keyframes absNodePulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Abstract line draw */
.abs-draw {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: absLineDraw 2s var(--ease-out-expo) forwards;
}
.abs-draw:nth-child(1) { animation-delay: 0.6s; }
.abs-draw:nth-child(2) { animation-delay: 0.8s; }
.abs-draw:nth-child(3) { animation-delay: 1.0s; }
.abs-draw:nth-child(4) { animation-delay: 1.2s; }
.abs-draw:nth-child(5) { animation-delay: 1.4s; }
.abs-draw:nth-child(6) { animation-delay: 1.6s; }
.abs-draw:nth-child(7) { animation-delay: 1.8s; }
.abs-draw:nth-child(8) { animation-delay: 2.0s; }

@keyframes absLineDraw {
  to { stroke-dashoffset: 0; }
}

/* Process flow node float */
.abs-flow {
  animation: absFlow 4s ease-in-out infinite;
}
.abs-flow:nth-child(2n) { animation-delay: -1s; }
.abs-flow:nth-child(3n) { animation-delay: -2.5s; }

@keyframes absFlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Origins ripple — slow expansion pulse */
.origin-ripple {
  transform-origin: 80px 200px;
  animation: ripplePulse 8s ease-in-out infinite;
}

.origin-ripple:nth-child(2) { animation-delay: 0s; }
.origin-ripple:nth-child(3) { animation-delay: -1.5s; }
.origin-ripple:nth-child(4) { animation-delay: -3s; }
.origin-ripple:nth-child(5) { animation-delay: -4.5s; }
.origin-ripple:nth-child(6) { animation-delay: -6s; }

@keyframes ripplePulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

.page-body {
  padding-bottom: 3rem;
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: lineReveal var(--duration-slow) var(--ease-out-expo) 0.3s forwards;
}

.page-body .content-measure > h2 {
  font-size: var(--size-h2);
  margin-top: 3.5rem;
  margin-bottom: 1.1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border-light);
  position: relative;
}

/* Small accent dot before section headings */
.page-body .content-measure > h2::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.4;
}

.page-body .content-measure > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.page-body .content-measure > h2:first-child::before {
  display: none;
}

.page-body p { color: var(--color-text); }

/* Workflow card grid */
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 2rem 0 2.5rem;
}

.workflow-card {
  padding: 1.5rem 1.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.3s ease,
    box-shadow 0.4s var(--ease-out-expo),
    transform 0.4s var(--ease-out-expo);
}

.workflow-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out-expo);
}

.workflow-card:hover {
  border-color: var(--color-border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.02);
  transform: translateY(-2px);
}

.workflow-card:hover::before {
  transform: scaleX(1);
}

.workflow-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5em;
  color: var(--color-text);
  transition: color 0.3s ease;
}

.workflow-card:hover h3 {
  color: var(--color-accent);
}

.workflow-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Tech stack items */
.stack-item {
  margin-bottom: 1.25em;
  padding-left: 1.5rem;
  border-left: 2px solid var(--color-border-light);
  position: relative;
}

.stack-item::before {
  content: '';
  position: absolute;
  left: -4.5px;
  top: 0.7em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.35;
}

.stack-item em {
  font-family: var(--font-display);
  font-style: italic;
}

/* Section breaks */
.section-break {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
  max-width: var(--measure);
}

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

.site-footer {
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg-warm);
  position: relative;
  overflow: hidden;
}

/* Subtle geometric accent in footer */
.footer-geo {
  position: absolute;
  right: var(--space-page-x);
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.06;
  pointer-events: none;
}

.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem var(--space-page-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.footer-inner p {
  font-size: var(--size-xxs);
  color: var(--color-text-tertiary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0;
}

.footer-mark {
  font-size: var(--size-xxs);
  color: var(--color-text-tertiary);
  letter-spacing: 0.03em;
}

/* ============================================================
   AMBIENT CANVAS (behind content)
   ============================================================ */

.ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 80em) {
  .page-abstract { display: none; }
}

@media (max-width: 64em) {
  :root {
    --size-h1: 2.25rem;
    --size-opening: 1.75rem;
    --space-page-y: 4.5rem;
  }

  .hero-graphic {
    width: 480px;
    height: 480px;
    right: -6rem;
  }

  .pillar-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 48em) {
  :root {
    --size-h1: 1.75rem;
    --size-h2: 1.3125rem;
    --size-body: 1rem;
    --size-body-lg: 1.0625rem;
    --size-opening: 1.4rem;
    --space-page-x: 1.5rem;
    --space-page-y: 3.5rem;
  }

  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(250, 250, 247, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--color-border-light);
    padding: 0.75rem var(--space-page-x) 1.25rem;
    gap: 0;
    z-index: 100;
  }

  .nav-links.is-open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--color-border-light); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a { display: block; padding: 0.8rem 0; font-size: var(--size-small); }
  .nav-links a::after { display: none; }

  .home-hero {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .hero-graphic {
    position: relative;
    top: auto; right: auto;
    transform: none;
    width: 100%;
    max-width: 340px;
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto 2rem;
    opacity: 0;
    animation: graphicFadeIn 1.5s var(--ease-out-expo) 0.2s forwards;
  }

  .opening-line {
    white-space: normal;
  }

  .pillar-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .pillar-card { padding: 1.75rem 1.5rem; }
  .pillar-section { padding: 3rem 0 2rem; }
  .home-closing { padding: 2.5rem 0 1rem; }

  .closing-text {
    padding: 6rem 0 2rem 1.5rem;
  }

  .closing-map {
    opacity: 0.40;
  }

  .page-sidebar-graphic { display: none; }
  .page-abstract { display: none; }

  .page-body .content-measure > h2 {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
  }

  .page-header::before {
    width: 24px;
    height: 2px;
    margin-bottom: 1.25rem;
  }

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

  .stack-item { padding-left: 1.25rem; }

  .footer-inner {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .footer-geo { display: none; }
}

@media (max-width: 30em) {
  :root {
    --space-page-x: 1.25rem;
    --size-h1: 1.5rem;
    --size-opening: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .opening-line, .home-bridge, .home-body, .page-header, .page-body,
  .hero-graphic {
    opacity: 1; transform: none; animation: none;
  }
  .reveal, .reveal-left { opacity: 1; transform: none; transition: none; }
  .ring, .ring-1, .ring-2, .ring-3, .ring-4 { opacity: 1; animation: none; transform: none; }
  .draw-arc, .radial-line, .cross-line { opacity: 1; animation: none; }
  .draw-arc, .abs-draw { stroke-dashoffset: 0; }
  .orbital-node, .orbital-dot, .hero-graphic-inner, .radial-group { animation: none; }
  .abs-node, .abs-draw, .abs-flow, .origin-ripple { animation: none; opacity: 1; }
  .page-abstract { opacity: 0.7; animation: none; }
  .page-sidebar-graphic { height: 200px; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
