/* base.css — Maple Street Cleaners: reset, primitives and page chrome.
   Section-level design lives in site.css. Colour lives in tokens.css. */

/* ------------------------------------------------------------------ reset */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(var(--duna-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin: 0 0 var(--sp-3);
  text-wrap: balance;
}
h1 { font-size: var(--fs-4); letter-spacing: -0.032em; }
h2 { font-size: var(--fs-3); letter-spacing: -0.026em; }
h3 { font-size: var(--fs-2); letter-spacing: -0.02em; }
p { margin: 0 0 var(--sp-3); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }
b, strong { font-weight: 600; color: var(--ink); }

::selection { background: var(--slate); color: var(--on-slate); }
:focus-visible { outline: 2px solid var(--slate); outline-offset: 3px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--slate); color: var(--on-slate);
  padding: 0.85rem 1.25rem; font-weight: 600; text-decoration: none;
  border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ------------------------------------------------------------------ layout */

.container { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.container--narrow { --maxw: 960px; }
.container--mid { --maxw: 1080px; }

.section { padding-block: var(--section-y); position: relative; }
.section--tint { background: var(--paper-2); }
.section--slate { background: var(--slate); color: var(--on-slate); }
.section--deep { background: var(--slate-deep); color: var(--on-slate); }
.section--hair { border-top: 1px solid var(--line); }
.section--slate h1, .section--slate h2, .section--slate h3,
.section--deep h1, .section--deep h2, .section--deep h3 { color: var(--on-slate); }

.split { display: grid; gap: var(--sp-5); align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 5rem); }
  .split--flip > :first-child { order: 2; }
  .split--wide-left { grid-template-columns: 1.15fr 0.85fr; }
  .split--wide-right { grid-template-columns: 0.85fr 1.15fr; }
}

.stack > * + * { margin-top: var(--sp-3); }

/* Section intro: label, headline, one explanatory line — always on one measure. */
.sec-head { max-width: 46rem; margin-bottom: clamp(2rem, 4.5vw, 3.25rem); }
.sec-head > :last-child { margin-bottom: 0; }
.sec-head .lead { margin-top: var(--sp-3); }
.sec-head--center { margin-inline: auto; text-align: center; }
.sec-head--center .lead { margin-inline: auto; }

.eyebrow {
  display: block; margin: 0 0 var(--sp-3);
  font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--slate);
}
.section--slate .eyebrow, .section--deep .eyebrow { color: rgba(247, 244, 237, 0.72); }

.lead { font-size: var(--fs-1); line-height: 1.55; color: var(--muted); }
.section--slate .lead, .section--deep .lead { color: rgba(247, 244, 237, 0.82); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1; }

/* The dotted hairline is the connective tissue of the whole site — it is the
   line off the shop ticket, reused as every divider on every page. */
.hair { border: 0; border-top: 1px dotted var(--line-2); margin: 0; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 52px; padding: 0.85rem 1.55rem;
  border: 1px solid transparent; border-radius: var(--r);
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.btn--primary { background: var(--slate); color: var(--on-slate); border-color: var(--slate); box-shadow: var(--shadow-sm); }
.btn--primary:hover, .btn--primary:focus-visible {
  background: var(--slate-deep); border-color: var(--slate-deep);
  transform: translateY(-1px); box-shadow: 0 12px 22px -14px rgba(27, 44, 61, 0.85);
}
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover, .btn--ghost:focus-visible { border-color: var(--ink); background: rgba(28, 37, 48, 0.045); transform: translateY(-1px); }
.btn--lg { min-height: 58px; padding: 1rem 1.9rem; font-size: 1.05rem; }

/* Inside a saturated band the fills invert so the control keeps a visible edge. */
.section--slate .btn--primary, .section--deep .btn--primary {
  background: var(--on-slate); color: var(--slate-deep); border-color: var(--on-slate);
}
.section--slate .btn--primary:hover, .section--deep .btn--primary:hover { background: #FFFFFF; border-color: #FFFFFF; }
.section--slate .btn--ghost, .section--deep .btn--ghost { color: var(--on-slate); border-color: rgba(247, 244, 237, 0.45); }
.section--slate .btn--ghost:hover, .section--deep .btn--ghost:hover { background: rgba(247, 244, 237, 0.10); border-color: var(--on-slate); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin-top: var(--sp-4); }
/* On a phone two buttons of different widths stacked left look like an accident.
   Full width, and the tap target gets bigger at the same time. */
@media (max-width: 560px) {
  .btn-row { gap: var(--sp-2); }
  .btn-row > .btn { width: 100%; }
}

/* Text link with a rule that draws itself on hover. */
.link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 600; text-decoration: none; color: var(--slate);
  padding-bottom: 2px; background-image: linear-gradient(var(--slate), var(--slate));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 1px;
  transition: background-size var(--dur) var(--ease), color var(--dur) var(--ease);
}
.link:hover { color: var(--slate-deep); background-size: 100% 2px; }
.link svg, .link .arw { transition: transform var(--dur) var(--ease); }
.link:hover .arw { transform: translateX(3px); }

/* ------------------------------------------------------------------ media */

.media { overflow: hidden; border-radius: var(--r-lg); background: var(--paper-3); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.r-4-3 { aspect-ratio: 4 / 3; }
.r-3-4 { aspect-ratio: 3 / 4; }
.r-4-5 { aspect-ratio: 4 / 5; }
.r-16-9 { aspect-ratio: 16 / 9; }

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
@supports not (backdrop-filter: blur(1px)) { .site-header { background: var(--paper); } }
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 6px 20px -18px rgba(28, 37, 48, 0.9); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); min-height: var(--header-h);
}

.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.14rem;
  letter-spacing: -0.025em; text-decoration: none; color: var(--ink);
  padding-block: 0.4rem;
}
.brand__mark {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: var(--r); background: var(--slate); color: var(--on-slate);
  font-family: var(--font-display); font-size: 1rem; font-weight: 700; letter-spacing: 0;
  line-height: 1; padding-bottom: 1px;
}

.nav { display: flex; align-items: center; gap: clamp(1.1rem, 2.4vw, 2rem); }
.nav a:not(.btn) {
  position: relative; text-decoration: none; font-weight: 500; font-size: 0.97rem;
  color: var(--ink-2); padding-block: 0.6rem;
  transition: color var(--dur) var(--ease);
}
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.15rem; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav a:not(.btn):hover { color: var(--slate); }
.nav a:not(.btn):hover::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--slate); font-weight: 600; }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav .btn { min-height: 44px; padding: 0.6rem 1.15rem; font-size: 0.95rem; }
.header-phone { display: none; }
@media (min-width: 1080px) { .header-phone { display: inline; } }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-2); border-radius: var(--r);
  width: 46px; height: 44px; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink);
}
.nav-toggle:hover { border-color: var(--ink); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: var(--sp-2) var(--gutter) var(--sp-4);
    box-shadow: 0 20px 40px -28px rgba(28, 37, 48, 0.8);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding: 0.95rem 0; border-bottom: 1px dotted var(--line-2); font-size: 1.05rem; }
  .nav a:not(.btn)::after { display: none; }
  .nav .btn { margin-top: var(--sp-3); width: 100%; min-height: 52px; font-size: 1rem; }
}

/* ------------------------------------------------------------------ footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--sp-5) var(--sp-4);
  color: var(--muted); font-size: var(--fs-sm); background: var(--paper);
}
.site-footer .container { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.site-footer p { max-width: 34ch; margin-bottom: var(--sp-2); }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--slate); text-decoration: underline; text-underline-offset: 3px; }
.site-footer .brand { font-size: 1.05rem; margin-bottom: var(--sp-2); }
.footer-h { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink); margin: 0 0 var(--sp-2); }
.footer-links { display: grid; gap: 0.4rem; }
.site-footer .demo {
  grid-column: 1 / -1; border-top: 1px dotted var(--line-2);
  padding-top: var(--sp-3); margin: var(--sp-2) 0 0; max-width: none; font-size: 0.8rem;
}

/* ------------------------------------------------------------------ sticky call bar (mobile) */

.cta-bar {
  position: fixed; left: 0; right: 0; z-index: 90; display: none;
  bottom: calc(var(--duna-h) + env(safe-area-inset-bottom));
  padding: 0.6rem var(--gutter) 0.7rem;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -18px rgba(28, 37, 48, 0.9);
}
@supports not (backdrop-filter: blur(1px)) { .cta-bar { background: var(--paper); } }
.cta-bar .btn { width: 100%; }
.cta-bar__hours { display: block; text-align: center; font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; }
@media (max-width: 860px) {
  .cta-bar { display: block; }
  body.has-cta-bar { padding-bottom: calc(var(--duna-h) + 104px + env(safe-area-inset-bottom)); }
}

/* ------------------------------------------------------------------ reveal */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 640ms var(--ease), transform 640ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ Duna sample-site bar */

/* ---------- Duna Marketing sample-site bar ---------- */
/* Frosted glass: the page shows through a dark-grey translucent bar, so it belongs to every
   palette while still reading as a control. The whole bar is one link back to dunamarketing.com.
   rgba(25,28,35,.72) composited over even a pure-white page keeps white text at 6.7:1; the
   backdrop blur is decoration on top of that, never load-bearing. On phones the site's own
   .cta-bar lifts above it. */
:root { --duna-h: 54px; }
.duna-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  box-sizing: border-box; min-height: var(--duna-h);
  /* Three columns so the button stays optically centred no matter how wide the copyright is. */
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem;
  padding: 0.55rem 1rem calc(0.55rem + env(safe-area-inset-bottom));
  background: rgba(25, 28, 35, 0.72);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #FFFFFF; text-decoration: none;
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  font-family: var(--font-body); font-size: 0.92rem; line-height: 1.3; text-align: center;
  cursor: pointer; transition: background 0.15s ease;
}
/* No colour here: `.duna-bar a` (0,1,1) would outrank .duna-bar__btn--text (0,1,0) and paint
   the text button white on white. The button classes own their colours. */
.duna-bar a { text-decoration: none; }
.duna-bar__copy {
  justify-self: start; font-size: 0.76rem; letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.85);   /* 5.42:1 on the bar over even a white page */
  white-space: nowrap;
}
.duna-bar__note {
  grid-column: 3; justify-self: end; font-size: 0.76rem; letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.85);   /* same 5.42:1 as the copyright */
  white-space: nowrap;
}
/* Two buttons now, side by side and optically centred in the middle column. */
.duna-bar__actions { grid-column: 2; justify-self: center; display: inline-flex; align-items: center; gap: 0.5rem; }
.duna-bar__btn {
  /* Own dark fill over the bar's glass: transparent let each site's palette bleed through and
     muddied the white text. Black at 45% takes it from 6.7:1 to 12.7:1 in the worst case
     (a pure-white page behind the bar) while staying translucent. */
  display: inline-block; background: rgba(0, 0, 0, 0.45); color: #FFFFFF;
  border: 1.5px solid #FFFFFF; border-radius: 4px;
  padding: 0.45rem 1.1rem; font-weight: 700; font-size: 0.9rem; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.duna-bar__btn:hover, .duna-bar__btn:focus-visible { background: #FFFFFF; color: #14171E; }
/* "Text me" is the offer on this bar, so it leads: white fill and dark label, the reverse of the
   home button, and it inverts on hover the same way. */
.duna-bar__btn--text { margin-left: 0.6rem; background: #C8102E; color: #FFFFFF; border-color: #C8102E;
  border-radius: 10px; box-shadow: 0 4px 14px rgba(200, 16, 46, 0.32);
  display: inline-flex; align-items: center; gap: 0.45rem; }
.duna-bar__btn--text svg { width: 15px; height: 15px; flex: none; }
.duna-bar__btn--call { margin-left: 0.6rem; background: #003087; color: #FFFFFF; border-color: #003087;
  border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 48, 135, 0.34);
  display: inline-flex; align-items: center; gap: 0.45rem; }
.duna-bar__btn--call:hover, .duna-bar__btn--call:focus-visible { background: #001D52; border-color: #001D52;
  color: #FFFFFF; box-shadow: 0 6px 18px rgba(0, 48, 135, 0.44); }
.duna-bar__btn--call svg { width: 15px; height: 15px; flex: none; }
.duna-bar__btn--text:hover, .duna-bar__btn--text:focus-visible { background: #A50D25; border-color: #A50D25;
  color: #FFFFFF; box-shadow: 0 6px 18px rgba(200, 16, 46, 0.42); }
/* Mobile: the button is the only thing that matters — drop the copyright and the tagline so
   the bar is one unambiguous tap target. */
@media (max-width: 720px) {
  /* Phones (all ad traffic): two full-width, full-label text and call buttons on one row.
     --duna-h tracks the taller bar so pages keep clearing it. */
  :root { --duna-h: 66px; }
  .duna-bar__copy, .duna-bar__note, .duna-bar .long { display: none; }
  .duna-bar { grid-template-columns: 1fr; gap: 0; padding: 0.4rem 0.6rem calc(0.5rem + env(safe-area-inset-bottom)); }
  .duna-bar__actions { grid-column: 1 / -1; justify-self: stretch; display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 0.5rem; }
  .duna-bar__btn { grid-column: 1 / -1; justify-self: center; background: none; border: 0; padding: 0.1rem 0 0.15rem;
    font-size: 0.74rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; opacity: 0.9; }
  .duna-bar__btn--text, .duna-bar__btn--call { grid-column: auto; justify-self: stretch; justify-content: center; text-align: center;
    margin-left: 0; min-height: 46px; padding: 0.4rem 0.45rem; font-size: 0.82rem; font-weight: 700; line-height: 1.15;
    white-space: normal; text-decoration: none; opacity: 1; border-radius: 10px; }
  .duna-bar__btn--text { background: #C8102E; border: 1.5px solid #C8102E; }
  .duna-bar__btn--call { background: #003087; border: 1.5px solid #003087; }
  .duna-bar__btn--text .long, .duna-bar__btn--call .long { display: inline; }
  .duna-bar__btn--text svg, .duna-bar__btn--call svg { width: 16px; height: 16px; }
}
