/* ==========================================================================
   Proven Construction LLC - Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties & Reset
   -------------------------------------------------------------------------- */
:root {
  /* --- Brand palette (unchanged) ------------------------------------------ */
  --color-primary: #1B3A5C;
  --color-accent: #E8772F;
  --color-secondary: #3A8FC2;
  --color-bg-light: #F5F7FA;
  --color-white: #FFFFFF;
  --color-text: #2C2C2C;
  --color-border: #D4D8DE;

  /* --- Derived palette ----------------------------------------------------
     Same brand hues, tuned for legibility. --color-accent stays exactly as-is
     for fills, icons and rules; these two variants exist only for *text*,
     where the raw accent does not reach WCAG AA at small sizes.
     accent-ink  : orange text on white/light  -> 4.7:1
     accent-glow : orange text on navy         -> 4.7:1
     ---------------------------------------------------------------------- */
  --color-accent-ink: #B05711;
  --color-accent-glow: #F08C42;
  --color-secondary-ink: #2A6C96;
  --color-accent-hover: #CF651F;
  --color-accent-active: #B4530F;
  --color-primary-deep: #0F2438;
  --color-text-muted: #55606B;
  --color-border-soft: #E4E8ED;

  /* --- Type --------------------------------------------------------------- */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;

  /* Type scale (documents the steps the stylesheet actually uses) */
  --step-display: 3.5rem;   /* home hero h1            */
  --step-1: 3rem;           /* h1 / page-hero h1       */
  --step-2: 2.25rem;        /* h2 / section headings   */
  --step-3: 1.5rem;         /* h3 / card headings      */
  --step-4: 1.25rem;        /* h4                      */
  --step-body-lg: 1.125rem; /* lead paragraphs         */
  --step-body: 1rem;
  --step-sm: 0.9375rem;
  --step-xs: 0.8125rem;

  /* Tracking + leading */
  --tracking-display: -0.022em;
  --tracking-tight: -0.012em;
  --tracking-label: 0.14em;
  --leading-display: 1.08;
  --leading-heading: 1.2;
  --leading-body: 1.65;

  /* Comfortable reading measure for long-form copy */
  --measure: 68ch;

  /* --- Space scale (8px baseline) ----------------------------------------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 56px;
  --space-9: 72px;
  --space-10: 96px;

  /* Section rhythm + grid gutter — overridden per breakpoint further down */
  --section-y: 96px;
  --section-header-gap: 64px;
  --grid-gap: 32px;

  /* --- Radius scale ------------------------------------------------------- */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  /* --- Elevation ----------------------------------------------------------
     Two-layer, navy-tinted rather than neutral black: on a navy-branded site
     a cool shadow reads as intentional instead of "default drop shadow".
     ---------------------------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(16, 32, 52, 0.06);
  --shadow-sm: 0 1px 2px rgba(16, 32, 52, 0.05), 0 2px 8px rgba(16, 32, 52, 0.06);
  --shadow-md: 0 2px 4px rgba(16, 32, 52, 0.05), 0 8px 20px rgba(16, 32, 52, 0.08);
  --shadow-lg: 0 4px 8px rgba(16, 32, 52, 0.06), 0 16px 32px rgba(16, 32, 52, 0.11);
  --shadow-xl: 0 8px 16px rgba(16, 32, 52, 0.07), 0 28px 56px rgba(16, 32, 52, 0.15);

  /* --- Motion -------------------------------------------------------------
     One easing curve for the whole site. Everything below is additionally
     neutralised by the global prefers-reduced-motion block (section 22).
     ---------------------------------------------------------------------- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.15s var(--ease);
  --transition: 0.24s var(--ease);
  --transition-slow: 0.4s var(--ease);

  /* --- Focus -------------------------------------------------------------- */
  --focus-ring-color: var(--color-accent-ink);
  --focus-ring-width: 3px;
  --focus-ring-offset: 3px;

  /* --- Layout ------------------------------------------------------------- */
  --max-width: 1200px;
  --header-height: 80px;
}

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

html {
  scroll-behavior: smooth;
  /* Stop in-page anchors from landing underneath the sticky header. */
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: var(--leading-body);
  overflow-x: hidden;
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--color-accent);
  color: var(--color-white);
}

/* --------------------------------------------------------------------------
   1b. Focus visibility
   A single, consistent keyboard-focus ring. Mouse users never see it;
   keyboard users always do — including on elements that previously relied on
   the browser default (which the accent-coloured :focus styles hid).
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-xs);
}

/* Dark surfaces need the lighter accent so the ring stays visible. */
.hero :focus-visible,
.page-hero :focus-visible,
.top-bar :focus-visible,
.stats-bar :focus-visible,
.cta-banner :focus-visible,
.licensing-section :focus-visible,
.footer :focus-visible,
.lightbox :focus-visible,
.portfolio-item:focus-visible {
  outline-color: var(--color-accent-glow);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   2. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: var(--leading-heading);
  /* Keeps headlines from leaving a single orphan word on the last line. */
  text-wrap: balance;
}

h1 {
  font-size: var(--step-1);
  font-weight: 700;
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  margin-bottom: 0.45em;
}

h2 {
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 0.45em;
}

h3 {
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.006em;
  margin-bottom: 0.5em;
}

h4 {
  font-size: var(--step-4);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

.section-subtitle {
  font-size: var(--step-body-lg);
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 60ch;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--color-accent-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: var(--font-heading);
  line-height: 1.2;
  margin-bottom: var(--space-3);
}

/* Prose links need to be identifiable without colour alone. The global
   `a { text-decoration: none }` reset otherwise makes inline links invisible. */
.blog-post-content p a,
.blog-post-content li a,
.about-preview-text p a,
.service-detail p a,
.services-category-intro a,
.form-privacy a,
.form-help a {
  color: var(--color-accent-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(176, 87, 17, 0.4);
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.blog-post-content p a:hover,
.blog-post-content li a:hover,
.about-preview-text p a:hover,
.service-detail p a:hover,
.services-category-intro a:hover,
.form-privacy a:hover,
.form-help a:hover {
  color: var(--color-primary);
  text-decoration-color: currentColor;
}

/* --------------------------------------------------------------------------
   3. Layout Utilities
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.section {
  padding: var(--section-y) 0;
}

.section-bg-light {
  background-color: var(--color-bg-light);
  position: relative;
  isolation: isolate;
}

/* A whisper of cedar grain warms the light sections against all the navy.
   Kept at 0.07 so it registers as paper warmth, not as a wood photograph —
   body copy above it is unaffected. Sits behind content via z-index. */
.section-bg-light::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url('../images/textures/texture-cedar.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.07;
  pointer-events: none;
}

/* Where a light section meets a white one, a hairline keeps the seam crisp
   instead of relying on the tint alone. */
.section-bg-light + .section:not(.section-bg-light),
.section:not(.section-bg-light) + .section-bg-light {
  border-top: 1px solid var(--color-border-soft);
}

.section-header {
  text-align: center;
  margin-bottom: var(--section-header-gap);
}

.section-header h2 {
  margin-bottom: var(--space-5);
}

/* A short accent rule anchors the centred header block and gives the page a
   repeating structural beat. */
.section-header h2::after {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  margin: var(--space-5) auto 0;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
}

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

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
}

/* --------------------------------------------------------------------------
   3b. Buttons — full state ladder (rest / hover / active / focus / disabled)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    transform var(--transition-fast);
  font-family: var(--font-heading);
  border: 2px solid transparent;
  text-align: center;
  line-height: 1.2;
}

.btn:active {
  transform: translateY(0);
}

.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.55;
  pointer-events: none;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-white);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  background: var(--color-accent-active);
  border-color: var(--color-accent-active);
  box-shadow: var(--shadow-xs);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-white);
  color: var(--color-white);
}

.btn-outline:hover,
.btn-outline:focus {
  background: var(--color-white);
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.btn-outline:active {
  background: rgba(255, 255, 255, 0.88);
  color: var(--color-primary);
  box-shadow: none;
}

.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: #2f7aa8;
  border-color: #2f7aa8;
  color: var(--color-white);
  box-shadow: var(--shadow-md);
}

.btn-secondary:active {
  background: #276691;
  border-color: #276691;
  box-shadow: var(--shadow-xs);
}

/* The 1px lift is a pointer affordance only — never on touch, and removed
   entirely by the reduced-motion block. */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-outline:hover {
    transform: translateY(-1px);
  }
}

/* --------------------------------------------------------------------------
   4. Skip Link
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
}

.skip-link:focus {
  top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   5. Top Utility Bar
   -------------------------------------------------------------------------- */
.top-bar {
  background: var(--color-primary-deep);
  color: rgba(255, 255, 255, 0.86);
  padding: 10px 0;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar a {
  color: var(--color-white);
  transition: color var(--transition);
}

.top-bar a:hover,
.top-bar a:focus {
  color: var(--color-accent);
}

.top-bar-left {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.top-bar-left a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 6px;
}

.top-bar-right {
  display: flex;
  gap: 15px;
  align-items: center;
}

.top-bar-right a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.top-bar-right svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   6. Main Navigation
   -------------------------------------------------------------------------- */
.navbar {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border-soft);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.navbar.scrolled {
  border-bottom-color: transparent;
  box-shadow: var(--shadow-md);
}

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

.nav-logo {
  display: inline-flex;
  align-items: center;
}

.nav-logo img {
  height: 60px;
  width: auto;
}

.nav-menu {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.nav-menu a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.005em;
  color: var(--color-primary);
  position: relative;
  transition: color var(--transition);
  padding: 10px 0;
}

.nav-menu a:hover,
.nav-menu a:focus,
.nav-menu a.active {
  color: var(--color-accent-ink);
}

.nav-menu a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--transition);
}

.nav-menu a:not(.nav-cta):hover::after,
.nav-menu a:not(.nav-cta):focus::after,
.nav-menu a.active:not(.nav-cta)::after {
  transform: scaleX(1);
}

.nav-cta {
  color: var(--color-white) !important;
  padding: 12px 24px !important;
  min-height: 44px;
  font-size: 0.9375rem;
}

.nav-cta:hover,
.nav-cta:focus {
  color: var(--color-white) !important;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* 44x44 hit area, 30x25 visual glyph */
  width: 44px;
  height: 44px;
  margin-right: -10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-md);
}

.hamburger span {
  display: block;
  height: 3px;
  width: 28px;
  background: var(--color-primary);
  margin: 3px 0;
  transition: transform var(--transition), opacity var(--transition), background var(--transition);
  transform-origin: center;
  border-radius: var(--radius-pill);
}

.hamburger:hover span {
  background: var(--color-accent-ink);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   7. Hero Sections
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  padding: var(--space-10) 0;
  isolation: isolate;
}

/* Scrim.
   Previously a single flat navy wash at 70–85%, which flattened the
   photography. This is a vignette instead: lighter through the middle so the
   photo still reads, heavier at the edges so the headline block always sits on
   a dark, even field regardless of what the underlying image is doing. Net
   contrast behind the copy is equal to or better than before. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      125% 95% at 50% 42%,
      rgba(15, 36, 56, 0.56) 0%,
      rgba(15, 36, 56, 0.76) 58%,
      rgba(15, 36, 56, 0.90) 100%
    ),
    linear-gradient(
      180deg,
      rgba(27, 58, 92, 0.55) 0%,
      rgba(27, 58, 92, 0.30) 42%,
      rgba(27, 58, 92, 0.62) 100%
    );
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  padding: 0 var(--space-5);
  margin: 0 auto;
}

.hero h1 {
  color: var(--color-white);
  font-size: var(--step-display);
  margin-bottom: var(--space-5);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  /* Last-resort legibility insurance if a future hero photo is very bright. */
  text-shadow: 0 2px 24px rgba(8, 20, 33, 0.45);
}

.hero p {
  font-size: 1.25rem;
  line-height: 1.55;
  max-width: 56ch;
  margin: 0 auto var(--space-7);
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 12px rgba(8, 20, 33, 0.4);
}

.hero-buttons {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

.page-hero {
  min-height: 40vh;
  padding: var(--space-9) 0;
}

.page-hero h1 {
  font-size: var(--step-1);
  margin-bottom: var(--space-4);
}

.page-hero p {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   8. Stats Bar
   -------------------------------------------------------------------------- */
.stats-bar {
  /* The solid colour is declared separately from the image so a failed or
     slow-loading texture still paints navy and never strands white text on
     white. The 86% scrim keeps contrast well clear of AA. */
  background-color: var(--color-primary);
  background-image:
    linear-gradient(rgba(27, 58, 92, 0.86), rgba(27, 58, 92, 0.86)),
    url('../images/textures/bg-stats-texture.jpg');
  background-size: auto, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  /* A crisp accent rule hands the eye off from the hero photo to the bar. */
  border-top: 3px solid var(--color-accent);
  padding: var(--space-8) 0;
  color: var(--color-white);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-7) var(--space-6);
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

/* Hairline separators between columns. Only drawn on items that are NOT
   first in their row, so the rule stays correct as the grid reflows
   4-up -> 2-up -> 1-up (see the responsive block in section 24). */
.stat-item {
  position: relative;
}

.stat-item::before {
  content: '';
  position: absolute;
  left: calc(var(--space-6) / -2);
  top: 8%;
  bottom: 8%;
  width: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.stat-item:nth-child(4n + 1)::before {
  display: none;
}

.stat-icon {
  color: var(--color-accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 40px;
  height: 40px;
  fill: var(--color-accent-glow);
}

.stat-text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.35;
  letter-spacing: 0.005em;
  color: var(--color-white);
  text-wrap: balance;
}

/* --------------------------------------------------------------------------
   9. Service Cards
   -------------------------------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

.service-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
  border: 1px solid var(--color-border-soft);
}

.service-card:hover,
.service-card:focus-within {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border);
}

.service-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto var(--space-5);
  background: var(--color-bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}

.service-card:hover .service-icon,
.service-card:focus-within .service-icon {
  background: rgba(232, 119, 47, 0.12);
}

.service-icon svg {
  width: 34px;
  height: 34px;
  fill: var(--color-accent);
}

.service-card h3 {
  margin-bottom: var(--space-3);
}

.service-card p {
  font-size: var(--step-sm);
  line-height: 1.62;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* Inline "keep going" links. The chevron moves, not the gap — transforms are
   composited, `gap` is not. */
.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  color: var(--color-accent-ink);
  font-weight: 700;
  margin-top: var(--space-7);
  font-family: var(--font-heading);
  letter-spacing: 0.01em;
  transition: color var(--transition-fast);
}

.view-all-link svg {
  transition: transform var(--transition);
  flex-shrink: 0;
}

.view-all-link:hover,
.view-all-link:focus {
  color: var(--color-primary);
}

.view-all-link:hover svg,
.view-all-link:focus svg {
  transform: translateX(4px);
}

.view-all-wrapper {
  text-align: center;
  margin-top: var(--space-7);
}

/* The wrapper already supplies the top margin — without this the two stack
   and open an 80px hole under every grid. */
.view-all-wrapper .view-all-link {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   10. About Preview (split layout)
   -------------------------------------------------------------------------- */
.about-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-9);
  align-items: center;
}

.about-preview-text h2 {
  margin-bottom: var(--space-5);
}

.about-preview-text p {
  margin-bottom: var(--space-4);
  max-width: var(--measure);
  color: var(--color-text);
}

.about-preview-text ul {
  margin: var(--space-6) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.about-preview-text li {
  padding-left: 30px;
  position: relative;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.5;
}

.about-preview-text li::before {
  content: '\2713';
  color: var(--color-accent-ink);
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.5;
}

.about-preview-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  aspect-ratio: 4 / 3;
}

.about-preview-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   11. Portfolio Grid
   -------------------------------------------------------------------------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

.portfolio-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  display: block;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.portfolio-item:hover,
.portfolio-item:focus-visible {
  box-shadow: var(--shadow-lg);
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.portfolio-item:hover img,
.portfolio-item:focus img {
  transform: scale(1.05);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  /* Gradient rather than a flat navy block: the project photo stays partly
     readable behind the caption instead of being switched off. */
  background: linear-gradient(
    to top,
    rgba(15, 36, 56, 0.92) 0%,
    rgba(15, 36, 56, 0.78) 40%,
    rgba(15, 36, 56, 0.55) 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  color: var(--color-white);
  padding: var(--space-5);
  text-align: center;
}

.portfolio-item:hover .portfolio-overlay,
.portfolio-item:focus .portfolio-overlay,
.portfolio-item:focus-visible .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay h3 {
  margin-bottom: var(--space-2);
  color: var(--color-white);
}

.portfolio-overlay span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-glow);
  font-family: var(--font-heading);
  font-weight: 700;
}

/* Touch devices never fire :hover, so on phones and tablets the project titles
   were unreachable. Show them permanently as a bottom-anchored caption. */
@media (hover: none) {
  .portfolio-overlay {
    opacity: 1;
    justify-content: flex-end;
    text-align: left;
    align-items: flex-start;
    padding: var(--space-7) var(--space-5) var(--space-5);
    background: linear-gradient(
      to top,
      rgba(15, 36, 56, 0.9) 0%,
      rgba(15, 36, 56, 0.45) 45%,
      rgba(15, 36, 56, 0) 78%
    );
  }

  .portfolio-overlay h3 {
    font-size: 1.15rem;
    margin-bottom: 2px;
  }

  .portfolio-overlay span {
    font-size: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   12. Testimonials
   -------------------------------------------------------------------------- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

.testimonial-card {
  position: relative;
  background: var(--color-white);
  padding: var(--space-7) var(--space-6);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-accent);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Oversized quote mark, set very low-contrast — reads as texture, not as an
   element competing with the copy. */
.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: -0.24em;
  right: 0.12em;
  font-family: var(--font-heading);
  font-size: 7rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-primary);
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
}

.testimonial-stars {
  color: var(--color-accent);
  font-size: 1.15rem;
  margin-bottom: var(--space-4);
  letter-spacing: 3px;
}

.testimonial-text {
  position: relative;
  font-style: italic;
  font-size: 1.0625rem;
  margin-bottom: var(--space-5);
  line-height: 1.72;
  color: var(--color-text);
}

.testimonial-author {
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-heading);
  letter-spacing: 0.005em;
}

.testimonial-project {
  font-size: var(--step-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* --------------------------------------------------------------------------
   13. CTA Banner
   -------------------------------------------------------------------------- */
.cta-banner {
  background: var(--color-primary);
  background-image: linear-gradient(160deg, #21486F 0%, var(--color-primary) 48%, var(--color-primary-deep) 100%);
  color: var(--color-white);
  text-align: center;
  padding: var(--space-9) 0;
  position: relative;
  overflow: hidden;
}

/* Blueprint line work replaces the old repeating-gradient hatch. Held at low
   opacity so it reads as paper texture rather than a picture competing with
   the headline; .cta-banner > .container sits above it on z-index 1. */
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../images/textures/bg-blueprint-cta.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.22;
  pointer-events: none;
}

.cta-banner > .container {
  position: relative;
  z-index: 1;
}

.cta-banner h2 {
  color: var(--color-white);
  margin-bottom: var(--space-4);
}

/* The accent rule belongs to centred section headers, not to this banner. */
.cta-banner h2::after {
  content: none;
}

.cta-banner p {
  margin-bottom: var(--space-6);
  font-size: var(--step-body-lg);
  color: rgba(255, 255, 255, 0.88);
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

.cta-phone {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-accent-glow);
  display: block;
  width: fit-content;
  /* padding + line-height clear the 44px minimum tap target */
  padding: 6px 10px;
  margin: 0 auto var(--space-6);
  line-height: 1.25;
  font-family: var(--font-heading);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 2px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.cta-phone:hover,
.cta-phone:focus {
  color: var(--color-white);
  text-decoration-color: var(--color-accent-glow);
}

/* --------------------------------------------------------------------------
   14. Services Page (detailed)
   -------------------------------------------------------------------------- */
.services-category {
  margin-bottom: var(--space-10);
}

.services-category:last-child {
  margin-bottom: 0;
}

.services-category > h2 {
  padding-bottom: var(--space-4);
  border-bottom: 3px solid var(--color-accent);
  margin-bottom: var(--space-6);
}

.services-category-intro {
  margin-bottom: var(--space-8);
  font-size: var(--step-body-lg);
  line-height: 1.7;
  color: var(--color-text-muted);
  max-width: var(--measure);
}

.service-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border-soft);
}

.service-detail:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.service-detail:nth-child(even) .service-detail-img {
  order: -1;
}

.service-detail-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition), transform var(--transition);
}

.service-detail-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

/* Pointer-only: a slow, small push-in that signals "this is a real photo of
   real work" without turning the page into a carousel of effects. */
@media (hover: hover) and (pointer: fine) {
  .service-detail-img:hover {
    box-shadow: var(--shadow-lg);
  }

  .service-detail-img:hover img,
  .company-story-img:hover img,
  .about-preview-img:hover img {
    transform: scale(1.04);
  }

  .company-story-img img,
  .about-preview-img img {
    transition: transform var(--transition-slow);
  }
}

.service-detail h3 {
  margin-bottom: var(--space-3);
}

.service-detail p {
  margin-bottom: var(--space-4);
  max-width: var(--measure);
  color: var(--color-text);
}

.service-detail-full {
  grid-template-columns: 1fr;
}

/* --------------------------------------------------------------------------
   15. Portfolio Page filters
   -------------------------------------------------------------------------- */
.filter-tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-heading);
  background: transparent;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
  color: var(--color-primary);
  font-size: var(--step-sm);
  letter-spacing: 0.01em;
}

.filter-tab:hover,
.filter-tab:focus {
  border-color: var(--color-accent);
  color: var(--color-accent-ink);
  background: rgba(232, 119, 47, 0.06);
}

.filter-tab.active {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.filter-tab.active:hover,
.filter-tab.active:focus {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-white);
}

.project-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-soft);
  box-shadow: var(--shadow-sm);
  transition:
    opacity 0.4s var(--ease),
    transform var(--transition),
    box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.project-card.hidden {
  /* display:none fully removes from layout. Higher specificity (and !important)
     ensure the .fade-in.visible styles can't override this. */
  display: none !important;
}

.project-card-img {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.project-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-card-img img {
  transform: scale(1.05);
}

.project-card-body {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card-tag {
  display: inline-block;
  background: rgba(27, 58, 92, 0.07);
  color: var(--color-primary);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: var(--space-3);
  font-weight: 700;
  font-family: var(--font-heading);
  align-self: flex-start;
}

.project-card-body h3 {
  margin-bottom: var(--space-2);
  font-size: 1.25rem;
}

.project-card-body p {
  font-size: var(--step-sm);
  line-height: 1.62;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  flex: 1;
}

.project-thumbnails {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: auto;
}

.project-thumbnails img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.project-thumbnails img:hover,
.project-thumbnails img:focus {
  transform: scale(1.06);
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   16. Before/After Slider
   -------------------------------------------------------------------------- */
.ba-slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  cursor: col-resize;
  max-width: 800px;
  margin: 40px auto;
  user-select: none;
}

.ba-slider img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.ba-before {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
}

.ba-before img {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  height: 100%;
  min-width: 100%;
  max-width: none;
  object-fit: cover;
}

.ba-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: var(--color-accent);
  cursor: col-resize;
  z-index: 3;
  transform: translateX(-50%);
}

.ba-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 3px solid white;
  /* Sits on top of photography, so it needs a harder edge than the ambient
     card shadows. */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition-fast);
}

.ba-slider:hover .ba-handle::after {
  transform: translate(-50%, -50%) scale(1.06);
}

.ba-label {
  position: absolute;
  top: 15px;
  padding: 5px 15px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 4px;
  z-index: 2;
  font-family: var(--font-heading);
}

.ba-label-before {
  left: 15px;
}

.ba-label-after {
  right: 15px;
}

/* --------------------------------------------------------------------------
   16b. Start-to-Finish Slideshow
   -------------------------------------------------------------------------- */
.slideshow {
  position: relative;
  max-width: 560px;
  margin: 40px auto 0;
}

.slideshow-viewport {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-primary);
}

/* Progressive enhancement: with no JS, slides simply stack and stay visible. */
.slide {
  margin: 0;
}

.slide + .slide {
  margin-top: 10px;
}

.slide img {
  display: block;
  width: 100%;
  height: auto;
}

.slide figcaption {
  padding: 14px 18px;
  background: var(--color-white);
  color: var(--color-text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.slide-stage {
  display: inline-block;
  margin-right: 8px;
  padding: 3px 10px;
  background: var(--color-accent-ink);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  vertical-align: middle;
}

/* Carousel mode — enabled once JS adds .is-initialized */
.slideshow.is-initialized .slideshow-viewport {
  aspect-ratio: 3 / 4;
}

.slideshow.is-initialized .slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition);
}

.slideshow.is-initialized .slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.slideshow.is-initialized .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slideshow.is-initialized .slide figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 44px 20px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
  color: var(--color-white);
}

.slideshow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(27, 58, 92, 0.72);
  color: var(--color-white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  transition: background var(--transition);
}

.slideshow-btn:hover {
  background: var(--color-accent);
}

.slideshow-prev {
  left: 12px;
}

.slideshow-next {
  right: 12px;
}

.slideshow-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.slideshow-dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--color-secondary);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.slideshow-dot.is-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.slideshow-btn:focus-visible,
.slideshow-dot:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .slideshow.is-initialized .slide {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   17. Lightbox
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 2.25rem;
  color: white;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  line-height: 1;
  transition: background var(--transition);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 52px;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  transition: background var(--transition);
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   18. About Page specifics
   -------------------------------------------------------------------------- */
.why-choose-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
}

.why-choose-card {
  padding: var(--space-7) var(--space-6);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.why-choose-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.why-choose-card .card-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--space-5);
  background: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.why-choose-card .card-icon svg {
  width: 30px;
  height: 30px;
  fill: var(--color-accent-glow);
}

.why-choose-card h3 {
  margin-bottom: var(--space-3);
}

.why-choose-card p {
  font-size: var(--step-sm);
  line-height: 1.62;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.licensing-section {
  background: var(--color-primary);
  background-image: linear-gradient(160deg, #21486F 0%, var(--color-primary) 55%, var(--color-primary-deep) 100%);
  color: var(--color-white);
  text-align: center;
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius-lg);
  margin-top: var(--space-8);
  box-shadow: var(--shadow-lg);
}

.licensing-section h2 {
  color: var(--color-white);
  margin-bottom: var(--space-4);
}

.licensing-section h2::after {
  content: none;
}

.licensing-section p {
  max-width: 64ch;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--step-body-lg);
  line-height: 1.65;
}

.licensing-shield {
  color: var(--color-accent-glow);
  margin-bottom: var(--space-4);
  display: flex;
  justify-content: center;
}

.licensing-shield svg {
  width: 60px;
  height: 60px;
  fill: var(--color-accent-glow);
}

.company-story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-9);
  align-items: center;
}

.company-story-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-xl);
}

.company-story-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   19. Contact Page
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-8);
  align-items: start;
}

.contact-form {
  background: var(--color-white);
  padding: var(--space-7);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

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

.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  font-family: var(--font-heading);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  /* 16px keeps iOS Safari from auto-zooming on focus. */
  font-size: 1rem;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--color-text);
  background: var(--color-white);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: #B9C0C9;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(58, 143, 194, 0.2);
}

/* Keyboard focus gets the full ring on top of the border tint. */
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 2px;
  box-shadow: none;
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-group .error-message {
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: #dc3545;
}

.form-group.error .error-message {
  display: block;
}

.form-privacy {
  font-size: 0.8rem;
  color: var(--color-text);
  opacity: 0.7;
  margin-bottom: 20px;
}

.form-submit-error {
  background: #fdecec;
  color: #b3261e;
  border-left: 4px solid #b3261e;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
}

.form-success {
  background: var(--color-white);
  padding: 60px 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  text-align: center;
  border-top: 6px solid var(--color-accent);
  animation: form-success-pop 0.5s ease-out;
}

@keyframes form-success-pop {
  0%   { opacity: 0; transform: scale(0.92) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.form-success-icon {
  width: 90px;
  height: 90px;
  margin: 0 auto 24px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(232, 119, 47, 0.35);
}

.form-success-icon svg {
  width: 50px;
  height: 50px;
  fill: var(--color-white);
}

.form-success h3 {
  margin-bottom: 14px;
  font-size: 1.5rem;
}

.form-success p {
  color: var(--color-text);
  opacity: 0.85;
  margin-bottom: 0;
  font-size: 1.05rem;
}

.form-success a {
  color: var(--color-accent-ink);
  font-weight: 600;
}

/* ── Intake form: fieldsets, radio pills, file input, scarcity note ── */
.form-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 28px 0;
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
}

.form-fieldset:first-of-type {
  border-top: none;
  padding-top: 0;
}

.form-fieldset legend {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-accent-ink);
  margin-bottom: 18px;
  padding: 0;
}

.form-group-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.9rem;
  font-family: var(--font-heading);
}

.form-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-radio-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-white);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
  user-select: none;
  font-family: var(--font-body);
}

.form-radio-pill:hover {
  border-color: var(--color-secondary);
}

.form-radio-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.form-radio-pill:has(input[type="radio"]:checked) {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 2px 6px rgba(27, 58, 92, 0.25);
}

.form-radio-pill input[type="radio"]:focus-visible + span {
  outline: 2px solid var(--color-secondary);
  outline-offset: 4px;
  border-radius: 2px;
}

.form-group.error .form-radio-group {
  outline: 2px solid #dc3545;
  outline-offset: 4px;
  border-radius: 6px;
}

.form-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
  padding: 4px;
  border-radius: 6px;
}

.form-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  cursor: pointer;
}

.form-checkbox-row label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.5;
  cursor: pointer;
  margin: 0;
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: normal;
}

.form-group.error .form-checkbox-row {
  outline: 2px solid #dc3545;
}

.form-file {
  padding: 10px !important;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--color-bg-light) !important;
}

.form-file::-webkit-file-upload-button {
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-right: 14px;
  cursor: pointer;
  transition: background var(--transition);
}

.form-file::-webkit-file-upload-button:hover {
  background: var(--color-accent);
}

.form-help {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--color-text);
  opacity: 0.75;
  line-height: 1.4;
}

.form-note-scarcity {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--color-primary);
  text-align: center;
  margin: 24px 0 16px;
  padding: 14px 16px;
  background: rgba(232, 119, 47, 0.07);
  border-left: 3px solid var(--color-accent);
  border-radius: 3px;
  font-weight: 600;
}

/* Netlify honeypot: visually & assistively hidden, still in the DOM */
.form-bot-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 600px) {
  .form-radio-pill {
    padding: 9px 14px;
    font-size: 0.85rem;
  }
  .form-fieldset legend {
    font-size: 0.7rem;
  }
}

.contact-info-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.contact-info-card {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border-soft);
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  text-align: center;
}

.contact-info-card .card-icon {
  color: var(--color-accent);
  margin-bottom: var(--space-3);
  display: flex;
  justify-content: center;
}

.contact-info-card .card-icon svg {
  width: 32px;
  height: 32px;
  fill: var(--color-accent);
}

.contact-info-card h3 {
  margin-bottom: var(--space-2);
  font-size: 1.0625rem;
}

.contact-info-card a {
  display: inline-block;
  padding: 4px 0;
  color: var(--color-secondary-ink);
  font-weight: 600;
  word-break: break-word;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.18em;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.contact-info-card a:hover,
.contact-info-card a:focus {
  color: var(--color-accent-ink);
  text-decoration-color: currentColor;
}

.contact-info-card p {
  margin-bottom: 0;
  font-size: var(--step-sm);
  color: var(--color-text-muted);
}

.map-section {
  margin-top: var(--space-8);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.map-section iframe {
  width: 100%;
  height: 350px;
  border: 0;
  display: block;
}

.service-area-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.service-area-grid h4 {
  color: var(--color-primary);
  margin-bottom: 8px;
}

.service-area-grid p,
.service-area-grid ul {
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   20. Blog
   -------------------------------------------------------------------------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
}

.blog-card {
  background: var(--color-white);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.blog-card-img {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.blog-card:hover .blog-card-img img {
  transform: scale(1.05);
}

.blog-card-body {
  padding: var(--space-6) var(--space-5) var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-date {
  font-size: var(--step-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.blog-card-body h3 {
  margin-bottom: var(--space-3);
  font-size: 1.25rem;
}

.blog-card-body p {
  font-size: var(--step-sm);
  line-height: 1.62;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
  flex: 1;
}

.read-more {
  color: var(--color-accent-ink);
  font-weight: 700;
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 2px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
  align-self: flex-start;
}

.read-more svg {
  transition: transform var(--transition);
  flex-shrink: 0;
}

/* The arrow here is a text glyph (&rarr;), so the affordance is the rule,
   not a transform. */
.read-more:hover,
.read-more:focus {
  color: var(--color-primary);
  text-decoration-color: var(--color-accent);
}

.read-more:hover svg,
.read-more:focus svg {
  transform: translateX(4px);
}

.blog-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: var(--space-9);
  align-items: start;
}

.blog-post-content {
  max-width: 72ch;
}

.blog-post-content h2 {
  margin-top: 1.6em;
  margin-bottom: 0.5em;
}

/* Long-form headings don't need the centred section rule. */
.blog-post-content h2::after {
  content: none;
}

.blog-post-content h3 {
  margin-top: 1.35em;
  margin-bottom: 0.45em;
}

.blog-post-content p {
  margin-bottom: 1.15em;
  font-size: 1.0625rem;
  line-height: 1.78;
}

.blog-post-content ul,
.blog-post-content ol {
  margin: 1.15em 0 1.15em 1.5em;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.blog-post-content ul {
  list-style: disc;
}

.blog-post-content ol {
  list-style: decimal;
}

.blog-post-content li {
  margin-bottom: 0.5em;
}

.blog-post-content img {
  border-radius: var(--radius-lg);
  margin: 1.5em 0;
}

.blog-sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-widget {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border-soft);
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
}

.sidebar-widget h3,
.sidebar-widget h4 {
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-accent);
  font-size: 1.0625rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-widget h3::after,
.sidebar-widget h4::after {
  content: none;
}

.sidebar-widget ul li {
  margin-bottom: var(--space-1);
}

.sidebar-widget ul li a {
  display: block;
  padding: 8px 0;
  color: var(--color-primary);
  font-weight: 600;
  font-size: var(--step-sm);
  transition: color var(--transition);
}

.sidebar-widget ul li a:hover,
.sidebar-widget ul li a:focus {
  color: var(--color-accent-ink);
}

.sidebar-widget p {
  font-size: var(--step-sm);
  line-height: 1.62;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

/* --------------------------------------------------------------------------
   21. Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--color-primary-deep);
  color: white;
  padding: var(--space-9) 0 0;
  border-top: 3px solid var(--color-accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.1fr;
  gap: var(--space-7) var(--space-8);
}

.footer-col h4 {
  color: var(--color-accent-glow);
  margin-bottom: var(--space-5);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}

.footer-col p,
.footer-col a {
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--step-sm);
  line-height: 1.75;
}

.footer-col a {
  display: inline-block;
  padding: 7px 0;
  transition: color var(--transition-fast);
}

.footer-col a:hover,
.footer-col a:focus {
  color: var(--color-accent-glow);
}

.footer-col ul li {
  margin-bottom: 2px;
}

/* logo.png ships with a baked-in near-white background (#ECF1F2-ish), not
   transparency, so on the navy footer it reads as a stray pale rectangle.
   Until a knockout/transparent variant exists (see the design spec), we lean
   into it: a matched plate with padding and a radius turns the artefact into a
   deliberate badge, and the extra height makes the mark legible. */
.footer-logo {
  /* box-sizing is border-box globally, so this is 58px of artwork + padding. */
  height: 78px;
  width: auto;
  padding: 10px 16px;
  background: #EFF2F3;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-5);
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 15px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.footer-social a:hover {
  background: var(--color-accent);
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: var(--space-8);
  padding: var(--space-5) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--step-xs);
  color: rgba(255, 255, 255, 0.62);
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px 6px 10px;
  border: 1px solid rgba(240, 140, 66, 0.35);
  border-radius: var(--radius-pill);
  color: var(--color-accent-glow);
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.footer-badge svg {
  width: 16px;
  height: 16px;
  fill: var(--color-accent-glow);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   22. Scroll Animations
   -------------------------------------------------------------------------- */
.fade-in {
  opacity: 0;
  /* 18px rather than 30px: enough to read as motion, not enough to feel like
     the page is assembling itself. */
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* Safety net: if scripting is off, nothing ever gets .visible, so the content
   would be permanently invisible. */
@media (scripting: none) {
  .fade-in {
    opacity: 1;
    transform: none;
  }
}

/* Grid children enter the viewport together, so a short stagger reads as one
   considered sweep instead of a simultaneous pop. */
@media (prefers-reduced-motion: no-preference) {
  .services-grid > .fade-in:nth-child(2),
  .portfolio-grid > .fade-in:nth-child(2),
  .testimonials-grid > .fade-in:nth-child(2),
  .why-choose-grid > .fade-in:nth-child(2),
  .blog-grid > .fade-in:nth-child(2) {
    transition-delay: 70ms;
  }

  .services-grid > .fade-in:nth-child(3),
  .portfolio-grid > .fade-in:nth-child(3),
  .testimonials-grid > .fade-in:nth-child(3),
  .why-choose-grid > .fade-in:nth-child(3),
  .blog-grid > .fade-in:nth-child(3) {
    transition-delay: 140ms;
  }

  .services-grid > .fade-in:nth-child(4),
  .portfolio-grid > .fade-in:nth-child(4),
  .blog-grid > .fade-in:nth-child(4) {
    transition-delay: 70ms;
  }

  .services-grid > .fade-in:nth-child(5),
  .portfolio-grid > .fade-in:nth-child(5) {
    transition-delay: 140ms;
  }

  .services-grid > .fade-in:nth-child(6),
  .portfolio-grid > .fade-in:nth-child(6) {
    transition-delay: 210ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  /* Neutralise the pointer lifts and image push-ins added elsewhere. */
  .btn:hover,
  .service-card:hover,
  .service-card:focus-within,
  .why-choose-card:hover,
  .blog-card:hover,
  .project-card:hover,
  .service-detail-img:hover img,
  .company-story-img:hover img,
  .about-preview-img:hover img,
  .portfolio-item:hover img,
  .project-card:hover .project-card-img img,
  .project-thumbnails img:hover {
    transform: none;
  }
  /* This one carries its own centring transform — reset to that, not to none. */
  .ba-slider:hover .ba-handle::after {
    transform: translate(-50%, -50%);
  }
}

/* --------------------------------------------------------------------------
   23. Back to Top Button
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: max(30px, env(safe-area-inset-bottom, 0px));
  right: 30px;
  width: 46px;
  height: 46px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition), transform var(--transition), background var(--transition), box-shadow var(--transition);
  z-index: 900;
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus {
  background: var(--color-primary);
  box-shadow: var(--shadow-xl);
}

.back-to-top:active {
  background: var(--color-primary-deep);
}

/* --------------------------------------------------------------------------
   24. Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  :root {
    --section-y: 76px;
    --section-header-gap: 52px;
    --grid-gap: 28px;
  }
  .container {
    padding: 0 var(--space-6);
  }
  h1 {
    font-size: 2.75rem;
  }
  .hero h1 {
    font-size: 3.25rem;
  }
}

@media (max-width: 992px) {
  :root {
    --section-y: 64px;
    --section-header-gap: 44px;
    --grid-gap: 24px;
  }
  .hero h1 {
    font-size: 2.75rem;
  }
  .page-hero h1 {
    font-size: 2.5rem;
  }
  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }
  .about-preview,
  .service-detail,
  .contact-grid,
  .blog-post-layout,
  .company-story {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .blog-post-content {
    max-width: none;
  }
  .service-detail:nth-child(even) .service-detail-img {
    order: 0;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-7);
  }
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
  .testimonial-card {
    max-width: 68ch;
    margin-inline: auto;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Grid is 2-up here, so only even-position items sit mid-row. */
  .stat-item:nth-child(4n + 1)::before {
    display: block;
  }
  .stat-item:nth-child(2n + 1)::before {
    display: none;
  }
  .portfolio-grid,
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .blog-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  :root {
    --section-y: 56px;
    --section-header-gap: 36px;
    --grid-gap: 24px;
  }
  .nav-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: min(320px, 86vw);
    /* 100vh is wrong on mobile browsers with a collapsing address bar; dvh
       tracks the real visible height. Falls back to 100vh where unsupported. */
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: white;
    flex-direction: column;
    padding: 88px var(--space-6) var(--space-8);
    box-shadow: -8px 0 32px rgba(16, 32, 52, 0.18);
    transition: right var(--transition);
    z-index: 999;
    gap: var(--space-1);
    align-items: stretch;
  }
  .nav-menu.active {
    right: 0;
  }
  .nav-menu li {
    width: 100%;
  }
  /* Full-width rows with a real 44px target instead of a text-sized hit area. */
  .nav-menu a:not(.nav-cta) {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 10px 0;
    font-size: 1.0625rem;
    border-bottom: 1px solid var(--color-border-soft);
  }
  .nav-menu a:not(.nav-cta)::after {
    display: none;
  }
  .nav-menu .nav-cta {
    width: 100%;
    margin-top: var(--space-5);
  }
  .hamburger {
    display: flex;
    flex-direction: column;
  }
  .top-bar-right {
    display: none;
  }
  .top-bar {
    font-size: 0.75rem;
    /* The links carry their own 40px height — don't pay for the padding twice
       and push the hero further down the fold. */
    padding: 2px 0;
  }
  .top-bar .container {
    justify-content: center;
  }
  .top-bar-left {
    gap: var(--space-4);
    justify-content: center;
  }
  /* Tap-to-call is the highest-value action on a phone. 34px clears the WCAG
     2.2 minimum comfortably while keeping the utility bar the same height it
     has always been (~38px) on any screen where the two links fit on one row. */
  .top-bar-left {
    row-gap: 0;
  }
  .top-bar-left a {
    min-height: 34px;
  }
  .hero {
    background-attachment: scroll;
    min-height: 70vh;
    padding: var(--space-9) 0;
  }
  .hero h1 {
    font-size: 2.25rem;
  }
  .hero p {
    font-size: 1.0625rem;
  }
  .page-hero {
    min-height: 0;
    padding: var(--space-8) 0;
  }
  .page-hero h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.75rem;
  }
  h3 {
    font-size: 1.3rem;
  }
  .section-header h2::after {
    margin-top: var(--space-4);
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .portfolio-grid,
  .services-grid {
    grid-template-columns: 1fr;
  }
  .why-choose-grid {
    grid-template-columns: 1fr;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-7);
  }
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
  .contact-form {
    padding: var(--space-5);
  }
  .service-area-grid {
    grid-template-columns: 1fr;
  }
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .filter-tab {
    padding: 8px 18px;
    font-size: 0.85rem;
  }
  .testimonial-card::before {
    font-size: 5.5rem;
  }
}

@supports (height: 100dvh) {
  @media (max-width: 768px) {
    .nav-menu {
      height: 100dvh;
      max-height: 100dvh;
    }
  }
}

@media (max-width: 480px) {
  :root {
    --section-y: 48px;
    --section-header-gap: 32px;
    --grid-gap: 20px;
  }
  .container {
    padding: 0 var(--space-5);
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: var(--space-3);
  }
  .hero-buttons .btn {
    width: 100%;
    max-width: 300px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  /* Single column — no gutters left to draw a divider in. */
  .stat-item::before {
    display: none !important;
  }
  .stat-item {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: var(--space-4);
  }
  .stat-icon svg {
    width: 30px;
    height: 30px;
  }
  .service-card {
    padding: var(--space-6) var(--space-5);
  }
  .why-choose-card {
    padding: var(--space-6) var(--space-5);
  }
  .testimonial-card {
    padding: var(--space-6) var(--space-5);
  }
  .testimonial-card::before {
    font-size: 4.5rem;
  }
  .lightbox-prev,
  .lightbox-next {
    padding: 10px;
    font-size: 1.5rem;
  }
  .lightbox-close {
    top: 12px;
    right: 12px;
    font-size: 1.85rem;
  }
  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.55rem;
  }
  h3 {
    font-size: 1.2rem;
  }
  .btn {
    padding: 12px 22px;
    font-size: 0.95rem;
  }
  .back-to-top {
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    right: 20px;
    width: 44px;
    height: 44px;
  }
  .cta-phone {
    font-size: 1.4rem;
    /* Holds the 44px tap target once the type steps down. */
    padding: 9px 12px;
  }
  .footer-col a {
    padding: 9px 0;
  }
  .contact-form {
    padding: var(--space-5) var(--space-4);
  }
  .form-radio-group {
    gap: 6px;
  }
}

/* --------------------------------------------------------------------------
   25. Small controls — minimum touch targets
   Hit areas are enlarged with pseudo-elements so the visual size of these
   controls is unchanged.
   -------------------------------------------------------------------------- */
.slideshow-dot {
  position: relative;
}

/* 11px dot, 45px target. */
.slideshow-dot::after {
  content: '';
  position: absolute;
  inset: -17px;
}

/* --------------------------------------------------------------------------
   26. Print
   Estimates and contact details get printed. Strip the chrome, keep the
   information, and expose link targets.
   -------------------------------------------------------------------------- */
@media print {
  :root {
    --section-y: 18pt;
    --section-header-gap: 12pt;
  }

  *,
  *::before,
  *::after {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
    color: #000 !important;
    transition: none !important;
    animation: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.45;
  }

  .top-bar,
  .navbar,
  .hamburger,
  .nav-overlay,
  .back-to-top,
  .lightbox,
  .filter-tabs,
  .hero-buttons,
  .slideshow-btn,
  .slideshow-dots,
  .ba-handle,
  .map-section,
  .skip-link {
    display: none !important;
  }

  .hero,
  .page-hero {
    min-height: 0;
    padding: 12pt 0;
    color: #000 !important;
  }

  .hero::before {
    display: none;
  }

  .hero h1,
  .hero p {
    color: #000 !important;
  }

  .fade-in {
    opacity: 1 !important;
    transform: none !important;
  }

  .service-card,
  .project-card,
  .blog-card,
  .testimonial-card,
  .why-choose-card,
  .contact-info-card,
  .service-detail {
    border: 1pt solid #999 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  h1, h2, h3, h4 {
    break-after: avoid;
    page-break-after: avoid;
  }

  img {
    max-width: 100% !important;
    break-inside: avoid;
  }

  /* Print the destination of content links so the page is usable on paper. */
  .footer a[href^='http']::after,
  .blog-post-content a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 9pt;
    word-break: break-all;
  }

  a[href^='tel:']::after,
  a[href^='mailto:']::after {
    content: '';
  }
}
