/* ==========================================================================
   ClearPath Public Services — styles
   Mobile-first. Breakpoints: 768px (tablet), 1024px (desktop).
   ========================================================================== */

:root {
  --navy: #0A1A4A;
  --navy-2: #13275F;
  --orange: #F26B1D;
  --orange-text: #A8460F;   /* darker orange for small text on light backgrounds (AA) */
  --gray: #ECEAE6;
  --gray-line: #C9C5BE;
  --white: #FFFFFF;
  --ink: #1A1A1A;
  --ink-soft: #4A4A4A;
  --on-navy-soft: #C7CEE3;
  --error: #B3261E;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --header-h: 72px;
  --container: 1200px;
  --radius: 4px;
  --section-pad: clamp(4.5rem, 10vw, 8.5rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 { margin: 0; font-weight: 300; line-height: 1.12; letter-spacing: -0.02em; }

p { margin: 0 0 1rem; }

ul, ol { margin: 0; padding: 0; list-style: none; }

address { font-style: normal; }

section[id] { scroll-margin-top: var(--header-h); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --- Focus ---------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
  border-radius: 2px;
}

.section-navy :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--orange);
}

.skip-link {
  position: absolute;
  top: -100px; left: 1rem;
  z-index: 200;
  padding: .75rem 1rem;
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; outline-color: var(--orange); }

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .8rem 1.75rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

/* Navy text on orange keeps AA contrast (≈5.5:1) */
.btn-accent {
  background: var(--orange);
  color: var(--navy);
}
.btn-accent:hover { background: #FF8442; }
.btn-accent:active { transform: translateY(1px); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--white); }

/* --- Header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: #E2E0DC;
  box-shadow: 0 6px 20px rgba(10, 26, 74, .06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--navy);
  text-decoration: none;
}

.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px; height: 48px;
  padding: 12px;
  margin-right: -12px;
  background: none;
  border: 0;
  cursor: pointer;
}
.menu-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--navy);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile dropdown */
.primary-nav {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid #E2E0DC;
  box-shadow: 0 16px 30px rgba(10, 26, 74, .12);
  display: none;
}
.primary-nav.is-open { display: block; }

.nav-list {
  display: flex;
  flex-direction: column;
  padding: .5rem 1.5rem 1.5rem;
}
.nav-list li { border-bottom: 1px solid #ECEAE6; }
.nav-list li.nav-cta-item { border-bottom: 0; padding-top: 1.25rem; }

.nav-link {
  position: relative;
  display: block;
  padding: 1rem 0;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.nav-link:hover { color: var(--navy); }
.nav-link.is-active { color: var(--navy); font-weight: 600; }
.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -1.5rem; top: 50%;
  width: 4px; height: 1.5rem;
  transform: translateY(-50%);
  background: var(--orange);
}

.nav-cta { width: 100%; }

/* --- Sections ------------------------------------------------------------- */

.section { padding-block: var(--section-pad); }
.section-light { background: var(--gray); }
.section-white { background: var(--white); }
.section-navy { background: var(--navy); color: var(--white); }

.split {
  display: grid;
  gap: 2.5rem;
}

.section-title {
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  color: var(--navy);
}
.section-navy .section-title { color: var(--white); }

.section-intro {
  margin-top: 1.5rem;
  max-width: 26rem;
  font-size: 1.125rem;
  color: var(--on-navy-soft);
}

.lead {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, #1D3478 0%, rgba(29, 52, 120, 0) 55%),
    linear-gradient(160deg, #0A1A4A 0%, #081440 100%);
  padding-block: 3.5rem 4.5rem;
}

.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-pattern { width: 100%; height: 100%; }

/* Faint grid overlay */
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 60%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 60%);
}

.hero-inner { position: relative; }

.hero-card {
  background: var(--white);
  padding: 2.25rem 1.5rem 2.5rem;
  border-radius: var(--radius);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .25);
  max-width: 46rem;
}

.eyebrow {
  margin-bottom: 1.25rem;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange-text);
}

.hero-title {
  font-size: clamp(2.5rem, 8.5vw, 5rem);
  color: var(--navy);
}

.hero-text {
  margin: 1.5rem 0 2rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* --- Services ------------------------------------------------------------- */

.service-grid {
  display: grid;
  gap: 1.25rem;
}

.service-card {
  background: var(--gray);
  color: var(--ink);
  padding: 2rem 1.75rem 2.25rem;
  border-radius: var(--radius);
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  margin-bottom: 1.5rem;
  border-radius: 50%;
  background: var(--navy);
  color: var(--orange);
}

.service-title {
  margin-bottom: .85rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  color: var(--navy);
}

.service-card p { margin: 0; color: var(--ink-soft); }

/* --- Approach ------------------------------------------------------------- */

.approach-list { border-top: 1px solid var(--gray-line); }

.approach-row {
  display: grid;
  gap: .35rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--gray-line);
}

.approach-name {
  display: flex;
  align-items: center;
  gap: .85rem;
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  color: var(--navy);
}

.star { flex: none; color: var(--navy); }

.approach-tagline {
  margin: 0;
  padding-left: calc(16px + .85rem);
  font-size: 1.0625rem;
  color: var(--ink-soft);
}

/* --- Contact -------------------------------------------------------------- */

.contact-details {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: 2rem;
  font-size: 1.0625rem;
}
.contact-details a {
  color: var(--navy);
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
  border-bottom: 1px solid transparent;
  width: fit-content;
}
.contact-details a:hover { border-bottom-color: var(--orange); }

.contact-form { display: grid; gap: 1.25rem; }

.form-note { margin: 0; font-size: .9375rem; color: var(--ink-soft); }

.form-row { display: grid; gap: 1.25rem; }

.field { display: grid; gap: .4rem; }

.field label {
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink);
}
.req { color: var(--orange-text); }

.field input,
.field textarea {
  width: 100%;
  padding: .8rem .2rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid #75716A;  /* ≥3:1 against white */
  border-radius: 0;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 8rem; }

.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-bottom-color: var(--navy);
  box-shadow: 0 2px 0 0 var(--navy);
  background: #F7F6F4;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-bottom-color: var(--error);
}

.field-error {
  min-height: 0;
  margin: 0;
  font-size: .875rem;
  font-weight: 500;
  color: var(--error);
}
.field-error:empty { display: none; }

.form-status {
  margin: 0;
  padding: .85rem 1rem;
  border-left: 4px solid var(--error);
  background: #FBEDEC;
  color: var(--error);
  font-weight: 500;
}

.btn-submit { width: 100%; }
.btn-submit[disabled] { opacity: .7; cursor: progress; }

.form-success {
  padding: 2.5rem 2rem;
  background: var(--gray);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius);
  color: var(--ink);
}
.form-success svg { color: var(--navy); margin-bottom: 1rem; }
.form-success h3 { font-size: 1.85rem; color: var(--navy); margin-bottom: .75rem; }
.form-success p { margin: 0; color: var(--ink-soft); }
.form-success:focus { outline: none; }
.form-success:focus-visible { outline: 3px solid var(--navy); }

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  background: var(--navy);
  color: var(--white);
  padding-top: clamp(3.5rem, 8vw, 6rem);
}

.footer-inner {
  display: grid;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
}

.footer-logo {
  font-size: clamp(3rem, 13vw, 7.5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--white);
  text-decoration: none;
}

.footer-cols {
  display: grid;
  gap: 1rem;
  color: var(--on-navy-soft);
}
.footer-cols a {
  color: var(--white);
  text-decoration: none;
  overflow-wrap: anywhere;
  border-bottom: 1px solid transparent;
}
.footer-cols a:hover { border-bottom-color: var(--orange); }

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-block: 1.75rem 2.25rem;
  font-size: .9375rem;
  color: var(--on-navy-soft);
}
.footer-bottom p { margin: 0; }

.back-to-top {
  color: var(--white);
  font-weight: 500;
  text-decoration: none;
  width: fit-content;
}
.back-to-top span { color: var(--orange); margin-left: .25rem; }
.back-to-top:hover { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 4px; }

/* --- Reveal on scroll ----------------------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Tablet ≥ 768px
   ========================================================================== */

@media (min-width: 768px) {
  :root { --header-h: 80px; }

  .container { padding-inline: 2.5rem; }

  .hero { padding-block: 5.5rem 7rem; }
  .hero-card { padding: 3.5rem 3.25rem 3.75rem; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; }

  .form-row { grid-template-columns: 1fr 1fr; }
  .btn-submit { width: auto; justify-self: start; min-width: 12rem; }

  .service-grid { grid-template-columns: 1fr 1fr; padding-bottom: 3rem; }
  .service-card:nth-child(even) { transform: translateY(3rem); }
  .js .service-card.reveal:nth-child(even) { transform: translateY(calc(3rem + 24px)); }
  .js .service-card.reveal.is-visible:nth-child(even) { transform: translateY(3rem); }

  .approach-row {
    grid-template-columns: minmax(12rem, 1fr) 1.4fr;
    align-items: center;
    gap: 2rem;
    padding: 2.25rem 0;
  }
  .approach-tagline { padding-left: 0; font-size: 1.125rem; }

  .footer-cols { grid-template-columns: repeat(3, auto); justify-content: start; gap: 2.5rem; }
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ==========================================================================
   Desktop ≥ 1024px
   ========================================================================== */

@media (min-width: 1024px) {
  .menu-toggle { display: none; }

  .primary-nav,
  .primary-nav.is-open {
    position: static;
    display: block;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: 2.25rem;
    padding: 0;
  }
  .nav-list li { border: 0; }
  .nav-list li.nav-cta-item { padding: 0 0 0 .5rem; }

  .nav-link {
    padding: .5rem 0;
    font-size: 1rem;
  }
  .nav-link.is-active::before {
    left: 0; right: 0; top: auto; bottom: -2px;
    width: auto; height: 2px;
    transform: none;
  }

  .nav-cta { width: auto; min-height: 44px; padding: .65rem 1.4rem; }

  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 4rem;
    align-items: start;
  }

  .hero { padding-block: 7.5rem 9rem; }
  .hero-card { padding: 4.5rem 4.5rem 4.75rem; max-width: 52rem; }

  .service-grid { gap: 1.5rem; }
  .service-card { padding: 2.5rem 2.25rem 2.75rem; }

  .footer-inner {
    grid-template-columns: auto 1fr;
    align-items: end;
    gap: 4rem;
  }
  .footer-cols { justify-content: end; }
}

/* --- Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  .js .reveal,
  .js .reveal.is-visible { opacity: 1; transform: none; }
  .js .service-card.reveal:nth-child(even),
  .js .service-card.reveal.is-visible:nth-child(even) { transform: none; }
}

@media (prefers-reduced-motion: reduce) and (min-width: 768px) {
  .js .service-card.reveal:nth-child(even),
  .js .service-card.reveal.is-visible:nth-child(even) { transform: translateY(3rem); }
}
