/* Components (CLAUDE.md 3.4: flat, square, hairlines; pills only for chips and buttons). */

/* Dark surfaces: components inside adapt through the semantic tokens. */
.band,
.site-footer,
.section--dark,
.lightbox,
.site-header--overlay:not(.is-scrolled) {
  --color-text: var(--color-inverse-text);
  --color-text-muted: var(--color-inverse-muted);
  --color-line: var(--color-inverse-line);
  --color-border: var(--color-inverse-border);
  --color-border-muted: var(--color-inverse-muted);
  --color-accent-bg: var(--color-inverse-accent-bg);
  --color-accent-bg-hover: var(--color-inverse-accent-bg-hover);
  --color-accent-text: var(--color-inverse-accent-text);
  --color-focus: var(--pg-light);
}

/* Icons ---------------------------------------------------------------- */
/* Shapes in icons.svg use vector-effect="non-scaling-stroke", so this is a true
   1.3px line at every icon size. */
.icon {
  flex: none;
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: 44px;
  text-decoration: none;
}

.icon-link span {
  min-width: 0;
  overflow-wrap: anywhere; /* a long email address wraps instead of overflowing at 320px */
}

.icon-link:hover span {
  text-decoration: underline;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: var(--outline) solid currentColor;
  border-radius: var(--radius-pill);
  transition: background-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  min-height: 3rem;
  padding: 0.75rem 1.75rem;
  border: var(--outline) solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.btn--small {
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

/* Filled and outlined buttons: charcoal on light surfaces, light on dark ones
   (dark surfaces remap the tokens, see the top of this file). */
.btn--primary {
  border-color: var(--color-accent-bg);
  background: var(--color-accent-bg);
  color: var(--color-accent-text);
}

.btn--primary:hover {
  border-color: var(--color-accent-bg-hover);
  background: var(--color-accent-bg-hover);
}

.btn--outline {
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn--outline:hover {
  border-color: var(--color-accent-bg);
  background: var(--color-accent-bg);
  color: var(--color-accent-text);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 44px;
  font-weight: 500;
  text-decoration: none;
}

.link-arrow span {
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--duration-fast) var(--ease);
}

.link-arrow:hover span {
  text-decoration-color: currentColor;
}

.link-arrow .icon,
.card__more .icon {
  transition: transform var(--duration) var(--ease);
}

.link-arrow:hover .icon,
.card:hover .card__more .icon {
  transform: translateX(0.25rem);
}

/* Chips (deck slide 4) ----------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.35rem 1.15rem;
  border: var(--outline) solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-size: var(--step--1);
  line-height: 1.2;
  text-decoration: none;
}

a.chip {
  min-height: 44px;
  transition: background-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

a.chip:hover,
a.chip[aria-current] {
  border-color: var(--color-accent-bg);
  background: var(--color-accent-bg);
  color: var(--color-accent-text);
}

/* Section heading ---------------------------------------------------------- */
.section-heading {
  display: grid;
  gap: var(--space-s);
  max-width: 48rem;
  margin-bottom: var(--space-xl);
}

.section-heading--center {
  justify-items: center;
  margin-inline: auto;
  text-align: center;
}

.section-heading__eyebrow {
  color: var(--color-text-muted);
  font-size: var(--step-1);
  font-weight: 300;
  line-height: 1.3;
}

.section-heading__script {
  color: var(--color-text-muted);
  font-family: var(--font-script);
  font-size: max(1.75rem, var(--step-3));
  line-height: 1.05;
}

.section-heading__title {
  font-size: var(--step-4);
}

.section-heading__intro {
  max-width: 40rem;
  color: var(--color-text-muted);
  font-size: var(--step-1);
  font-weight: 300;
  line-height: 1.6;
}

.section-heading--inverse .section-heading__eyebrow,
.section-heading--inverse .section-heading__script,
.section-heading--inverse .section-heading__intro {
  color: var(--color-inverse-muted);
}

/* Header ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  border-bottom: var(--hairline) solid var(--color-line);
  background: var(--color-bg);
  color: var(--color-text);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  min-height: var(--header-height);
}

.site-header__home {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
  padding-block: var(--space-2xs);
}

.site-header__logo {
  width: auto;
  height: 2.75rem;
}

.site-nav,
.site-header__cta {
  display: none;
}

.site-nav__list {
  display: flex;
  gap: clamp(1rem, 1.6vw, 1.75rem);
  list-style: none;
}

.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.site-nav__link::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0.55rem;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration) var(--ease);
}

.site-nav__link:hover::after,
.site-nav__link[aria-current='page']::after {
  transform: scaleX(1);
}

.site-header__menu {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -0.5rem;
  color: inherit;
}

.site-header__menu .icon,
.drawer__close .icon {
  width: 1.75rem;
  height: 1.75rem;
}

@media (min-width: 30rem) {
  .site-header__cta {
    display: inline-flex;
  }
}

@media (min-width: 70rem) {
  .site-nav {
    display: block;
  }

  .site-header__menu {
    display: none;
  }
}

/* Over a dark hero: transparent until the page scrolls (header.js adds .is-scrolled). */
.site-header--overlay {
  position: absolute;
  inset: 0 0 auto;
  border-bottom-color: transparent;
  background: transparent;
  color: var(--color-inverse-text);
}

.site-header--overlay::before {
  content: '';
  position: absolute;
  inset: 0 0 -2.5rem;
  z-index: -1;
  background: var(--scrim-top);
  pointer-events: none;
}

.site-header--overlay .site-header__logo--dark {
  display: none;
}

.site-header--overlay.is-scrolled {
  position: fixed;
  border-bottom-color: var(--color-line);
  background: var(--color-bg);
  color: var(--color-text);
  animation: header-in var(--duration) var(--ease);
}

.site-header--overlay.is-scrolled::before,
.site-header--overlay.is-scrolled .site-header__logo--light {
  display: none;
}

.site-header--overlay.is-scrolled .site-header__logo--dark {
  display: block;
}

@keyframes header-in {
  from {
    transform: translateY(-100%);
  }
}

/* Mobile drawer (native <dialog>) ---------------------------------------- */
.drawer {
  width: min(26rem, 100%);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--color-bg);
  color: var(--color-text);
}

/* When its content scrolls, the drawer itself takes focus: draw that ring inside the
   panel, where it stays visible (charcoal on light). */
.drawer:focus-visible {
  outline-offset: -4px;
}

.drawer::backdrop {
  background: var(--scrim-backdrop);
}

.drawer[open] {
  animation: drawer-in var(--duration-slow) var(--ease);
}

@keyframes drawer-in {
  from {
    transform: translateX(100%);
  }
}

html:has(.drawer[open]) {
  overflow: hidden;
}

.drawer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  min-height: 100%;
  padding: 0 var(--gutter) var(--space-xl);
}

.drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
}

.drawer__logo {
  width: auto;
  height: 2.75rem;
}

.drawer__close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -0.5rem;
  padding: 0;
  border: 0;
  background: none;
}

.drawer__list {
  border-top: var(--hairline) solid var(--color-line);
  list-style: none;
}

.drawer__list li {
  border-bottom: var(--hairline) solid var(--color-line);
}

.drawer__link {
  display: flex;
  align-items: center;
  min-height: 3.5rem;
  font-family: var(--font-display);
  font-stretch: var(--font-display-stretch);
  font-weight: var(--font-display-weight);
  font-size: var(--step-2);
  text-decoration: none;
}

.drawer__link[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.drawer__cta {
  align-self: flex-start;
}

.drawer__contact {
  display: grid;
  margin-top: auto;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* Cards --------------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--color-surface);
}

/* On white sections a white card would vanish, so it takes the page tone instead. */
.section--white .card {
  background: var(--color-bg);
}

.card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-surface-alt);
}

.card__media picture,
.card__media img,
.card__media .placeholder {
  width: 100%;
  height: 100%;
}

.card__media img {
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

@media (prefers-reduced-motion: no-preference) {
  .card:hover .card__media img {
    transform: scale(1.04);
  }
}

.card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-m) var(--space-m) var(--space-l);
}

.card__meta,
.card__text {
  color: var(--color-text-muted);
}

.card__meta {
  font-size: var(--step--1);
}

.card__title {
  font-size: var(--step-2);
}

.card__link {
  text-decoration: none;
}

/* A group of one: full width, image beside the text on wide screens. */
.grid > .card--wide {
  grid-column: 1 / -1;
}

@media (min-width: 48rem) {
  .card--wide {
    flex-direction: row;
  }

  .card--wide > .card__media {
    flex: 0 0 50%;
  }

  .card--wide > .card__body {
    justify-content: center;
    padding: var(--space-xl);
  }

  /* Keep "Learn more" with the text instead of pinned to the bottom. */
  .card--wide .card__more {
    margin-top: 0;
  }
}

/* The title link covers the whole card. */
.card__link::after {
  content: '';
  position: absolute;
  inset: 0;
}

/* Ring the whole card where :has() exists; otherwise the link keeps its own ring. */
@supports selector(:has(*)) {
  .card__link:focus-visible {
    outline: none;
  }

  .card:has(.card__link:focus-visible) {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
  }
}

.card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: auto;
  padding-top: var(--space-xs);
  font-size: var(--step--1);
  font-weight: 500;
}

/* Stats --------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: var(--space-l) var(--space-m);
}

.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: var(--space-2xs);
  padding-top: var(--space-s);
  border-top: var(--hairline) solid var(--color-line);
}

.stat__value {
  font-family: var(--font-display);
  font-stretch: var(--font-display-stretch);
  font-weight: var(--font-display-weight);
  font-size: var(--step-4);
  line-height: 1;
}

.stat__label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.stats--inverse .stat {
  border-top-color: var(--color-inverse-line);
}

.stats--inverse .stat__label {
  color: var(--color-inverse-muted);
}

/* Marble band: a baked texture (CLAUDE.md 3.4) behind light content --------- */
.band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--pg-charcoal);
  color: var(--color-inverse-text);
}

.band__media,
.band__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.band__media {
  z-index: -2;
}

/* Scrim: over the brightest veins of marble-deep, light text drops to ~3.7–4.1:1
   (99.9% of pixels are ≥ 7:1), so text areas sit on a charcoal gradient (CLAUDE.md 3.4). */
.band::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--scrim-center);
}

.band__content {
  position: relative;
}

.cta-band {
  padding-block: var(--space-section);
}

.cta-band__inner {
  display: grid;
  justify-items: center;
  gap: var(--space-l);
  text-align: center;
}

.cta-band .section-heading {
  margin-bottom: 0;
}

.cta-band__actions {
  justify-content: center;
}

/* Breadcrumbs ----------------------------------------------------------------- */
.breadcrumbs {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.6rem;
  list-style: none;
}

.breadcrumbs__list li {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* Decorative separator: empty alt text keeps screen readers from reading "slash". */
.breadcrumbs__list li + li::before {
  content: '/' / '';
  color: var(--color-line);
}

.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs [aria-current] {
  color: var(--color-text);
}

/* Accordion (<details>) ------------------------------------------------------- */
.accordion {
  border-top: var(--hairline) solid var(--color-line);
}

.accordion__item {
  border-bottom: var(--hairline) solid var(--color-line);
}

.accordion__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  min-height: 4rem;
  padding-block: var(--space-s);
  font-family: var(--font-display);
  font-stretch: var(--font-display-stretch);
  font-weight: 400;
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  list-style: none;
  cursor: pointer;
}

.accordion__summary::-webkit-details-marker {
  display: none;
}

.accordion__icon {
  width: 1.5rem;
  height: 1.5rem;
  transition: transform var(--duration) var(--ease);
}

.accordion__item[open] .accordion__icon {
  transform: rotate(45deg);
}

.accordion__panel {
  max-width: var(--measure);
  padding-bottom: var(--space-m);
  color: var(--color-text-muted);
}

/* Dot-timeline (deck slide 7) -------------------------------------------------- */
.timeline {
  --dot: 0.5625rem;
  position: relative;
  display: grid;
  gap: var(--space-l);
  padding-left: 2rem;
  list-style: none;
}

/* The line */
.timeline::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: calc(var(--dot) / 2);
  width: var(--hairline);
  background: var(--color-line);
}

.timeline__step {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--space-3xs);
}

.timeline__dot {
  position: absolute;
  top: 0.35rem;
  left: -2rem;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--pg-silver);
}

.timeline__number {
  color: var(--color-text-muted);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
}

.timeline__title {
  font-family: var(--font-body);
  font-size: var(--step-1);
  font-weight: 400;
}

.timeline__text {
  max-width: 22rem;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  line-height: 1.6;
}

@media (min-width: 48rem) {
  .timeline {
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: var(--space-m);
    padding-top: 3rem;
    padding-left: 0;
  }

  .timeline::before {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    height: var(--hairline);
  }

  /* Arrowhead at the end of the line, as in the deck. */
  .timeline::after {
    content: '';
    position: absolute;
    top: -0.2rem;
    right: 0;
    width: 0.45rem;
    height: 0.45rem;
    border-top: var(--hairline) solid var(--color-line);
    border-right: var(--hairline) solid var(--color-line);
    transform: rotate(45deg);
  }

  .timeline__step {
    justify-items: center;
    text-align: center;
  }

  /* Centred on the line, which sits 3rem above the steps (the list's padding-top). */
  .timeline__dot {
    top: calc(-3rem - var(--dot) / 2);
    left: 50%;
    transform: translateX(-50%);
  }
}

.timeline--inverse .timeline__number,
.timeline--inverse .timeline__text {
  color: var(--color-inverse-muted);
}

.timeline--inverse::before,
.timeline--inverse::after {
  border-color: var(--color-inverse-line);
  background: var(--color-inverse-line);
}

.timeline--inverse::after {
  background: none;
}

/* Footer -------------------------------------------------------------------- */
.site-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--space-2xl) var(--space-l);
  background: var(--pg-charcoal);
  color: var(--color-inverse-text);
  font-size: 0.9375rem;
}

.site-footer__media,
.site-footer__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-footer__media {
  z-index: -1;
}

.site-footer__inner {
  display: grid;
  gap: var(--space-xl) var(--space-l);
}

@media (min-width: 40rem) {
  .site-footer__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  /* The contact column holds the unbreakable email address, so it sizes to it. */
  .site-footer__inner {
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)) max-content;
  }

  /* Until services.json exists there are only three columns. */
  .site-footer__inner:not(:has(> :nth-child(4))) {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) max-content;
  }
}

.site-footer__home {
  display: inline-flex;
}

.site-footer__logo {
  width: auto;
  height: 7rem;
}

.site-footer__tagline {
  max-width: 22rem;
  margin-top: var(--space-m);
  color: var(--color-inverse-muted);
  font-weight: 300;
  line-height: 1.7;
}

.site-footer__social {
  display: flex;
  gap: var(--space-2xs);
  margin-top: var(--space-m);
  list-style: none;
}

.site-footer__social .icon-button:hover {
  background: var(--color-accent-bg);
  color: var(--color-accent-text);
}

.site-footer__heading {
  margin-bottom: var(--space-2xs);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.site-footer__links {
  list-style: none;
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-width: 44px;
  min-height: 44px;
  color: var(--color-inverse-muted);
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--color-inverse-text);
  text-decoration: underline;
}

.site-footer__address {
  margin-bottom: var(--space-2xs);
  color: var(--color-inverse-muted);
  line-height: 1.7;
}

.site-footer__hours {
  color: var(--color-inverse-muted);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--space-m);
  margin-top: var(--space-2xl);
  padding-top: var(--space-s);
  border-top: var(--hairline) solid var(--color-inverse-line);
  color: var(--color-inverse-muted);
  font-size: 0.8125rem;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-m);
  list-style: none;
}

.site-footer__legal a,
.site-footer__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
  white-space: nowrap;
}

/* "Cookie settings" (only while tracking is on): a button that looks like its neighbours. */
.site-footer__button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-underline-offset: 0.22em;
}

.site-footer__legal a:hover,
.site-footer__button:hover {
  color: var(--color-inverse-text);
  text-decoration: underline;
}

/* Forms --------------------------------------------------------------------- */
.form-grid {
  display: grid;
  gap: var(--space-m);
}

@media (min-width: 40rem) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field--full {
    grid-column: 1 / -1;
  }
}

.field {
  display: grid;
  align-content: start;
  gap: var(--space-2xs);
}

.field__label {
  font-size: var(--step--1);
  font-weight: 500;
}

.field__hint {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* Slate outline: 5.08:1 on light (≥ 3:1 for interactive boundaries, WCAG 1.4.11). */
.field__input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border: var(--outline) solid var(--color-border-muted);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--step-0);
  line-height: 1.4;
  transition: border-color var(--duration-fast) var(--ease);
  scroll-margin-top: 2.5rem; /* room for the label when an error-summary link jumps here */
}

.field__input:hover,
.field__input:focus {
  border-color: var(--color-border);
}

.field__textarea {
  min-height: 8rem;
  resize: vertical;
}

/* A select still on its placeholder shows it muted, so it doesn't read as answered. */
.field__select:has(option[value='']:checked) {
  color: var(--color-text-muted);
}

.field__select option {
  color: var(--color-text);
}

.field__select {
  appearance: none;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2357646C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 0.85rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
}

.field__optional {
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Error state: charcoal text on light, plus a thicker border and the message itself,
   so the error never relies on colour alone. */
.field__input[aria-invalid='true'] {
  border-width: 2px;
  border-color: var(--color-border);
}

.field__error {
  display: flex;
  gap: var(--space-2xs);
  font-size: var(--step--1);
  font-weight: 500;
}

.field__error::before {
  content: '!' / '';
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1em;
  border-radius: 50%;
  background: var(--color-accent-bg);
  color: var(--color-accent-text);
  font-size: 0.75rem;
}

.field__file {
  padding: 0.6rem;
  font-size: var(--step--1);
}

.field__file::file-selector-button {
  margin-right: var(--space-s);
  padding: 0.5rem 1rem;
  border: var(--outline) solid var(--color-border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.error-summary {
  margin-bottom: var(--space-l);
  padding: var(--space-m);
  border: 2px solid var(--color-border);
  background: var(--color-bg);
}

.error-summary:focus-visible {
  outline-offset: 4px;
}

.error-summary__title {
  margin-bottom: var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 500;
}

.error-summary__list {
  display: grid;
  gap: var(--space-3xs);
  padding-left: 1.2rem;
}

.error-summary__list a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.error-summary__note {
  margin-top: var(--space-xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.quote-form__required {
  margin-bottom: var(--space-m);
}

.quote-form__footer {
  display: grid;
  justify-items: start;
  gap: var(--space-s);
  margin-top: var(--space-l);
}

.quote-form__privacy {
  max-width: 36rem;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* Placeholder (development only; never rendered in production) ------------- */
.placeholder {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  border-radius: var(--radius);
  background: repeating-linear-gradient(135deg, var(--pg-mist) 0 12px, var(--pg-light) 12px 24px);
}

.placeholder__badge {
  padding: 0.25rem 0.75rem;
  border: var(--hairline) solid var(--pg-charcoal);
  border-radius: var(--radius-pill);
  background: var(--pg-light);
  color: var(--pg-charcoal);
  font-size: 0.75rem;
}

/* Scroll reveal (public/js/reveal.js) ---------------------------------------- */
/* Screen only, so printing never hides unrevealed content. */
@media screen {
  .reveal-pending {
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity var(--duration-slow) var(--ease), transform var(--duration-slow) var(--ease);
  }

  .reveal-pending.is-visible {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-pending {
    transform: none;
  }
}

/* Filter chips (server-side ?type= / ?category= links) ------------------------- */
.filter-chips {
  margin-top: var(--space-l);
}

/* Under a section heading (which has its own bottom margin), sit closer to it. */
.section .section-heading + .filter-chips {
  margin-top: calc(var(--space-l) - var(--space-xl));
  margin-bottom: var(--space-l);
}

/* Pagination ---------------------------------------------------------------- */
.pagination {
  margin-top: var(--space-xl);
}

.pagination__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2xs);
  list-style: none;
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  min-width: 44px;
  min-height: 44px;
  padding-inline: var(--space-xs);
  border: var(--outline) solid var(--color-border-muted);
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

a.pagination__link:hover,
.pagination__link[aria-current] {
  border-color: var(--color-accent-bg);
  background: var(--color-accent-bg);
  color: var(--color-accent-text);
}

/* Photo grid (square thumbnails → lightbox) --------------------------------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xs);
  list-style: none;
}

@media (min-width: 40rem) {
  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .photo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-s);
  }
}

.photo-grid__item {
  aspect-ratio: 1;
  background: var(--color-surface-alt);
}

/* The link clips the hover zoom, so its focus ring sits outside, in the grid gap, on the
   page tone rather than over the photo. */
.photo-grid__link {
  display: block;
  height: 100%;
  overflow: hidden;
}

picture.photo-grid__picture,
.photo-grid__picture img {
  display: block;
  width: 100%;
  height: 100%;
}

.photo-grid__item .placeholder {
  height: 100%;
}

.photo-grid__picture img {
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

@media (prefers-reduced-motion: no-preference) {
  .photo-grid__link:hover img {
    transform: scale(1.04);
  }
}

/* Lightbox (a modal <dialog>) ------------------------------------------------ */
.lightbox {
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(42 51 58 / 0.96);
  color: var(--color-text);
  /* Horizontal swipes go to lightbox.js; vertical scroll and pinch-zoom stay native. */
  touch-action: pan-y pinch-zoom;
}

.lightbox::backdrop {
  background: var(--scrim-backdrop);
}

html:has(.lightbox[open]) {
  overflow: hidden;
}

.lightbox__inner {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  padding: var(--space-xl) var(--space-s);
}

.lightbox__figure {
  display: grid;
  justify-items: center;
  gap: var(--space-xs);
  width: 100%;
  max-height: 100%;
}

/* --ratio (set by lightbox.js) gives the photo its final box before it loads. */
.lightbox__image {
  width: min(100%, 120rem, (100dvh - 7rem) * var(--ratio, 1.5));
  height: auto;
  max-height: calc(100dvh - 7rem);
  aspect-ratio: var(--ratio, 1.5);
  object-fit: contain;
}

.lightbox__counter {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.lightbox__button {
  position: absolute;
  background: rgb(42 51 58 / 0.6);
}

.lightbox__close {
  top: var(--space-s);
  right: var(--space-s);
}

.lightbox__prev,
.lightbox__next {
  bottom: var(--space-s);
}

.lightbox__prev {
  left: var(--space-s);
}

.lightbox__next {
  right: var(--space-s);
}

@media (min-width: 48rem) {
  .lightbox__inner {
    padding: var(--space-xl) calc(var(--space-s) * 2 + 44px);
  }

  .lightbox__prev,
  .lightbox__next {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
}

/* Before/after comparison ---------------------------------------------------- */
/* Without JS: the two photos side by side. With JS: stacked, the "after" photo
   clipped to the right of the handle, the range input on top. */
.compare {
  display: grid;
  gap: var(--space-xs);
}

.compare__frame {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xs);
}

.compare__side {
  position: relative;
  aspect-ratio: var(--compare-ratio, 4 / 3);
  overflow: hidden;
  background: var(--color-surface-alt);
}

.compare__picture,
.compare__picture img {
  display: block;
  width: 100%;
  height: 100%;
}

.compare__side .placeholder {
  height: 100%;
}

.compare__picture img {
  object-fit: cover;
}

.compare__label {
  position: absolute;
  top: var(--space-xs);
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgb(42 51 58 / 0.78);
  color: var(--pg-light);
  font-size: var(--step--1);
  font-weight: 500;
}

.compare__side--before .compare__label {
  left: var(--space-xs);
}

.compare__side--after .compare__label {
  right: var(--space-xs);
}

.compare__handle {
  display: none;
}

.compare__title {
  font-size: var(--step-0);
  font-weight: 500;
}

/* Stacked from the first paint when scripts run, so enhancing doesn't shift the layout. */
@media (scripting: enabled) {
  /* overflow: clip keeps the handle's ring inside the frame (no sideways scroll at 320px);
     the frame's own focus outline isn't clipped by it. */
  .compare .compare__frame {
    grid-template-columns: 1fr;
    gap: 0;
    overflow: clip;
  }

  .compare .compare__side {
    grid-area: 1 / 1;
  }

  .compare .compare__side--after {
    clip-path: inset(0 0 0 var(--compare-position, 50%));
  }

  .compare .compare__handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--compare-position, 50%);
    display: block;
    width: 2px;
    margin-left: -1px;
    background: var(--pg-light);
    pointer-events: none;
  }

  .compare .compare__handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.75rem;
    height: 2.75rem;
    border: 2px solid var(--pg-light);
    border-radius: 50%;
    background: rgb(42 51 58 / 0.55);
    transform: translate(-50%, -50%);
  }
}

/* The range input covers the whole photo, so a drag anywhere moves the handle. */
.compare__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y pinch-zoom;
}

.compare__frame:has(.compare__range:focus-visible) {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* Cookie notice (only while tracking is on; public/js/tracking.js) ---------------- */
/* Non-modal and fixed to the bottom. While it shows, the script sets --consent-height,
   so the page scrolls clear of it (base.css, WCAG 2.4.11) and the phone call bar and the
   calculator total sit above it (pages.css). */
.consent {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-consent);
  padding-block: var(--space-s) calc(var(--space-s) + env(safe-area-inset-bottom, 0px));
  border-top: var(--hairline) solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.consent__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s) var(--space-l);
}

.consent__body {
  flex: 1 1 24rem;
  max-width: var(--measure);
}

.consent__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-stretch: var(--font-display-stretch);
  font-weight: var(--font-display-weight);
  line-height: var(--leading-snug);
}

.consent__text {
  margin-top: var(--space-3xs);
  font-size: var(--step--1);
  line-height: 1.6;
}

.consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}

@media (prefers-reduced-motion: no-preference) {
  .consent {
    animation: consent-in var(--duration-slow) var(--ease);
  }
}

@keyframes consent-in {
  from {
    transform: translateY(100%);
  }
}
