/* Diamond Plumbing — styles (forked from the Emerald Plumbing site, re-coloured to the Diamond logo blues).
   Theme: light is the default; dark applies when the visitor's system is dark (or for this visit via the toggle).
   All colour pairs used for text were checked for WCAG 2.2 AA contrast (4.5:1 text, 3:1 large text / UI borders). */

:root {
  /* shared by both themes */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pad: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --bg-rgb: 244, 246, 249;
  --fg-rgb: 18, 22, 28;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --border-soft: rgba(0, 0, 0, 0.06);
  --field-border: #7a8392;          /* 3.8:1 on white: form fields need 3:1 to be visible */
  --text: #12161c;
  --text-muted: #4a525e;
  --text-faint: #5a626e;
  --titanium-3: #83898f;
  --shower-shadow: drop-shadow(0 14px 16px rgba(18, 30, 50, 0.26));

  --brand: #1d68c7;                 /* derived from the logo blue #2072d4, darkened to pass 4.5:1 as text */
  --brand-dim: #16559f;
  --brand-glow: rgba(29, 104, 199, 0.14);
  --on-brand: #ffffff;
  --water-rgb: 29, 104, 199;
  --ice: #0a6f94;
  --danger: #b42318;
  --todo-bg: #fff4d6;
  --todo-fg: #6b4300;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #06080c;
  --bg-rgb: 6, 8, 12;
  --fg-rgb: 255, 255, 255;
  --bg-elevated: #0c0f14;
  --card: #10141a;
  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.05);
  --field-border: #677182;
  --text: #f1f3f6;
  --text-muted: #a6adb8;
  --text-faint: #8d95a1;
  --titanium-3: #7d8389;
  --shower-shadow: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.45));

  --brand: #5c9dff;
  --brand-dim: #3d7fe0;
  --brand-glow: rgba(92, 157, 255, 0.18);
  --on-brand: #04122a;
  --water-rgb: 92, 157, 255;
  --ice: #8fd3ff;
  --danger: #ff8a80;
  --todo-bg: #3a2a00;
  --todo-fg: #ffe08a;
}

/* Follow the visitor's system by default (dark system -> dark; light, no preference or unsupported -> light). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #06080c;
    --bg-rgb: 6, 8, 12;
    --fg-rgb: 255, 255, 255;
    --bg-elevated: #0c0f14;
    --card: #10141a;
    --border: rgba(255, 255, 255, 0.09);
    --border-soft: rgba(255, 255, 255, 0.05);
    --field-border: #677182;
    --text: #f1f3f6;
    --text-muted: #a6adb8;
    --text-faint: #8d95a1;
    --titanium-3: #7d8389;
    --shower-shadow: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.45));

    --brand: #5c9dff;
    --brand-dim: #3d7fe0;
    --brand-glow: rgba(92, 157, 255, 0.18);
    --on-brand: #04122a;
    --water-rgb: 92, 157, 255;
    --ice: #8fd3ff;
    --danger: #ff8a80;
    --todo-bg: #3a2a00;
    --todo-fg: #ffe08a;
  }
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
img, svg, canvas { display: block; max-width: 100%; }
::selection { background: var(--brand); color: var(--on-brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.03em; line-height: 1.02; font-weight: 700; }
h2 { font-size: clamp(34px, 5.2vw, 72px); }
h3 { font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -0.02em; }
.accent { color: var(--brand); }
.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; }

.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 200; padding: 12px 18px; border-radius: 999px;
  background: var(--brand); color: var(--on-brand); font-weight: 600; transform: translateY(-160%); transition: transform 0.2s;
}
.skip-link:focus { transform: none; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 18px; display: flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }

/* Placeholder for details the business must supply before launch (legal name, CSLB licence number). */
.todo { background: var(--todo-bg); color: var(--todo-fg); outline: 1px dashed currentColor; outline-offset: 1px; border-radius: 4px; padding: 0 5px; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 28px; min-height: 48px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  will-change: transform;
}
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 0 0 0 var(--brand-glow); }
.btn-primary:hover { box-shadow: 0 0 0 8px var(--brand-glow); }
.btn-ghost { border: 1px solid var(--field-border); color: var(--text); background: rgba(var(--fg-rgb), 0.03); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-small { padding: 12px 18px; min-height: 44px; font-size: 14px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: progress; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s, transform 0.5s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(var(--bg-rgb), 0.78);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--border-soft);
}
.site-header.hide { transform: translateY(-100%); }
.site-header:focus-within { transform: none; }          /* never hide the header while a keyboard user is in it */
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px var(--pad); }
.brand-logo { display: block; flex: none; }
.brand-logo img { height: 46px; width: auto; }
.brand-logo-small img { height: 40px; }
.main-nav { display: flex; gap: 30px; }
.main-nav a { font-size: 14px; color: var(--text-muted); position: relative; padding: 4px 0; transition: color 0.3s; }
.main-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease); }
.main-nav a:hover { color: var(--text); }
.main-nav a:hover::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* Region switch: US (this site) | CA (diamondplumbing.ca). A plain link — no location detection. */
.region-switch { display: inline-flex; align-items: center; padding: 3px; border-radius: 999px; border: 1px solid var(--field-border); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.region-switch span, .region-switch a { display: inline-grid; place-items: center; min-width: 38px; min-height: 36px; padding: 0 10px; border-radius: 999px; }
.region-switch [aria-current] { background: var(--brand); color: var(--on-brand); }
.region-switch a { color: var(--text-muted); transition: color 0.3s, background 0.3s; }
.region-switch a:hover { color: var(--brand); background: var(--brand-glow); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 1px solid var(--field-border); color: var(--text-muted); transition: color 0.3s, border-color 0.3s, transform 0.5s var(--ease);
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.theme-toggle:hover { transform: rotate(25deg); }
.icon-sun { display: none; }
.icon-moon { display: block; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
.icon-play { display: none; }
.anim-paused .icon-pause { display: none; }
.anim-paused .icon-play { display: block; }

.nav-toggle { display: none; width: 44px; height: 44px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.nav-toggle span { width: 20px; height: 1.5px; background: var(--text); transition: transform 0.3s var(--ease), opacity 0.2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Progress, rail, gauge, cursor ---------- */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 60;
  background: linear-gradient(90deg, var(--brand-dim), var(--brand));
  transform: scaleX(0); transform-origin: left; pointer-events: none;
}
.rail { position: fixed; left: clamp(14px, 2vw, 30px); top: 18vh; bottom: 18vh; width: 2px; z-index: 40; display: none; }
.rail-line { position: absolute; inset: 0; background: var(--border); border-radius: 2px; }
.rail-fill { position: absolute; inset: 0; background: linear-gradient(180deg, var(--ice), var(--brand)); transform: scaleY(0); transform-origin: top; border-radius: 2px; }
.rail-drop {
  position: absolute; left: 50%; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  background: var(--brand); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 0 18px 4px var(--brand-glow);
}
.rail-node { position: absolute; left: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; display: grid; place-items: center; }
.rail-node i { width: 8px; height: 8px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--text-faint); transition: transform 0.4s var(--ease), background 0.3s, border-color 0.3s; }
.rail-node span {
  position: absolute; left: 30px; top: 50%; transform: translate(-6px, -50%);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; color: var(--text-muted);
  opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.4s var(--ease);
  background: rgba(var(--bg-rgb), 0.9); padding: 2px 8px; border-radius: 6px;
}
.rail-node:hover span, .rail-node:focus-visible span { opacity: 1; transform: translate(0, -50%); }
.rail-node.passed i { background: var(--brand); border-color: var(--brand); }
.rail-node.active i { transform: scale(1.7); background: var(--brand); border-color: var(--brand); }

.gauge {
  position: fixed; right: clamp(14px, 2vw, 28px); bottom: clamp(14px, 2vw, 28px); z-index: 40;
  padding: 10px 14px 8px; border-radius: 16px; background: rgba(var(--bg-rgb), 0.75); border: 1px solid var(--border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); text-align: center; pointer-events: none;
}
.gauge svg { width: 96px; height: auto; margin: 0 auto; }
.gauge-arc, .gauge-arc-fill { fill: none; stroke-width: 6; stroke-linecap: round; }
.gauge-arc { stroke: var(--border); }
.gauge-arc-fill { stroke: var(--brand); stroke-dasharray: 151; stroke-dashoffset: 151; }
#gauge-needle line { stroke: var(--ice); stroke-width: 2.5; stroke-linecap: round; }
#gauge-needle circle { fill: var(--ice); }
.gauge-read { font-size: 11px; color: var(--text-faint); letter-spacing: 0.12em; text-transform: uppercase; margin-top: -2px; }
.gauge-read b { font-family: var(--display); font-size: 18px; color: var(--text); margin-right: 4px; letter-spacing: 0; }

.cursor {
  position: fixed; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; z-index: 100;
  border-radius: 50%; border: 1.5px solid var(--brand); pointer-events: none; opacity: 0;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease), background 0.3s, opacity 0.3s;
}
.cursor.on { opacity: 1; }
.cursor.big { width: 54px; height: 54px; margin: -27px 0 0 -27px; background: var(--brand-glow); }
@media (pointer: coarse) { .cursor { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: 120px var(--pad) 100px; overflow: hidden; isolation: isolate;
  --sw: clamp(320px, calc(53.6vw - 196px), 620px);     /* shower width */
}
#water { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 50% at 20% 30%, rgba(var(--bg-rgb), 0.85), transparent 70%);
}
.hero-inner { position: relative; z-index: 2; max-width: 1100px; margin-left: clamp(0px, 4vw, 70px); }
/* A soft veil of the page colour behind the small hero text, so it keeps WCAG contrast when the pool rises behind it on scroll.
   Sized to each block (not the whole column) so it never dims the rain on the right. */
.hero-inner .eyebrow { display: inline-flex; }
.hero-actions { width: fit-content; max-width: 100%; }
.hero-inner .hero-in { position: relative; }
.hero-inner .hero-in::after {
  content: ""; position: absolute; inset: -20px -28px; z-index: -1; pointer-events: none;   /* blur(10px) leaves the text area at full strength */
  background: rgba(var(--bg-rgb), 0.86); filter: blur(10px); border-radius: 32px;
}
.hero-title { font-size: clamp(52px, 11vw, 168px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.92; margin-bottom: 32px; }
.hero-title .line { display: block; overflow: hidden; padding: 0.04em 0 0.18em; margin-bottom: -0.16em; }
.hero-title .line-in { display: inline-block; will-change: transform; }
.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--ice), var(--brand));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lede { max-width: 580px; font-size: clamp(16px, 1.4vw, 19px); color: var(--text-muted); margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted);
}
.scroll-cue i { width: 1px; height: 46px; background: var(--border); position: relative; overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 16px; background: var(--brand); animation: drip 1.8s var(--ease) infinite; }
@keyframes drip { 0% { transform: translateY(-16px); } 100% { transform: translateY(46px); } }

/* Rain-shower head on an arm from the right-hand wall (an original SVG drawing); the rain is drawn by water.js. */
.shower { position: absolute; z-index: 1; top: 78px; right: 0; width: var(--sw); aspect-ratio: 600 / 180; pointer-events: none; filter: var(--shower-shadow); }
.shower-svg { width: 100%; height: 100%; overflow: visible; }
.rain-emit { position: absolute; left: 10.3%; top: 91.1%; width: 55.3%; height: 1px; }
.valve { position: absolute; left: 6%; top: 62%; width: 63%; height: 38%; pointer-events: auto; cursor: pointer; border-radius: 18px; }
.valve:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.valve-hint {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, 6px); padding: 6px 11px; border-radius: 999px;
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
  font: 600 12px/1 var(--body); letter-spacing: 0.04em; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.valve:hover .valve-hint, .valve:focus-visible .valve-hint, .shower[data-water="off"] .valve-hint { opacity: 1; }
.shower[data-water="on"] .valve-hint::before { content: "Turn rain off"; }
.shower[data-water="off"] .valve-hint::before { content: "Turn rain on"; }
.shower[data-water="starting"] .valve-hint::before { content: "Turn rain off"; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--border); padding: 22px 0; background: var(--bg-elevated); }
.marquee-track { display: flex; gap: 36px; width: max-content; font-family: var(--display); font-weight: 700; font-size: clamp(28px, 4.4vw, 60px); letter-spacing: -0.03em; white-space: nowrap; will-change: transform; }
.marquee-track span { color: transparent; -webkit-text-stroke: 1px var(--titanium-3); }
.marquee-track span:nth-child(4n+1) { color: var(--text); -webkit-text-stroke: 0; }
.marquee-track b { color: var(--brand); font-size: 0.4em; align-self: center; }

/* ---------- Services (a plain responsive grid: no pinned sideways scrolling, so keyboard focus is always visible) ---------- */
.services { padding: 110px var(--pad); }
.services-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 20px; }
.services-head h2 { max-width: 15ch; }
.services-note { color: var(--text-muted); max-width: 62ch; margin-bottom: 48px; font-size: 16px; }
.services-track { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.panel {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--card), var(--bg-elevated)); border: 1px solid var(--border); overflow: hidden;
  transition: border-color 0.4s, transform 0.5s var(--ease);
}
.panel::before {
  content: ""; position: absolute; inset: auto -20% -60% -20%; height: 80%;
  background: radial-gradient(closest-side, var(--brand-glow), transparent); opacity: 0; transition: opacity 0.6s; pointer-events: none;
}
.panel.active, .panel:hover, .panel:focus-within { border-color: rgba(var(--water-rgb), 0.5); }
.panel.active::before, .panel:hover::before { opacity: 1; }
.panel-num { font-family: var(--display); font-size: 14px; letter-spacing: 0.2em; color: var(--text-faint); }
.panel p { color: var(--text-muted); max-width: 42ch; }
.panel-cta {
  position: relative; margin-top: auto; align-self: flex-start; display: inline-flex; gap: 10px; align-items: center;
  padding: 13px 22px; min-height: 44px; border-radius: 999px; border: 1px solid var(--field-border); font-size: 14px; font-weight: 600;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.panel-cta span { transition: transform 0.4s var(--ease); }
.panel-cta:hover { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.panel-cta:hover span { transform: translateX(5px); }
.tank {
  position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: var(--radius-md); overflow: hidden;
  display: grid; place-items: center; color: var(--text); isolation: isolate;
  /* a glass vessel: faint fill, a lit top edge and soft inner shading */
  background: linear-gradient(180deg, rgba(var(--fg-rgb), 0.035), rgba(var(--fg-rgb), 0.01) 60%, rgba(var(--water-rgb), 0.05));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -18px 30px -24px rgba(var(--water-rgb), 0.35);
}
/* the water itself is drawn on this canvas by water.js (same engine as the hero): a stream fills the tank, then it settles */
.tank-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.tank { place-items: start; }
.tank-tip { position: absolute; left: 70%; top: 0; width: 1px; height: 1px; }      /* where the filling stream enters */
.tank svg { position: absolute; left: 13%; top: 16%; z-index: 1; filter: drop-shadow(0 1px 0 rgba(var(--bg-rgb), 0.6)); }

/* ---------- Method ---------- */
.method { padding: 120px var(--pad); border-top: 1px solid var(--border-soft); }
.method-inner { display: grid; grid-template-columns: minmax(280px, 5fr) 7fr; gap: clamp(32px, 6vw, 110px); max-width: 1320px; margin: 0 auto; }
.method-side { position: sticky; top: 120px; align-self: start; }
.method-side h2 { margin-bottom: 36px; }
.method-counter { font-family: var(--display); font-weight: 800; font-size: clamp(64px, 9vw, 130px); letter-spacing: -0.06em; line-height: 1; color: var(--text); }
.method-counter span { font-size: 18px; letter-spacing: 0; color: var(--text-faint); margin-left: 8px; font-weight: 500; }
.steps { list-style: none; padding: 0 0 0 44px; position: relative; display: flex; flex-direction: column; }
.steps::before { content: ""; position: absolute; left: 9px; top: 18px; bottom: 18px; width: 2px; background: var(--border); border-radius: 2px; }
.steps-fill { position: absolute; left: 9px; top: 18px; width: 2px; height: calc(100% - 36px); background: linear-gradient(180deg, var(--ice), var(--brand)); transform: scaleY(0); transform-origin: top; border-radius: 2px; }
.step { position: relative; padding: 0 0 clamp(60px, 14vh, 150px); opacity: 0.45; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); transform: translateX(8px); }
.step:last-child { padding-bottom: 0; }
.step.active { opacity: 1; transform: none; }
.step.done { opacity: 0.7; transform: none; }
.step-dot { position: absolute; left: -44px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px solid var(--text-faint); transition: border-color 0.4s, background 0.4s, box-shadow 0.4s; }
.step.active .step-dot, .step.done .step-dot { border-color: var(--brand); background: var(--brand); }
.step.active .step-dot { box-shadow: 0 0 0 8px var(--brand-glow); }
.step h3 { font-size: clamp(28px, 3.6vw, 52px); margin-bottom: 14px; }
.step p { color: var(--text-muted); max-width: 48ch; font-size: clamp(16px, 1.3vw, 19px); }

/* ---------- Canadian history: numbers ---------- */
.flow { padding: 90px 0 0; overflow: hidden; }
.flow-card { position: relative; padding: 90px var(--pad); background: var(--bg-elevated); border-block: 1px solid var(--border); overflow: hidden; will-change: transform; }
.flow-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 120% at 50% 120%, var(--brand-glow), transparent); pointer-events: none; }
.flow-head { position: relative; max-width: 1320px; margin: 0 auto 48px; }
.flow-head h2 { max-width: 18ch; }
.flow-inner { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; max-width: 1320px; margin: 0 auto; }
.stat { display: flex; flex-direction: column; gap: 6px; border-left: 1px solid var(--border); padding-left: 24px; }
.stat-num {
  font-family: var(--display); font-weight: 800; font-size: clamp(64px, 10vw, 160px); letter-spacing: -0.06em; line-height: 0.9;
  background: linear-gradient(180deg, var(--text), var(--titanium-3)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat > span { color: var(--text-muted); font-size: 16px; display: flex; flex-direction: column; }
.stat small { color: var(--text-faint); font-size: 14px; }
.flow-foot { position: relative; max-width: 1320px; margin: 40px auto 0; color: var(--text-faint); font-size: 14px; }

/* ---------- Canadian history: story, credentials, projects ---------- */
.about { padding: 120px var(--pad); }
.about-inner { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 6vw, 100px); max-width: 1320px; margin: 0 auto; align-items: start; }
.about-copy h2 { margin-bottom: 32px; }
.about-copy p { color: var(--text-muted); margin-bottom: 18px; max-width: 62ch; font-size: 17px; }
.about-copy h3 { font-size: 22px; margin: 34px 0 14px; }
.about-list { list-style: none; padding: 0; margin-top: 10px; display: grid; gap: 12px; }
.about-list li { position: relative; padding-left: 30px; color: var(--text); }
.about-list li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 16px; height: 2px; background: var(--brand); }
.fine-print { color: var(--text-faint) !important; font-size: 14px !important; }
.about-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 28px;
  background: linear-gradient(160deg, var(--card), var(--bg-elevated)); transform-style: preserve-3d; will-change: transform;
  position: sticky; top: 120px;
}
.about-card-row { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border-soft); }
.about-card-row:last-child { border: 0; }
.about-card-label { color: var(--text-faint); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; flex: none; }
.about-card-value { font-family: var(--display); font-weight: 700; font-size: 18px; text-align: right; }

.projects { padding: 0 var(--pad) 120px; }
.projects-inner { max-width: 1320px; margin: 0 auto; }
.projects-inner h3 { font-size: clamp(26px, 3vw, 40px); margin-bottom: 10px; }
.projects-intro { color: var(--text-muted); max-width: 70ch; margin-bottom: 28px; }
.project-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.project-list li { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); display: grid; gap: 2px; }
.project-list b { font-family: var(--display); font-size: 17px; letter-spacing: -0.01em; }
.project-list span { color: var(--text-muted); font-size: 14px; }
.project-list .tag { justify-self: start; margin-top: 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }

/* ---------- Contact ---------- */
.contact { padding: 130px var(--pad); border-top: 1px solid var(--border-soft); position: relative; overflow: hidden; }
.contact::before { content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 60px; background: linear-gradient(var(--brand), transparent); }
.contact-inner { display: grid; grid-template-columns: 6fr 5fr; gap: clamp(32px, 6vw, 100px); max-width: 1320px; margin: 0 auto; }
.contact-info h2 { margin-bottom: 26px; }
.contact-lede { color: var(--text-muted); max-width: 46ch; font-size: 18px; margin-bottom: 36px; }
.contact-methods { display: grid; gap: 14px; }
.contact-method { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); transition: border-color 0.3s, transform 0.4s var(--ease); }
a.contact-method:hover { border-color: var(--brand); transform: translateX(6px); }
.contact-method-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-glow); color: var(--brand); flex: none; }
.contact-method strong { display: block; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); font-weight: 600; }
.contact-method span span, .contact-method address { color: var(--text); font-style: normal; }

.contact-form { padding: clamp(22px, 3vw, 36px); border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(160deg, var(--card), var(--bg-elevated)); display: grid; gap: 18px; align-self: start; }
.form-intro { color: var(--text-muted); font-size: 14px; }
.form-row label, .form-legend { display: block; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; font-weight: 600; }
.form-row .opt { text-transform: none; letter-spacing: 0; font-weight: 500; }
.form-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: rgba(var(--fg-rgb), 0.03);
  border: 1px solid var(--field-border); border-radius: var(--radius-sm); padding: 13px 16px; min-height: 48px;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
select option { background: var(--bg-elevated); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow); background: transparent; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { resize: vertical; min-height: 120px; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: 14px; margin-top: 6px; }
.field-error:empty { display: none; }
.hint { color: var(--text-faint); font-size: 13px; margin-top: 6px; }
.consent { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 14px; color: var(--text-muted); }
.consent input { width: 22px; height: 22px; min-height: 0; margin-top: 1px; padding: 0; accent-color: var(--brand); cursor: pointer; }
.consent label { cursor: pointer; }
.consent a, .notice a, .legal a, .footer-links a, .inline-link { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.notice { font-size: 13px; color: var(--text-faint); }
.form-honeypot { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.4em; font-size: 15px; }
.form-status.success { color: var(--brand); }
.form-status.error { color: var(--danger); }
.contact-form.picked select { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow); }

/* ---------- Footer ---------- */
.site-footer { padding: 44px var(--pad) 90px; border-top: 1px solid var(--border); }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 20px 40px; align-items: start; max-width: 1320px; margin: 0 auto; }
.footer-meta { color: var(--text-faint); font-size: 14px; display: grid; gap: 6px; }
.footer-meta p { max-width: 90ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.footer-links a { display: inline-block; padding: 4px 0; }

/* ---------- Legal pages ---------- */
.legal-page .site-header { position: sticky; background: rgba(var(--bg-rgb), 0.92); border-bottom-color: var(--border-soft); }
.legal { max-width: 780px; margin: 0 auto; padding: 60px var(--pad) 100px; }
.legal h1 { font-size: clamp(38px, 6vw, 64px); margin-bottom: 12px; }
.legal h2 { font-size: clamp(24px, 3vw, 32px); margin: 44px 0 14px; letter-spacing: -0.02em; line-height: 1.15; }
.legal h3 { font-size: 19px; margin: 26px 0 10px; letter-spacing: -0.01em; }
.legal p, .legal li { color: var(--text-muted); font-size: 16.5px; }
.legal p { margin-bottom: 14px; }
.legal ul, .legal ol { padding-left: 22px; margin-bottom: 14px; display: grid; gap: 6px; }
.legal strong { color: var(--text); }
.legal .updated { color: var(--text-faint); font-size: 14px; margin-bottom: 30px; }
.legal .callout { border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--card); margin: 20px 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 10px 0 20px; font-size: 15px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.legal th { color: var(--text); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.back-link { display: inline-flex; gap: 8px; align-items: center; color: var(--brand); font-weight: 600; margin-bottom: 26px; }

/* ---------- Responsive ---------- */
@media (min-width: 1100px) {
  .rail { display: block; }
  .hero-inner { margin-left: 40px; }
}
@media (max-width: 1000px) {
  .method-inner, .about-inner, .contact-inner { grid-template-columns: 1fr; }
  .method-side { position: relative; top: 0; }
  .method-counter { display: none; }
  .about-card { position: relative; top: 0; }
  .flow-inner { grid-template-columns: 1fr; }
  .stat { flex-direction: row; align-items: baseline; gap: 20px; }
  .stat-num { font-size: 84px; min-width: 2.2ch; }
}
@media (min-width: 861px) {
  .footer-inner { padding-right: 150px; }      /* keep the footer clear of the fixed pressure gauge */
}
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .btn-small { display: none; }
  .main-nav {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0; padding: 12px var(--pad) 24px;
    background: rgba(var(--bg-rgb), 0.97); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
    transform: translateY(-120%); visibility: hidden; transition: transform 0.5s var(--ease), visibility 0s linear 0.5s; z-index: -1;
  }
  .main-nav.open { transform: none; visibility: visible; transition: transform 0.5s var(--ease), visibility 0s; }
  .main-nav a { font-size: 22px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); color: var(--text); }
  .gauge { display: none; }
  .services-head { flex-direction: column; align-items: flex-start; }
  .form-row-split { grid-template-columns: 1fr; }
  .hero { padding-top: 110px; --sw: 300px; }
  .scroll-cue { display: none; }
  .shower { top: 70px; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .brand-logo img { height: 38px; }
  .header-inner { gap: 8px; }
  .header-actions { gap: 6px; }
  .region-switch span, .region-switch a { min-width: 32px; padding: 0 7px; }
  .hero { --sw: 150px; }
  .shower { top: 150px; }
}
@media (max-width: 380px) {
  .brand-logo img { height: 32px; }
  .icon-btn { width: 40px; height: 40px; }
}

/* Reduced motion, or the visitor pressed "Pause animations": stop every looping CSS animation. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
.anim-paused *, .anim-paused *::before, .anim-paused *::after { animation-play-state: paused !important; }
.anim-paused { scroll-behavior: auto; }

@media print {
  .shower, #water, .gauge, .rail, .cursor, .progress-bar, .scroll-cue, .site-header, .marquee { display: none !important; }
  .hero { min-height: 0; padding-top: 20px; }
}
.projects-note { margin-top: 18px; }
.nav-region { display: none; }
@media (max-width: 560px) {
  .region-switch { display: none; }          /* on phones the Canada link moves into the menu */
  .nav-region { display: block; }
}
