/* ==========================================================================
   Tallowgate Roofing (example site by AA Webworks)
   A serious, established roofing firm: charcoal, stone and a little brass,
   one sturdy grotesk for everything, square corners and thin 1px rules.
   No motion apart from button and link hovers.
   ========================================================================== */

/* --- Fonts (self-hosted, SIL Open Font Licence, see fonts/) --- */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
/* The serif is for the wordmark only */
@font-face {
  font-family: "Libre Caslon Text";
  src: url("fonts/libre-caslon-text-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* --- Design tokens --- */
:root {
  /* Colours (contrast checked: see the notes beside each) */
  --charcoal: #1E2126;  /* header, footer, dark sections, body text (14.4:1 on stone) */
  --graphite: #2A2E34;  /* cards and the form panel on dark backgrounds */
  --stone: #F5F2EC;     /* light section backgrounds */
  --white: #FFFFFF;     /* cards on light backgrounds */
  --brass: #B08D57;     /* buttons (charcoal text, 5.2:1), rules, step numbers. Never text on light backgrounds */
  --brass-hover: #C4A06A;
  --brass-dark: #7A5F33; /* star ratings on light backgrounds (5.3:1 on stone) */
  --muted: #565B62;     /* secondary text on light (6.1:1 on stone) */
  --soft: #C9C4BA;      /* secondary text on dark (7.9:1 on graphite) */
  --rule: #D8D2C6;      /* 1px rules on light backgrounds (decoration only) */
  --rule-dark: rgba(255, 255, 255, 0.14); /* 1px rules on dark backgrounds */
  --field-edge: #8A9098; /* form field borders on dark (4.2:1 on graphite) */

  /* Type */
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mark: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --text-small: 0.9rem;

  /* Spacing and layout */
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  --max-width: 76rem;
  --ring: var(--charcoal); /* focus outline colour; brass on dark sections */
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 3.5rem; -webkit-text-size-adjust: 100%; }
/* Phones: no text under 16px (labels, hints, review names and small notes were 14.4px,
   tags 12.8px). The word "Roofing" in the logo is part of the logo and stays as it is. */
@media (max-width: 47.99rem) {
  :root { --text-small: 1rem; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--stone);
  color: var(--charcoal);
  font: 400 1.0625rem/1.6 var(--font);
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0 0 var(--space-s); font-weight: 700; line-height: 1.1; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.75rem); }
h3 { font-size: 1.2rem; line-height: 1.25; letter-spacing: 0; }
p { margin: 0 0 var(--space-s); }
a { color: inherit; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }

.wrap { width: min(100% - 2rem, var(--max-width)); margin-inline: auto; }
.section { padding-block: var(--space-xl); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--brass);
  color: var(--charcoal);
  font-weight: 700;
}
.skip-link:focus { top: 3rem; }

/* Small print used for "Example …" notes */
.small-note { color: var(--muted); font-size: var(--text-small); }
.tag {
  display: inline-block;
  margin: 0 0 var(--space-xs);
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--rule);
  background: var(--stone);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

/* --- Buttons: square, brass with charcoal text, or a thin outline --- */
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-s); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.6rem 1.5rem;
  border: 1px solid transparent;
  font: 700 1rem/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
}
.btn--brass { background: var(--brass); border-color: var(--brass); color: var(--charcoal); }
.btn--brass:hover { background: var(--brass-hover); border-color: var(--brass-hover); }
.btn--outline { border-color: var(--stone); color: var(--white); }
.btn--outline:hover { background: rgba(255, 255, 255, 0.1); }
.btn--full { width: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color 0.2s ease-out, border-color 0.2s ease-out; }
}

/* Anything on a dark background gets a brass focus outline */
.header, .hero, .services, .footer, .callbar { --ring: var(--brass); }

/* --- Wordmark: serif capitals over a thin brass rule --- */
.wordmark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding-block: 0.35rem;
  color: var(--white);
  font-family: var(--font-mark);
  text-decoration: none;
  text-transform: uppercase;
  line-height: 1;
}
.wordmark__name { font-size: 1.35rem; letter-spacing: 0.16em; margin-right: -0.16em; }
.wordmark__trade {
  margin-top: 0.4rem;
  padding: 0.35rem 0.6rem 0;
  border-top: 1px solid var(--brass);
  color: var(--soft);
  font-size: 0.68rem;
  letter-spacing: 0.42em;
  margin-right: -0.42em;
}

/* --- 2. Header --- */
.header { background: var(--charcoal); color: var(--white); border-bottom: 1px solid var(--rule-dark); }
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  min-height: 4.5rem;
}
.header__nav { display: none; }
.header__phone {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.4rem 1.1rem;
  background: var(--brass);
  color: var(--charcoal);
  font-weight: 700;
  text-decoration: none;
}
.header__phone:hover { background: var(--brass-hover); }
.header__phone-number { display: none; }

@media (min-width: 60rem) {
  .header__inner { display: grid; grid-template-columns: 1fr auto 1fr; min-height: 5.5rem; }
  .header__nav { display: block; }
  .header__nav ul { display: flex; gap: var(--space-m); margin: 0; padding: 0; list-style: none; }
  .header__nav a {
    display: inline-block;
    padding-block: 0.5rem;
    color: var(--stone);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid transparent;
  }
  .header__nav a:hover { border-bottom-color: var(--brass); }
  .header__phone { justify-self: end; gap: 0.4rem; padding: 0.4rem 0; background: none; color: var(--white); font-size: 1.15rem; }
  .header__phone:hover { background: none; text-decoration: underline; text-decoration-color: var(--brass); }
  .header__phone-label { color: var(--soft); font-weight: 400; }
  .header__phone-number { display: inline; }
  .wordmark__name { font-size: 1.6rem; }
}

/* --- 3. Hero: roof photo, a dark gradient so the text passes contrast --- */
.hero {
  position: relative;
  isolation: isolate;
  background: var(--charcoal);
  color: var(--white);
}
.hero__photo img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* dark enough at the top for the small brass line to pass contrast (4.5:1) on phones */
  background: linear-gradient(180deg, rgba(30, 33, 38, 0.9) 0%, rgba(30, 33, 38, 0.93) 45%, var(--charcoal) 100%);
}
.hero__grid {
  display: grid;
  gap: var(--space-l);
  padding-block: var(--space-l) var(--space-xl);
}
.hero__label { margin-bottom: var(--space-s); color: var(--brass); font-weight: 700; }
/* Phones: the photo shows through more behind this line, so it uses the lighter brass (passes 4.5:1) */
@media (max-width: 47.99rem) {
  .hero__label { color: var(--brass-hover); }
}
.hero h1 { max-width: 15ch; margin-bottom: var(--space-m); font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.25rem); line-height: 1.02; letter-spacing: -0.025em; }
.hero__lead { max-width: 34rem; margin-bottom: var(--space-l); color: var(--stone); font-size: 1.2rem; }

@media (min-width: 60rem) {
  .hero::after {
    background: linear-gradient(90deg, rgba(30, 33, 38, 0.94) 0%, rgba(30, 33, 38, 0.84) 42%, rgba(30, 33, 38, 0.3) 100%);
  }
  .hero__grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(22rem, 0.8fr);
    align-items: center;
    gap: var(--space-xl);
    min-height: 40rem;
    padding-block: var(--space-xl);
  }
}

/* The quote panel beside the headline (below it on phones) */
.quote-panel {
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  border: 1px solid var(--rule-dark);
  border-top: 2px solid var(--brass);
  background: var(--graphite);
}
.quote-panel__title { margin-bottom: var(--space-m); font-size: 1.6rem; }
.quote-panel__rating { margin: var(--space-m) 0 0; padding-top: var(--space-s); border-top: 1px solid var(--rule-dark); color: var(--soft); font-size: var(--text-small); }
.quote-panel__rating .stars { color: var(--brass); letter-spacing: 0.1em; }
.sample { font-style: italic; }

.form { display: grid; gap: var(--space-s); }
.form__pair { display: grid; gap: var(--space-s); }
@media (min-width: 30rem) {
  .form__pair { grid-template-columns: 1fr 1fr; }
}
.field { display: grid; gap: 0.3rem; }
.field label { color: var(--stone); font-size: var(--text-small); font-weight: 700; }
.field__hint { color: var(--soft); font-weight: 400; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--field-edge);
  border-radius: 0;
  background: var(--charcoal);
  color: var(--white);
  font: inherit;
}
.field textarea { resize: vertical; }
.field select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23B08D57' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 0.8rem;
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline-offset: 0; border-color: var(--brass); }
.quote-panel .demo-form-note { margin: 0; color: var(--soft); font-size: var(--text-small); }

/* --- 4. Trust strip: four text badges --- */
.trust { background: var(--white); border-bottom: 1px solid var(--rule); }
.trust__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}
.trust__list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: var(--space-m) var(--space-s) var(--space-m) 0;
  font-weight: 700;
  line-height: 1.3;
}
.trust__list li:nth-child(n + 3) { border-top: 1px solid var(--rule); }
.trust__list svg {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  fill: none;
  stroke: var(--charcoal);
  stroke-width: 1.6;
  stroke-linecap: square;
}
.trust__note { margin: 0; padding-block: var(--space-s); border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--text-small); }
@media (min-width: 60rem) {
  .trust__list { grid-template-columns: repeat(4, 1fr); }
  .trust__list li { padding: var(--space-l) var(--space-m); }
  .trust__list li:first-child { padding-left: 0; }
  .trust__list li:nth-child(n + 3) { border-top: 0; }
  .trust__list li + li { border-left: 1px solid var(--rule); }
}

/* --- 5. About and figures --- */
.about__grid { display: grid; gap: var(--space-l); align-items: center; }
.about__text > p:first-of-type { max-width: 38rem; font-size: 1.15rem; }
.about__photo { width: 100%; }
.figures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: var(--space-l) 0 var(--space-xs);
  border-top: 1px solid var(--charcoal);
}
.figures > div {
  display: flex;
  flex-direction: column-reverse; /* number above its label, but read label first */
  justify-content: flex-end;
  padding: var(--space-m) var(--space-s) 0 0;
}
.figures > div + div { padding-left: var(--space-s); border-left: 1px solid var(--rule); }
.figures dt { color: var(--muted); font-size: var(--text-small); }
.figures dd { margin: 0 0 0.25rem; font-size: clamp(2rem, 1.5rem + 2vw, 3rem); font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
@media (min-width: 60rem) {
  .about__grid { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
}

/* --- 6. Services on a dark photo band (slate photo under a heavy charcoal wash) --- */
.services {
  background:
    linear-gradient(rgba(30, 33, 38, 0.93), rgba(30, 33, 38, 0.93)),
    url("images/project-reroof.webp") center / cover;
  color: var(--white);
}
.services__list {
  display: grid;
  gap: 1px; /* the gap shows the 1px rule colour behind */
  margin: var(--space-l) 0 0;
  padding: 0;
  border: 1px solid var(--rule-dark);
  background: var(--rule-dark);
  list-style: none;
}
.services__list li { padding: var(--space-m); background: var(--graphite); }
.services__list img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin-bottom: var(--space-m); }
.services__list h3 { color: var(--white); }
.services__list p { margin: 0; color: var(--soft); }
@media (min-width: 40rem) {
  .services__list { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 60rem) {
  .services__list { grid-template-columns: repeat(3, 1fr); }
}

/* --- 7. How it works: three real steps, numbered in brass --- */
.steps { background: var(--white); }
.steps__list {
  display: grid;
  gap: var(--space-l);
  margin: var(--space-l) 0 0;
  padding: 0;
  list-style: none;
}
.steps__photo { position: relative; margin-bottom: var(--space-m); }
.steps__photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.steps__no {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 0.5rem 0.9rem;
  background: var(--charcoal);
  color: var(--brass);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.steps__list p { margin: 0; color: var(--muted); }
@media (min-width: 48rem) {
  .steps__list { grid-template-columns: repeat(3, 1fr); gap: var(--space-m); }
}

/* --- 8. Recent projects and the map --- */
.projects__grid { display: grid; gap: var(--space-l); margin-top: var(--space-l); }
.map {
  margin: 0;
  padding: var(--space-m);
  border: 1px solid var(--rule);
  background: var(--white);
}
.map svg { width: 100%; height: auto; overflow: visible; }
.map__area { fill: #EDE8DE; stroke: var(--charcoal); stroke-width: 1.5; stroke-linejoin: round; }
.map__town circle { fill: var(--brass); stroke: var(--charcoal); stroke-width: 2; }
.map__town text {
  fill: var(--charcoal);
  font: 700 24px var(--font);
  text-anchor: middle;
  paint-order: stroke;
  stroke: #EDE8DE;
  stroke-width: 5px;
  stroke-linejoin: round;
}
.map__town text[text-anchor="end"] { text-anchor: end; }
.map__town--main text { font-size: 28px; }
.map figcaption { margin-top: var(--space-s); padding-top: var(--space-s); border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--text-small); }

.projects__list { display: grid; gap: var(--space-m); margin: 0; padding: 0; list-style: none; }
.project { display: grid; border: 1px solid var(--rule); background: var(--white); }
.project img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.project__body { padding: var(--space-m); }
.project h3 { margin-bottom: var(--space-xs); }
.project__town { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 1rem; font-weight: 400; }
.project p:last-child { margin: 0; }
@media (min-width: 40rem) {
  .project { grid-template-columns: 2fr 3fr; }
  .project img { height: 100%; aspect-ratio: auto; min-height: 12rem; }
}
@media (min-width: 64rem) {
  .projects__grid { grid-template-columns: 5fr 6fr; align-items: start; }
}

/* --- 9. Reviews (samples) --- */
.reviews { background: var(--white); }
.reviews__intro { color: var(--muted); }
.reviews__list {
  display: grid;
  gap: var(--space-m);
  margin: var(--space-l) 0 0;
  padding: 0;
  list-style: none;
}
.reviews__list li { display: flex; flex-direction: column; padding: var(--space-m); border: 1px solid var(--rule); border-top: 2px solid var(--brass); background: var(--stone); }
.reviews__list .tag { align-self: flex-start; background: var(--white); }
.reviews .stars { margin: 0 0 var(--space-xs); color: var(--brass-dark); font-size: 1.2rem; letter-spacing: 0.12em; }
.reviews blockquote { margin: 0 0 var(--space-m); font-size: 1.15rem; }
.reviews blockquote p { margin: 0; }
.reviews__who { margin: auto 0 0; color: var(--muted); font-size: var(--text-small); font-weight: 700; }
@media (min-width: 48rem) {
  .reviews__list { grid-template-columns: repeat(3, 1fr); }
}

/* --- 10. FAQ --- */
.faq__grid { display: grid; gap: var(--space-l); }
.faq__list { border-top: 1px solid var(--charcoal); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: var(--space-s);
  padding: 1.1rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 1.25rem; color: var(--charcoal); font-size: 1.5rem; line-height: 1; text-align: center; }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 0.25em; }
.faq details p { max-width: 42rem; margin: 0; padding-bottom: var(--space-m); color: var(--muted); }
@media (min-width: 60rem) {
  .faq__grid { grid-template-columns: 1fr 2fr; gap: var(--space-xl); }
}

/* --- 11. Contact strip and footer --- */
.footer { padding-block: var(--space-xl) var(--space-l); background: var(--charcoal); color: var(--white); }
.contact-strip {
  display: grid;
  gap: 1px;
  margin: 0 0 var(--space-xl);
  padding: 0;
  border: 1px solid var(--rule-dark);
  background: var(--rule-dark);
  list-style: none;
}
.contact-strip li { display: grid; gap: 0.3rem; padding: var(--space-m); background: var(--charcoal); }
.contact-strip__label { color: var(--soft); font-size: var(--text-small); }
/* Phone and email: 44px+ tall to tap, with the extra cancelled out so nothing moves */
.contact-strip__value { justify-self: start; padding-block: 0.35rem; margin-block: -0.35rem; font-size: 1.3rem; font-weight: 700; overflow-wrap: anywhere; }
a.contact-strip__value { text-decoration-color: var(--brass); }
@media (min-width: 48rem) {
  .contact-strip { grid-template-columns: repeat(3, 1fr); }
}
.footer__base {
  display: grid;
  gap: var(--space-m);
  justify-items: start;
  padding-top: var(--space-l);
  border-top: 1px solid var(--rule-dark);
}
.footer__links { display: flex; flex-wrap: wrap; gap: 0.25rem var(--space-m); margin: 0; padding: 0; list-style: none; }
.footer__links a { display: inline-block; padding-block: 0.55rem; margin-block: -0.15rem; color: var(--stone); } /* 44px tall to tap */
.footer__credit { margin: 0; color: var(--soft); font-size: var(--text-small); }
@media (min-width: 60rem) {
  .footer__base { grid-template-columns: auto 1fr; align-items: center; column-gap: var(--space-xl); }
  .footer__links { justify-content: flex-end; }
  .footer__credit { grid-column: 1 / -1; }
}

/* --- Fixed call bar on phones --- */
.callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-xs) max(var(--space-xs), env(safe-area-inset-bottom));
  background: var(--charcoal);
  border-top: 1px solid var(--rule-dark);
}
/* Room at the bottom of the footer so the call bar never covers it. The scroll padding
   does the same for keyboard users: anything they tab to is scrolled clear of the bar. */
@media (max-width: 47.99rem) {
  .footer { padding-bottom: calc(var(--space-l) + 4.5rem); }
  html { scroll-padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
}
@media (min-width: 48rem) {
  .callbar { display: none; }
}

@media print {
  .callbar, .demo-banner { display: none; }
}

/* Phones: the small "Example project" tags are 16px too (see the note near the top) */
@media (max-width: 47.99rem) {
  .tag { font-size: 1rem; }
}
