/* ════════════════════════════════════════════════════════════════
   GIS CONTRACTING — DESIGN SYSTEM
   Editorial / warm / restrained. Magnolia meets Restoration Hardware.
   Loaded on every page. Hosts design tokens + reusable primitives.
   Rebuild content lives in each page; this file is tokens + utilities.
═══════════════════════════════════════════════════════════════════ */

:root {
  /* ── Palette ────────────────────────────────────────────────── */
  --color-bg:          #FAF7F2;  /* warm off-white base — NEVER pure white */
  --color-bg-alt:      #F2EDE5;  /* alternating sections */
  --color-ink:         #1C1B18;  /* charcoal — NEVER pure black */
  --color-ink-soft:    #3A3834;  /* secondary text */
  --color-muted:       #8A8680;  /* tertiary / captions */
  --color-muted-on-dark:#A7A29A; /* muted on dark bg */
  --color-rule:        #E5DFD3;  /* thin dividing rules */
  --color-accent:      #B2502E;  /* warm terracotta — CTAs, accents only */
  --color-accent-dark: #8F3E22;  /* hover */
  --color-trust:       #2D4A32;  /* deep forest green for trust badges */

  /* ── Type scale (desktop) ───────────────────────────────────── */
  --fs-display:   clamp(56px, 6.2vw, 96px);  /* display numbers */
  --fs-hero:      clamp(44px, 5.4vw, 72px);  /* hero headline */
  --fs-section:   clamp(36px, 3.8vw, 56px);  /* section headlines */
  --fs-xl:        clamp(28px, 2.4vw, 36px);  /* large copy / pull quotes */
  --fs-lg:        clamp(20px, 1.4vw, 22px);  /* subheads */
  --fs-body:      17px;
  --fs-sm:        15px;
  --fs-xs:        13px;
  --fs-kicker:    13px;

  /* ── Spacing scale ──────────────────────────────────────────── */
  --space-section: 120px;  /* desktop section vertical */
  --space-section-mobile: 80px;
  --gutter:        clamp(24px, 4vw, 80px);

  /* ── Container widths (don't default to one) ────────────────── */
  --w-wide:  1280px;
  --w-page:  1160px;
  --w-narrow: 880px;
  --w-prose:  640px;
}

/* ── Baseline resets (scoped so existing pages don't break) ──── */
html { scroll-behavior: smooth; }

.ds-body, body.ds-body {
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ds h1, .ds h2, .ds h3, .ds h4, .ds .serif, .ds-body h1, .ds-body h2, .ds-body h3, .ds-body h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  color: var(--color-ink);
}

/* ── Kicker — small-caps editorial label above headlines ─────── */
.kicker {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: var(--fs-kicker);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 20px;
}
.kicker-muted { color: var(--color-muted); }
.kicker-on-dark { color: var(--color-accent); }

/* ── Pull quote — Fraunces italic with vertical accent rule ──── */
.pull-quote {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.35;
  color: var(--color-ink);
  padding-left: 24px;
  border-left: 2px solid var(--color-accent);
  margin: 0;
}
.pull-quote-on-dark { color: var(--color-bg); }

/* ── Buttons (primitive; buttons are the ONE place we allow
       light rounding — keep at 4px, no drop shadow, no gradient) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.02em;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .22s cubic-bezier(.2,.8,.2,1),
              border-color .22s,
              color .22s,
              transform .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

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

.btn-secondary {
  background: transparent;
  color: var(--color-ink);
  border: 1px solid var(--color-ink);
}
.btn-secondary:hover {
  background: var(--color-ink);
  color: var(--color-bg);
}

.btn-on-dark {
  background: var(--color-bg);
  color: var(--color-ink);
  border-color: var(--color-bg);
}
.btn-on-dark:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg);
}

/* ── Rules — thin dividing lines, editorial ─────────────────── */
.rule {
  border: 0;
  border-top: 1px solid var(--color-rule);
  margin: 0;
}
.rule-accent {
  border: 0;
  border-top: 1px solid var(--color-accent);
  max-width: 48px;
  margin: 24px 0;
}
.rule-short {
  border: 0;
  border-top: 1px solid var(--color-rule);
  max-width: 120px;
  margin: 0;
}

/* ── Display number — oversized stat treatment ──────────────── */
.display-num {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-size: var(--fs-display);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--color-ink);
}
.display-num-accent { color: var(--color-accent); }

/* ── Form inputs — editorial, minimal, NO drop shadows ──────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.field input,
.field select,
.field textarea {
  font-family: 'Inter', sans-serif;
  /* 16px prevents iOS Safari zoom-on-focus */
  font-size: 16px;
  color: var(--color-ink);
  background: var(--color-bg);
  border: 1px solid var(--color-rule);
  border-radius: 4px;
  padding: 13px 16px;
  min-height: 50px;
  width: 100%;
  transition: border-color .18s, box-shadow .18s;
  -webkit-appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(178, 80, 46, 0.12);
}

/* ── A11y: focus-visible for keyboard users ─────────────────── */
.ds a:focus-visible,
.ds button:focus-visible,
.ds .btn:focus-visible,
body.ds-body a:focus-visible,
body.ds-body button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Utility: screen-reader only ────────────────────────────── */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Container utilities (different widths, not a single default) ── */
.container      { max-width: var(--w-page);   margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.container-wide { max-width: var(--w-wide);   margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.container-narrow { max-width: var(--w-narrow); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.container-prose { max-width: var(--w-prose); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ── Mobile performance & UX ─────────────────────────────────── */
/* Prevent 300ms tap delay on all interactive elements */
a, button, [role="button"], input, select, textarea, label {
  touch-action: manipulation;
}
/* Remove iOS tap flash (use focus-visible for keyboard instead) */
a, button, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}
/* Minimum 44×44pt touch targets (Apple HIG / WCAG 2.5.5) */
@media (max-width: 768px) {
  .btn, a.btn, button.btn {
    min-height: 44px;
    min-width: 44px;
  }
  /* Prevent content overflow on very small screens */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  img, video, iframe {
    max-width: 100%;
  }
}
