/* ============================================================
   William & Sons Plumbing — warm earth editorial
   Palette: paper / espresso ink / terracotta / moss
   ============================================================ */

:root {
  --bg: #f5efe4;
  --bg-raise: #fbf7ef;
  --ink: #2b1e14;
  --ink-soft: #5a4a3c;
  --ink-faint: #8a7a6a;
  --accent: #c25a37;
  --accent-deep: #9d4527;
  --secondary: #6a7a4a;
  --rule: #d9cdb9;
  --rule-soft: #e6dccb;
  --warm-light: rgba(226, 168, 96, 0.30);
  --shadow: 0 1px 2px rgba(43, 30, 20, 0.06), 0 12px 32px -18px rgba(43, 30, 20, 0.35);
  --glow-y: 12%;
  --wrap: 1180px;
  --serif: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

html[data-theme="dark"] {
  --bg: #1a1410;
  --bg-raise: #241c16;
  --ink: #f2e9dc;
  --ink-soft: #cbbcaa;
  --ink-faint: #9b8a78;
  --accent: #e07a52;
  --accent-deep: #f0936c;
  --secondary: #9aab74;
  --rule: #3b2f26;
  --rule-soft: #302620;
  --warm-light: rgba(200, 120, 60, 0.22);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 36px -20px rgba(0, 0, 0, 0.8);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.7;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
  overflow-x: hidden;
}

/* Background: soft light source that drifts with scroll */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% var(--glow-y), var(--warm-light) 0, transparent 62%);
  transition: background-position 0.2s linear;
}

img, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 7vw, 4.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.7rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); }

p { margin: 0 0 1.1em; max-width: 68ch; }

a { color: var(--accent-deep); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

.kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

/* ---------- Header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}

.head-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-block: 0.7rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border-radius: 50%;
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--serif); font-size: 1.12rem; font-weight: 700; }
.brand-text em {
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.site-nav { display: flex; gap: 1.4rem; }
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 1.5px solid transparent;
}
.site-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.head-actions { display: flex; align-items: center; gap: 0.6rem; }

.phone-btn {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 3px;
  min-height: 44px;
  justify-content: center;
}
.phone-btn:hover { background: var(--accent-deep); color: #fff; }
.phone-label { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; }
.phone-num { font-weight: 700; font-size: 0.98rem; }

.theme-toggle {
  width: 44px; height: 44px;
  border: 1px solid var(--rule);
  background: var(--bg-raise);
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-icon {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset -5px -3px 0 0 var(--bg-raise);
}
html[data-theme="dark"] .theme-icon {
  background: var(--accent);
  box-shadow: none;
}

@media (max-width: 860px) {
  .site-nav { display: none; }
}
@media (max-width: 520px) {
  .brand-text em { display: none; }
  .phone-label { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 5vw, 4rem);
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: clamp(1.1rem, 4vw, 2.5rem);
  }
}

.hero-title {
  position: relative;
  margin-bottom: 0.5em;
  font-variation-settings: 'wght' 300, 'opsz' 100;
  animation: weigh linear both;
  animation-timeline: scroll(root);
  animation-range: 0 30vh;
}

@keyframes weigh {
  from { font-variation-settings: 'wght' 250, 'opsz' 40; }
  to   { font-variation-settings: 'wght' 800, 'opsz' 120; }
}

.hero-title .default,
.hero-title .alt {
  display: block;
  transition: opacity 0.35s ease;
}
.hero-title .alt {
  position: absolute;
  inset: 0;
  opacity: 0;
  color: var(--accent);
  pointer-events: none;
}
.hero-title:hover .default,
.hero-title:focus-within .default { opacity: 0; }
.hero-title:hover .alt,
.hero-title:focus-within .alt { opacity: 1; }

.hero-sub {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.6rem 0 2rem;
}

.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); color: #fff; }
.btn-ghost {
  border: 1.5px solid var(--rule);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-facts {
  list-style: none;
  margin: 0;
  padding: 1.2rem 0 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 2.4rem;
}
.hero-facts li { display: flex; flex-direction: column; }
.hero-facts strong {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.hero-facts span { font-size: 0.82rem; color: var(--ink-faint); }

.hero-figure { margin: 0; }
.hero-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: var(--shadow);
}
.hero-figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-style: italic;
  max-width: 46ch;
}

/* ---------- Bands ---------- */

.band { padding-block: clamp(3rem, 7vw, 5.5rem); }
.band-services { border-top: 1px solid var(--rule-soft); }
.band-about { background: var(--bg-raise); border-block: 1px solid var(--rule-soft); }
.band-hood { border-bottom: 1px solid var(--rule-soft); }

.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { margin-bottom: 0.5em; }
.lede { font-size: 1.08rem; color: var(--ink-soft); margin-bottom: 0; }

/* ---------- Services ---------- */

.service-grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.service-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-raise);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.service-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.service-card h3 { margin: 1.2rem 1.3rem 0.5rem; }
.service-card p {
  margin: 0 1.3rem 0.8rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.service-card p:last-child { margin-bottom: 1.4rem; }
.service-meta {
  font-size: 0.78rem !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--secondary) !important;
  border-top: 1px solid var(--rule-soft);
  padding-top: 0.8rem;
}

/* ---------- About: three-column broadsheet ---------- */

.broadsheet {
  column-count: 3;
  column-gap: 3rem;
  column-rule: 1px solid var(--rule-soft);
  font-size: 1.02rem;
}
.broadsheet p { max-width: none; }
.broadsheet p:first-child::first-letter {
  font-family: var(--serif);
  font-size: 3.4em;
  font-weight: 700;
  float: left;
  line-height: 0.82;
  padding: 0.08em 0.1em 0 0;
  color: var(--accent);
}
.pull {
  break-inside: avoid;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--accent-deep);
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .broadsheet { column-count: 2; column-gap: 2rem; }
}
@media (max-width: 620px) {
  .broadsheet { column-count: 1; column-rule: none; }
}

.credo {
  display: grid;
  gap: 1.5rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
.credo dt {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.credo dd {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-soft);
}

/* ---------- Neighborhoods ---------- */

.hood-layout {
  display: grid;
  gap: clamp(1.8rem, 4vw, 3rem);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 880px) {
  .hood-layout { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
}

.hood-figure { margin: 0; }
.hood-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: var(--shadow);
}
.hood-figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-style: italic;
}

.hood-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.hood-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.hood-list strong {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
}
.hood-list span { font-size: 0.9rem; color: var(--ink-soft); }
.hood-note {
  margin-top: 1.4rem;
  font-size: 0.92rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* ---------- Visit ---------- */

.visit-grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.2rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.visit-card {
  background: var(--bg-raise);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow);
}
.visit-card h3 { margin-bottom: 0.7rem; }
.visit-card p { font-size: 0.94rem; color: var(--ink-soft); margin-bottom: 0; }
.visit-card p + p { margin-top: 0.8rem; }

.visit-phone {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 0.8rem;
  letter-spacing: -0.01em;
}
.visit-phone:hover { color: var(--accent-deep); text-decoration: underline; }

.visit-card address {
  font-style: normal;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.9rem;
}

.map-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 1px;
}

.hours {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  margin-bottom: 0.9rem;
}
.hours th, .hours td {
  text-align: left;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule-soft);
  font-weight: 400;
}
.hours th { color: var(--ink); font-weight: 500; }
.hours td { text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: none; }
.hours-note { font-size: 0.88rem; color: var(--ink-faint); margin-bottom: 0; }

/* ---------- Reviews ---------- */

.reviews { margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 2rem; border-top: 1px solid var(--rule); }
.review-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.review-grid blockquote {
  margin: 0;
  padding: 1.3rem 1.4rem;
  background: var(--bg-raise);
  border-left: 3px solid var(--secondary);
  border-radius: 0 4px 4px 0;
}
.review-grid p {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.55;
  margin-bottom: 0.7rem;
  max-width: none;
}
.review-grid cite {
  font-style: normal;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Footer ---------- */

.site-foot {
  background: var(--bg-raise);
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.2rem, 4vw, 3rem) 4.5rem;
}
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  justify-content: space-between;
  align-items: flex-start;
}
.foot-brand strong { font-family: var(--serif); font-size: 1.15rem; }
.foot-brand p { font-size: 0.92rem; color: var(--ink-soft); margin: 0.4rem 0 0; }
.foot-fine { font-size: 0.82rem !important; color: var(--ink-faint) !important; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.foot-nav a {
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.foot-nav a:hover { color: var(--accent); text-decoration: underline; }

.foot-claim { margin-top: 2rem; }
.claim-banner {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--secondary) 12%, transparent);
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  padding: 0.45rem 0.8rem;
  text-decoration: none;
}
.claim-banner:hover { color: var(--accent); border-color: var(--accent); }

.attribution {
  position: fixed;
  bottom: 0.5rem;
  right: 0.75rem;
  margin: 0;
  font-size: 0.7rem;
  opacity: 0.5;
  font-family: var(--sans);
  z-index: 30;
}
.attribution a { color: inherit; }

/* ---------- Motion preferences ---------- */

@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;
  }
  .hero-title { animation: none; font-variation-settings: 'wght' 600, 'opsz' 100; }
  body::before { transition: none; }
}
