/* Headwaters Analytics — base styles */

:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6db;
  --ink: #14201c;
  --ink-soft: #3a4742;
  --ink-muted: #6b7670;
  --rule: rgba(20, 32, 28, 0.14);
  --rule-soft: rgba(20, 32, 28, 0.07);
  --accent: #2d5d6b;
  --accent-soft: #4a7d8a;

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Geist", "Söhne", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
}

/* ───────── Type scale ───────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 8.4vw, 144px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink);
  font-feature-settings: "ss01", "ss02";
}
.display em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}

.headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 3.6vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.018em;
  margin: 0;
}

.lede {
  font-family: var(--sans);
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 400;
  max-width: 56ch;
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.coord {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ───────── Layout ───────── */
.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 56px);
}

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

/* ───────── Nav ───────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--paper), transparent 8%);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--rule-soft);
  border-top: 3px solid var(--accent);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 22px;
  height: 22px;
  display: block;
}
.brand-name {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.005em;
}
.brand-name .small {
  font-family: var(--mono);
  font-weight: 400;
  color: var(--ink-muted);
  margin-left: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--paper);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-cta:hover { background: transparent; color: var(--accent); }

/* ───────── Hero shared ───────── */
.hero {
  position: relative;
  overflow: hidden;
}
.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 36px;
}
.hero-meta .left, .hero-meta .right {
  display: flex;
  gap: 24px;
  color: var(--ink-muted);
}

/* Hero variant A — Cartograph (left title, right topo) */
.hero-a {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
  padding: clamp(80px, 12vh, 160px) 0 clamp(64px, 10vh, 128px);
}
.hero-a .title-block { display: flex; flex-direction: column; gap: 28px; }
.hero-a .topo-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.hero-a .topo-frame .topo-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}

/* ───────── Map plate (live iframe in Hero A) ───────── */
.map-plate {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.map-plate-tag {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--ink-soft);
}
.map-plate-tag .coord:first-child {
  color: var(--accent);
  font-weight: 500;
}
.map-plate-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--paper);
  border: 1px solid var(--rule);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 20px 60px -30px color-mix(in oklab, var(--accent), transparent 55%);
}
.map-plate-frame > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Corner tick marks — like cartographic register marks */
.map-plate-frame::before,
.map-plate-frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--accent);
  z-index: 3;
  pointer-events: none;
}
.map-plate-frame::before {
  top: -1px; left: -1px;
  border-right: 0; border-bottom: 0;
}
.map-plate-frame::after {
  bottom: -1px; right: -1px;
  border-left: 0; border-top: 0;
}
.map-plate-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-plate-fallback-cta {
  position: absolute;
  bottom: 16px;
  left: 16px;
}
.map-plate-caption {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding-top: 4px;
}
.map-plate-title {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.25;
  color: var(--ink);
  margin-top: 4px;
  max-width: 32ch;
}
.map-plate-sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-top: 6px;
}
.map-plate-link {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--accent);
  white-space: nowrap;
  transition: color 0.15s ease;
}
.map-plate-link:hover { color: var(--ink); }
.map-plate-link .arrow {
  display: inline-block;
  transition: transform 0.18s ease;
}
.map-plate-link:hover .arrow { transform: translate(2px, -2px); }

/* Hero variant B — Datum (centered, full-bleed topo behind) */
.hero-b {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(80px, 12vh, 140px) 0;
}
.hero-b .topo-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 35%, transparent 80%);
}
.hero-b .center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  max-width: 880px;
}
.hero-b .display { text-align: center; }
.hero-b .lede { text-align: center; }

/* Hero variant C — Survey (editorial split, metadata sidebar) */
.hero-c {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(32px, 4vw, 64px);
  padding: clamp(64px, 10vh, 120px) 0 clamp(64px, 10vh, 120px);
  position: relative;
}
.hero-c .sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-top: 1px solid var(--ink);
  padding-top: 20px;
}
.hero-c .sidebar .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-c .sidebar .field .v {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.hero-c .main {
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-top: 1px solid var(--ink);
  padding-top: 20px;
}
.hero-c .topo-band {
  margin-top: 24px;
  height: 220px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}

.cta-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
  cursor: default;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: var(--paper);
}
.btn-primary:hover { background: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn .arrow {
  display: inline-block;
  transition: transform 0.18s ease;
}
.btn:hover .arrow { transform: translateX(3px); }

/* ───────── Section header ───────── */
.section {
  padding: clamp(72px, 10vh, 128px) 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
.section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 64px;
  height: 2px;
  background: var(--accent);
}
.section-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(32px, 4vw, 64px);
  margin-bottom: 64px;
  align-items: start;
}
.section-head .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.section-head .meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4vw, 64px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 18ch;
}
.section-head h2 em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}

/* ───────── Services ───────── */
.services {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(32px, 4vw, 64px);
}
.services-aside { display: flex; flex-direction: column; gap: 14px; }
.services-aside .helper { color: var(--ink-soft); font-size: 13.5px; line-height: 1.55; max-width: 24ch; }
.services-list { display: flex; flex-direction: column; }
.svc {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: clamp(24px, 3vw, 48px);
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  align-items: start;
  transition: background 0.2s ease, padding 0.2s ease;
}
.svc:last-child { border-bottom: 1px solid var(--rule); }
.svc:hover { background: color-mix(in oklab, var(--accent), transparent 95%); }
.svc:hover h3 { color: var(--accent); }
.svc h3 { transition: color 0.18s ease; }
.svc .idx {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.svc h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 1.9vw, 30px);
  line-height: 1.1;
  letter-spacing: -0.012em;
  margin: 0 0 12px 0;
}
.svc p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 46ch;
}
.svc .stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.svc .stack .label { font-size: 10.5px; }
.svc .stack .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 4px 9px;
  border: 1px solid color-mix(in oklab, var(--accent), transparent 70%);
  border-radius: 999px;
  color: var(--accent);
  letter-spacing: 0.02em;
  background: color-mix(in oklab, var(--accent), var(--paper) 92%);
}

/* ───────── Capabilities strip ───────── */
.cap-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.cap {
  background: var(--paper);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cap .coord {
  color: var(--accent);
  font-weight: 500;
}
.cap .n {
  font-family: var(--serif);
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.cap .t {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
  max-width: 28ch;
}

/* ───────── Footer ───────── */
.foot {
  padding: clamp(64px, 8vh, 96px) 0 32px;
  border-top: 1px solid var(--rule);
  position: relative;
}
.foot::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 64px;
  height: 2px;
  background: var(--accent);
}
.foot h4 em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
.foot h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 16px 0;
  max-width: 18ch;
}
.foot .link-col { display: flex; flex-direction: column; gap: 10px; }
.foot .link-col a {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s ease;
}
.foot .link-col a:hover { color: var(--ink); }
.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* ───────── Responsive ───────── */
@media (max-width: 900px) {
  .hero-a { grid-template-columns: 1fr; }
  .hero-c { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1fr; gap: 16px; margin-bottom: 40px; }
  .services { grid-template-columns: 1fr; }
  .svc { grid-template-columns: 60px 1fr; }
  .svc .stack { grid-column: 1 / -1; padding-left: 60px; }
  .cap-strip { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .nav-links { display: none; }
}
