/* ─────────────────────────────────────────────────────────────
   Mahangi Construction & General Services
   Brand: navy #1B3A5C, amber #D98324 (from the posters & letterhead)
   ───────────────────────────────────────────────────────────── */

:root {
  --navy: #1B3A5C;
  --navy-700: #22466D;
  --navy-900: #0F2238;
  --amber: #D98324;
  --amber-400: #E8A34A;
  --amber-600: #C06F17;
  --ink: #16202E;
  --slate: #4A5A6E;
  --slate-300: #B9C7D8;
  --mist: #F2F5F8;
  --rule: #DCE2E9;
  --paper: #FFFFFF;
  --wa: #1FAF54;

  --font-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 34, 56, .06), 0 2px 6px rgba(15, 34, 56, .05);
  --shadow-md: 0 2px 4px rgba(15, 34, 56, .06), 0 12px 32px rgba(15, 34, 56, .10);
  --shadow-lg: 0 4px 12px rgba(5, 15, 28, .18), 0 30px 60px rgba(5, 15, 28, .28);

  --header-h: 72px;
  --gutter: clamp(16px, 4vw, 40px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.05; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.amber { color: var(--amber); }
.muted { color: var(--slate); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--amber); color: var(--ink); padding: 10px 14px; border-radius: 6px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

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

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 16px;
}

/* ───────────── Buttons ───────────── */
.btn {
  --bg: var(--navy); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 20px;
  background: var(--bg); color: var(--fg);
  border: 0; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, box-shadow 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 54px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-amber { --bg: var(--amber); --fg: var(--ink); }
.btn-ghost { --bg: rgba(255, 255, 255, .06); --fg: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .28); }
.btn-ghost-dark { --bg: transparent; --fg: var(--navy); box-shadow: inset 0 0 0 1.5px var(--rule); }
.btn-whatsapp { --bg: var(--wa); --fg: #fff; }
.btn .ic { transition: transform 200ms var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .btn-amber:hover { --bg: var(--amber-400); }
  .btn-ghost:hover { --bg: rgba(255, 255, 255, .12); }
  .btn-ghost-dark:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }
  .btn:hover .ic:only-of-type:last-child { transform: translateX(3px); }
}

.text-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; color: var(--navy);
  text-decoration: none; border-bottom: 2px solid var(--amber); padding-bottom: 2px;
}
.text-link .ic { transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .text-link:hover .ic { transform: translateX(3px); }
}

/* ───────────── Header ───────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--navy-900) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  color: #fff;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.site-header[data-scrolled] { border-color: rgba(255, 255, 255, .08); box-shadow: 0 8px 24px rgba(5, 15, 28, .25); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 32px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; flex: none; }
.brand-mark { width: 40px; height: 40px; }
.brand-text { display: grid; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: .14em; }
.brand-sub { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--slate-300); margin-top: 5px; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  padding: 8px 12px; border-radius: 6px;
  color: rgba(255, 255, 255, .78); text-decoration: none; font-size: 15px; font-weight: 500;
  transition: color 150ms ease, background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
}

.header-cta { display: flex; align-items: center; gap: 16px; }
.header-phone {
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums;
}
.header-phone .ic { color: var(--amber); }

.menu-btn {
  display: none; width: 44px; height: 44px; margin-right: -10px;
  background: none; border: 0; cursor: pointer; place-items: center;
}
.menu-btn .bars, .menu-btn .bars::before, .menu-btn .bars::after {
  display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px;
  transition: transform 240ms var(--ease-out), opacity 150ms ease;
}
.menu-btn .bars { position: relative; }
.menu-btn .bars::before, .menu-btn .bars::after { content: ""; position: absolute; left: 0; }
.menu-btn .bars::before { transform: translateY(-6px); }
.menu-btn .bars::after { transform: translateY(6px); }
.menu-btn[aria-expanded="true"] .bars { background: transparent; }
.menu-btn[aria-expanded="true"] .bars::before { transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars::after { transform: rotate(-45deg); }

.mobile-menu {
  position: absolute; inset: 100% 0 auto 0;
  background: var(--navy-900);
  border-top: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 24px 40px rgba(5, 15, 28, .35);
  opacity: 0; transform: translateY(-8px);
  transition: opacity 200ms var(--ease-out), transform 240ms var(--ease-drawer);
}
.mobile-menu[data-open] { opacity: 1; transform: translateY(0); }
.mobile-menu nav { display: grid; padding-top: 8px; padding-bottom: 16px; }
.mobile-menu a {
  padding: 14px 0; color: #fff; text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.mobile-menu a:last-child { border-bottom: 0; }

/* ───────────── Blueprint grid background ───────────── */
.grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  background-position: -1px -1px;
  mask-image: radial-gradient(120% 90% at 70% 30%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(120% 90% at 70% 30%, #000 30%, transparent 85%);
}

/* ───────────── Hero ───────────── */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(90% 70% at 80% 10%, var(--navy-700), transparent 60%), var(--navy);
  color: #fff;
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 40px;
  padding-top: clamp(48px, 8vw, 96px); padding-bottom: clamp(56px, 8vw, 104px);
}
.hero-title {
  font-weight: 850; font-stretch: 88%;
  font-size: clamp(2.9rem, 6.2vw, 5.4rem);
  line-height: .9; letter-spacing: -0.035em; text-transform: uppercase;
}
.hero-title .line { display: block; white-space: nowrap; }
.hero-lede { margin-top: 28px; max-width: 34em; font-size: clamp(17px, 1.6vw, 19px); color: rgba(255, 255, 255, .8); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.hero-facts {
  display: flex; flex-wrap: wrap; gap: 12px 36px; margin-top: 48px; padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.hero-facts li { display: flex; align-items: baseline; gap: 10px; }
.hero-facts strong { font-family: var(--font-display); font-size: 32px; font-weight: 800; color: var(--amber); line-height: 1; }
.hero-facts span { font-size: 14px; color: rgba(255, 255, 255, .68); max-width: 9.5em; line-height: 1.3; }

.hero-art { position: relative; margin: 0 -16px 0 0; }
.blueprint { width: 100%; height: auto; overflow: visible; }
.blueprint path, .blueprint circle { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.blueprint text {
  font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: .14em;
  fill: rgba(255, 255, 255, .5); stroke: none;
}
.bp-ground path { stroke: rgba(255, 255, 255, .8); stroke-width: 2; }
/* The existing house starts faded; the renovation brightens it (see @keyframes renew) */
.bp-old path { stroke: rgba(255, 255, 255, .42); stroke-width: 2; }
.bp-old-roof path { stroke: #8A6236; stroke-width: 4; }
.bp-wash { fill: rgba(255, 255, 255, .07); }
.bp-setout { fill: none; stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 6 5; }
.bp-slab { fill: rgba(185, 199, 216, .35); }
.bp-bricks rect { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .26); stroke-width: 1; }
.bp-ext path { stroke: rgba(255, 255, 255, .85); stroke-width: 2; }
.bp-ext-roof path { stroke: var(--amber); stroke-width: 4; }
.bp-broken .glass { fill: #102A45; }
.bp-broken path { stroke: rgba(255, 255, 255, .42); stroke-width: 2; }
.bp-broken .crack { stroke: rgba(255, 255, 255, .6); stroke-width: 1.2; }
.bp-win .glass { fill: #12304F; }
.bp-win .light { fill: #FFCF73; opacity: 0; transition: opacity 500ms ease; }
.bp-win .light.on { opacity: .88; filter: drop-shadow(0 0 7px rgba(255, 200, 110, .6)); }
.bp-win.is-new > path { stroke: rgba(255, 255, 255, .9); stroke-width: 2; }
.bp-door .knob { fill: var(--amber); stroke: none; }
.bp-roller rect { fill: var(--navy); stroke: var(--amber); stroke-width: 2.5; }
.bp-roller path { stroke: #fff; stroke-width: 2.5; }
.bp-grass path { fill: none; stroke: #8FD18A; stroke-width: 2; stroke-linecap: round; }
.bp-dim path { stroke: rgba(255, 255, 255, .35); stroke-width: 1.2; }
.bp-note path { stroke: var(--amber); stroke-width: 1.5; }
.bp-note text { fill: var(--amber); }

.replay {
  position: absolute; left: 4%; bottom: -2%;
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .02em;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease, opacity 300ms ease;
}
.replay .ic { width: 15px; height: 15px; }
.replay:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .replay:hover { background: rgba(255, 255, 255, .14); color: #fff; }
}

.stamp {
  position: absolute; right: 0; top: 14%;
  display: grid; padding: 10px 14px;
  border: 2px solid var(--amber); border-radius: 6px;
  color: var(--amber); background: rgba(15, 34, 56, .55);
  font-family: var(--font-display); font-weight: 800; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; line-height: 1.35;
  transform: rotate(-6deg);
}

/* ── Renovation + extension sequence ──────────────────────────────
   main.js adds .is-building; each stage is a keyframe animation with a delay.
   Times are ms from the start. Removing and re-adding .is-building replays it.
      0–700   existing house drawn in (faded), weeds already overgrown
    700       extension set out (dashed), footing at 1000
   1300–2600  extension bricks laid course by course
   2700       extension outline; lean-to roof set at 3000
   3400–4400  roller repaints the old house; lines brighten; cracked window removed
   4400       new windows fitted; weeds cut at 4500
   4800+      dimensions, stamp; lights come on (main.js, 5300) */
.js .hero-art [pathLength] { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .bp-slab { transform-box: fill-box; transform-origin: 50% 50%; transform: scaleX(0); }
.js .bp-wash { transform-box: fill-box; transform-origin: 0 50%; transform: scaleX(0); }
.js .bp-bricks rect { opacity: 0; }
.js .bp-setout, .js .bp-ext-roof, .js .bp-roller, .js .bp-broken, .js .bp-win .glass,
.js .bp-win.is-new, .js .bp-door .knob, .js .bp-grass, .js .blueprint text, .js .stamp { opacity: 0; }
.js .tuft { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(1.9) skewX(-6deg); }
.js .stamp { transform: rotate(-6deg) scale(1.08); }

/* 1. The house that's already there */
.is-building .bp-ground path { animation: draw 500ms var(--ease-out) forwards; }
.is-building .bp-old path { animation: draw 700ms var(--ease-in-out) 100ms forwards, renew 700ms ease 3600ms forwards; }
.is-building .bp-old-roof path { animation: draw 700ms var(--ease-in-out) 100ms forwards, renew-roof 700ms ease 3600ms forwards; }
.is-building .bp-win.is-kept .glass, .is-building .bp-door .knob { animation: show 400ms ease 400ms forwards; }
.is-building .bp-broken { animation: show 400ms ease 400ms forwards, leave 350ms ease 3900ms forwards; }
.is-building .bp-grass { animation: show 400ms ease 300ms forwards; }

/* 2. Extension goes up */
.is-building .bp-setout { animation: show 300ms ease 700ms forwards, leave 400ms ease 2700ms forwards; }
.is-building .bp-slab { animation: slab 400ms var(--ease-out) 1000ms forwards; }
.is-building .bp-bricks rect { animation: lay 280ms var(--ease-out) var(--d) forwards; }
.is-building .bp-ext path { animation: draw 500ms var(--ease-in-out) 2700ms forwards; }
.is-building .bp-ext-roof { animation: set-roof 450ms var(--ease-out) 3000ms forwards; }

/* 3. Renovation of the old house */
.is-building .bp-roller { animation: roller 1300ms 3300ms forwards; }
.is-building .bp-wash { animation: slab 1000ms var(--ease-in-out) 3400ms forwards; }
.is-building .bp-win.is-new { animation: fit 380ms var(--ease-out) calc(4400ms + var(--i) * 120ms) forwards; }
.is-building .tuft { animation: cut 380ms var(--ease-out) 4500ms forwards; }
.is-building .bp-grass g:nth-child(2n) .tuft { animation-delay: 4560ms; }
.is-building .bp-grass g:nth-child(3n) .tuft { animation-delay: 4620ms; }

/* 4. Drawing furniture */
.is-building .bp-dim path, .is-building .bp-note path { animation: draw 700ms var(--ease-in-out) 4700ms forwards; }
.is-building .blueprint text { animation: show 500ms ease 4900ms forwards; }
.is-building .stamp { animation: stamp 450ms var(--ease-out) 5100ms forwards; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes show { to { opacity: 1; } }
@keyframes leave { from { opacity: 1; } to { opacity: 0; } }
@keyframes slab { to { transform: scaleX(1); } }
@keyframes renew { to { stroke: rgba(255, 255, 255, .88); } }
@keyframes renew-roof { to { stroke: var(--amber); } }
@keyframes lay {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: none; }
}
@keyframes set-roof {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fit {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@keyframes cut { to { transform: scaleY(1) skewX(0deg); } }
@keyframes stamp { to { opacity: 1; transform: rotate(-6deg) scale(1); } }
/* Roller appears at the left wall, sweeps to the extension, lifts away. Shares a clock with .bp-wash. */
@keyframes roller {
  0%   { opacity: 0; transform: translateX(0); }
  8%   { opacity: 1; transform: translateX(0); animation-timing-function: var(--ease-in-out); }
  85%  { opacity: 1; transform: translateX(276px); }
  100% { opacity: 0; transform: translate(276px, -10px); }
}

/* Lived-in: grass sways once the build is done (main.js adds .is-alive) */
.is-alive .bp-grass path {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: sway 3.2s cubic-bezier(.45, 0, .55, 1) infinite alternate;
}
.is-alive .bp-grass g:nth-child(2n) path { animation-duration: 2.7s; animation-delay: -1.1s; }
.is-alive .bp-grass g:nth-child(3n) path { animation-duration: 3.6s; animation-delay: -2s; }
@keyframes sway {
  from { transform: rotate(-7deg); }
  to { transform: rotate(6deg); }
}

.hero-art.is-paused * { animation-play-state: paused !important; }

/* Headline lines rise in once on load */
.js .hero-title .line, .js .hero-lede, .js .hero-actions, .js .hero-facts, .js .hero .eyebrow {
  opacity: 0; transform: translateY(14px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}
.js .is-loaded .hero .eyebrow { opacity: 1; transform: none; }
.js .is-loaded .hero-title .line { opacity: 1; transform: none; }
.js .is-loaded .hero-title .line:nth-child(1) { transition-delay: 60ms; }
.js .is-loaded .hero-title .line:nth-child(2) { transition-delay: 120ms; }
.js .is-loaded .hero-title .line:nth-child(3) { transition-delay: 180ms; }
.js .is-loaded .hero-lede { opacity: 1; transform: none; transition-delay: 260ms; }
.js .is-loaded .hero-actions { opacity: 1; transform: none; transition-delay: 320ms; }
.js .is-loaded .hero-facts { opacity: 1; transform: none; transition-delay: 380ms; }

/* ───────────── Ticker ───────────── */
.ticker {
  position: relative; overflow: hidden;
  background: var(--amber); color: var(--ink);
  border-top: 1px solid rgba(0, 0, 0, .08);
}
.ticker-track { display: flex; width: max-content; animation: ticker 48s linear infinite; }
.ticker ul { display: flex; flex: none; }
.ticker li {
  display: flex; align-items: center; gap: 28px; padding: 16px 0 16px 28px;
  font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
.ticker li::after { content: ""; width: 7px; height: 7px; background: var(--navy); transform: rotate(45deg); }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (hover: hover) and (pointer: fine) {
  .ticker:hover .ticker-track { animation-play-state: paused; }
}

/* ───────────── Sections ───────────── */
.section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.section-head { max-width: 720px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head h2, .clients h2, .about h2, .quote h2 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-weight: 800; letter-spacing: -0.025em;
}
.section-lede { margin-top: 18px; font-size: 18px; color: var(--slate); max-width: 36em; }

/* Scroll reveal (JS adds .js to <html>; content stays visible without it) */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }
/* Once revealed, hand transitions back to the component (no stagger delay on hover) */
.js .reveal.is-settled { transition-delay: 0ms; }
.js .service.reveal.is-settled { transition: transform 250ms var(--ease-out), box-shadow 250ms var(--ease-out); }

/* ───────────── Services ───────────── */
.services { background: var(--mist); }
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.service {
  position: relative; display: flex; flex-direction: column;
  padding: 24px 22px 22px;
  background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-bottom: 3px solid var(--amber);
  transition: transform 250ms var(--ease-out), box-shadow 250ms var(--ease-out), opacity 600ms var(--ease-out);
}
.service-icon {
  width: 56px; height: 56px; border-radius: 10px; display: grid; place-items: center;
  background: var(--navy); color: var(--amber);
  transition: background-color 200ms ease, color 200ms ease;
}
.service-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.service-num {
  position: absolute; top: 24px; right: 22px;
  font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--rule);
}
.service h3 { margin-top: 22px; font-size: 22px; font-weight: 800; color: var(--navy); letter-spacing: -0.01em; }
.service-tag { margin-top: 6px; font-size: 15px; color: var(--slate); }
.service ul { margin: 18px 0 22px; display: grid; gap: 8px; }
.service li { position: relative; padding-left: 18px; font-size: 14.5px; line-height: 1.45; }
.service li::before { content: ""; position: absolute; left: 0; top: .5em; width: 7px; height: 7px; background: var(--amber); }
.service-link {
  margin-top: auto; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--navy); text-decoration: none;
}
/* The whole card is the click target */
.service-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.service-link .ic { width: 16px; height: 16px; transition: transform 200ms var(--ease-out); }
.service:active { transform: scale(0.985); }

@media (hover: hover) and (pointer: fine) {
  .service:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
  .service:hover .service-icon { background: var(--amber); color: var(--navy); }
  .service:hover .service-link .ic { transform: translateX(3px); }
}

/* ───────────── Clients ───────────── */
.clients { background: var(--navy-900); color: #fff; }
.clients-inner { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start; }
.clients h2 { position: sticky; top: calc(var(--header-h) + 32px); }
.client-list li {
  display: grid; grid-template-columns: 220px 1fr; gap: 24px;
  padding: 26px 0; border-top: 1px solid rgba(255, 255, 255, .1);
}
.client-list li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .1); }
.client-k { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--amber); line-height: 1.25; }
.client-list span:last-child { color: rgba(255, 255, 255, .72); }

/* ───────────── Process ───────────── */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; counter-reset: step; }
.step { position: relative; padding-top: 28px; border-top: 2px solid var(--rule); }
.step::before {
  content: ""; position: absolute; top: -2px; left: 0; width: 48px; height: 2px; background: var(--amber);
}
.step-n {
  display: block; font-family: var(--font-display); font-size: 64px; font-weight: 850; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px var(--navy); letter-spacing: -0.04em;
}
.step h3 { margin-top: 20px; font-size: 21px; font-weight: 800; color: var(--navy); }
.step p { margin-top: 10px; color: var(--slate); font-size: 15.5px; }

/* ───────────── About ───────────── */
.about { background: var(--mist); }
.about-inner { display: grid; grid-template-columns: 1fr 1.05fr; gap: 64px; align-items: center; }
.about-copy p { margin-top: 18px; color: var(--slate); font-size: 17px; }
.about-copy h2 { color: var(--navy); }
.about-copy .text-link { margin-top: 28px; }

.video-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--navy-900); box-shadow: var(--shadow-lg); aspect-ratio: 16 / 9;
}
.video-card video { width: 100%; height: 100%; object-fit: cover; }
.video-play {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(180deg, rgba(15, 34, 56, .05), rgba(15, 34, 56, .55));
  border: 0; cursor: pointer; color: #fff;
  transition: opacity 200ms ease;
}
.video-play[hidden] { display: none; }
.video-play-btn {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: var(--amber); color: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transition: transform 200ms var(--ease-out);
}
.video-play-btn svg { width: 30px; height: 30px; margin-left: 4px; }
.video-play-label { font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; text-shadow: 0 1px 8px rgba(0, 0, 0, .4); }
.video-play:active .video-play-btn { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) {
  .video-play:hover .video-play-btn { transform: scale(1.05); }
}

/* ───────────── Quote ───────────── */
.quote { background: var(--navy); color: #fff; overflow: hidden; }
.quote-inner { position: relative; display: grid; grid-template-columns: .8fr 1.2fr; gap: 64px; align-items: start; }
.quote-intro { position: sticky; top: calc(var(--header-h) + 32px); }
.quote-intro > p { margin-top: 18px; font-size: 18px; color: rgba(255, 255, 255, .78); }
.quote-alt { margin-top: 32px; display: grid; gap: 14px; }
.quote-alt li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255, 255, 255, .78); }
.quote-alt .ic { color: var(--amber); margin-top: 3px; }
.quote-alt a { white-space: nowrap; color: #fff; font-weight: 600; text-decoration-color: var(--amber); text-underline-offset: 3px; font-variant-numeric: tabular-nums; }

.quote-form {
  position: relative;
  background: var(--paper); color: var(--ink);
  border-radius: 16px; padding: clamp(22px, 3.4vw, 40px);
  box-shadow: var(--shadow-lg);
}
.form-body { display: grid; gap: 20px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 8px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field label, .field legend { font-weight: 600; font-size: 14px; color: var(--ink); padding: 0; }
.field legend { margin-bottom: 10px; }
.opt { font-weight: 400; color: var(--slate); font-size: 13px; margin-left: 4px; }

input:not([type="checkbox"]):not([type="radio"]), textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--mist); border: 1.5px solid transparent; border-radius: var(--radius-sm);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
textarea { resize: vertical; min-height: 116px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #8A97A8; }
input:focus, textarea:focus { outline: none; background: #fff; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(217, 131, 36, .22); }
[aria-invalid="true"] { border-color: #C2410C !important; background: #FFF7F3 !important; }
.err { color: #B4380B; font-size: 13.5px; min-height: 0; }
.err:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--mist); border: 1.5px solid var(--rule);
  font-size: 14px; font-weight: 500; color: var(--ink); user-select: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}
.chip span::before {
  content: ""; width: 0; height: 10px; margin-right: -6px;
  border-right: 2px solid var(--amber); border-bottom: 2px solid var(--amber);
  transform: rotate(45deg) translate(-1px, -2px) scale(.6); opacity: 0;
  transition: width 200ms var(--ease-out), margin 200ms var(--ease-out), opacity 150ms ease, transform 200ms var(--ease-out);
}
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip input:checked + span::before { width: 5px; margin-right: 2px; opacity: 1; transform: rotate(45deg) translate(-1px, -2px) scale(1); }
.chip input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.chip:active span { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .chip input:not(:checked) + span:hover { border-color: var(--slate-300); }
}

/* Segmented control: the thumb slides with :has(), no JS */
.segmented {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 4px; background: var(--mist); border-radius: 10px;
}
.segmented label { position: relative; z-index: 1; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: grid; place-items: center; height: 40px; font-size: 14.5px; font-weight: 600; color: var(--slate);
  transition: color 200ms ease;
}
.segmented input:checked + span { color: var(--navy); }
.segmented input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: -2px; border-radius: 7px; }
.seg-thumb {
  position: absolute; top: 4px; left: 4px; bottom: 4px; width: calc((100% - 8px) / 3);
  background: #fff; border-radius: 7px; box-shadow: var(--shadow-sm);
  transition: transform 260ms var(--ease-out);
}
.segmented:has(input[value="whatsapp"]:checked) .seg-thumb { transform: translateX(100%); }
.segmented:has(input[value="email"]:checked) .seg-thumb { transform: translateX(200%); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-error { color: #B4380B; font-weight: 500; font-size: 14.5px; }
.form-error:empty { display: none; }
.form-note { text-align: center; font-size: 13px; color: var(--slate); margin-top: -6px; }

.submit { position: relative; }
.submit-label { display: inline-flex; align-items: center; gap: 10px; transition: filter 200ms ease, opacity 200ms ease; }
.submit[data-busy] { pointer-events: none; }
.submit[data-busy] .submit-label { opacity: .85; }
.submit-label.is-swapping { filter: blur(2px); opacity: .4; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(22, 32, 46, .25); border-top-color: var(--ink);
  animation: spin 600ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-done, .form-fallback { text-align: center; padding: 32px 8px; }
.form-done:focus, .form-fallback:focus { outline: none; }
.form-done h3, .form-fallback h3 { font-size: 28px; font-weight: 800; color: var(--navy); }
[data-done-ref] { white-space: nowrap; }
.form-done p, .form-fallback p { margin: 12px auto 28px; max-width: 30em; color: var(--slate); }
.form-fallback { text-align: left; }
.fallback-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.text-btn { margin-top: 20px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--slate); text-decoration: underline; text-underline-offset: 3px; }

.done-check {
  width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--navy); color: var(--amber);
}
.done-check svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.form-done:not([hidden]), .form-fallback:not([hidden]) {
  animation: settle 400ms var(--ease-out);
}
.form-done:not([hidden]) .done-check { animation: pop 500ms var(--ease-out); }
@keyframes settle { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }

/* ───────────── Contact ───────────── */
.contact .section-head h2 { color: var(--navy); }
.phones {
  display: grid; grid-template-columns: repeat(3, max-content); justify-content: space-between; gap: 8px 32px; align-items: baseline;
  padding-bottom: clamp(36px, 5vw, 56px); margin-bottom: clamp(36px, 5vw, 56px);
  border-bottom: 1px solid var(--rule);
}
.phone {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-family: var(--font-display); font-weight: 850; letter-spacing: -0.03em;
  font-size: clamp(2.4rem, 4.3vw, 3.75rem); line-height: 1.05; color: var(--navy);
  text-decoration: none; font-variant-numeric: tabular-nums;
  transition: color 150ms ease;
}
.phone .cc { font-size: .34em; font-weight: 700; color: var(--slate); letter-spacing: 0; }
.phone:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .phone:hover { color: var(--amber-600); }
}

.contact-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.contact-card { padding: 28px; border-radius: var(--radius); background: var(--mist); }
.contact-card .ic-lg { width: 28px; height: 28px; fill: none; stroke: var(--amber); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-card h3 { margin-top: 18px; font-size: 20px; font-weight: 800; color: var(--navy); }
.contact-card p { margin-top: 10px; color: var(--slate); }
.contact-card .text-link { margin-top: 18px; }

.copy-list { margin-top: 12px; display: grid; gap: 8px; }
.copy-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.copy-list a { color: var(--ink); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) {
  .copy-list a:hover { text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 3px; }
}
.copy {
  position: relative; flex: none; width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center; background: #fff; border: 1px solid var(--rule); cursor: pointer; color: var(--slate);
  transition: transform 160ms var(--ease-out), color 150ms ease;
}
.copy:active { transform: scale(0.94); }
.copy svg {
  grid-area: 1 / 1; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: opacity 200ms ease, transform 200ms var(--ease-out), filter 200ms ease;
}
.copy .i-check { opacity: 0; transform: scale(.6); filter: blur(2px); color: var(--wa); }
.copy[data-copied] .i-copy { opacity: 0; transform: scale(.6); filter: blur(2px); }
.copy[data-copied] .i-check { opacity: 1; transform: none; filter: none; }

/* ───────────── Footer ───────────── */
.footer { background: var(--navy-900); color: rgba(255, 255, 255, .7); padding: 56px 0 40px; }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 28px 40px; align-items: center; }
.footer-logo { width: 260px; height: auto; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 24px; }
.footer-nav a { color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .footer-nav a:hover { color: #fff; } }
.footer-small { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13.5px; }

/* ───────────── Mobile action bar ───────────── */
.action-bar { display: none; }

/* ───────────── Toast ───────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-md);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity 200ms var(--ease-out), transform 250ms var(--ease-out);
}
.toast[data-show] { opacity: 1; transform: translate(-50%, 0); }

/* ───────────── Responsive ───────────── */
@media (max-width: 1080px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 48px; }
  .nav { display: none; }
  .menu-btn { display: grid; }
  .header-cta { margin-left: auto; }
}

@media (max-width: 1080px) and (min-width: 761px) {
  .phones { grid-template-columns: repeat(2, max-content); justify-content: start; column-gap: 48px; }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero-art { max-width: 520px; width: 100%; justify-self: center; margin: 24px 0 0; }
  .clients-inner, .about-inner, .quote-inner { grid-template-columns: 1fr; gap: 40px; }
  .clients h2, .quote-intro { position: static; }
  .contact-cards { grid-template-columns: 1fr; }
  .client-list li { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .header-phone, .header-cta .btn { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-name { font-size: 17px; }
  .brand-sub { font-size: 8.5px; letter-spacing: .14em; }

  .hero-art { max-width: 400px; }
  .stamp { font-size: 11px; padding: 8px 11px; top: 10%; }
  .hero .eyebrow { font-size: 11.5px; letter-spacing: .16em; }
  .hero-title { font-size: 10.6vw; }
  .ticker li { font-size: 13px; padding: 13px 0 13px 22px; gap: 22px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-facts { gap: 16px 24px; }
  .hero-facts strong { font-size: 26px; }

  .service-grid { grid-template-columns: 1fr; gap: 12px; }
  .service { display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; padding: 18px 18px 16px; }
  .service-icon { width: 48px; height: 48px; grid-row: span 2; }
  .service-icon svg { width: 26px; height: 26px; }
  .service-num { display: none; }
  .service h3 { margin-top: 0; font-size: 19px; align-self: end; }
  .service-tag { margin-top: 2px; font-size: 14px; }
  .service ul { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 0; margin: 14px 0 12px; }
  .service li { padding-left: 0; font-size: 13.5px; color: var(--slate); }
  .service li::before { display: none; }
  .service li:not(:last-child)::after { content: "·"; margin: 0 8px; color: var(--amber); font-weight: 700; }
  .service-link { grid-column: 1 / -1; }
  .steps { grid-template-columns: 1fr; row-gap: 36px; }
  .step { display: grid; grid-template-columns: 56px 1fr; column-gap: 16px; padding-top: 22px; }
  .step-n { font-size: 48px; grid-row: span 2; }
  .step h3 { margin-top: 0; }
  .step p { margin-top: 6px; }
  .row { grid-template-columns: 1fr; }
  .phones { grid-template-columns: 1fr; gap: 4px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { justify-content: flex-start; }

  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .action-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--navy-900) 94%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, .08);
    transition: transform 300ms var(--ease-drawer);
  }
  .action-bar[data-hidden] { transform: translateY(110%); }
  .action-bar a {
    display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px;
    border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff;
    font-family: var(--font-display); font-weight: 700; font-size: 15px; text-decoration: none;
    transition: transform 160ms var(--ease-out);
  }
  .action-bar a:active { transform: scale(0.97); }
  .action-bar a.primary { background: var(--amber); color: var(--ink); }
  .action-bar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* Reduced motion: keep fades that aid comprehension, drop movement */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; flex-wrap: wrap; width: auto; }
  .ticker ul[aria-hidden] { display: none; }
  .ticker ul { flex-wrap: wrap; justify-content: center; }
  .js .reveal, .js .hero-title .line, .js .hero-lede, .js .hero-actions, .js .hero-facts, .js .hero .eyebrow { transform: none; }
  /* Skip the build: show the finished house, no crane */
  .js .hero-art [pathLength], .is-building .hero-art [pathLength] { stroke-dashoffset: 0; animation: none; }
  .hero-art *, .is-building * { animation: none !important; }
  .js .bp-bricks rect, .js .bp-ext-roof, .js .bp-win .glass, .js .bp-win.is-new, .js .bp-door .knob,
  .js .bp-grass, .js .blueprint text, .js .stamp { opacity: 1; }
  .js .bp-slab, .js .bp-wash, .js .tuft { transform: none; }
  .bp-old path { stroke: rgba(255, 255, 255, .88); }
  .bp-old-roof path { stroke: var(--amber); }
  .bp-setout, .bp-broken, .bp-roller, .replay { display: none; }
  .js .stamp { transform: rotate(-6deg); }
  .js .bp-dim path, .js .bp-note path { stroke-dashoffset: 0; }
  .service, .btn, .chip span, .seg-thumb, .action-bar, .mobile-menu { transition-property: opacity, background-color, color, border-color; }
  .form-done:not([hidden]), .form-fallback:not([hidden]), .form-done:not([hidden]) .done-check { animation: none; }
}
