/* Window Cleaner Bristol. Clear glass, daylight. Single light theme by design (brief allows).
   Radius rule: buttons are pills, panels 18px, inputs 10px. One accent: --blue. */
:root {
  --sky: #e6f0f8;        --on-sky: #14273a;
  --glass: #f8fbfe;      --on-glass: #14273a;
  --mist: #d3e5f3;       --on-mist: #14273a;
  --slate: #1a3048;      --on-slate: #eef5fb;
  --blue: #0b5896;       --on-blue: #f8fbfe;
  --ribbon: #14273a;     --on-ribbon: #e6f0f8;
  --err: #9e1c1c;
  --muted: #3e5468;
  --line: #9db6cb;
  --r-panel: 18px;
  --r-input: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-out: cubic-bezier(.2, 0, 0, 1);
  --ease-wipe: cubic-bezier(.45, .05, .35, 1);
  --haze: rgb(150 146 130 / .42);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sky);
  color: var(--on-sky);
  font: 400 1.0625rem/1.6 "Onest", system-ui, sans-serif;
  overflow-wrap: anywhere;
  padding-bottom: 5rem; /* room for the mobile dock */
}
@media (min-width: 768px) { body { padding-bottom: 0; } }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.025em; margin: 0 0 .6em; overflow-wrap: normal; }
h1 { font-size: clamp(2.25rem, 6.4vw, 4.1rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 4.2vw, 2.8rem); font-weight: 800; max-width: 22ch; }
h3 { font-size: 1.35rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 768px) { .wrap { padding: 0 2rem; } }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 30; padding: .5rem 1rem; background: var(--glass); color: var(--on-glass); }

.ribbon {
  margin: 0; max-width: none; text-align: center;
  padding: .45rem 1rem; font-size: .8125rem; font-weight: 500;
  background: var(--ribbon); color: var(--on-ribbon);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .7rem 1.4rem; border-radius: 999px;
  font-family: inherit; font-size: 1rem; font-weight: 700; line-height: 1.1; text-decoration: none; white-space: nowrap;
  border: 2px solid transparent; cursor: pointer;
  position: relative; isolation: isolate; overflow: hidden;
  transition-property: scale, background-color, border-color, color;
  transition-duration: 150ms; transition-timing-function: ease-out;
}
.btn:active { scale: .96; }
/* A clean-glass glint crosses the button on hover. Behind the label (z -1, above the fill). */
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / .28) 44%, transparent 58%);
  transform: translateX(-110%);
}
@media (hover: hover) {
  .btn:hover::after { transform: translateX(110%); transition: transform .65s var(--ease-out); }
}
.btn-ink { background: var(--blue); color: var(--on-blue); border-color: var(--blue); }
.btn-ink:hover { background: var(--slate); color: var(--on-slate); border-color: var(--slate); }
.btn-line { background: var(--glass); color: var(--on-glass); border-color: var(--on-glass); }
.btn-line:hover { background: var(--mist); color: var(--on-mist); }
.btn-sm { min-height: 2.5rem; padding: .5rem 1.1rem; font-size: .95rem; }

/* Header */
.top { background: var(--sky); color: var(--on-sky); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; text-decoration: none; letter-spacing: -.01em; }
.brand-mark { width: 2rem; height: 2rem; flex: none; }
.bm-frame { fill: var(--slate); }
.bm-wipe { fill: none; stroke: var(--mist); stroke-width: 3.5; stroke-linecap: round; }
nav { display: none; }
@media (min-width: 900px) {
  nav { display: flex; align-items: center; gap: 1.6rem; }
  nav a:not(.btn) { text-decoration: none; font-weight: 500; }
  nav a:not(.btn) { position: relative; padding: .25rem 0; }
  nav a:not(.btn)::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor;
    transform: scaleX(0); transform-origin: right; transition: transform .3s var(--ease-out);
  }
  nav a:not(.btn):hover::after, nav a:not(.btn):focus-visible::after { transform: scaleX(1); transform-origin: left; }
}

/* Hero */
.hero { padding: 2.5rem 0 3.5rem; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 4rem 0 5rem; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 4rem; }
}
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.1rem; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.pane-art { margin: 0; justify-self: center; width: min(100%, 420px); }
@media (max-width: 899px) { .pane-art { width: min(78%, 340px); } }
.pane-art svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 24px 40px rgb(26 48 72 / .18)); }
.frame { fill: var(--slate); }
.bar { fill: var(--slate); }
.glint { fill: #fff; opacity: .5; }
.haze { fill: #b9b6a8; opacity: .78; }
.wipe-path { fill: none; stroke: #000; stroke-width: 96; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
/* Squeegee and post-wipe shine: hidden at rest, only shown while JS / CSS plays them. */
.squeegee { opacity: 0; }
.sq-handle { fill: var(--slate); }
.sq-channel { fill: #8ea6ba; }
.sq-rubber { fill: #0d1b29; }
.sweep { fill: #fff; opacity: 0; }

/* Headline haze: a soapy film over the h1, wiped off left to right by a blade.
   Text stays legible through the film from the first frame; done by .8s. */
.wiped { position: relative; }

@media (prefers-reduced-motion: no-preference) {
  .bm-wipe { stroke-dasharray: 1; animation: draw 1s .15s var(--ease-out) both; }
  .wipe-path { animation: draw .95s .25s var(--ease-wipe) both; }
  .sweep { animation: shine .6s 1.05s var(--ease-out) both; }
  @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes shine {
    0% { opacity: 0; transform: translateX(-60px); }
    35% { opacity: .55; }
    100% { opacity: 0; transform: translateX(470px); }
  }

  .wiped::before, .wiped::after { content: ""; position: absolute; inset: -.08em -.15em; pointer-events: none; }
  .wiped::before {
    background: radial-gradient(circle at 30% 40%, rgb(255 255 255 / .5) 0 .06em, transparent .07em) 0 0 / .5em .45em,
      rgb(236 243 249 / .5);
    animation: haze-off .7s .1s var(--ease-wipe) both;
  }
  .wiped::after {
    background: linear-gradient(to left, var(--slate) 0 5px, rgb(255 255 255 / .7) 5px 10px, transparent 10px);
    animation: blade-pass .7s .1s var(--ease-wipe) both;
  }
  @keyframes haze-off { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 0 100%); } }
  @keyframes blade-pass {
    0% { transform: translateX(-100%); opacity: 1; }
    88% { opacity: 1; }
    100% { transform: translateX(0); opacity: 0; }
  }

  /* The rest of the hero copy settles in behind the headline. */
  .hero-copy > :not(h1) { animation: rise .5s var(--ease-out) both; }
  .hero-copy > .lede { animation-delay: .18s; }
  .hero-copy > .cta-row { animation-delay: .28s; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
}

/* Services: four cells, asymmetric */
.services { padding: 4rem 0; }
.svc-grid { display: grid; gap: 1rem; margin-top: 2rem; }
.svc { border-radius: var(--r-panel); padding: 1.75rem; background: var(--glass); color: var(--on-glass); }
.svc p { color: inherit; }
.svc p:last-child { margin-bottom: 0; }
.svc-windows {
  background: var(--mist); color: var(--on-mist);
  background-image: linear-gradient(115deg, transparent 0 58%, rgb(255 255 255 / .55) 58% 63%, transparent 63% 68%, rgb(255 255 255 / .4) 68% 70%, transparent 70%);
}
.svc-windows h3 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.svc-windows { position: relative; overflow: hidden; }
.gutter-art { display: block; width: 7.5rem; height: auto; margin-bottom: 1.5rem; }
.gutter-art path { fill: none; stroke: var(--on-slate); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.svc-gutters { background: var(--slate); color: var(--on-slate); }
.own-words { font-size: 1.35rem; font-weight: 700; line-height: 1.3; margin-top: 1.5rem; }
.own-words span { display: block; font-size: .875rem; font-weight: 400; margin-top: .4rem; }
@media (min-width: 768px) {
  .svc-grid { grid-template-columns: 1fr 1fr 1.1fr; grid-template-rows: auto auto; }
  .svc-windows { grid-column: 1 / 3; padding: 2.5rem; min-height: 15rem; display: flex; flex-direction: column; justify-content: flex-end; }
  .svc-gutters { grid-column: 3; grid-row: 1 / 3; padding: 2.5rem; display: flex; flex-direction: column; justify-content: space-between; }
}

/* Years */
.years { padding: 3rem 0 4rem; }
.years-grid { display: grid; gap: 1rem; align-items: center; }
.big-num {
  margin: 0; font-size: clamp(6rem, 26vw, 15rem); font-weight: 800; line-height: .9; letter-spacing: -.06em;
  color: var(--blue); padding: .04em .06em .02em;
}
.kinds { display: grid; gap: 1.25rem; margin: 1.5rem 0 0; }
.kinds dt { font-weight: 700; font-size: 1.1rem; }
.kinds dd { margin: .2rem 0 0; color: var(--muted); }
@media (min-width: 768px) {
  .years-grid { grid-template-columns: auto 1fr; gap: 3.5rem; }
  .kinds { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

/* Work plates */
.work { padding: 4rem 0; }
.section-lede { color: var(--muted); }
.plates { display: grid; gap: 1rem; margin: 2rem 0 1.5rem; }
.plate {
  display: grid; place-items: center; min-height: 12rem; padding: 1.5rem; text-align: center;
  border-radius: var(--r-panel); border: 2px dashed var(--line);
  background: var(--glass); color: var(--on-glass);
  background-image: linear-gradient(to right, transparent calc(50% - 5px), rgb(26 48 72 / .08) calc(50% - 5px) calc(50% + 5px), transparent calc(50% + 5px)),
    linear-gradient(to bottom, transparent calc(50% - 5px), rgb(26 48 72 / .08) calc(50% - 5px) calc(50% + 5px), transparent calc(50% + 5px));
}
.plate p { margin: 0; font-weight: 700; max-width: 24ch; background: var(--glass); color: var(--on-glass); padding: .4rem .7rem; border-radius: var(--r-input); }
@media (min-width: 768px) {
  .plates { grid-template-columns: 1.7fr 1fr; }
  .plate { min-height: 18rem; }
}
.text-link { font-weight: 700; color: var(--blue); text-underline-offset: 4px; }

/* Quote */
.quote { padding: 4rem 0; background: var(--glass); color: var(--on-glass); }
.quote-grid { display: grid; gap: 2rem; }
@media (min-width: 900px) { .quote-grid { grid-template-columns: .8fr 1.2fr; gap: 4rem; } }
.quote-intro p { color: var(--muted); }
.direct { font-weight: 500; }
.direct a { color: var(--blue); font-weight: 700; }
.form { display: grid; gap: 1.25rem; }
.field { display: grid; gap: .45rem; border: 0; margin: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-weight: 700; padding: 0; }
.field legend { margin-bottom: .45rem; }
.opt { font-weight: 400; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]), textarea {
  width: 100%; font: inherit; padding: .75rem .9rem; border-radius: var(--r-input);
  border: 2px solid var(--line); background: var(--sky); color: var(--on-sky);
  transition-property: border-color, box-shadow; transition-duration: .2s; transition-timing-function: var(--ease-out);
}
input:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgb(11 88 150 / .25); }
[aria-invalid="true"] { border-color: var(--err) !important; }
.checks { display: flex; flex-wrap: wrap; gap: .6rem; }
.checks label {
  display: inline-flex; align-items: center; gap: .5rem; font-weight: 500;
  padding: .55rem .95rem; border-radius: 999px; border: 2px solid var(--line); cursor: pointer;
  background: var(--sky); color: var(--on-sky);
  transition-property: scale, border-color, background-color; transition-duration: 150ms; transition-timing-function: ease-out;
}
.checks label:active { scale: .96; }
.checks label:has(input:checked) { border-color: var(--blue); background: var(--mist); color: var(--on-mist); }
.checks input { accent-color: var(--blue); width: 1.1rem; height: 1.1rem; margin: 0; }
.help { font-size: .9rem; color: var(--muted); margin: 0; }
.err { font-size: .9rem; font-weight: 500; color: var(--err); margin: 0; }
.form .btn { justify-self: start; }
.done { align-self: start; border-radius: var(--r-panel); padding: 2rem; background: var(--mist); color: var(--on-mist); }
.done p { margin: 0; }
.tick { display: block; width: 3rem; height: 3rem; margin-bottom: 1rem; }
.tick circle, .tick path { fill: none; stroke: var(--blue); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }

/* Reviews */
.reviews { padding: 4rem 0; }
.reviews-card {
  display: grid; gap: 2rem;
}
.reviews-card > div, .how { border-radius: var(--r-panel); }
.how {
  margin: 0; padding: 1.75rem 1.75rem 1.75rem 3.2rem; background: var(--slate); color: var(--on-slate);
  display: grid; gap: 1rem; font-size: 1.1rem; align-content: center;
}
.how li::marker { font-weight: 800; }
@media (min-width: 900px) { .reviews-card { grid-template-columns: 1.3fr 1fr; gap: 4rem; align-items: center; } }

/* Footer */
.foot { background: var(--slate); color: var(--on-slate); padding: 3rem 0 2rem; font-size: .95rem; }
.foot-grid { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .foot-grid { grid-template-columns: 1.2fr 1fr 1.2fr; gap: 2.5rem; } }
.foot-name { font-weight: 800; font-size: 1.15rem; margin-bottom: .4rem; }
.foot-h { font-weight: 700; margin-bottom: .3rem; }
.foot a { text-underline-offset: 3px; }

/* Mobile dock */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
  padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom));
  background: var(--glass); color: var(--on-glass); border-top: 1px solid var(--line);
}
.dock .btn { padding-left: .5rem; padding-right: .5rem; }
@media (min-width: 768px) { .dock { display: none; } }
/* With JS, the dock arrives once the hero's own call buttons have scrolled away. */
@media (max-width: 767px) {
  .js .dock { transition: transform .4s var(--ease-out); }
  .js .dock:not(.show) { transform: translateY(calc(100% + 2px)); }
}

/* Very narrow phones: let long button labels wrap rather than overflow. */
@media (max-width: 359px) { .btn { white-space: normal; text-align: center; } }

/* ---------- Scroll choreography ----------
   Hidden states only exist under html.js + .armed (set by app.js on the first scroll, for elements
   still below the fold), so an unscrolled capture or a no-JS visit shows everything. */
@media (prefers-reduced-motion: no-preference) {
  .js .rv {
    transition-property: opacity, transform, filter; transition-duration: .6s; transition-timing-function: var(--ease-out);
    transition-delay: calc(var(--i, 0) * 80ms);
  }
  .js .rv.armed:not(.in) { opacity: 0; transform: translateY(16px); filter: blur(4px); transition: none; }

  .js .svc-windows.in::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(110deg, transparent 35%, rgb(255 255 255 / .6) 48%, transparent 60%);
    animation: glint 1.1s .35s var(--ease-out) both;
  }
  @keyframes glint { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
  .js .svc-gutters .gutter-art path { transition: stroke-dashoffset 1.1s .3s var(--ease-wipe); }
  .js .svc-gutters.armed:not(.in) .gutter-art path { stroke-dashoffset: 1; }

  .js .form .err:not([hidden]) { animation: rise .22s var(--ease-out) both; }
  .done:not([hidden]) { animation: clear-in .55s var(--ease-wipe) both; }
  .done:not([hidden]) .tick circle { animation: draw .5s .25s var(--ease-out) both; }
  .done:not([hidden]) .tick path { animation: draw .35s .6s var(--ease-out) both; }
  @keyframes clear-in { from { clip-path: inset(0 100% 0 0 round var(--r-panel)); } to { clip-path: inset(0 0 0 0 round var(--r-panel)); } }

  /* Scrub plates: a haze wiped off by a squeegee blade as the plate scrolls into view. */
  .scrub { position: relative; }
  .scrub::before, .scrub::after { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
  .scrub::before {
    background: radial-gradient(circle at 30% 40%, rgb(255 255 255 / .45) 0 2px, transparent 3px) 0 0 / 22px 19px, var(--haze);
  }
  .scrub::after { background: linear-gradient(to left, var(--slate) 0 6px, rgb(255 255 255 / .75) 6px 12px, transparent 12px); }

  @supports (animation-timeline: view()) {
    .scrub { view-timeline: --scrub block; }
    .scrub::before, .scrub::after { content: ""; animation: haze-off linear both; animation-timeline: --scrub; animation-range: entry 60% cover 50%; }
    .scrub::after { animation-name: blade-pass; }
  }
  @supports not (animation-timeline: view()) {
    .js .scrub::before, .js .scrub::after { content: ""; }
    .js .scrub::after { transform: translateX(-100%); }
    .js .scrub.in::before { animation: haze-off 1s .1s var(--ease-wipe) both; }
    .js .scrub.in::after { animation: blade-pass 1s .1s var(--ease-wipe) both; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
