/* ==========================================================================
   Reforium Design System
   Hand-written, modern static CSS
   - 8px strict spacing system
   - Fluid typography using clamp()
   - Neutral architectural palette + 2 accents (Terracotta & Sage)
   - Dark mode via prefers-color-scheme
   - GPU-only animations (transform & opacity)
   - WCAG AA compliant contrast & visible focus states
   ========================================================================== */

/* Self-hosted Fraunces (variable font, weight axis 400-600, latin subset only).
   Replaces the Google Fonts <link> that used to load this. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/fraunces-variable-latin.woff2") format("woff2");
}

:root {
  /* Color Palette - Light Mode */
  --bg-primary: #FAF9F6;          /* Editorial off-white / linen */
  --bg-surface: #FFFFFF;          /* Pure white card surface */
  --bg-subtle: #F2EFEB;           /* Soft muted section background */
  --bg-sunken: #E9E5DE;           /* Deeper neutral surface */
  
  --text-primary: #18181A;        /* Deep ink */
  --text-secondary: #575653;      /* Architectural slate / charcoal */
  --text-tertiary: #625F5A;       /* Soft caption / meta */
  --text-inverse: #FAF9F6;        /* White text for dark surfaces */
  
  --border-subtle: rgba(24, 24, 26, 0.08);
  --border-strong: rgba(24, 24, 26, 0.16);
  --border-focus: #C85A32;        /* Terracotta focus ring */
  
  /* Primary corporate accent: ink/navy, used for primary buttons and key UI */
  --accent-ink: #1F2A37;
  --accent-ink-hover: #141B24;
  --accent-ink-subtle: rgba(31, 42, 55, 0.08);

  /* Terracotta and sage are now small accents only: eyebrows, focus ring, detail marks */
  --accent-terracotta: #9A3D20;   /* Primary accent - rich clay / rust, WCAG AA on linen */
  --accent-terracotta-hover: #7E2E16;
  --accent-terracotta-subtle: rgba(154, 61, 32, 0.08);

  --accent-sage: #385E4D;         /* Secondary accent - deep botanical sage */
  --accent-sage-subtle: rgba(56, 94, 77, 0.10);

  /* Elevation Shadows */
  --shadow-sm: 0 1px 3px rgba(24, 24, 26, 0.04), 0 1px 2px rgba(24, 24, 26, 0.03);
  --shadow-md: 0 4px 12px rgba(24, 24, 26, 0.06), 0 2px 4px rgba(24, 24, 26, 0.04);
  --shadow-lg: 0 16px 36px -8px rgba(24, 24, 26, 0.09), 0 6px 12px -3px rgba(24, 24, 26, 0.04);
  --shadow-bloom: 0 12px 28px -6px rgba(31, 42, 55, 0.22);

  /* Typography Scale via clamp() */
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Fraunces", Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --text-xs: clamp(0.75rem, 0.70rem + 0.25vw, 0.8125rem); /* 12-13px */
  --text-sm: clamp(0.8438rem, 0.80rem + 0.22vw, 0.9063rem); /* 13.5-14.5px */
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);      /* 16-17px */
  --text-lg: clamp(1.125rem, 1.05rem + 0.38vw, 1.25rem);    /* 18-20px */
  --text-xl: clamp(1.35rem, 1.22rem + 0.65vw, 1.625rem);    /* 21.6-26px */
  --text-2xl: clamp(1.75rem, 1.50rem + 1.25vw, 2.25rem);    /* 28-36px */
  --text-3xl: clamp(2.25rem, 1.80rem + 2.25vw, 3.25rem);    /* 36-52px */
  --text-display: clamp(2.75rem, 2.10rem + 3.25vw, 4.5rem); /* 44-72px */

  /* Spacing Scale (8px strict) */
  --space-1: 0.5rem;   /* 8px */
  --space-2: 1rem;     /* 16px */
  --space-3: 1.5rem;   /* 24px */
  --space-4: 2rem;     /* 32px */
  --space-5: 2.5rem;   /* 40px */
  --space-6: 3rem;     /* 48px */
  --space-8: 4rem;     /* 64px */
  --space-10: 5rem;    /* 80px */
  --space-12: 6rem;    /* 96px */
  --space-16: 8rem;    /* 128px */

  /* Layout */
  --container-max: 1240px;
  --measure-prose: 68ch;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Transition curves */
  --ease-out-cubic: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-hover: 150ms;
}

/* Dark Mode via prefers-color-scheme */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #121214;        /* Deep matte charcoal */
    --bg-surface: #1B1B1E;        /* Elevated dark surface */
    --bg-subtle: #161619;         /* Subdued section bg */
    --bg-sunken: #0C0C0D;         /* Darkest floor */

    --text-primary: #F4F3F0;      /* Warm white */
    --text-secondary: #AAA8A2;    /* Refined warm gray */
    --text-tertiary: #73716C;     /* Muted metadata */
    --text-inverse: #121214;

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --border-focus: #E07044;

    /* Brightened so the ink accent still reads as navy, not black, on a dark surface */
    --accent-ink: #4A6D8C;
    --accent-ink-hover: #5D82A0;
    --accent-ink-subtle: rgba(74, 109, 140, 0.20);

    --accent-terracotta: #EA7A50; /* Brightened for dark mode contrast */
    --accent-terracotta-hover: #F59A73;
    --accent-terracotta-subtle: rgba(234, 122, 80, 0.18);

    --accent-sage: #5A947B;
    --accent-sage-subtle: rgba(90, 148, 123, 0.16);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.55);
    --shadow-bloom: 0 12px 28px -6px rgba(74, 109, 140, 0.35);
  }
}

/* ==========================================================================
   CSS Reset & Base Rules
   ========================================================================== */

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

html {
  font-family: var(--font-system);
  font-size: 100%;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-2);
  background: var(--accent-terracotta);
  color: #FFFFFF;
  padding: var(--space-1) var(--space-2);
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  transition: transform 150ms var(--ease-out-cubic);
}

.skip-link:focus {
  top: var(--space-2);
  outline: 3px solid var(--text-primary);
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-family: var(--font-serif);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); font-weight: 500; }
h2 { font-size: var(--text-2xl); font-weight: 500; }
h3 { font-size: var(--text-xl); font-weight: 500; }
h4 { font-size: var(--text-lg); font-weight: 500; font-family: var(--font-system); letter-spacing: -0.01em; }

p, li, blockquote {
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.65;
  max-width: var(--measure-prose);
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

small {
  font-size: var(--text-xs);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--duration-hover) var(--ease-out-cubic);
}

a:hover {
  color: var(--accent-terracotta);
}

/* Accessible focus styling across all interactive elements */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

/* Container & Grid Primitives */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

.section {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

@media (min-width: 768px) {
  .section {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }
}

.section-subtle {
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

/* Grid Layouts - Asymmetric, deliberate, no centered-everything */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }
}

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

@media (min-width: 992px) {
  .grid-split-hero {
    grid-template-columns: 1.15fr 0.85fr;
    gap: var(--space-8);
  }
}

/* Hero image and milestone card are hidden on phones only; shown again from tablet width up. */
.hero-visual {
  display: none;
}

@media (min-width: 640px) {
  .hero-visual {
    display: block;
  }
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.site-header.is-scrolled {
  background-color: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

@media (prefers-color-scheme: dark) {
  .site-header.is-scrolled {
    background-color: rgba(18, 18, 20, 0.92);
  }
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem; /* 72px */
}

.brand-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-symbol {
  width: 28px;
  height: 28px;
  display: inline-block;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-menu {
  display: none;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
}

@media (min-width: 860px) {
  .nav-menu {
    display: flex;
  }
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-1) 0;
  position: relative;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text-primary);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent-terracotta);
}

.nav-link:not(.is-active)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--text-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 250ms var(--ease-out-cubic);
}

.nav-link:not(.is-active):hover::after {
  transform: scaleX(1);
}

.nav-cta-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-cta-group .btn-primary {
  display: none;
}

@media (min-width: 860px) {
  .nav-cta-group .btn-primary {
    display: inline-flex;
  }
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}

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

.mobile-menu-drawer {
  display: none;
  padding: var(--space-3) 0 var(--space-4);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

.mobile-menu-drawer.is-open {
  display: block;
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-nav-list .nav-link {
  font-size: var(--text-base);
  padding: var(--space-1) 0;
  display: block;
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 0.75rem 1.5rem;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--duration-hover) var(--ease-out-cubic),
              background-color var(--duration-hover) var(--ease-out-cubic),
              border-color var(--duration-hover) var(--ease-out-cubic),
              box-shadow var(--duration-hover) var(--ease-out-cubic);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--accent-ink);
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 550ms var(--ease-out-cubic);
}

.btn-primary:hover::before {
  left: 130%;
}

.btn-primary:hover {
  background-color: var(--accent-ink-hover);
  color: #FFFFFF;
  box-shadow: var(--shadow-bloom);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background-color: var(--bg-surface);
  border-color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
}

/* ==========================================================================
   Cards & Content Blocks
   ========================================================================== */

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: transform var(--duration-hover) var(--ease-out-cubic),
              box-shadow var(--duration-hover) var(--ease-out-cubic),
              border-color var(--duration-hover) var(--ease-out-cubic);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* Editorial eyebrow label: a short rule + tracked caps, no pill/chip */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-system);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-terracotta);
  width: fit-content;
}

.eyebrow::before {
  content: "";
  display: block;
  width: 22px;
  height: 1px;
  background-color: currentColor;
  flex-shrink: 0;
}

.eyebrow-sage {
  color: var(--accent-sage);
}

/* Serif display numeral used for step markers ("01", "02"...) */
.step-number {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 500;
  color: var(--accent-terracotta);
  font-size: var(--text-2xl);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.metric-highlight {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.metric-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

/* ==========================================================================
   Signature Interactive Moments:
   1. Sticky Swapping Services
   2. Horizon Metric Slider / Case study scroll
   ========================================================================== */

.sticky-services-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  position: relative;
}

@media (min-width: 900px) {
  .sticky-services-wrapper {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: var(--space-8);
  }
}

.services-pinned-panel {
  position: static;
  min-width: 0;
}

.services-scroll-content {
  min-width: 0;
}

@media (min-width: 900px) {
  .services-pinned-panel {
    position: sticky;
    top: 6rem;
    height: fit-content;
  }
}

.service-scroll-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.service-scroll-item.is-current {
  border-color: var(--accent-terracotta);
  box-shadow: var(--shadow-md);
}

/* Horizontal Case Studies Scroll Container */
.case-study-rail {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-3);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.case-study-rail::-webkit-scrollbar {
  height: 6px;
}

.case-study-rail::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}

.case-study-rail::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.case-study-card {
  min-width: 320px;
  max-width: 380px;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

@media (min-width: 768px) {
  .case-study-card {
    min-width: 400px;
    max-width: 420px;
  }
}

/* ==========================================================================
   Animations & Transitions (Strict transform & opacity ONLY)
   ========================================================================== */

.hero-title {
  font-size: var(--text-display);
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* Hero clip-path staggered line reveal */
.hero-line-mask {
  overflow: hidden;
  display: block;
}

.hero-line {
  display: block;
  transform: translateY(105%);
  opacity: 0;
  transition: transform 650ms var(--ease-out-cubic), opacity 650ms var(--ease-out-cubic);
}

.is-loaded .hero-line:nth-child(1) {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 100ms;
}

.is-loaded .hero-line:nth-child(2) {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 220ms;
}

.is-loaded .hero-line:nth-child(3) {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 340ms;
}

.hero-subhead {
  transform: translateY(20px);
  opacity: 0;
  transition: transform 550ms var(--ease-out-cubic), opacity 550ms var(--ease-out-cubic);
  transition-delay: 480ms;
}

.hero-cta {
  transform: translateY(20px);
  opacity: 0;
  transition: transform 550ms var(--ease-out-cubic), opacity 550ms var(--ease-out-cubic);
  transition-delay: 600ms;
}

.is-loaded .hero-subhead,
.is-loaded .hero-cta {
  transform: translateY(0);
  opacity: 1;
}

/* Scroll reveal classes (IntersectionObserver) */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms var(--ease-out-cubic), transform 500ms var(--ease-out-cubic);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger utilities for children */
.stagger-parent > *:nth-child(1) { transition-delay: 60ms; }
.stagger-parent > *:nth-child(2) { transition-delay: 130ms; }
.stagger-parent > *:nth-child(3) { transition-delay: 200ms; }
.stagger-parent > *:nth-child(4) { transition-delay: 270ms; }
.stagger-parent > *:nth-child(5) { transition-delay: 340ms; }
.stagger-parent > *:nth-child(6) { transition-delay: 410ms; }

/* Image wrapper with fixed aspect ratio to eliminate layout shift */
.media-frame {
  position: relative;
  width: 100%;
  background-color: var(--bg-sunken);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   Table & Metrics Data Presentation
   ========================================================================== */

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--text-sm);
}

.data-table th,
.data-table td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background-color: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--text-xs);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   Case Studies: disclosure tag, stat strip, filters, disclaimer
   ========================================================================== */

/* Square-cornered disclosure tag, deliberately not a pill */
.disclosure-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  width: fit-content;
}

.disclosure-tag::before {
  content: "i";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 10px;
  line-height: 1;
}

.disclaimer-box {
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-terracotta);
  background: var(--bg-subtle);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-style: italic;
}

/* Key-fact strip: Client type · Location · Employees · Duration */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
}

@media (min-width: 640px) {
  .stat-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat-strip > div {
  background: var(--bg-subtle);
  padding: var(--space-2) var(--space-3);
  overflow-wrap: break-word;
}

@media (min-width: 640px) {
  .stat-strip > div {
    padding: var(--space-3) var(--space-4);
  }
}

.stat-strip dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 0.3rem;
}

.stat-strip dd {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--text-primary);
  line-height: 1.2;
}

/* Borderless feature item: small accent rule instead of a full card box.
   Used for plain heading+text feature grids so not every grid on the page
   reads as a stack of identical bordered boxes. */
.feature-item::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  background-color: var(--accent-terracotta);
  margin-bottom: var(--space-3);
}

.feature-item-sage::before {
  background-color: var(--accent-sage);
}

.feature-item h3 {
  margin-bottom: var(--space-1);
}

.feature-item p {
  color: var(--text-secondary);
}

/* Spec list: compact two-column list with dividers, for short label+text
   items (amenities, inclusions) as an alternative to a card grid. */
.spec-list {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--border-subtle);
}

@media (min-width: 640px) {
  .spec-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.spec-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 640px) {
  .spec-item:nth-child(odd) {
    padding-right: var(--space-4);
    border-right: 1px solid var(--border-subtle);
  }

  .spec-item:nth-child(even) {
    padding-left: var(--space-4);
  }
}

.spec-item-marker {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.6em;
  background-color: var(--accent-terracotta);
}

.spec-item h3 {
  font-size: var(--text-base);
  margin-bottom: 0.2rem;
}

.spec-item p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}

/* Process list: numbered steps separated by a vertical rule instead of
   individual boxes, for sequential "how it works" style content. */
.process-list > div {
  border-left: 1px solid var(--border-subtle);
  padding-left: var(--space-4);
}

.process-list > div:first-child {
  border-left: none;
  padding-left: 0;
}

@media (max-width: 639px) {
  .process-list > div {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-4);
  }

  .process-list > div:first-child {
    border-top: none;
    padding-top: 0;
  }
}

/* Areas We Cover: simple list with a square-cornered status badge per area */
.area-list {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--border-subtle);
}

@media (min-width: 640px) {
  .area-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.area-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 640px) {
  .area-item:nth-child(odd) {
    padding-right: var(--space-4);
    border-right: 1px solid var(--border-subtle);
  }

  .area-item:nth-child(even) {
    padding-left: var(--space-4);
  }
}

.area-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.area-status::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.area-status-active {
  color: var(--accent-sage);
  background: var(--accent-sage-subtle);
}

.area-status-recruiting {
  color: var(--text-tertiary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

/* Vetting checklist: small inline SVG icon (no icon library) ahead of a spec-item */
.spec-item-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 0.1em;
  color: var(--accent-sage);
}

.spec-item-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   FAQ Accordions (Accessible HTML5 Details/Summary)
   ========================================================================== */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  transition: border-color var(--duration-hover) ease;
}

.faq-item[open] {
  border-color: var(--border-strong);
}

.faq-summary {
  padding: var(--space-3);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: "+";
  font-size: 1.35rem;
  line-height: 1;
  color: var(--accent-terracotta);
  font-weight: 400;
  transition: transform 180ms ease;
}

.faq-item[open] .faq-summary::after {
  transform: rotate(45deg);
}

.faq-content {
  padding: 0 var(--space-3) var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-base);
}

/* ==========================================================================
   Forms & Contact Elements
   ========================================================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.form-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-terracotta-subtle);
  outline: none;
}

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

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: auto;
  background-color: var(--bg-sunken);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-8);
  padding-bottom: var(--space-6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr repeat(3, 1fr);
  }
}

.footer-col-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.footer-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.footer-nav a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--accent-terracotta);
}

.footer-bottom {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ==========================================================================
   Reduced Motion Override (Non-negotiable requirement)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero-line,
  .hero-subhead,
  .hero-cta,
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}


/* Cross-document View Transitions API: browsers that support it animate native
   document navigation; unsupported browsers continue with normal instant links. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root) {
    animation: 150ms var(--ease-out-cubic) both page-fade-out;
  }

  ::view-transition-new(root) {
    animation: 220ms var(--ease-out-cubic) both page-fade-in;
  }
}

@keyframes page-fade-out {
  to { opacity: 0; transform: translateY(-4px); }
}

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(8px); }
}


/* Placeholder metrics remain visually compact until verified figures are supplied. */
.metric-placeholder {
  font-size: var(--text-sm);
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  max-width: 100%;
}

/* Case study body rhythm */
.case-body p { margin-bottom: var(--space-2); }
.case-body h2 { margin-bottom: var(--space-2); font-size: var(--text-2xl); }

/* Flagship case study card spans the full grid row */
.card-flagship { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .card-flagship { padding: var(--space-5) !important; }
  .card-flagship h3 { font-size: var(--text-xl) !important; }
}

@media (max-width: 639px) {
  .stat-strip dd { font-size: var(--text-base); hyphens: manual; }
  .stat-strip > div { padding: var(--space-2); }
}
