/* ============================================================
   Maple MPSS — Editorial design system
   Fraunces (display) + IBM Plex Sans (body) + IBM Plex Mono (numerals/labels)
   Ivory #F9F6EF · Ink Navy #1B2A3B · Oxblood #6B2737
   ============================================================ */

:root {
  --ivory: #F9F6EF;
  --ivory-warm: #F2EDE1;
  --ink: #1B2A3B;
  --ink-soft: #3A4A5E;
  --ink-muted: #6B7684;
  --oxblood: #6B2737;
  --oxblood-dark: #541D2C;
  --rule: #D8D0BF;
  --rule-soft: #E8E2D1;

  --serif: "Fraunces", "Times New Roman", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;

  --max: 1240px;
  --gutter: clamp(1.25rem, 3vw, 2.5rem);

  /* ===== Per-page tint palette (Level 1 differentiation) =====
     Subtle secondary surface colors. Each page sets --page-tint on body.
     Used only on: page-header-meta left border, § numerals background,
     and content-block top border. Rest of site remains ivory + ink + oxblood. */
  --tint-home:     #E8D9B8;  /* Warm amber */
  --tint-sourcing: #D9CFBB;  /* Warm sand */
  --tint-ai:       #C9D3DC;  /* Cool slate */
  --tint-about:    #C8D4C5;  /* Muted forest */
  --tint-contact:  #E4CED2;  /* Soft oxblood rose */
}

/* Apply the correct tint based on data-page attribute on <body>.
   Default falls back to ivory-warm so nothing breaks if attribute is absent. */
body                           { --page-tint: var(--ivory-warm); }
body[data-page="home"]         { --page-tint: var(--tint-home); }
body[data-page="sourcing"]     { --page-tint: var(--tint-sourcing); }
body[data-page="ai"]           { --page-tint: var(--tint-ai); }
body[data-page="about"]        { --page-tint: var(--tint-about); }
body[data-page="contact"]      { --page-tint: var(--tint-contact); }

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

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

body {
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
}

/* Subtle paper-like texture for warmth without busyness */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(107, 39, 55, 0.015) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(27, 42, 59, 0.02) 0%, transparent 50%);
  mix-blend-mode: multiply;
}

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

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 180ms ease;
}
a:hover { color: var(--oxblood); }

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

h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 50, "WONK" 0;
}

h1 {
  font-size: clamp(2.75rem, 6vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 350;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 380;
}

h3 {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.2;
  font-weight: 450;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--oxblood);
  font-weight: 500;
  display: inline-block;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.45;
  color: var(--ink-soft);
  font-weight: 350;
  letter-spacing: -0.005em;
}

p { max-width: 62ch; }
p + p { margin-top: 1rem; }

strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

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

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

.container-wide {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

section { position: relative; }

.section {
  padding: clamp(4rem, 9vw, 8rem) 0;
  position: relative;
}

.section-tight { padding: clamp(3rem, 6vw, 5rem) 0; }

.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
  margin: 0;
}

/* Corner page numerals — key editorial device */
.section-head {
  position: relative;
  padding-top: 3rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--ink);
}

.section-head .numeral {
  position: absolute;
  top: 1rem;
  right: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  font-weight: 500;
}

.section-head .label {
  position: absolute;
  top: 1rem;
  left: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
}

.section-head h2 {
  margin-top: 2.25rem;
  max-width: 22ch;
}

/* ========== NAV ========== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 246, 239, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 450;
  letter-spacing: -0.015em;
  color: var(--ink);
  border: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-brand .logo-mark {
  height: 38px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.nav-brand .mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--oxblood);
  border-radius: 1px;
  transform: translateY(-1px);
}

.nav-brand .sub {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}

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

.nav-links a {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink);
  border: 0;
  font-weight: 450;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--oxblood);
  transition: width 220ms ease;
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-links a.active { color: var(--oxblood); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--ink);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
  border-radius: 0;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn:hover {
  background: var(--ink);
  color: var(--ivory);
  border-color: var(--ink);
}

.btn-primary {
  background: var(--oxblood);
  color: var(--ivory);
  border-color: var(--oxblood);
}

.btn-primary:hover {
  background: var(--oxblood-dark);
  border-color: var(--oxblood-dark);
  color: var(--ivory);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-small {
  padding: 0.6rem 1.1rem;
  font-size: 0.82rem;
}

.btn .arrow {
  display: inline-block;
  transition: transform 200ms ease;
  font-family: var(--mono);
  font-weight: 400;
}

.btn:hover .arrow { transform: translateX(4px); }

/* ========== HERO ========== */

.hero {
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(5rem, 9vw, 8rem);
  position: relative;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: end;
  position: relative;
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.3fr 1fr; gap: 4rem; }
}

.hero-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.hero-meta .divider { color: var(--rule); }

.hero h1 {
  margin-bottom: 2rem;
  max-width: 16ch;
}

.hero h1 .accent {
  color: var(--oxblood);
  font-style: italic;
  font-weight: 350;
}

.hero-lede {
  margin-bottom: 2.5rem;
  max-width: 32ch;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-aside {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--ink-soft);
  padding-left: 1.25rem;
  border-left: 1px solid var(--ink);
  max-width: 34ch;
}

.hero-aside .tag {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* ========== IMAGE COMPONENTS ========== */
/*
  Image frames are set to a fixed aspect ratio so the layout stays stable
  while images load. Your uploaded photos can be ANY dimensions — they'll
  be automatically centered and cover the frame.

  Default behavior: object-fit: cover (crops from center).
  Override per-image: add class "img-contain" to the <img> tag to letterbox
  instead of crop — useful for product shots where you can't afford to crop
  edges, or UI screenshots that must show the full frame.

  Per-image positioning: add inline style="object-position: top" (or bottom,
  left, right, "30% 50%", etc.) to shift the crop focus.
*/

.hero-visual {
  margin-top: 4rem;
  width: 100%;
  aspect-ratio: 21 / 9;
  position: relative;
  border: 1px solid var(--rule);
  overflow: hidden;
  background: var(--ivory-warm);
}

.hero-visual img,
.page-header-image img,
.block-image img,
.model-node-image img,
.case-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Escape hatch: letterbox instead of crop.
   Use when the full image must be visible (e.g. UI screenshots, product
   shots where edges matter). Letterbox background matches frame background. */
.hero-visual img.img-contain,
.page-header-image img.img-contain,
.block-image img.img-contain,
.model-node-image img.img-contain,
.case-image-wrapper img.img-contain {
  object-fit: contain;
  padding: 1rem;
  background: var(--ivory-warm);
}

.page-header-image {
  margin-top: 3rem;
  width: 100%;
  aspect-ratio: 21 / 9;
  border: 1px solid var(--rule);
  overflow: hidden;
  background: var(--ivory-warm);
}

.block-image {
  margin-top: 1.75rem;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--rule);
  overflow: hidden;
  background: var(--ivory-warm);
}

.block-image-caption {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.75rem;
  display: block;
}

/* 4-across image strip — supporting detail shots.
   Sits below text content and reads as supplementary, not hero.
   Collapses to 2 columns on tablet, 1 on mobile. */
.block-image-grid {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.block-image-grid .grid-cell {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--ivory-warm);
  position: relative;
}

.block-image-grid .grid-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.block-image-grid .grid-cell .cell-num {
  position: absolute;
  top: 0.5rem;
  left: 0.75rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ivory);
  background: rgba(27, 42, 59, 0.72);
  padding: 0.2rem 0.45rem;
  border-radius: 2px;
  z-index: 1;
}

@media (max-width: 900px) {
  .block-image-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .block-image-grid {
    grid-template-columns: 1fr;
  }
}

/* Auto-scrolling parts strip — ambient proof gallery.
   Matches the editorial design system: thin rules, ivory frame,
   no loud motion. Pauses on hover, respects reduced-motion. */
.parts-strip {
  margin-top: 2.5rem;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--ivory-warm);
  position: relative;
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 3%,
    #000 97%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 3%,
    #000 97%,
    transparent 100%
  );
}

.parts-strip-track {
  display: flex;
  gap: 1px;
  width: max-content;
  animation: parts-scroll 80s linear infinite;
}

.parts-strip:hover .parts-strip-track {
  animation-play-state: paused;
}

.strip-item {
  flex: 0 0 auto;
  width: 280px;
  height: 210px;
  margin: 0;
  overflow: hidden;
  background: var(--ivory);
  border-right: 1px solid var(--rule);
}

.strip-item:last-child {
  border-right: none;
}

.strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

@keyframes parts-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .parts-strip-track {
    animation: none;
  }
  .parts-strip {
    overflow-x: auto;
    mask-image: none;
    -webkit-mask-image: none;
  }
}

@media (max-width: 640px) {
  .strip-item {
    width: 200px;
    height: 150px;
  }
  .parts-strip-track {
    animation-duration: 60s;
  }
}

.model-node-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--rule);
  overflow: hidden;
  background: var(--ivory);
  margin-bottom: 1rem;
}

.case-image-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: rgba(249, 246, 239, 0.05);
  border: 1px solid rgba(249, 246, 239, 0.1);
  margin-bottom: 2rem;
}

.case-image-wrapper img {
  filter: saturate(0.85);
}

.case-image-wrapper img.img-contain {
  background: rgba(0, 0, 0, 0.2);
}

/* Screenshot treatment: for UI/dashboard shots, use contain + subtle inset.
   Add class "img-screenshot" for web UI, dashboards, CRM screenshots. */
.block-image img.img-screenshot,
.case-image-wrapper img.img-screenshot {
  object-fit: contain;
  padding: 1.5rem;
  background: #ffffff;
  filter: none;
}

.hero-visual-caption {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ========== PAGE HEADER (for subpages) ========== */

.page-header {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(3rem, 5vw, 4.5rem);
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.page-header-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  padding-bottom: 1rem;
  padding-left: 0.85rem;
  border-bottom: 1px solid var(--rule);
  border-left: 3px solid var(--page-tint);
}

.page-header h1 {
  max-width: 18ch;
  margin-bottom: 1.5rem;
}

.page-header .lede {
  max-width: 44ch;
}

/* ========== SERVICE CARDS (homepage) ========== */

.services {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

@media (min-width: 800px) {
  .services { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
  .services.services-two { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

/* Card framing — each service card sits in its own soft-tinted frame,
   giving clear visual separation between parallel offerings.
   Replaces the previous hairline-divider approach. */
.service-card {
  padding: 2.5rem 2rem 2.25rem;
  background: var(--ivory-warm);
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: background 280ms ease, border-color 280ms ease, transform 280ms ease;
}

@media (max-width: 800px) {
  .services, .services.services-two { gap: 1.25rem; }
}

.service-card:hover {
  background: #F5EFDF;
  border-color: var(--rule);
}

.service-card .num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--oxblood);
  font-weight: 500;
}

.service-card h3 {
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.service-card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.55;
  flex: 1;
}

.service-card .card-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border: 0;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
  font-weight: 500;
}

.service-card .card-link:hover { color: var(--oxblood); }
.service-card .card-link .arrow { transition: transform 200ms ease; }
.service-card .card-link:hover .arrow { transform: translateX(3px); }

/* ========== TWO-COLUMN EDITORIAL ========== */

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 900px) {
  .two-col { grid-template-columns: 0.8fr 1.2fr; gap: 5rem; align-items: start; }
}

.two-col .col-left h2 { max-width: 14ch; }

.two-col .col-right p { font-size: 1.08rem; color: var(--ink-soft); line-height: 1.65; }
.two-col .col-right p + p { margin-top: 1.1rem; }

/* ========== POSITIONING / WHY SECTION ========== */

.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 3rem;
}

@media (min-width: 700px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

/* Card framing — each point/option sits in its own soft-tinted frame.
   Clearer separation between parallel items than the previous single
   top-border approach, which let items blur together at a glance. */
.why-item {
  padding: 1.75rem 1.65rem 1.85rem;
  background: var(--ivory-warm);
  border: 1px solid var(--rule-soft);
  border-top: 2px solid var(--page-tint);
  border-radius: 3px;
  position: relative;
}

.why-item .pt-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--oxblood);
  font-weight: 500;
  margin-bottom: 0.75rem;
  display: block;
}

.why-item h4 {
  font-family: var(--serif);
  font-weight: 450;
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.why-item p {
  font-size: 0.97rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ========== CASE STUDY SNIPPET ========== */

.case {
  background: var(--ink);
  color: var(--ivory);
  padding: clamp(3.5rem, 7vw, 6rem) 0;
  position: relative;
}

.case-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  position: relative;
  z-index: 2;
}

@media (min-width: 900px) {
  .case-inner { grid-template-columns: 0.85fr 1.15fr; gap: 4rem; align-items: start; }
}

.case .eyebrow { color: #C9976D; }

.case-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.8;
  color: rgba(249, 246, 239, 0.65);
  letter-spacing: 0.05em;
}

.case-meta dt {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(249, 246, 239, 0.4);
  font-size: 0.7rem;
  margin-top: 1rem;
}

.case-meta dt:first-child { margin-top: 0; }
.case-meta dd { color: var(--ivory); margin-bottom: 0; }

.case-body {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1.45;
  font-weight: 350;
  color: var(--ivory);
  letter-spacing: -0.005em;
}

.case-body .pullquote {
  display: block;
  font-style: italic;
  color: #E8C8A0;
  margin-top: 1.5rem;
  font-size: 0.9em;
}

/* ========== CLOSING CTA ========== */

.closing {
  padding: clamp(4rem, 8vw, 7rem) 0;
  border-top: 1px solid var(--ink);
  position: relative;
}

.closing-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  text-align: left;
}

.closing .eyebrow { margin-bottom: 1.5rem; display: block; }

.closing h2 {
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  margin-bottom: 2rem;
  max-width: 20ch;
  line-height: 1.05;
}

.closing h2 em {
  font-style: italic;
  color: var(--oxblood);
  font-weight: 350;
}

.closing-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.closing .note {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 2rem;
  letter-spacing: 0.02em;
}

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

.footer {
  background: var(--ink);
  color: var(--ivory);
  padding: clamp(3rem, 5vw, 5rem) 0 2rem;
  position: relative;
}

.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2.5rem; }
}

.footer-brand h3 {
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 450;
  margin-bottom: 0.75rem;
  letter-spacing: -0.015em;
}

.footer-brand .footer-logo {
  height: 56px;
  width: auto;
  display: block;
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.9rem;
  color: rgba(249, 246, 239, 0.7);
  line-height: 1.55;
  max-width: 32ch;
}

.footer-col h5 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(249, 246, 239, 0.5);
  font-weight: 500;
  margin-bottom: 1.25rem;
}

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

.footer-col a {
  color: var(--ivory);
  font-size: 0.95rem;
  border: 0;
  transition: color 180ms ease;
  font-weight: 400;
}

.footer-col a:hover { color: #E8C8A0; }

.footer-col address {
  font-style: normal;
  font-size: 0.92rem;
  line-height: 1.65;
  color: rgba(249, 246, 239, 0.85);
}

.footer-col address .label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(249, 246, 239, 0.45);
  display: block;
  margin-bottom: 0.35rem;
}

.footer-col address + .label { margin-top: 1rem; }

.footer-bottom {
  max-width: var(--max);
  margin: 3.5rem auto 0;
  padding: 1.5rem var(--gutter) 0;
  border-top: 1px solid rgba(249, 246, 239, 0.12);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(249, 246, 239, 0.45);
  text-transform: uppercase;
}

/* ========== SERVICE PAGE LAYOUTS ========== */

.content-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding: clamp(3rem, 5vw, 4.5rem) 0;
  border-top: 2px solid var(--page-tint);
}

@media (min-width: 900px) {
  .content-block { grid-template-columns: 0.4fr 1fr; gap: 4rem; }
}

.content-block .block-head {
  position: sticky;
  top: 6rem;
  align-self: start;
}

.content-block .block-head .num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--oxblood);
  font-weight: 500;
  display: inline-block;
  margin-bottom: 0.75rem;
  background: var(--page-tint);
  padding: 0.28rem 0.55rem;
  border-radius: 2px;
}

.content-block .block-head h3 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.content-block .block-body {
     min-width: 0;
}

.content-block .block-body p {
  font-size: 1.05rem;
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 62ch;
}

.content-block .block-body p + p { margin-top: 1rem; }

.content-block .block-body ul {
  list-style: none;
  margin-top: 1.25rem;
}

.content-block .block-body ul li {
  padding: 0.75rem 0 0.75rem 2rem;
  border-top: 1px solid var(--rule-soft);
  position: relative;
  font-size: 0.98rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.content-block .block-body ul li:last-child { border-bottom: 1px solid var(--rule-soft); }

.content-block .block-body ul li::before {
  content: counter(list-counter, decimal-leading-zero);
  counter-increment: list-counter;
  position: absolute;
  left: 0;
  top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--oxblood);
  font-weight: 500;
}

.content-block .block-body ul { counter-reset: list-counter; }

.content-block .block-body ul.plain li {
  padding-left: 1.25rem;
}

.content-block .block-body ul.plain li::before {
  content: "—";
  font-family: var(--sans);
  color: var(--oxblood);
  top: 0.7rem;
  font-size: 0.95rem;
}

/* Spec tables */
.spec {
  margin-top: 1.5rem;
  border-top: 1px solid var(--ink);
}

.spec-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.spec-row dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
  padding-top: 2px;
}

.spec-row dd {
  color: var(--ink-soft);
}

/* ========== ABOUT MODEL DIAGRAM ========== */

.model-diagram {
  margin: 3rem 0;
  border: 1px solid var(--ink);
  padding: 2rem;
  background: var(--ivory-warm);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
  position: relative;
}

@media (min-width: 800px) {
  .model-diagram {
    grid-template-columns: 1fr auto 1fr;
    gap: 2.5rem;
    padding: 2.5rem;
  }
}

.model-node h4 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.model-node .city {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.model-node ul {
  list-style: none;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.model-node li {
  padding-left: 1rem;
  position: relative;
}

.model-node li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--oxblood);
  font-weight: 700;
}

.model-bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 1rem 0;
  position: relative;
}

@media (min-width: 800px) {
  .model-bridge {
    padding: 8rem 0.5rem 0;
    font-size: 1.5rem;
    color: var(--oxblood);
  }
  .model-bridge span {
    position: relative;
    z-index: 2;
    font-family: var(--serif);
    font-weight: 300;
  }
}

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

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
}

@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1.15fr 0.85fr; gap: 5rem; }
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
}

.form-field input,
.form-field textarea {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 0.6rem 0;
  outline: none;
  transition: border-color 200ms ease;
  border-radius: 0;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-bottom-color: var(--oxblood);
  border-bottom-width: 2px;
}

.form-field textarea { min-height: 140px; line-height: 1.55; }

.form-file {
  padding: 1rem 1.25rem;
  border: 1px dashed var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  line-height: 1.5;
  background: var(--ivory-warm);
}

.form-file strong { color: var(--ink); font-family: var(--sans); font-size: 0.92rem; }

.form-file a { border-bottom: 1px solid var(--oxblood); color: var(--oxblood); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

.form-note {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.contact-aside {
  padding: 2rem;
  background: var(--ivory-warm);
  border: 1px solid var(--rule);
  position: relative;
}

.contact-aside h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  letter-spacing: -0.015em;
}

.contact-block {
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
}

.contact-block:first-of-type { border-top: 1px solid var(--ink); }
.contact-block:last-of-type { border-bottom: 1px solid var(--rule); }

.contact-block .label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood);
  font-weight: 500;
  margin-bottom: 0.4rem;
  display: block;
}

.contact-block .value {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.55;
}

.contact-block .value a {
  border: 0;
  color: var(--ink);
  font-weight: 500;
}

.contact-block .value a:hover { color: var(--oxblood); }

/* ========== ANIMATIONS ========== */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  animation: fadeInUp 900ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.reveal-d1 { animation-delay: 80ms; }
.reveal-d2 { animation-delay: 200ms; }
.reveal-d3 { animation-delay: 340ms; }
.reveal-d4 { animation-delay: 480ms; }
.reveal-d5 { animation-delay: 620ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; }
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

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

@media (max-width: 860px) {
  .nav-toggle { display: block; order: 3; }
  .nav-cta-desktop { display: none; }

  .nav-links {
    position: fixed;
    inset: 64px 0 auto 0;
    background: var(--ivory);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: transform 240ms ease, opacity 240ms ease;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    border-top: 1px solid var(--rule-soft);
  }

  .nav-links a {
    display: block;
    padding: 1rem var(--gutter);
    font-size: 1rem;
  }

  .nav-links .nav-cta-mobile {
    padding: 1rem var(--gutter);
  }

  .nav-links .nav-cta-mobile .btn {
    width: 100%;
    justify-content: center;
  }

  .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); }
}

@media (min-width: 861px) {
  .nav-cta-mobile { display: none; }
}

/* ========== UTILITIES ========== */

.text-mono { font-family: var(--mono); }
.text-serif { font-family: var(--serif); }
.text-accent { color: var(--oxblood); }
.text-muted { color: var(--ink-muted); }
.text-soft { color: var(--ink-soft); }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-0 { margin-bottom: 0; }

.hide-mobile { display: none; }
@media (min-width: 700px) { .hide-mobile { display: initial; } }

/* Focus states for accessibility */
:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 3px;
}

.btn:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 3px;
}
