/* Living Water Tech — site styles.
   Self-hosted fonts, no CDN, no inline styles: the CSP in _headers stays all-'self'.

   DESIGN INTENT (see DESIGN.md):
   The signature element is the Continuity Line — a vertical timeline that carries
   the page's structure. It exists because the one thing this company has that a
   competitor cannot fabricate is elapsed time: a system still shipping releases
   years in. The line is information, not ornament, which is why it is the spine
   rather than a decoration hung off the side. */

/* ---------- fonts ---------- */
@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage-var.d73fd1f9.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "PublicSans";
  src: url("/fonts/publicsans-var.13dbb4bd.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "PlexMono";
  src: url("/fonts/plexmono.374e47b0.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ---------- tokens ----------
   Palette is 6 named values, each with one job. Deliberately NOT the SaaS
   white+blue default, and deliberately not the cream/serif/terracotta cluster:
   #F3F5F3 is a cool paper, green-leaning, distinct from the warm #F4F1EA that
   AI-generated pages converge on.
   Concept: water takes its colour from what it runs through — deep water, moss,
   silt, and the mineral (brass) it leaves behind. */
:root {
  --abyss:  #0B1A1D;   /* text, deep water                     */
  --moss:   #2C5449;   /* headings accent, structure           */
  /* --silt was #6E827A until measured: 3.73:1 on --paper, under the 4.5:1 that
     WCAG AA requires for body text. It carried .when, .nav, .tags and every
     service description — i.e. most of the small type on the page, which is
     precisely where contrast matters most. Now 5.5:1, measured not assumed. */
  --silt:   #55665F;   /* secondary text, the line itself      */
  --paper:  #F3F5F3;   /* page ground, cool paper              */
  /* #9A7328 measured 3.95:1 — fine for the timeline dots (non-text, 3:1 applies)
     but it also carries the .how labels, which are 12.5px text needing 4.5:1.
     Darkened to 5.0:1 so one token can serve both without a special case. */
  --brass:  #856320;   /* timeline nodes, mineral deposit      */
  --live:   #1F7A57;   /* "still running" signal — one use only*/

  --rule:   #D9E0DC;

  --step-0: 0.9375rem;
  --step-1: 1.0625rem;
  --step-2: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --step-3: clamp(1.6rem, 1.3rem + 1.5vw, 2.25rem);
  --step-4: clamp(2.4rem, 1.6rem + 4vw, 4.5rem);

  /* spacing scale — every gap comes from here, no stray values */
  --s1: 0.5rem;  --s2: 0.75rem; --s3: 1rem;   --s4: 1.5rem;
  --s5: 2rem;    --s6: 3rem;    --s7: 4.5rem; --s8: 7rem;

  --pad-x: clamp(1.25rem, 5vw, 3rem);
  --rail: 2.25rem;      /* distance from rail line to content */
}

@media (prefers-color-scheme: dark) {
  :root {
    --abyss:  #E4EBE7;
    --moss:   #8FC4B2;
    --silt:   #8A9C94;
    --paper:  #0A1114;
    --brass:  #C79A44;
    --live:   #3FBF8C;
    --rule:   #1E2C30;
  }
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--abyss);
  font-family: "PublicSans", ui-sans-serif, system-ui, sans-serif;
  font-size: var(--step-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 62rem; margin-inline: auto; padding-inline: var(--pad-x); }

a { color: var(--moss); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--abyss); }

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

h1, h2, h3 {
  font-family: "Bricolage", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 var(--s3);
  font-variation-settings: "wdth" 88;
}
h1 { font-size: var(--step-4); letter-spacing: -0.035em; max-width: 14ch; }
h2 { font-size: var(--step-3); letter-spacing: -0.02em; }
h3 { font-size: var(--step-2); letter-spacing: -0.012em; }

p { margin: 0 0 var(--s3); max-width: 64ch; }
.lede { font-size: var(--step-2); color: var(--silt); line-height: 1.5; max-width: 48ch; }

.mono {
  font-family: "PlexMono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.skip { position: absolute; left: -9999px; background: var(--abyss); color: var(--paper); padding: var(--s2) var(--s3); }
.skip:focus { left: var(--s3); top: var(--s3); z-index: 20; }

/* ---------- header — deliberately not a sticky bar with a pill CTA ---------- */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s4); padding-block: var(--s4);
}
.brand {
  font-family: "Bricolage", sans-serif; font-weight: 700; font-size: 1.05rem;
  letter-spacing: -0.03em; font-variation-settings: "wdth" 82;
  color: var(--abyss); text-decoration: none;
}
.nav { display: flex; gap: var(--s4); }
.nav a { color: var(--silt); text-decoration: none; font-size: var(--step-0); }
.nav a:hover { color: var(--abyss); }

/* ---------- hero ---------- */
.hero { padding-block: var(--s8) var(--s7); }
.hero h1 em {
  font-style: normal;
  color: var(--moss);
}
.hero .lede { margin-top: var(--s4); }
.hero-act { margin-top: var(--s5); display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; }
.btn {
  font-family: "PublicSans", sans-serif; font-size: var(--step-0); font-weight: 600;
  text-decoration: none; padding: var(--s2) var(--s4);
  background: var(--abyss); color: var(--paper);
  border-radius: 2px;   /* squared — the rounded pill belongs to the timeline nodes */
}
.btn:hover { background: var(--moss); color: var(--paper); }
.btn-plain { color: var(--silt); text-decoration: none; font-size: var(--step-0); }
.btn-plain:hover { color: var(--abyss); }

/* ---------- THE CONTINUITY LINE (signature) ----------
   One rail down the page. Entries hang off it at their real dates. Sections do
   not restart it; that continuity IS the argument. */
.rail { position: relative; padding-left: var(--rail); }
.rail::before {
  content: "";
  position: absolute; left: 5px; top: 0; bottom: 0;
  width: 1px; background: var(--rule);
}

.node { position: relative; padding-block: var(--s5); }
.node::before {                     /* the dot on the rail */
  content: "";
  position: absolute; left: calc(-1 * var(--rail) + 1px); top: calc(var(--s5) + 0.3em);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brass);
}
.node + .node { border-top: 1px solid var(--rule); }
.node .when { display: block; color: var(--silt); margin-bottom: var(--s2); }
.node h3 { margin-bottom: var(--s2); }
.node p { color: var(--abyss); }
.node p + p { margin-top: calc(-1 * var(--s1)); }

/* The one live signal on the page: this system is still shipping.
   Information, not decoration — and it is the only animation. */
.node.is-live::before { background: var(--live); }
.node.is-live::after {
  content: "";
  position: absolute; left: calc(-1 * var(--rail) - 3px); top: calc(var(--s5) + 0.3em - 4px);
  width: 17px; height: 17px; border-radius: 50%;
  border: 1px solid var(--live);
  animation: pulse 3.4s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(0.45); opacity: 0; }
  35%  { opacity: 0.75; }
  100% { transform: scale(1); opacity: 0; }
}

.tags { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); margin: var(--s3) 0 0; padding: 0; list-style: none; }
.tags li { color: var(--silt); }
.tags li::before { content: "· "; color: var(--rule); }
.tags li:first-child::before { content: ""; }

/* ---------- sections ---------- */
section { padding-block: var(--s7); }
.band { border-top: 1px solid var(--rule); }
.eyebrow {
  color: var(--silt); margin: 0 0 var(--s4);
  display: flex; align-items: baseline; gap: var(--s2);
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* services: a definition list, not a card grid */
.svc { display: grid; gap: 0; margin-top: var(--s5); }
.svc > div {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: var(--s3) var(--s5); padding-block: var(--s4);
  border-top: 1px solid var(--rule);
}
.svc > div:last-child { border-bottom: 1px solid var(--rule); }
.svc h3 { margin: 0; }
.svc p { margin: 0; color: var(--silt); }
.svc .lead-mark { color: var(--brass); }
@media (max-width: 44rem) {
  .svc > div { grid-template-columns: 1fr; gap: var(--s2); }
}

/* approach: numbered ONLY because these are sequential stages of an engagement */
.how { margin-top: var(--s5); display: grid; gap: var(--s5); }
.how > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--s4); }
.how .n { color: var(--brass); margin: 0; padding-top: 0.45em; }
@media (max-width: 34rem) { .how > div { grid-template-columns: 1fr; gap: var(--s1); } }
.how h3 { margin-bottom: var(--s1); }
.how p { margin: 0; color: var(--silt); }

/* ---------- contact ---------- */
.mail {
  font-family: "Bricolage", sans-serif; font-weight: 700;
  font-size: var(--step-3); letter-spacing: -0.025em; font-variation-settings: "wdth" 86;
  color: var(--abyss); text-decoration: none;
  border-bottom: 2px solid var(--brass); padding-bottom: 2px;
  display: inline-block; margin-block: var(--s3) var(--s4);
}
.mail:hover { color: var(--moss); border-color: var(--moss); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--rule); padding-block: var(--s5); color: var(--silt); }
.site-foot p { margin: 0 0 var(--s1); max-width: none; font-size: var(--step-0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .node.is-live::after { animation: none; opacity: 0.5; transform: scale(1); }
  * { transition: none !important; }
}
