/* ==========================================================================
   Vertical Surfaces — Design Tokens
   Colours derived from the real logo (blue + charcoal). Interactive blue is
   a darkened variant of the logo blue so it clears WCAG AA (4.5:1) as text;
   the lighter logo blue is reserved for decorative/large use only.
   See DESIGN-SYSTEM.md for the full record of these decisions.
   ========================================================================== */

:root {
  /* Brand colour */
  --color-brand-accent: #2ba6de;   /* logo blue — decorative/large text/icons only (2.76:1 on white) */
  --color-primary: #0e6e93;        /* interactive blue — buttons, links, icons on white (5.72:1) */
  --color-primary-dark: #0a5473;

  /* Neutrals (from logo charcoal, tuned for contrast) */
  --color-ink: #1a1d21;
  --color-charcoal: #3a3d42;
  --color-grey-600: #5b6066;
  --color-grey-400: #8a9096;
  --color-grey-200: #d7dee2;
  --color-grey-100: #edf1f3;
  --color-off-white: #f7f9fa;
  --color-white: #ffffff;

  --color-success: #1b7a3d;
  --color-error: #b3261e;

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: var(--font-body);

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.75rem;
  --text-4xl: 3.25rem;

  --leading-tight: 1.2;
  --leading-normal: 1.6;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 780px;
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(26, 29, 33, 0.08);
  --shadow-md: 0 8px 24px rgba(26, 29, 33, 0.1);

  --focus-ring: 3px solid #0e6e93;
  --focus-ring-offset: 2px;

  --motion-fast: 150ms ease;
  --motion-normal: 250ms ease;
}

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { margin: 0; padding: 0; list-style: none; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
table { border-collapse: collapse; width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-charcoal);
  background: var(--color-white);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-ink);
  line-height: var(--leading-tight);
  font-weight: 700;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

@media (min-width: 700px) {
  h1 { font-size: var(--text-4xl); }
}

p { max-width: 68ch; }
p + p { margin-top: var(--space-4); }

a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:not([class]) { color: var(--color-primary); }
a:not([class]):hover { color: var(--color-primary-dark); }

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

/* Never remove focus outlines without a visible replacement. */
a, button, input, textarea, select, [tabindex] {
  scroll-margin-top: 100px;
}

/* ==========================================================================
   Skip link
   ========================================================================== */

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  background: var(--color-ink);
  color: var(--color-white);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--motion-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ==========================================================================
   Layout utilities
   ========================================================================== */

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.container--narrow {
  max-width: var(--container-narrow);
}

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

.section--tight {
  padding-block: var(--space-8);
}

.section--muted {
  background: var(--color-off-white);
}

.section--dark {
  background: var(--color-ink);
  color: var(--color-grey-100);
}

.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--color-white); }

.stack { display: flex; flex-direction: column; gap: var(--space-5); }
.stack--sm { gap: var(--space-3); }
.stack--lg { gap: var(--space-8); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

/* CSS Grid's `1fr` tracks default to `minmax(auto, 1fr)` — a column won't
   shrink below its content's min-content width (e.g. one long unbroken word
   like "ADMINISTRATION"), so tracks can end up unequal even with equal `fr`
   values. Forcing min-width: 0 on direct grid children fixes it. */
.grid > * {
  min-width: 0;
}

@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 860px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.text-center { text-align: center; }
.max-w-prose { max-width: 62ch; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-grey-200);
}

.site-header__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-3);
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.site-header__logo img {
  height: 48px;
  width: auto;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
}

.nav-toggle__icon {
  width: 22px;
  height: 16px;
  position: relative;
}

.nav-toggle__icon span,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-ink);
}

.nav-toggle__icon::before { top: 0; }
.nav-toggle__icon span { top: 7px; }
.nav-toggle__icon::after { bottom: 0; }

.primary-nav {
  display: none;
}

.primary-nav.is-open {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-grey-200);
  box-shadow: var(--shadow-md);
  max-height: calc(100vh - 72px);
  overflow-y: auto;
}

.primary-nav__list {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-5);
}

.primary-nav__list a {
  display: block;
  padding: var(--space-3) 0;
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--color-grey-100);
}

.primary-nav__sublist {
  padding-left: var(--space-4);
}

.primary-nav__sublist a { font-weight: 500; color: var(--color-charcoal); }

.site-header__phone {
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}

.site-header__bar > .cluster {
  flex-basis: 100%;
  justify-content: flex-end;
  order: 3;
}

@media (min-width: 640px) {
  .site-header__bar > .cluster {
    flex-basis: auto;
    order: 0;
  }
}

@media (min-width: 960px) {
  .nav-toggle { display: none; }

  .primary-nav {
    display: block;
  }

  .primary-nav__list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-5);
    padding: 0;
  }

  .primary-nav__list > li {
    position: relative;
  }

  .primary-nav__list a {
    padding: var(--space-2) 0;
    border-bottom: none;
    font-size: var(--text-sm);
  }

  .primary-nav__list > li > a {
    display: flex;
    align-items: center;
  }

  .has-children:hover .primary-nav__sublist,
  .has-children:focus-within .primary-nav__sublist {
    display: block;
  }

  .primary-nav__sublist {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-white);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: var(--space-2);
    min-width: 260px;
  }

  .primary-nav__sublist a {
    white-space: nowrap;
    padding: var(--space-2) var(--space-3);
  }

  .site-header__bar { flex-wrap: nowrap; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: var(--text-sm);
  text-decoration: none;
  border: 2px solid transparent;
  min-height: 48px;
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn--primary:hover { background: var(--color-primary-dark); }

.btn--secondary {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn--secondary:hover { background: var(--color-primary); color: var(--color-white); }

.btn--on-dark {
  border-color: var(--color-white);
  color: var(--color-white);
}

.btn--on-dark:hover { background: var(--color-white); color: var(--color-ink); }

.btn--block { width: 100%; }

.text-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
}

.text-link:hover { color: var(--color-primary-dark); }

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: var(--color-white);
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  height: 100%;
}

.card--link {
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--motion-fast), border-color var(--motion-fast);
}

.card--link:hover,
.card--link:focus-visible {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.card__icon {
  width: 48px;
  height: 48px;
  color: var(--color-primary);
}

.card img { border-radius: var(--radius-sm); }

.team-title {
  color: var(--color-primary);
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: calc(var(--space-3) * -1);
}

.card .media-frame { margin: calc(var(--space-6) * -1) calc(var(--space-6) * -1) 0; border-radius: var(--radius-md) var(--radius-md) 0 0; }

/* ==========================================================================
   Media frame — constrains a (possibly portrait/tall) real photo to a
   predictable aspect ratio so the subject stays visible instead of being
   cut off by the container's natural height.
   ========================================================================== */

.media-frame {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
}

/* eleventy-img wraps the <img> in a <picture> element; the sitewide reset
   (img, picture, svg, video { height: auto }) leaves that wrapper sized to
   its own intrinsic aspect ratio unless we force it to fill the frame too —
   otherwise images wider than the frame's aspect ratio leave a gap instead
   of covering the box. */
.media-frame picture,
.media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.media-frame--portrait { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame--wide { aspect-ratio: 16 / 9; }

/* For diagrams/CAD drawings where cropping would lose information */
.media-frame--contain {
  background: var(--color-off-white);
  border: 1px solid var(--color-grey-200);
}

.media-frame--contain img { object-fit: contain; }

/* ==========================================================================
   Trust badges
   ========================================================================== */

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  align-items: center;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 340px;
}

.trust-badge img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.trust-badge__text { font-size: var(--text-sm); }
.trust-badge__name { font-weight: 700; color: var(--color-ink); display: block; }

/* ==========================================================================
   Testimonials
   ========================================================================== */

.testimonial {
  background: var(--color-off-white);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: var(--space-6);
}

.testimonial__quote {
  font-size: var(--text-lg);
  color: var(--color-ink);
  font-style: italic;
}

.testimonial__quote::before { content: "\201C"; }
.testimonial__quote::after { content: "\201D"; }

.testimonial__attribution {
  margin-top: var(--space-4);
  font-weight: 700;
  font-style: normal;
  color: var(--color-charcoal);
}

/* ==========================================================================
   Process steps
   ========================================================================== */

.process-steps {
  counter-reset: step;
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .process-steps { grid-template-columns: repeat(3, 1fr); }
}

.process-step {
  position: relative;
  padding-top: var(--space-8);
}

.process-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.gallery-filters button {
  background: var(--color-white);
  border: 1px solid var(--color-grey-200);
  border-radius: 999px;
  padding: var(--space-2) var(--space-4);
  font-weight: 600;
  font-size: var(--text-sm);
}

.gallery-filters button[aria-pressed="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 960px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}

.gallery-grid__item {
  border: 0;
  background: none;
  padding: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.gallery-grid__item picture,
.gallery-grid__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--motion-normal);
}

.gallery-grid__item:hover img { transform: scale(1.05); }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 33, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-6);
}

.lightbox.is-open { display: flex; }

.lightbox img { max-height: 85vh; max-width: 100%; }

.lightbox__close {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  background: var(--color-white);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: var(--text-lg);
}

/* ==========================================================================
   Video
   ========================================================================== */

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-ink);
}

.video-embed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.video-embed__play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
}

.video-embed__play-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.form-field label {
  font-weight: 700;
  color: var(--color-ink);
}

.hint {
  font-size: var(--text-xs);
  color: var(--color-grey-600);
}

.form-field input,
.form-field textarea,
.form-field select {
  padding: var(--space-3);
  border: 1.5px solid var(--color-grey-200);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  font-size: var(--text-base);
}

.form-field input:focus-visible,
.form-field textarea:focus-visible,
.form-field select:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
}

.form-field.has-error input,
.form-field.has-error textarea {
  border-color: var(--color-error);
}

.form-field .error-text {
  color: var(--color-error);
  font-size: var(--text-sm);
  font-weight: 600;
}

.form-status {
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-5);
}

.form-status--success {
  background: #e6f4ea;
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

/* honeypot field, hidden from sighted and AT users but present for bots */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--color-ink);
  color: var(--color-grey-100);
  padding-block: var(--space-10) var(--space-6);
}

.site-footer a { color: var(--color-grey-100); text-decoration: none; }
.site-footer a:hover { color: var(--color-white); text-decoration: underline; }

.site-footer__grid {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
  padding-bottom: var(--space-8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

@media (min-width: 760px) {
  .site-footer__grid { grid-template-columns: repeat(4, 1fr); }
}

.site-footer h2 {
  color: var(--color-white);
  font-size: var(--text-base);
  margin-bottom: var(--space-3);
}

.site-footer__list li { margin-bottom: var(--space-2); }

.site-footer__social {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.site-footer__social a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.site-footer__social svg {
  flex-shrink: 0;
}

.site-footer__bottom {
  padding-top: var(--space-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-grey-400);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding-top: var(--space-10);
  background: linear-gradient(180deg, var(--color-off-white) 0%, var(--color-white) 100%);
}

.hero__banner {
  margin-top: var(--space-10);
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.hero__banner picture,
.hero__banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (min-width: 700px) {
  .hero__banner { aspect-ratio: 21 / 9; }
}

.hero__eyebrow {
  color: var(--color-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--text-sm);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* ==========================================================================
   Page hero (interior pages)
   ========================================================================== */

.page-hero {
  padding-block: var(--space-8);
  background: var(--color-off-white);
  border-bottom: 1px solid var(--color-grey-200);
}

.breadcrumbs {
  font-size: var(--text-xs);
  color: var(--color-grey-600);
  margin-bottom: var(--space-3);
}

.breadcrumbs a { color: var(--color-grey-600); }

/* ==========================================================================
   Fixing-type explainer (top-fixed / face-fixed / postless)
   ========================================================================== */

.fixing-types {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .fixing-types { grid-template-columns: repeat(3, 1fr); }
}

.fixing-type {
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.fixing-type h3 { color: var(--color-primary); }
