/* Waterloo Rain Gutter Systems — v2
   One family (Archivo), width as personality: expanded for headlines, normal for reading.
   Colors come from the W logo: charcoal, Texas blue, red, white. */

:root {
  /* Palette taken from the Waterloo "W" logo */
  --charcoal: #1A1D27; /* logo background: header, hero, dark bands, footer */
  --charcoal-2: #252A37;
  --sky: #F2F4F7;      /* light page sections */
  --paper: #FFFFFF;
  --ink: #1A1D27;      /* text on light */
  --slate: #545B6B;    /* secondary text on light */
  --mist: #AEB6C4;     /* secondary text on dark */
  --alum: #C9CFD8;     /* rules, outlines */
  --blue: #1D5A92;     /* logo blue: links, accents */
  --blue-light: #3882AF;
  --red: #CD1B35;      /* logo red: main buttons, stars */
  --red-dark: #A3142A;
  --white: #FCFCFC;
  --water: var(--blue);
  --copper: #B0663A;
  --error: #B3261E;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4.5rem, 10vw, 8rem);

  --f: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--f);
  font-stretch: 100%;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--water); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { margin: 0; font-stretch: 125%; line-height: 1.05; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 750; }
h3 { font-size: 1.3rem; font-weight: 700; font-stretch: 112%; line-height: 1.2; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 100; }
.skip:focus { left: 0.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: 0.8rem 1.5rem;
  font: inherit; font-weight: 700; font-stretch: 112%; font-size: 1rem;
  text-decoration: none; border-radius: 4px; cursor: pointer;
  border: 2px solid var(--ink);
  transition: background-color .15s ease, color .15s ease;
}
.btn-tape { background: var(--red); border-color: var(--red); color: #fff; }
.btn-tape:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-line { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-line:hover { background: #fff; color: var(--charcoal); border-color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(26, 29, 39, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #2E3442;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.wordmark { display: flex; align-items: center; gap: 0.7rem; color: #fff; text-decoration: none; font-size: 0.95rem; line-height: 1.15; }
.wordmark strong { font-stretch: 125%; font-weight: 800; font-size: 1.1rem; }
.wordmark .logo { width: 2.75rem; flex: none; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 1.75rem; }
.nav a { color: #E4E8EE; text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav a:hover { text-decoration: underline; }
.nav .nav-phone { font-weight: 750; font-stretch: 112%; padding: 0.45rem 0.85rem; background: var(--red); color: #fff; border-radius: 4px; }
.nav .nav-phone:hover { background: var(--red-dark); text-decoration: none; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .wordmark span { font-size: 0.85rem; }
  .nav-toggle {
    display: block; font: inherit; font-weight: 700; background: none;
    border: 2px solid rgba(255,255,255,.7); border-radius: 4px; padding: 0.4rem 0.9rem; color: #fff; cursor: pointer;
  }
  .nav ul {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--charcoal); border-bottom: 1px solid #2E3442; padding: 0.5rem var(--gutter) 1.25rem;
  }
  .nav ul.is-open { display: flex; }
  .nav li a { display: block; padding: 0.8rem 0; border-bottom: 1px solid #2E3442; }
  .nav .nav-phone { margin-top: 0.9rem; text-align: center; border-bottom: 0; padding: 0.8rem; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(3.5rem, 9vw, 7rem); overflow: hidden; background: var(--charcoal); color: #fff; }
.hero-kicker { color: var(--mist); font-weight: 500; margin-bottom: 1.25rem; }
.hero-title {
  font-size: clamp(3rem, 10.5vw, 8.25rem);
  font-weight: 820;
  line-height: 0.9;
  letter-spacing: -0.025em;
  max-width: 11ch;
}
.hero-sub { margin-top: 1.75rem; max-width: 36rem; font-size: 1.15rem; color: #C9CFD9; }
.hero-actions { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* The measuring tape: the one bold moment on the page */
.tape-run { margin: clamp(3.5rem, 8vw, 6rem) 0 0; }
.tape-track { position: relative; height: 4.5rem; display: flex; align-items: center; }
.tape {
  position: relative;
  height: 3.25rem; width: 100%;
  background: var(--white);
  border-top: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
  transform-origin: left center;
  overflow: hidden;
}
/* inch ticks + half-foot ticks; one foot = var(--ft) */
.tape { --ft: 72px; }
.tape::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 100%;
  background:
    linear-gradient(to right, var(--ink) 0 2px, transparent 2px) var(--off, 0px) 0 / var(--ft) 62% repeat-x,
    linear-gradient(to right, var(--ink) 0 1px, transparent 1px) var(--off, 0px) 0 / calc(var(--ft) / 2) 38% repeat-x,
    linear-gradient(to right, var(--ink) 0 1px, transparent 1px) var(--off, 0px) 0 / calc(var(--ft) / 12) 20% repeat-x;
}
.tape-ticks { position: absolute; inset: 0; }
.tape-ticks span {
  color: var(--charcoal);
  position: absolute; bottom: 0.2rem;
  transform: translateX(-50%);
  font-stretch: 75%; font-weight: 700; font-size: 1rem; line-height: 1; color: var(--ink);
}
.tape-ticks span.is-foot { color: var(--red); }
.tape-case {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 5.5rem; height: 4.5rem;
  background: var(--ink); border-radius: 14px 4px 4px 14px;
  display: none;
}
.tape-case-hook { display: none; }

.tape-caption {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.25rem;
  padding-top: 1.1rem; padding-bottom: clamp(4rem, 9vw, 7rem);
  color: var(--mist);
}
.tape-readout { font-stretch: 125%; font-weight: 800; font-size: 1.6rem; color: #fff; font-variant-numeric: tabular-nums; }

/* entrance: tape pulls out left to right once, readout counts up (JS) */
.js .tape { transform: scaleX(0); }
.js .tape.is-out { transform: scaleX(1); transition: transform 1.8s cubic-bezier(.22,.8,.24,1) .35s; }
@media (prefers-reduced-motion: reduce) {
  .js .tape, .js .tape.is-out { transform: none; transition: none; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.section-paper { background: var(--paper); border-block: 1px solid var(--alum); }
.section-ink { background: var(--charcoal); color: #E7EDF1; border-top: 1px solid #2E3442; }
.section-head { max-width: 40rem; margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }
.lede { margin-top: 1rem; color: var(--slate); font-size: 1.125rem; max-width: 34rem; }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Services: a plain definition list on a single rule, like a spec sheet */
.services { margin: 0; border-top: 3px solid var(--blue); }
.service { display: grid; grid-template-columns: 11rem 1fr; gap: 0.5rem 2rem; padding: 1.4rem 0; border-bottom: 1px solid var(--alum); }
.service dt { font-weight: 750; font-stretch: 112%; font-size: 1.15rem; }
.service dd { margin: 0; color: var(--slate); max-width: 34rem; }
@media (max-width: 560px) { .service { grid-template-columns: 1fr; } }

/* Profiles */
.profiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 3.5rem); }
@media (max-width: 940px) { .profiles { grid-template-columns: 1fr; max-width: 36rem; } }
.profile h3 { margin-top: 1.5rem; }
.profile > p { margin-top: 0.6rem; color: var(--slate); }
.profile-drawing {
  background: var(--sky);
  border: 1px solid var(--alum);
  border-radius: 6px;
  padding: 1.25rem 1rem;
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
}
.profile-drawing svg { width: 100%; height: 100%; overflow: visible; }
.fascia { stroke: var(--alum); stroke-width: 6; stroke-linecap: round; fill: none; }
.g-out { fill: none; stroke: var(--ink); stroke-width: 8; stroke-linejoin: round; stroke-linecap: round; }
.g-in { fill: none; stroke: var(--k-fill, #F4F4F1); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; transition: stroke .25s ease; }
.g-alum { stroke: #DCE2E6; }
.g-copper { stroke: #C47A48; }
.bead { fill: #C47A48; stroke: var(--ink); stroke-width: 2; }
.guard { stroke: var(--ink); stroke-width: 3; stroke-dasharray: 4 3; fill: none; }
.leaves path { fill: #7C8B4A; }
.dim path { stroke: var(--slate); stroke-width: 1; fill: none; }
.dim text { font-family: var(--f); font-size: 10px; font-weight: 700; fill: var(--ink); }
#k-shape { transform-origin: 22px 96px; transition: transform .3s ease; }
.is-6 #k-shape { transform: scale(1.12); }

.option-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1.1rem; }
.option-label { width: 3.5rem; font-weight: 600; font-size: 0.95rem; }
.chip {
  font: inherit; font-size: 0.95rem; font-weight: 600;
  padding: 0.35rem 0.9rem; min-height: 2.5rem;
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--alum); border-radius: 999px; cursor: pointer;
}
.chip.is-on { border-color: var(--blue); background: var(--blue); color: #fff; }
.swatch {
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--c); border: 1.5px solid var(--alum); cursor: pointer; padding: 0;
}
.swatch.is-on { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.swatch-name { font-size: 0.95rem; color: var(--slate); margin-left: 0.25rem; }
.fine { font-size: 0.875rem; color: var(--slate); margin-top: 0.75rem; }

/* Steps: a real sequence, so it's numbered */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 3rem); counter-reset: step; }
.steps li { counter-increment: step; border-top: 3px solid var(--blue); padding-top: 1.25rem; }
.steps li::before {
  content: counter(step);
  display: block; color: var(--red); font-stretch: 125%; font-weight: 800; font-size: 2.75rem; line-height: 1; margin-bottom: 1rem;
}
.steps p { margin-top: 0.6rem; color: var(--slate); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; max-width: 36rem; } }

/* Lone stars */
.tape-star { width: 1.35rem; fill: var(--red); align-self: center; }

/* Texas weather band */
.weather { position: relative; overflow: hidden; }
.weather h2 { color: #fff; }
.weather .lede { color: var(--mist); }
.weather-star {
  position: absolute; right: -6rem; top: 50%; transform: translateY(-50%);
  width: clamp(20rem, 42vw, 34rem); fill: none; stroke: rgba(56,130,175,.22); stroke-width: 1.5;
  pointer-events: none;
}
.weather .wrap { position: relative; }
.weather-list { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 3rem); }
.weather-list > div { border-top: 3px solid var(--red); padding-top: 1.25rem; }
.weather-list dt { font-weight: 750; font-stretch: 112%; font-size: 1.2rem; line-height: 1.25; color: #fff; }
.weather-list dd { margin: 0.6rem 0 0; color: #C9CFD9; }
@media (max-width: 860px) { .weather-list { grid-template-columns: 1fr; max-width: 36rem; } }

/* Story + map */
.story { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.story-body { font-size: 1.15rem; max-width: 36rem; margin-top: 1.5rem; color: var(--slate); }
.story-body p + p { margin-top: 1.1rem; }
.tx-map { margin: 0; }
.tx-map svg { width: 100%; max-width: 26rem; overflow: visible; }
.tx { fill: var(--sky); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.tx-area { fill: rgba(29,90,146,.14); stroke: var(--water); stroke-width: 1.5; stroke-dasharray: 4 3; }
.tx-star { fill: var(--red); }
.tx-label { font-family: var(--f); font-weight: 750; font-size: 17px; fill: var(--ink); }
.tx-map figcaption { margin-top: 1rem; color: var(--slate); max-width: 26rem; }
@media (max-width: 860px) { .story { grid-template-columns: 1fr; } }

/* Contact */
.contact-direct { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid var(--alum); }
.contact-direct li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--alum); overflow-wrap: anywhere; }
.contact-direct span { color: var(--slate); font-size: 0.95rem; }
.contact-direct a { font-weight: 600; }

.form { background: var(--paper); border: 1px solid var(--alum); border-radius: 6px; padding: clamp(1.5rem, 4vw, 2.5rem); }
.field { margin-bottom: 1.25rem; border: 0; padding: 0; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.4rem; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 0.75rem 0.85rem; min-height: 3rem;
  background: var(--paper);
  border: 1.5px solid #9AA9B4; border-radius: 4px;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--water); box-shadow: 0 0 0 3px rgba(29,90,146,.25); }
.field [aria-invalid="true"] { border-color: var(--error); }
.error { color: var(--error); font-size: 0.875rem; margin-top: 0.35rem; min-height: 0; }
.error:empty { display: none; }
.form-hint { margin: -0.5rem 0 1.25rem; }
.form-hint.is-error { color: var(--error); }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form .btn { width: 100%; margin-top: 0.25rem; }
.form .btn[disabled] { opacity: .6; cursor: wait; }
.form-status { margin-top: 1rem; font-weight: 600; }
.form-status:empty { display: none; }
.form-status.is-ok { color: #1F6B3A; }
.form-status.is-err { color: var(--error); }

/* Footer */
.site-footer { background: var(--charcoal); color: var(--mist); border-top: 4px solid var(--red); padding-block: 3rem; font-size: 0.95rem; }
.site-footer strong { color: #fff; font-stretch: 112%; }
.site-footer a { color: #E7EDF1; }
.footer-inner { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 1.5rem 3rem; }
.footer-legal a { margin-right: 1rem; }
.footer-brand { display: flex; gap: 1rem; align-items: flex-start; }
.footer-brand .logo { width: 3.25rem; flex: none; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }
