/* ============================================================
   JPD Water Consulting — Design Tokens (Clarity palette)
   ============================================================ */

:root,
[data-theme='light'] {
  /* Surfaces */
  --color-bg: #f5fafb;
  --color-surface: #ffffff;
  --color-surface-2: #fbfefe;
  --color-surface-offset: #eaf3f5;
  --color-surface-offset-2: #dfedf0;
  --color-surface-dynamic: #d3e6ea;
  --color-divider: #dce9ec;
  --color-border: #cbdfe3;

  /* Text */
  --color-text: #0d1f26;
  --color-text-muted: #4c6871;
  --color-text-faint: #93aab0;
  --color-text-inverse: #f5fafb;

  /* Primary accent — Clarity Blue */
  --color-primary: #0a6e8c;
  --color-primary-hover: #085468;
  --color-primary-active: #063d4b;
  --color-primary-highlight: #cfe8ed;

  /* Deep navy for high-contrast sections */
  --color-deep: #06212a;
  --color-deep-2: #0a2e39;

  /* Status colors (used sparingly) */
  --color-warning: #9a5b1d;
  --color-error: #a13a3a;
  --color-success: #3f7a4e;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.15 0.03 220 / 0.08);
  --shadow-md: 0 6px 20px oklch(0.15 0.03 220 / 0.10);
  --shadow-lg: 0 20px 48px oklch(0.15 0.03 220 / 0.16);

  --content-narrow: 640px;
  --content-default: 980px;
  --content-wide: 1240px;
  --content-full: 100%;

  --font-display: 'General Sans', 'Segoe UI', sans-serif;
  --font-body: 'Satoshi', 'Segoe UI', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #071318;
  --color-surface: #0c1b21;
  --color-surface-2: #0f222a;
  --color-surface-offset: #112730;
  --color-surface-offset-2: #142c34;
  --color-surface-dynamic: #1a343e;
  --color-divider: #1d3941;
  --color-border: #24444e;

  --color-text: #dceaee;
  --color-text-muted: #8facb4;
  --color-text-faint: #5c7982;
  --color-text-inverse: #0c1b21;

  --color-primary: #55c8de;
  --color-primary-hover: #7ad6e6;
  --color-primary-active: #3aa9bf;
  --color-primary-highlight: #163a42;

  --color-deep: #030d11;
  --color-deep-2: #061a20;

  --color-warning: #d99657;
  --color-error: #d97a7a;
  --color-success: #7bc48d;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.35);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #071318;
    --color-surface: #0c1b21;
    --color-surface-2: #0f222a;
    --color-surface-offset: #112730;
    --color-surface-offset-2: #142c34;
    --color-surface-dynamic: #1a343e;
    --color-divider: #1d3941;
    --color-border: #24444e;
    --color-text: #dceaee;
    --color-text-muted: #8facb4;
    --color-text-faint: #5c7982;
    --color-text-inverse: #0c1b21;
    --color-primary: #55c8de;
    --color-primary-hover: #7ad6e6;
    --color-primary-active: #3aa9bf;
    --color-primary-highlight: #163a42;
    --color-deep: #030d11;
    --color-deep-2: #061a20;
  }
}

/* Type scale */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-28: 7rem;
  --space-32: 8rem;
}

/* ============================================================
   Global
   ============================================================ */

body {
  overflow-x: hidden;
}

.wrap {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 5vw, var(--space-12));
}

.wrap--narrow {
  max-width: var(--content-default);
}

section {
  position: relative;
}

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.eyebrow::before {
  content: '';
  width: 20px;
  height: 1.5px;
  background: var(--color-primary);
  display: inline-block;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.section-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: var(--space-3);
  max-width: 20ch;
}

.section-lede {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-4);
  max-width: 58ch;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top var(--transition-interactive);
}
.skip-link:focus {
  top: var(--space-4);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-sm);
  min-height: 44px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-inverse {
  background: #ffffff;
  color: #06212a;
}
.btn-inverse:hover {
  background: #cfe8ed;
}

.btn-icon {
  transition: transform var(--transition-interactive);
}
.btn:hover .btn-icon {
  transform: translateX(3px);
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(from var(--color-bg) l c h / 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-header.header--hidden {
  transform: translateY(-100%);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.brand-logo {
  width: 52px;
  height: 52px;
  color: var(--color-primary);
  flex-shrink: 0;
  object-fit: contain;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
}
.brand-sub {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.main-nav ul {
  display: flex;
  gap: var(--space-6);
}
.main-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}
.main-nav a:hover {
  color: var(--color-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}
.theme-toggle:hover {
  background: var(--color-surface-offset);
  color: var(--color-primary);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--color-text);
}

@media (min-width: 861px) {
  .site-header .wrap {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
  .brand {
    order: 2;
    justify-self: center;
  }
  .main-nav {
    order: 1;
    justify-self: start;
  }
  .header-actions {
    order: 3;
    justify-self: end;
  }
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  color: var(--color-text-inverse);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    oklch(0.1 0.03 220 / 0.35) 0%,
    oklch(0.08 0.03 220 / 0.55) 55%,
    oklch(0.05 0.03 220 / 0.88) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-block: var(--space-24) var(--space-16);
  max-width: 760px;
  width: 100%;
}

.hero-logo {
  display: block;
  width: 128px;
  height: 128px;
  margin: 0 auto var(--space-6);
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.4));
}

.hero-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a9dbe6;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.hero-eyebrow::before {
  content: '';
  width: 20px;
  height: 1.5px;
  background: #a9dbe6;
}

.hero-title {
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: 1.05;
  margin-top: var(--space-5);
  color: #ffffff;
}
.hero-title em {
  font-style: normal;
  color: #8fd8e8;
}

.hero-desc {
  font-size: var(--text-lg);
  color: #d9edf1;
  margin-top: var(--space-6);
  max-width: 52ch;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-10);
  flex-wrap: wrap;
}

.hero-actions .btn-ghost {
  border-color: oklch(1 0 0 / 0.35);
  color: #fff;
}
.hero-actions .btn-ghost:hover {
  border-color: #fff;
  color: #fff;
  background: oklch(1 0 0 / 0.08);
}

/* Stat strip below hero */
.stat-strip {
  background: var(--color-deep);
  color: var(--color-text-inverse);
}
.stat-strip .wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-block: var(--space-8);
}
.stat-item {
  padding-inline: var(--space-5);
  border-left: 1px solid oklch(1 0 0 / 0.12);
}
.stat-item:first-child {
  border-left: none;
  padding-left: 0;
}
.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: #8fd8e8;
}
.stat-label {
  font-size: var(--text-xs);
  color: #b9d3d9;
  margin-top: var(--space-1);
  letter-spacing: 0.02em;
}

/* ============================================================
   Services
   ============================================================ */

.services {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}

.services-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-10);
  flex-wrap: wrap;
  margin-bottom: clamp(var(--space-10), 6vw, var(--space-16));
}

.service-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--space-6);
  padding-block: clamp(var(--space-8), 5vw, var(--space-12));
  border-top: 1px solid var(--color-divider);
}
.service-row:last-child {
  border-bottom: 1px solid var(--color-divider);
}

.service-num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text-faint);
  font-weight: 500;
  padding-top: var(--space-1);
}

.service-body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(var(--space-8), 5vw, var(--space-16));
  align-items: center;
}

.service-row--reverse .service-body {
  direction: rtl;
}
.service-row--reverse .service-body > * {
  direction: ltr;
}

.service-text h3 {
  font-size: var(--text-xl);
  font-weight: 600;
}
.service-text p {
  color: var(--color-text-muted);
  margin-top: var(--space-4);
  font-size: var(--text-base);
}
.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}
.service-tags span {
  font-size: var(--text-xs);
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-weight: 500;
}

.service-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--color-surface-offset);
}
.service-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-row--full .service-body {
  grid-template-columns: 1fr;
}
.service-row--full .service-media {
  aspect-ratio: 21/9;
}

/* ============================================================
   Approach
   ============================================================ */

.approach {
  padding-block: clamp(var(--space-16), 8vw, var(--space-28));
  background: var(--color-surface-offset);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}

.approach-header {
  max-width: 640px;
  margin-bottom: clamp(var(--space-10), 6vw, var(--space-16));
}

.approach-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
}

.approach-step {
  position: relative;
  padding-top: var(--space-6);
  border-top: 2px solid var(--color-primary);
}
.approach-step-num {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  font-weight: 600;
}
.approach-step h4 {
  font-size: var(--text-lg);
  margin-top: var(--space-3);
  font-weight: 600;
}
.approach-step p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
}

/* ============================================================
   About
   ============================================================ */

.about {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}

.about-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(var(--space-10), 6vw, var(--space-20));
  align-items: center;
}

.about-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3.2;
}
.about-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: var(--space-3);
  max-width: 24ch;
}

.about-text p {
  color: var(--color-text-muted);
  margin-top: var(--space-5);
  font-size: var(--text-base);
}

.about-credentials {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.credential-row {
  display: flex;
  gap: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}
.credential-row:first-child {
  border-top: none;
  padding-top: 0;
}
.credential-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-width: 140px;
  flex-shrink: 0;
  padding-top: 2px;
}
.credential-value {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
}

/* ============================================================
   Clients
   ============================================================ */

.clients {
  padding-block: clamp(var(--space-14), 7vw, var(--space-24));
  border-top: 1px solid var(--color-divider);
}

.clients-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-10), 6vw, var(--space-16));
  align-items: start;
}

.client-list {
  display: flex;
  flex-direction: column;
}
.client-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: var(--space-5);
  border-top: 1px solid var(--color-divider);
  font-size: var(--text-base);
  font-weight: 500;
}
.client-item:last-child {
  border-bottom: 1px solid var(--color-divider);
}
.client-item span.tag {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 400;
}

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

.cta {
  background: var(--color-deep);
  color: var(--color-text-inverse);
  padding-block: clamp(var(--space-16), 9vw, var(--space-28));
}

.cta-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-10);
  flex-wrap: wrap;
}

.cta-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  max-width: 16ch;
  color: #fff;
}

.cta-sub {
  color: #b9d3d9;
  margin-top: var(--space-4);
  max-width: 48ch;
  font-size: var(--text-base);
}

.cta-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.cta-email {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: #8fd8e8;
  font-weight: 500;
}
.cta-email:hover {
  color: #fff;
}

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

.site-footer {
  padding-block: var(--space-10);
  border-top: 1px solid var(--color-divider);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.footer-brand .brand-logo {
  width: 24px;
  height: 24px;
}
.footer-nav {
  display: flex;
  gap: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.footer-nav a:hover {
  color: var(--color-primary);
}
.footer-meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 860px) {
  .main-nav ul {
    display: none;
  }
  .menu-toggle {
    display: grid;
  }
  .header-actions .btn {
    display: none;
  }
  .brand-sub {
    display: none;
  }
  .brand-name {
    font-size: var(--text-xs);
  }
  .brand-logo {
    width: 40px;
    height: 40px;
  }
  .site-header .wrap {
    padding-block: var(--space-3);
  }

  .stat-strip .wrap {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
  .stat-item {
    border-left: none;
    padding-left: 0;
  }
  .stat-item:nth-child(odd) {
    border-right: 1px solid oklch(1 0 0 / 0.12);
  }

  .service-body,
  .service-row--reverse .service-body {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .service-row {
    grid-template-columns: 40px 1fr;
  }

  .approach-steps {
    grid-template-columns: 1fr 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-media {
    order: -1;
  }

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

  .cta-grid {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .approach-steps {
    grid-template-columns: 1fr;
  }
  .hero-content {
    padding-block: var(--space-16) var(--space-12);
  }
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-logo {
    width: 88px;
    height: 88px;
    margin-bottom: var(--space-5);
  }
}

/* Mobile nav drawer */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--color-bg);
  display: none;
  flex-direction: column;
  padding: var(--space-6);
}
.mobile-nav.is-open {
  display: flex;
}
.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-10);
}
.mobile-nav a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  padding-block: var(--space-3);
  display: block;
  border-bottom: 1px solid var(--color-divider);
}
.mobile-nav-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Remove decorative dashes before eyebrow labels */
.eyebrow::before,
.hero-eyebrow::before {
  display: none;
}

/* ============================================================
   Equity & Environmental Justice
   ============================================================ */
.equity {
  background: var(--color-deep-2);
  color: #e6f1f4;
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}
.equity-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(var(--space-10), 6vw, var(--space-20));
  align-items: start;
}
.eyebrow--light { color: #7fd3e3; }
.equity-title { color: #ffffff; }
.equity-lede { color: #b7ccd2; }
.equity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.equity-list li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: var(--space-4);
  padding-block: var(--space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.equity-num {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #7fd3e3;
  padding-top: 0.2em;
  font-variant-numeric: tabular-nums;
}
.equity-list h3 {
  font-size: var(--text-base);
  font-weight: 600;
  color: #ffffff;
}
.equity-list p {
  font-size: var(--text-sm);
  color: #b7ccd2;
  margin-top: var(--space-2);
  max-width: 52ch;
}
@media (max-width: 860px) {
  .equity-grid { grid-template-columns: 1fr; }
}

/* Clients: single column after list removal */
.clients-grid { grid-template-columns: 1fr; }
.clients .section-title { max-width: 24ch; }
