/* M. Hagemann Plumbing & Building Services.
   Charcoal and orange from Matt's logo; layout after the trade-site references
   (solid colour bands, pill buttons, round icon badges, framed image cards). */
:root {
  --orange: #f29021;
  --orange-hi: #f7ae45;
  --orange-soft: #fde7cc;
  --orange-ink: #a85b00;      /* orange dark enough for text on white (AA) */
  --dark: #141414;
  --dark-2: #1e1e1e;
  --dark-3: #2a2a2a;
  --ink: #1a1a1a;
  --muted: #565656;
  --on-dark: #ffffff;
  --on-dark-muted: #b8b8b8;
  --line: #e7e3dd;
  --bg: #ffffff;
  --bg-alt: #f6f4f1;
  --error: #b42318;
  --radius: 16px;
  --shadow: 0 18px 40px -18px rgba(20, 20, 20, .35);
  --font: "Avenir Next", "Montserrat", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: 180ms ease;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  --dock-h: calc(72px + env(safe-area-inset-bottom));
  padding-bottom: var(--dock-h);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.band a:focus-visible, .band .btn:focus-visible { outline-color: var(--ink); }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.005em; }
h2 { font-size: clamp(1.75rem, 5vw, 2.4rem); color: var(--ink); }
h3 { font-size: 1.2rem; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.center { text-align: center; }
.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; }
.sprite { position: absolute; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--orange); color: var(--ink); padding: 10px 16px; border-radius: 999px; font-weight: 600; }
.skip:focus { left: 16px; }

/* Buttons: pills, as in the references */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px;
  border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease), transform var(--ease);
  touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn-sm { min-height: 44px; padding: 8px 20px; font-size: .95rem; }
.btn-lg { min-height: 56px; padding: 14px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--orange); color: var(--ink); }            /* 7:1 */
.btn-primary:hover { background: var(--orange-hi); }
.btn-ghost { color: var(--on-dark); border-color: rgba(255,255,255,.3); }
.btn-ghost:hover { border-color: var(--on-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #333; }
.btn-dark-on-dark { background: var(--dark-3); color: #fff; }
.btn-dark-on-dark:hover { background: #363636; }
.btn-outline { color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--dark); }
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: block; padding: 6px 0; margin-right: auto; }
.brand img { width: 124px; }
.nav { display: none; gap: 4px; }
.nav a { color: var(--on-dark-muted); text-decoration: none; font-weight: 500; font-size: .95rem; padding: 12px; transition: color var(--ease); }
.nav a:hover { color: var(--on-dark); }
.topbar-cta { display: none; }   /* phones use the bottom bar instead */

/* Hero */
.hero { position: relative; isolation: isolate; background: var(--dark); color: var(--on-dark); padding: 40px 0 48px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(20, 20, 20, .9); }
.hero-grid { display: grid; gap: 40px; }
.eyebrow { margin: 0 0 16px; color: var(--orange); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .14em; }
.hero h1 { font-size: clamp(2.3rem, 9vw, 4rem); color: var(--on-dark); margin-bottom: 20px; }
.hero h1 span { color: var(--orange); }
.lead { font-size: 1.125rem; color: var(--on-dark-muted); max-width: 32em; margin: 0 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions .btn { flex: 1 1 220px; }
.hero-checks { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 10px; font-size: .95rem; color: var(--on-dark-muted); }
.hero-checks li { display: flex; align-items: center; gap: 10px; }
.hero-checks .ic { color: var(--orange); }


/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-alt); }
.section-head { margin-bottom: 36px; }
.kicker { margin: 0 0 8px; color: var(--orange-ink); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .14em; }
.kicker-dark { color: var(--ink); }

/* About */
.narrow { max-width: 760px; }
.split-copy .btn { margin-top: 8px; }
.split-copy p { color: var(--muted); margin: 0 0 16px; }
.split-copy .about-lead { color: var(--ink); font-size: 1.2rem; line-height: 1.5; }
.split-copy .ticks { margin-top: 24px; }
.ticks { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks .ic { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: var(--orange); color: var(--ink); stroke-width: 3; margin-top: 1px; }

/* Orange bands */
.band { background: var(--orange); color: var(--ink); padding: 72px 0; }
.band h2 { color: var(--ink); }
.badge { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ink); flex: none; }
.badge svg { width: 30px; height: 30px; fill: none; stroke: var(--orange); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.badge-sm { width: 48px; height: 48px; }
.badge-sm svg { width: 22px; height: 22px; stroke-width: 2; }

/* Services */
.services { display: grid; gap: 16px; grid-template-columns: 1fr; }
.service { background: #fff; border-radius: var(--radius); padding: 28px 24px; box-shadow: 0 10px 30px -18px rgba(0,0,0,.45); }
.service .badge { margin-bottom: 18px; }
.service ul { list-style: none; margin: 0; padding: 0; color: var(--muted); }
.service li { padding: 8px 0; border-top: 1px solid var(--line); }
.service li:first-child { border-top: 0; padding-top: 0; }
.band-cta { margin: 36px 0 0; }

/* Our work: photo grid with one featured job */
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; grid-auto-flow: dense; }
.tile { position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: var(--dark); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.tile:hover img { transform: scale(1.03); }
.tile figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 12px;
  background: linear-gradient(180deg, rgba(20,20,20,0), rgba(20,20,20,.85));
  color: #fff; font-weight: 500; font-size: .9rem; line-height: 1.3;
}
.tile-feature { grid-column: span 2; grid-row: span 2; border: 5px solid var(--orange); }
.tile-tall { grid-row: span 2; }
.tile-wide { grid-column: span 2; }

/* Videos */
.sub-head { margin: 56px 0 20px; font-size: 1.35rem; }
.videos { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); max-width: 900px; margin: 0 auto; }
.vid { margin: 0; border-radius: 16px; overflow: hidden; background: var(--dark); }
.vid video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; background: var(--dark); }
.vid figcaption { padding: 10px 14px 12px; color: var(--on-dark); font-weight: 500; font-size: .9rem; }
.more { margin: 28px 0 0; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li { background: #fff; border-radius: var(--radius); padding: 28px 24px; text-align: center; }
.step-n { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--orange); color: var(--ink); font-weight: 600; font-size: 1.25rem; margin-bottom: 16px; }
.steps p { margin: 0; color: var(--muted); }

/* Enquiry band */
.contact-inner { display: grid; gap: 28px; grid-template-areas: "head" "form" "alt"; }
.contact-head { grid-area: head; }
.contact-head h2, .contact-head .kicker { margin-bottom: 12px; }
.band-lead { margin: 0; font-size: 1.1rem; max-width: 30em; }
.contact-alt { grid-area: alt; display: grid; gap: 16px; align-content: start; }
.contact-cards { display: grid; gap: 12px; }
.contact-card {
  display: flex; align-items: center; gap: 16px; min-height: 76px;
  background: rgba(255,255,255,.35); border-radius: var(--radius);
  padding: 14px 18px; text-decoration: none; font-weight: 600; font-size: 1.05rem;
  transition: background-color var(--ease);
  overflow-wrap: break-word; min-width: 0;
}
.contact-card:hover { background: rgba(255,255,255,.55); }
.contact-card small { display: block; font-weight: 500; font-size: .85rem; }
.socials { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.socials a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 20px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 500; font-size: .95rem; transition: background-color var(--ease); }
.socials a:hover { background: #333; }

/* Form */
.form-card { grid-area: form; background: #fff; color: var(--ink); border-radius: 20px; padding: 24px 20px; box-shadow: var(--shadow); }
.form-title { margin: 0 0 4px; font-size: 1.35rem; }
.form-sub { margin: 0 0 20px; color: var(--muted); font-size: .95rem; }
.hero-form-slot { display: none; }
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: grid; gap: 18px; align-items: end; }
.field label { font-weight: 600; font-size: .95rem; }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 16px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg-alt); border: 1.5px solid transparent; border-radius: 12px;
  transition: border-color var(--ease), box-shadow var(--ease), background-color var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 17px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 44px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background-color: #fff; border-color: var(--orange-ink); box-shadow: 0 0 0 3px rgba(242,144,33,.3); }
.field :user-invalid { border-color: var(--error); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { margin: -4px 0 0; font-size: .85rem; color: var(--muted); text-align: center; }
.form-error { margin: 0; padding: 12px 14px; border-radius: 12px; background: #fdecea; color: var(--error); font-weight: 500; font-size: .95rem; }
.sent { text-align: center; padding: 32px 8px; }
.sent:target { display: block; }
.sent .ic { width: 48px; height: 48px; color: var(--orange-ink); margin: 0 auto 12px; }
.sent p { margin: 0; color: var(--muted); }

/* Footer */
.footer { background: var(--dark); color: var(--on-dark-muted); padding: 32px 0; font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.footer p { margin: 0; }
.footer-contact a { color: var(--on-dark); text-decoration: none; display: inline-block; padding: 12px 0; }

/* Phone dock */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(20, 20, 20, .96); border-top: 1px solid #2c2c2c;
  backdrop-filter: blur(8px);
}

/* Tablet and up */
@media (min-width: 640px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .gallery { gap: 14px; grid-auto-rows: 200px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .form-card { padding: 32px; }
  .hero-checks { display: flex; flex-wrap: wrap; gap: 10px 24px; }
  .hero-checks li { white-space: nowrap; }
}

/* Desktop */
@media (min-width: 960px) {
  body { --dock-h: 0px; }
  .dock { display: none; }
  .brand img { width: 150px; }
  .nav { display: flex; }
  .topbar-cta { display: inline-flex; }
  .topbar-inner { min-height: 76px; }

  .hero { padding: 0; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 440px; gap: 64px; min-height: 640px; }
  .hero-copy { align-self: center; padding: 72px 0; }
  .hero-form-slot { display: block; align-self: center; padding: 48px 0; }
  .hero-form-slot .form-card { padding: 28px; }
  .hero-form-slot .form { gap: 14px; }
  .hero-form-slot .field textarea { min-height: 96px; }
  .hero-quote-btn { display: none; }   /* the form is right there */
  .hero::before { background: linear-gradient(90deg, rgba(20,20,20,.95) 0%, rgba(20,20,20,.86) 45%, rgba(20,20,20,.55) 100%); }
  .gallery { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 230px; }
  .videos { grid-template-columns: repeat(3, 1fr); gap: 20px; }

  .section, .band { padding: 104px 0; }
  .services { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .contact-inner { grid-template-columns: .9fr 1.1fr; grid-template-areas: "head form" "alt form"; grid-template-rows: auto 1fr; align-items: start; gap: 32px 72px; }
  /* Form has moved up into the hero: this band becomes the call / email / socials block */
  .contact.form-in-hero .contact-inner { grid-template-columns: 1fr 1fr; grid-template-areas: "head alt"; grid-template-rows: auto; align-items: center; }
  .footer-contact { margin-left: auto !important; }
}
