/* Mendham Plumbing & Heating — demo.
   One idea: the phone number is the masthead. Everything else stays quiet. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-alt: #eff2f5;
  --ink: #0f1b27;
  --muted: #4b5a68;
  --line: #d3dae1;
  --hot: #b0151f;        /* the number, primary buttons */
  --hot-ink: #ffffff;
  --navy: #0f1b27;       /* banner, call bar */
  --navy-ink: #ffffff;
  --focus: #1f5fbf;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  --max: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d141b;
    --bg-alt: #141e28;
    --ink: #e7ecf1;
    --muted: #a3b0bc;
    --line: #2a3846;
    --hot: #ff8576;
    --hot-ink: #1a0604;
    --navy: #1d2b39;
    --navy-ink: #e7ecf1;
    --focus: #8fb8ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--font);
  padding-bottom: 4rem; /* room for the call bar */
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.0625rem; }
p { margin: 0 0 1em; max-width: 65ch; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.demo-banner {
  margin: 0; max-width: none;
  padding: .5rem var(--gutter);
  background: var(--navy); color: var(--navy-ink);
  font-size: .875rem; text-align: center;
}

.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: var(--gutter); top: .5rem; background: var(--bg); padding: .5rem 1rem; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .25rem 1.5rem; padding-top: .75rem; padding-bottom: .75rem;
}
.logo { font-weight: 800; font-size: 1.125rem; text-decoration: none; letter-spacing: -.01em; }
.logo span { font-weight: 500; color: var(--muted); }
.nav-list { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.nav-list a { display: inline-block; padding: .5rem 0; text-decoration: none; font-size: .9375rem; }
.nav-list a:hover { text-decoration: underline; }

/* Hero — the one bold idea */
.hero { padding: 2rem 0 2.5rem; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.5rem); max-width: 20ch; }
.lede { color: var(--muted); font-size: 1.125rem; max-width: 40ch; }

.big-number {
  display: block;
  margin: 1.25rem 0 1.5rem;
  color: var(--hot);
  text-decoration: none;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: .9;
  white-space: nowrap;
  font-size: min(calc((100vw - 2 * var(--gutter)) / 3.9), 9rem); /* six digits fit the line */
}
.big-number span { display: block; }
.big-number:hover { text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .08em; }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin: 0; }

.btn {
  display: inline-block; min-height: 48px; padding: .75rem 1.5rem;
  border: 0; border-radius: 4px;
  font: 700 1.0625rem/1.4 var(--font); text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--hot); color: var(--hot-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.text-link { display: inline-block; padding: .5rem 0; font-size: 1.125rem; font-weight: 600; }

/* Sections */
.section { padding: 3rem 0; }
.section-alt { background: var(--bg-alt); }

.services { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 2px solid var(--ink); }
.services li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.services h3 { margin-bottom: .2em; }
.services p { margin: 0; color: var(--muted); }

.two-col { display: grid; gap: 2.5rem; }

.placeholder {
  border-left: 2px dashed var(--muted); padding: .25rem 0 .25rem .75rem;
  color: var(--muted); font-size: .9375rem; font-style: italic;
}

.reviews { display: grid; gap: 1.5rem; }
.review { margin: 0; padding-left: 1rem; border-left: 3px solid var(--line); }
.review blockquote { margin: 0; }
.review p { font-size: 1.125rem; margin-bottom: .5em; }
.review figcaption { color: var(--muted); font-size: .9375rem; font-style: italic; }

/* Form */
.quote-form { display: grid; gap: 1rem; max-width: 34rem; }
.field { display: grid; gap: .3rem; }
label { font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); }
input, textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--muted); border-radius: 4px; padding: .7rem .8rem; width: 100%;
}
.quote-form .btn { justify-self: start; }
.form-note { color: var(--muted); font-size: .9375rem; margin: 0; }
.hp { position: absolute; left: -9999px; }

.contact-list { list-style: none; padding: 0; margin: 0; font-size: 1.25rem; }
.contact-list li { padding: .25rem 0; }
.contact-list a { font-weight: 700; }

.site-footer { padding: 2rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9375rem; }

/* Thumb-reachable call bar on phones */
.call-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: block; padding: 1rem var(--gutter);
  background: var(--navy); color: var(--navy-ink);
  font-weight: 700; text-align: center; text-decoration: none;
}
.call-bar:focus-visible { outline-offset: -5px; }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .call-bar { display: none; }
  .hero { padding: 3.5rem 0 4rem; }
  .big-number { font-size: min(calc((100vw - 2 * var(--gutter)) / 7.6), 9.25rem); } /* whole number on one line */
  .big-number span { display: inline; }
  .services { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .two-col { grid-template-columns: 1fr 1fr; gap: 4rem; }
  .reviews { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

@media print {
  .demo-banner, .call-bar, nav, .quote-form { display: none; }
}

/* Call-back form in the hero */
.callback { margin: 0 0 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); max-width: 56rem; }
.callback-title { font-size: 1.125rem; font-weight: 700; max-width: 40ch; }
.callback-fields { display: grid; gap: .75rem; }
.callback .btn { justify-self: start; }
.callback .form-note:empty, .quote-form .form-note:empty { display: none; }

select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--muted); border-radius: 4px; padding: .7rem .8rem; width: 100%;
  min-height: 48px;
}
input, select { height: 3rem; min-height: 0; }
textarea { height: auto; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: .3rem; }
.choices { display: flex; gap: 1.25rem; }
.choices label { display: flex; align-items: center; gap: .4rem; font-weight: 400; min-height: 48px; }
.choices input { min-height: 0; width: 1.25rem; height: 1.25rem; accent-color: var(--hot); }
.field-row { display: grid; gap: 1rem; }
.form-note { color: var(--ink); }

@media (min-width: 760px) {
  .callback-fields { grid-template-columns: 1fr 1fr 10rem auto; align-items: end; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .reviews { grid-template-columns: repeat(3, 1fr); }
}
