/* ============================================================
   Rapheon AI — Living Water design system
   Palette is WCAG-AA verified per brand spec.
   ============================================================ */

:root {
  --navy:       #0A2540; /* primary bg, authority      */
  --teal:       #14B8A6; /* accent: current line, CTAs */
  --aqua:       #7DD3C8; /* secondary accent, data pts */
  --sea-white:  #F6FBFA; /* light surfaces             */
  --deep-ink:   #10212F; /* text on light              */
  --gold:       #E9A23B; /* rare highlight (~10% max)  */
  --deep-teal:  #0F766E; /* links on LIGHT surfaces    */

  --navy-soft:  #0E2D4D; /* raised surface on navy     */
  --ink-muted:  #4A5A66; /* muted text on light        */
  --aqua-soft:  rgba(125, 211, 200, 0.85); /* muted on navy */

  --maxw: 1120px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --radius: 16px;

  --font-display: "Space Grotesk", "Carlito", "DejaVu Sans", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----------------------------- Reset ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--deep-ink);
  background: var(--navy);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
ul { list-style: none; padding: 0; }
a { color: inherit; }

/* ----------------------------- Layout ---------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 760px; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--deep-teal);
  margin-bottom: 0.9rem;
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 1.1rem + 2.4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--deep-ink);
  max-width: 18ch;
}

/* ------------------------- Accessibility ------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--teal);
  color: var(--navy);
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

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

/* Links on LIGHT surfaces — Deep Teal (5.2:1) per spec */
.about a, .build a { color: var(--deep-teal); }

/* Links on NAVY surfaces — Aqua/Teal both pass AA on navy */
.link-on-navy {
  color: var(--aqua);
  text-decoration: underline;
  text-decoration-color: rgba(125, 211, 200, 0.45);
  text-underline-offset: 0.18em;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}
.link-on-navy:hover {
  color: #9FE3DA;
  text-decoration-color: currentColor;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 80% 0%, #103257 0%, var(--navy) 55%) ,
    var(--navy);
  color: var(--sea-white);
  display: flex;
  flex-direction: column;
  min-height: 92svh;
  padding-block: clamp(1.5rem, 4vh, 2.5rem) clamp(3rem, 8vh, 6rem);
}

.current-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.ghost-line {
  fill: none;
  stroke: var(--aqua);
  stroke-width: 1.5;
  stroke-opacity: 0.12;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.current-line {
  fill: none;
  stroke: url(#line-fade);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(20, 184, 166, 0.45));
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation: draw-line 2.4s var(--ease) 0.2s forwards;
}
.data-point {
  fill: var(--aqua);
  filter: drop-shadow(0 0 12px rgba(125, 211, 200, 0.8));
  opacity: 0;
  animation: pop-dot 0.6s var(--ease) 2.3s forwards;
}

@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes pop-dot {
  0% { opacity: 0; transform: scale(0); transform-origin: center; }
  60% { opacity: 1; transform: scale(1.35); }
  100% { opacity: 1; transform: scale(1); }
}

.hero__top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand { display: inline-block; }
.brand img { height: clamp(40px, 7vw, 56px); width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.15rem, 3vw, 2rem);
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--aqua-soft);
}
.site-nav a {
  position: relative;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.42rem;
  height: 2px;
  border-radius: 999px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s var(--ease);
}
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--sea-white);
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
}
.site-nav .site-nav__contact {
  color: var(--navy);
  background: rgba(125, 211, 200, 0.94);
  padding: 0.58rem 0.95rem;
  border-radius: 999px;
  box-shadow: 0 12px 30px -18px rgba(20, 184, 166, 0.9);
}
.site-nav .site-nav__contact::after {
  display: none;
}
.site-nav .site-nav__contact:hover,
.site-nav .site-nav__contact:focus-visible {
  color: var(--navy);
  background: var(--teal);
}

.hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(300px, 0.78fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: auto;
  margin-bottom: auto;
  padding-block: clamp(2rem, 6vh, 4rem);
}
.hero__copy {
  max-width: 680px;
}

.hero__headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 1.4rem + 5.2vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--sea-white);
  max-width: 14ch;
}
.hero__subhead {
  margin-top: 1.25rem;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  line-height: 1.5;
  color: var(--aqua-soft);
  max-width: 40ch;
}

.hero__cta { margin-top: clamp(2rem, 5vh, 3rem); }

.hero__visual {
  justify-self: end;
  width: min(47vw, 520px);
  min-width: 300px;
  filter: drop-shadow(0 34px 58px rgba(2, 18, 33, 0.26));
}
.hero__visual img {
  width: 100%;
  height: auto;
}

/* CTA — Living Teal fill + Midnight Navy text (6.2:1). Never white text. */
.btn {
  display: inline-block;
  background: var(--teal);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  padding: 1.05rem 1.9rem;
  border-radius: 999px;
  max-width: 100%;
  box-shadow: 0 10px 30px -10px rgba(20, 184, 166, 0.6);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.btn:hover {
  background: #19cdb9;
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -12px rgba(20, 184, 166, 0.75);
}
.btn:active { transform: translateY(0); }

.hero__fallback {
  margin-top: 1.1rem;
  font-size: 0.95rem;
  color: var(--aqua-soft);
}

/* ============================================================
   WHAT WE BUILD  (light surface)
   ============================================================ */
.build {
  background: var(--sea-white);
  color: var(--deep-ink);
  padding-block: clamp(3.5rem, 10vh, 7rem);
}
.build .section-heading { margin-bottom: clamp(2.5rem, 6vh, 4rem); }

.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

.card {
  position: relative;
  background: #fff;
  border: 1px solid #E3EDEC;
  border-radius: var(--radius);
  padding: 2rem 1.75rem 2.1rem;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--aqua));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: #CDE3E0;
  box-shadow: 0 22px 48px -28px rgba(10, 37, 64, 0.4);
}
.card:hover::before { transform: scaleX(1); }

.card__visual {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border: 1px solid #E0EEEC;
  border-radius: 14px;
  margin-bottom: 1.4rem;
  background: var(--sea-white);
}

.card__index {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--teal);
}
.card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin-top: 0.75rem;
  color: var(--deep-ink);
}
.card__body {
  margin-top: 0.7rem;
  color: var(--ink-muted);
  font-size: 1rem;
}

/* ============================================================
   PROOF  (light surface, outcome band)
   ============================================================ */
.proof {
  background: #fff;
  color: var(--deep-ink);
  padding-block: clamp(3.5rem, 10vh, 7rem);
  border-top: 1px solid #E3EDEC;
}
.proof__grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.proof__intro {
  max-width: 620px;
}
.proof .section-heading {
  max-width: 18ch;
}
.proof__lede {
  margin-top: 1.25rem;
  max-width: 44ch;
  color: #2A3A45;
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.18rem);
}
.proof__list {
  display: grid;
  gap: 1rem;
}
.proof__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.25rem 0;
  border-top: 1px solid #E3EDEC;
}
.proof__item:last-child {
  border-bottom: 1px solid #E3EDEC;
}
.proof__mark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #DDF3F0;
  margin-top: 0.1rem;
}
.proof__mark::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(20, 184, 166, 0.12);
}
.proof__item h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.18rem;
  line-height: 1.25;
  color: var(--deep-ink);
}
.proof__item p {
  margin-top: 0.35rem;
  color: var(--ink-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

/* ============================================================
   PROCESS  (light surface, working rhythm)
   ============================================================ */
.process {
  background: var(--sea-white);
  color: var(--deep-ink);
  padding-block: clamp(3.5rem, 10vh, 7rem);
  border-top: 1px solid #E3EDEC;
}
.process__intro {
  display: grid;
  gap: 0;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}
.process .section-heading {
  max-width: 23ch;
}
.process__steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid #DCE9E7;
}
.process__step {
  position: relative;
  display: grid;
  gap: 0.75rem;
  padding: 1.55rem 0;
  border-bottom: 1px solid #DCE9E7;
}
.process__number {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--deep-teal);
}
.process__step h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.55rem);
  line-height: 1.18;
  color: var(--deep-ink);
}
.process__step p {
  max-width: 34ch;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* ============================================================
   ABOUT  (light, tinted surface)
   ============================================================ */
.about {
  background:
    linear-gradient(180deg, var(--sea-white) 0%, #ECF6F4 100%);
  color: var(--deep-ink);
  padding-block: clamp(3.5rem, 10vh, 7rem);
  border-top: 1px solid #E3EDEC;
}
.about .section-heading { max-width: 22ch; margin-bottom: 1.5rem; }
.about__body {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.2rem);
  line-height: 1.7;
  color: #2A3A45;
}

/* ============================================================
   CONTACT  (navy)
   ============================================================ */
.contact {
  background:
    radial-gradient(120% 100% at 20% 0%, #103257 0%, var(--navy) 60%),
    var(--navy);
  color: var(--sea-white);
  padding-block: clamp(3.5rem, 10vh, 7rem);
  border-top: 1px solid rgba(125, 211, 200, 0.14);
}
.eyebrow--on-navy { color: var(--aqua); }
.section-heading--on-navy { color: var(--sea-white); max-width: 20ch; }
.contact__lede {
  margin-top: 1.1rem;
  color: var(--aqua-soft);
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.18rem);
  max-width: 46ch;
}

.form {
  margin-top: clamp(2rem, 5vh, 3rem);
  display: grid;
  gap: 1.25rem;
  max-width: 560px;
}
.field { display: grid; gap: 0.45rem; }
.field label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--sea-white);
}
.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--deep-ink);
  background: var(--sea-white);
  border: 1px solid #BFD6D2;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  width: 100%;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder,
.field textarea::placeholder { color: #6A7B86; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.35);
}
.field input:user-invalid,
.field textarea:user-invalid { border-color: #E9A23B; }

/* Honeypot — visually & programmatically removed from real users */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__submit { justify-self: start; margin-top: 0.25rem; cursor: pointer; border: none; }
.form__submit[disabled] { opacity: 0.6; cursor: progress; }

.form__status {
  display: block;
  font-size: 0.98rem;
  min-height: 1.2em;
  margin: 0;
}
.form__status.is-error { color: var(--gold); }
.form__status.is-success { color: var(--aqua); }

/* Inline field-level error (email validation) */
.field__error {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #B45309; /* amber-700 — stronger than gold on white */
  min-height: 1.1em;
}
.field__error:not(:empty)::before {
  content: "⚠";
  font-size: 0.8rem;
  flex-shrink: 0;
}
.field.is-invalid input,
.field.is-invalid textarea {
  border: 2px solid #D97706; /* amber-600 — visibly distinct from the teal focus ring */
  background: #FFFBEB; /* amber-50 — warm tint makes the field itself read as "attention" */
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.18);
  color: var(--deep-ink);
}

/* Success card — shown after a successful send */
.form__success {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 1rem;
  row-gap: 0.25rem;
  align-items: start;
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(125, 211, 200, 0.4);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  opacity: 0;
  transform: scale(0.97) translateY(10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.form__success.is-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.form__success-icon {
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  padding-top: 0.1rem;
}
.form__success-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--sea-white);
  margin: 0;
  align-self: end;
}
.form__success-copy {
  font-size: 0.95rem;
  color: var(--aqua-soft);
  margin: 0;
  line-height: 1.55;
}

/* Hide form fields once a message has been sent */
.form.is-sent .field,
.form.is-sent .hp,
.form.is-sent .cf-turnstile,
.form.is-sent .form__submit,
.form.is-sent .form__status {
  display: none;
}

/* ============================================================
   FOOTER  (navy)
   ============================================================ */
.footer {
  background: var(--navy);
  color: var(--sea-white);
  padding-block: clamp(3rem, 7vh, 4.5rem) 2rem;
  border-top: 1px solid rgba(125, 211, 200, 0.14);
}
.footer__grid {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}
.footer__brand img { height: 44px; width: auto; }
.footer__pron {
  margin-top: 0.9rem;
  color: var(--aqua-soft);
  font-size: 0.95rem;
}
.footer__pron strong { color: var(--sea-white); font-weight: 600; }

.footer__contact { display: flex; flex-direction: column; gap: 0.9rem; }
.footer__cta {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
}
.footer__social { display: flex; flex-direction: column; gap: 0.5rem; }
.footer__social a { font-size: 0.98rem; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.social-link__icon {
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0.36rem;
  border: 1px solid rgba(125, 211, 200, 0.32);
  border-radius: 999px;
  color: var(--aqua);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.social-link:hover .social-link__icon,
.social-link:focus-visible .social-link__icon {
  background: rgba(20, 184, 166, 0.13);
  border-color: rgba(125, 211, 200, 0.7);
  color: #9FE3DA;
}

.footer__base {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(125, 211, 200, 0.12);
}
.footer__base p { color: var(--aqua-soft); font-size: 0.85rem; }

/* ============================================================
   Entrance animations (staggered hero reveal)
   ============================================================ */
.hero__headline, .hero__subhead, .hero__cta, .hero__visual, .brand, .site-nav {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.9s var(--ease) forwards;
}
.brand { animation-delay: 0.05s; }
.site-nav { animation-delay: 0.12s; }
.hero__headline { animation-delay: 0.25s; }
.hero__subhead { animation-delay: 0.45s; }
.hero__cta { animation-delay: 0.65s; }
.hero__visual { animation-delay: 0.78s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ----------------------------- Tablet+ --------------------------- */
@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
  .proof__grid { grid-template-columns: 0.88fr 1fr; }
  .process__intro {
    grid-template-columns: 0.9fr 1fr;
    align-items: end;
  }
  .process__steps {
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 1px solid #DCE9E7;
  }
  .process__step {
    min-height: 280px;
    padding: 1.65rem 1.25rem 1.8rem;
    border-bottom: 0;
    border-right: 1px solid #DCE9E7;
  }
  .process__step:first-child {
    padding-left: 0;
  }
  .process__step:last-child {
    border-right: 0;
    padding-right: 0;
  }
  .footer__grid {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
  .footer__social { flex-direction: row; gap: 1.5rem; }
}

/* ----------------------------- Mobile ---------------------------- */
@media (max-width: 719px) {
  .hero {
    min-height: 92svh;
    padding-block: 1.35rem 2.75rem;
  }
  .hero__content {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding-block: clamp(2.25rem, 5vh, 3.25rem);
  }
  .brand img {
    height: 42px;
  }
  .site-nav {
    gap: 0;
    font-size: 0.92rem;
  }
  .site-nav a:not(.site-nav__contact) {
    display: none;
  }
  .site-nav .site-nav__contact {
    padding: 0.52rem 0.85rem;
  }
  .hero__headline {
    font-size: clamp(2.45rem, 12vw, 3.35rem);
    max-width: 10.5ch;
  }
  .hero__subhead {
    max-width: 30ch;
  }
  .hero__cta {
    margin-top: 1.75rem;
  }
  .hero__cta .btn {
    width: min(100%, 350px);
    padding-inline: 1.45rem;
  }
  .hero__visual {
    justify-self: center;
    width: min(86vw, 330px);
    min-width: 0;
    margin-top: -0.6rem;
  }
  .card {
    padding: 1.25rem 1.2rem 1.5rem;
  }
  .card__visual {
    border-radius: 12px;
    margin-bottom: 1.15rem;
  }
  .proof__item {
    padding-block: 1.15rem;
  }
  .process__step {
    padding-block: 1.35rem;
  }
}

/* ------------------------- Reduced motion ------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .current-line { stroke-dashoffset: 0; }
  .data-point { opacity: 1; }
  .hero__headline, .hero__subhead, .hero__cta, .hero__visual, .brand, .site-nav { opacity: 1; transform: none; }
  /* Success card: skip scale/translate, fade only */
  .form__success { transform: none; transition: opacity 0.3s linear; }
}
