/* The signature: a four-pane window, a frame crossed by its mullions, marks each section heading */

main h2::before,
.topic::before {
  content: "";
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-right: 0.4em;
  vertical-align: 0.02em;
  border: 0.09em solid var(--mark, var(--accent));
  background:
    linear-gradient(var(--mark, var(--accent)), var(--mark, var(--accent))) center / 0.09em 100% no-repeat,
    linear-gradient(var(--mark, var(--accent)), var(--mark, var(--accent))) center / 100% 0.09em no-repeat;
}

:is(.night, .statement, .band, .next) {
  --mark: var(--paper);
}

/* On /faq/ each question is an h2, so the mark moves to the topic line that opens each group */

.faq-group h2::before {
  content: none;
}

/* The hero's credentials stand as a list, one to a line */

ul.hero__proof {
  flex-direction: column;
  align-items: flex-start;
  gap: calc(var(--gap) * 0.25);
  padding-left: 0;
  list-style: none;
}

/* The footer's last row keeps to the page's left edge */

.footer-legal {
  margin-inline: 0;
  max-width: none;
}

/* Hero: the sky sits at the top of the photograph, the house below it */

.hero__figure img {
  object-position: center 70%;
}

/* The case: the boldest section, set in display type with the credentials under an accent rule */

main > section.case {
  padding-block: calc(var(--run) * 1.2);
}

.case .display {
  max-width: 17ch;
}

.case__lead {
  font-size: clamp(1.15rem, 1.9vw, 1.35rem);
  color: var(--ink-soft);
  max-width: 44ch;
}

.creds {
  display: grid;
  gap: var(--gap-wide);
  margin: calc(var(--gap-wide) * 1.5) 0 0;
  padding: 0;
  list-style: none;
}

.creds li {
  padding-top: var(--gap);
  border-top: 3px solid var(--accent);
  color: var(--ink-soft);
  max-width: 34ch;
}

.creds strong {
  display: block;
  margin-bottom: var(--step);
  font-family: var(--type-heading);
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
  font-weight: var(--heading-weight);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Services sit on the sunken surface, four cards in one row on a wide screen */

main > section.services,
main > section.area {
  background: var(--sunken);
}

/* Before and after keep the photographs' own square-ish shape, so nothing of the window is cropped */

.compare {
  max-width: 40rem;
}

.compare__frame img {
  aspect-ratio: auto;
}

/* The lead job photo crops to the house front rather than the lawn */

.jobs .gallery li:first-child img {
  object-position: center 30%;
}

/* The process on the night surface, with the timeline's step markers on the content edge */

[data-process="timeline"] .how .steps {
  margin-left: calc(1rem + 1px);
}

.night .step__when {
  color: var(--accent-line);
}

.night .steps {
  border-left-color: color-mix(in srgb, var(--paper) 30%, transparent);
}

/* The cost statement carries a heading in place of a figure line */

.statement__body h2.statement__figure {
  margin-bottom: var(--gap);
}

/* Closing bands start on the page's left edge like every section above them */

main > section.next {
  text-align: left;
}

main > section.next p {
  margin-inline: 0;
}

main > section.next .actions {
  justify-content: flex-start;
}

/* Service labels read as labels in the heading ink, so amber stays with links and buttons */

.service h3 {
  color: var(--ink);
}

/* Body text on fact and service pages keeps to about 70 characters a line */

.service p,
.service ul,
.intro p {
  max-width: 34rem;
}

/* A service page's price note sits on the sunken surface, apart from the questions below it */

main > section.service:not(:has(.service__body)) {
  background: var(--sunken);
  border-bottom: 0;
}

/* The contact band: on the page's left edge like every other section, with the form on paper so its
   fields and notes read clearly */

.band.contact {
  text-align: left;
}

.band.contact p {
  margin-inline: 0;
}

.band.contact .lead p {
  max-width: none;
}

.band .lead {
  margin-inline: 0;
  padding: var(--gap-wide);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.band .lead .lead__check,
.band .lead .lead__sent,
.band .lead .lead__unsent {
  color: var(--ink-soft);
}

.band .lead .action {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* Fact pages open with a band holding the heading and one photograph */

.intro--photo {
  display: grid;
  gap: var(--gap-wide);
  align-items: center;
}

.intro__photo {
  margin: 0;
}

.intro__photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.intro__photo figcaption {
  margin-top: var(--step);
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.intro .actions {
  margin-top: var(--gap);
}

/* A service section on /services/ leads with its photograph */

.service__media {
  width: 100%;
  max-width: 40rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: var(--gap-wide);
}

.service__more {
  font-weight: 600;
}

.service__more a,
.area a,
.questions > p a {
  color: var(--accent);
}

/* Fact tables keep to the reading measure */

table.facts,
table.hours-table {
  max-width: var(--narrow);
}

/* FAQ topics */

.faq-group {
  border-bottom: 1px solid var(--hairline);
}

.faq-group h2 {
  margin-top: var(--gap-wide);
  font-size: calc(1rem * pow(var(--scale), 1.6));
}

.faq-group h2:first-of-type {
  margin-top: 0;
}

.faq-group p {
  color: var(--ink-soft);
}

.faq-group .topic {
  margin-bottom: var(--gap-wide);
  font-family: var(--type-heading);
  font-size: clamp(
    calc(1rem * pow(var(--scale), 2.4)),
    3vw,
    calc(1rem * pow(var(--scale), 3.2))
  );
  font-weight: var(--heading-weight);
  line-height: 1.14;
  letter-spacing: -0.021em;
  color: var(--ink);
}

.faq-group p:not(.topic) {
  max-width: 34rem;
}

main > section.faq-group--sunken {
  background: var(--sunken);
}

/* A service page's photograph or before and after, under its opening */

main > section.figure {
  padding-top: 0;
}

.figure img {
  width: 100%;
  max-width: 48rem;
}

.figure .figure__narrow {
  max-width: 28rem;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  max-width: 52rem;
}

.pair figure {
  margin: 0;
}

.pair figcaption {
  margin-top: var(--step);
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* A service page's questions: a section heading with the mark, then each question */

main > section.answers {
  display: block;
  border: 0;
  border-radius: 0;
  background: none;
  overflow: visible;
}

section.answers h3 {
  margin-top: var(--gap-wide);
}

section.answers p {
  max-width: 34rem;
  color: var(--ink-soft);
}

/* About: the two fact tables side by side */

.fact-pair {
  display: grid;
  gap: var(--gap-wide);
}

/* About: the photograph of Louis, cropped to the window so the blurred patch beside it falls outside */

.intro__photo--crop .crop {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.intro__photo--crop .crop img {
  position: absolute;
  top: -33.9%;
  left: -30.4%;
  width: 160.7%;
  max-width: none;
  height: auto;
  aspect-ratio: auto;
}

/* 404: the pages as plain links */

.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--step) var(--gap-wide);
  margin: var(--gap-wide) 0 0;
  padding: 0;
  list-style: none;
}

.page-links a {
  color: var(--accent);
  font-weight: 600;
}

@media (min-width: 48rem) {
  .creds {
    grid-template-columns: repeat(3, 1fr);
  }

  .services .cards {
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  }

  .fact-pair {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (min-width: 60rem) {
  main > section.service:has(.service__body) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--gap-wide) * 1.5);
    align-items: center;
  }

  main > section.service:has(.service__body):nth-of-type(odd) .service__media {
    order: 2;
  }

  .service:has(.service__body) .service__media {
    margin-bottom: 0;
  }
}

@media (min-width: 60rem) {
  .intro--photo {
    grid-template-columns: 1.05fr 0.95fr;
    gap: calc(var(--gap-wide) * 1.5);
  }
}
