/* ==========================================================================
   DiBlasi Associates — Homepage Design · Version 01
   --------------------------------------------------------------------------
   1. Variables (palette, type, spacing)
   2. Base / reset
   3. Layout
   4. Shared components (button, section title, split head)
   5. Header / nav (desktop nav, hamburger, mobile menu)
   6. Hero
   7. About
   8. Services
   9. Featured projects
  10. Footer (Blue contact card, links, legal)
  11. Design option: heading alignment (Design panel)
  12. Motion (hero entrance, scroll reveal)
  13. Responsive (desktop-first: 1200 → 992 → 768 → 480, then touch)

   Notes
   - The page is rendered by js/support.js (dc-runtime, React). Text bindings
     ({{ … }}) render inside <span class="sc-interp">, so never style bare
     `span` selectors here; always target a class.
   - State classes set from the page logic: .is-solid, .is-open, .is-active,
     .is-menu-open (header and <html>).
   - Photos are <image-slot> elements; each fills its (positioned) parent.
   ========================================================================== */


/* 1. Variables
   ========================================================================== */
:root {
  /* Colour palette — "Classic Navy" (default). Other palettes override these
     per html[data-palette] (Design panel → Palette, see below). Every palette
     keeps Brand Blue #1C479E as --blue.
       --blue          Brand Blue: buttons, Blue titles, footer card, accents
       --blue-dark     button hover
       --navy          dark backgrounds: hero base, footer, mobile menu,
                       first service panel; dark text on white buttons
       --deep-blue     About background
       --ink           body text on light backgrounds
       --surface       page background (Services, solid header)
       --light         Featured Projects background; light button hover
       --light-photo   project photo placeholder
       --header-line   solid header hairline
       --about-line    About stats divider
       --about-muted   About stats labels, menu labels
       --about-photo   About photo placeholder
       --scrim-rgb     R, G, B of the photo scrims (hero, featured project box)
       --shade-rgb     R, G, B of the project card fade */
  --blue: #1C479E;
  --blue-dark: #153677;
  --navy: #001F3E;
  --deep-blue: #001F3E;
  --ink: #001F3E;
  --surface: #FFFFFF;
  --white: #FFFFFF;
  --light: #F1F3F6;
  --light-photo: #D3D7DE;
  --header-line: #E3E7EE;
  --about-line: #2A4C96;
  --about-muted: #8FA6D6;
  --about-photo: #1A3A80;
  --scrim-rgb: 0, 31, 62;
  --shade-rgb: 26, 32, 48;

  /* Hero slide placeholders (shown until a photo loads) */
  --hero-1: var(--navy);
  --hero-2: var(--about-photo);

  /* Highlighted words in headings (.title-hl). The Design panel's
     "Highlight color" swaps these per html[data-highlight-color] below.
       --highlight       underline bar on light sections (Services, Projects)
       --highlight-text  "Text color" style on light sections
       --highlight-dark  text / underline on dark or Blue sections
     Light colours (Lime, Yellow, Green) wouldn't read on white / light grey,
     so on light sections they leave the title as it is: no bar
     (transparent) and its own colour (currentColor). */
  --lime: #DCEF6A;
  --highlight: transparent;
  --highlight-text: currentColor;
  --highlight-dark: var(--lime);

  /* Type */
  --font: 'Hanken Grotesk', system-ui, sans-serif;

  /* Spacing */
  --container: 1248px;
  --container-wide: 1360px;
  --section-pad: 80px;      /* top + bottom padding of every section */
  --h2-size: clamp(36px, 8vw, 64px);   /* every h2 */
  --gutter: clamp(20px, 4vw, 56px);

  /* Shared floating home button (assets/shared/home-button.css) */
  --fab-space: var(--home-fab-clearance, 0px);
}


/* Highlight colour options (Design panel → Color), as version02 */
html[data-highlight-color="navy"] {
  --highlight: #142A5C;
  --highlight-text: #142A5C;
  --highlight-dark: #A9BEF0;
}
html[data-highlight-color="orange"] {
  --highlight: #F74335;
  --highlight-text: #F74335;
  --highlight-dark: #F74335;
}
html[data-highlight-color="yellow"] {   /* light: dark sections only */
  --highlight: transparent;
  --highlight-text: currentColor;
  --highlight-dark: #F2E004;
}
html[data-highlight-color="green"] {    /* light: dark sections only */
  --highlight: transparent;
  --highlight-text: currentColor;
  --highlight-dark: #70D146;
}


/* Colour palettes (Design panel → Palette, html[data-palette]).
   "classic" is the :root default above. Brand Blue #1C479E stays in all. */
html[data-palette="graphite"] {      /* Graphite + Brand Blue (brand palette) */
  --blue-dark: #153677;
  --navy: #1E2228;
  --deep-blue: #262B33;
  --ink: #1E2228;
  --surface: #FFFFFF;
  --light: #EEF0F3;
  --light-photo: #C9CDD4;
  --header-line: #E1E3E7;
  --about-line: #3A3F48;
  --about-muted: #9AA0A9;
  --about-photo: #30353D;
  --scrim-rgb: 30, 34, 40;
  --shade-rgb: 30, 34, 40;
}
html[data-palette="steel"] {         /* Slate blue-grey */
  --blue-dark: #3A5A8A;               /* hover: lighter steel blue */
  --navy: #22324A;
  --deep-blue: #2C3E59;
  --ink: #1B2738;
  --surface: #FFFFFF;
  --light: #E9EDF2;
  --light-photo: #CBD3DE;
  --header-line: #DFE4EB;
  --about-line: #43577A;
  --about-muted: #A9B6CA;
  --about-photo: #364A6A;
  --scrim-rgb: 27, 39, 58;
  --shade-rgb: 27, 39, 58;
}
html[data-palette="forest"] {        /* Deep green + Brand Blue */
  --blue-dark: #2E7A4F;               /* hover: green */
  --navy: #10291D;
  --deep-blue: #173A29;
  --ink: #10291D;
  --surface: #FFFFFF;
  --light: #EBF2EC;
  --light-photo: #C7D6CB;
  --header-line: #DCE7DF;
  --about-line: #2F5A43;
  --about-muted: #9CBDA9;
  --about-photo: #24503A;
  --scrim-rgb: 16, 41, 29;
  --shade-rgb: 16, 41, 29;
}


/* 2. Base / reset
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body { margin: 0; padding: 0; }

html { overflow-x: clip; }

body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* :where() keeps these at zero specificity so component classes always win. */
a { color: inherit; text-decoration: none; }
a:where(:hover) { color: var(--blue); }

button { font: inherit; color: inherit; }

img,
svg { max-width: 100%; }
img { height: auto; }

/* Zero specificity so component margins (e.g. .about-stats) win. */
:where(ul[class]) { margin: 0; padding: 0; list-style: none; }

address { font-style: normal; }

/* In-page targets clear the fixed header. */
section[id],
.project-grid__item { scroll-margin-top: 72px; }

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


/* 3. Layout
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
}

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}


/* 4. Shared components
   ========================================================================== */

/* Button: flat Blue, 6px corners, white text, no icon. Same colours on every
   background. Hover: the pill darkens. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s ease;
}
.btn:hover { background: var(--blue-dark); color: var(--white); }
.btn:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
/* White variant for the Blue contact card */
.btn--light { background: var(--white); color: var(--navy); }
.btn--light:hover { background: var(--light); color: var(--navy); }

.services .btn:focus-visible,
.projects .btn:focus-visible,
.site-header.is-solid .btn:focus-visible { outline-color: var(--blue); }

/* Smaller button (header CTA, hero projects card) */
.btn--sm { min-height: 42px; padding: 0 20px; font-size: 14px; }

/* Section titles (every h2): 64px, scaling down below ~800px wide. */
.section-title {
  margin: 0;
  font-weight: 700;
  font-size: var(--h2-size);
  line-height: 1;
  letter-spacing: -.01em;
}

/* Faint blueprint grid (as version02's CTA), fading in from the left.
   Used in About and the footer contact card; the parent needs
   position: relative, and its content sits above with position: relative. */
.bp-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(to right, transparent 30%, #000 75%);
  mask-image: linear-gradient(to right, transparent 30%, #000 75%);
  pointer-events: none;
}

/* Highlighted words in a heading (<mark class="title-hl">).
   Highlight style (Design panel → Style, html[data-highlight-style]); this
   page offers no "Behind the text" box:
     none       (default) reads like the rest of the heading
     underline  heading-coloured text over a bar
     text       the words change colour
   Dark / Blue sections (hero, About, footer card) use --highlight-dark for
   the bar and the text colour. */
.title-hl {
  padding: 0;
  background: none;
  color: inherit;
  font-weight: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
html[data-highlight-style="underline"] .title-hl {
  padding-bottom: .06em;
  background: linear-gradient(var(--highlight), var(--highlight)) 0 100% / 100% .12em no-repeat;
}
html[data-highlight-style="underline"] :is(.hero, .about, .contact-card) .title-hl {
  background-image: linear-gradient(var(--highlight-dark), var(--highlight-dark));
}
html[data-highlight-style="text"] .title-hl { color: var(--highlight-text); }
html[data-highlight-style="text"] :is(.hero, .about, .contact-card) .title-hl { color: var(--highlight-dark); }

/* Title left, button right (Services, Projects). The title can sit in a
   .split-head__main wrapper together with a short intro paragraph. */
.split-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

/* Short paragraph under a section title */
.section-intro {
  max-width: 56ch;
  margin: 16px 0 0;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.6;
  text-wrap: pretty;
}


/* 5. Header / nav
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  background: transparent;
  box-shadow: none;
  transition: background .3s ease, box-shadow .3s ease;
}
.site-header.is-solid {
  background: var(--surface);
  box-shadow: 0 1px 0 var(--header-line);
}

.site-header__inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 26px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: padding .3s ease;
}
.site-header.is-solid .site-header__inner { padding-top: 14px; padding-bottom: 14px; }

.site-header__logo { display: block; flex: none; }
.site-header__logo:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; }
.site-header.is-solid .site-header__logo:focus-visible { outline-color: var(--blue); }
.site-header__logo-img {
  display: block;
  width: auto;
  height: 48px;
}
/* White logo over the hero; the blue logo (logo-color.svg) once the header
   turns white on scroll. */
.site-header__logo-img--color { display: none; }
.site-header.is-solid .site-header__logo-img--white { display: none; }
.site-header.is-solid .site-header__logo-img--color { display: block; }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14px;
}
.site-nav__link { color: var(--white); transition: color .3s ease; }
.site-header.is-solid .site-nav__link { color: var(--ink); }
.site-nav__link:hover,
.site-header.is-solid .site-nav__link:hover { color: var(--blue); }
.site-nav__link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* Hamburger (shown ≤992px) */
.burger {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, .45);
  border-radius: 0;
  background: transparent;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: border-color .3s ease;
}
.burger__line {
  width: 20px;
  height: 2px;
  background: var(--white);
  transition: transform .25s, opacity .25s, background-color .3s;
}
.burger:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.site-header.is-solid .burger { border-color: var(--header-line); }
.site-header.is-solid .burger__line { background: var(--ink); }
.site-header.is-solid .burger:focus-visible { outline-color: var(--blue); }
.burger.is-open .burger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open .burger__line:nth-child(2) { opacity: 0; }
.burger.is-open .burger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu open: the header stays transparent over the navy menu (white logo and
   close button); its Contact button steps aside, the menu has Contact. */
.site-header.is-menu-open,
.site-header.is-menu-open.is-solid { background: transparent; box-shadow: none; }
.site-header.is-menu-open .site-header__logo-img--white { display: block; }
.site-header.is-menu-open .site-header__logo-img--color { display: none; }
.site-header.is-menu-open .site-header__cta { visibility: hidden; }
.site-header.is-menu-open .burger { border-color: rgba(255, 255, 255, .45); }
.site-header.is-menu-open .burger__line { background: var(--white); }
html.is-menu-open { overflow: hidden; }   /* scroll lock while the menu is open */

/* Full-screen mobile menu (≤992px). The fixed header (z-index 70) stays on
   top with the logo and close button; phone + email sit at the bottom. */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--navy);
  color: var(--white);
  overflow: auto;
  overscroll-behavior: contain;
  animation: menu-in .25s ease both;
}
.mobile-menu__inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 112px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px));
}
.mobile-menu__links { display: flex; flex-direction: column; }
.mobile-menu__link {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
  color: var(--white);
  font-weight: 300;
  font-size: clamp(30px, 8vw, 44px);
  line-height: 1.05;
  letter-spacing: -.02em;
  animation: menu-link-in .45s cubic-bezier(.2, .7, .2, 1) both;
}
.mobile-menu__link:first-child { border-top: 1px solid rgba(255, 255, 255, .16); }
.mobile-menu__link:nth-child(2) { animation-delay: .05s; }
.mobile-menu__link:nth-child(3) { animation-delay: .1s; }
.mobile-menu__link:nth-child(4) { animation-delay: .15s; }
.mobile-menu__arrow {
  margin-left: auto;
  font-size: .5em;
  transition: transform .2s ease;
}
.mobile-menu__link:hover { color: var(--white); }
.mobile-menu__link:hover .mobile-menu__arrow { transform: translateX(4px); }
.mobile-menu__link:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.mobile-menu__contact {
  margin-top: auto;                 /* pinned to the bottom of the screen */
  display: flex;
  flex-wrap: wrap;
  gap: 20px 48px;
  padding-right: var(--fab-space);  /* clear of the shared floating home button */
  font-size: 16px;
  animation: menu-link-in .45s .2s cubic-bezier(.2, .7, .2, 1) both;
}
.mobile-menu__label {
  margin-bottom: 4px;
  color: var(--about-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.mobile-menu__value { color: var(--white); }
.mobile-menu__value:hover { color: var(--white); text-decoration: underline; text-underline-offset: 4px; }
.mobile-menu__value:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
@keyframes menu-in { from { opacity: 0; } }
@keyframes menu-link-in { from { opacity: 0; transform: translateY(16px); } }


/* 6. Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: max(560px, min(780px, 92vh));
  display: flex;
  flex-direction: column;
  background: var(--navy);
  color: var(--white);
}

/* Cross-fading photo slides (the colour shows while a photo loads). */
.hero__slides { position: absolute; inset: 0; overflow: hidden; }   /* clips the photo's settle-in zoom */
.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}
.hero__slide.is-active { opacity: 1; }
.hero__slide--1 { background: var(--hero-1); }
.hero__slide--2 { background: var(--hero-2); }
.hero__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  /* Navy scrim so white text reads on any photo: a band behind the header,
     plus a left-to-right fade behind the headline. */
  background:
    linear-gradient(180deg, rgba(var(--scrim-rgb), .55) 0, rgba(var(--scrim-rgb), 0) 180px),
    linear-gradient(90deg, rgba(var(--scrim-rgb), .8) 0%, rgba(var(--scrim-rgb), .5) 45%, rgba(var(--scrim-rgb), .12) 80%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding-top: 140px;
  padding-bottom: clamp(40px, 5vw, 64px);
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
  padding-top: clamp(0px, 4vh, 48px);
}

.hero__title {
  margin: 0;
  max-width: 17ch;
  font-weight: 700;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.04;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.hero__lead {
  margin: -8px 0 4px;               /* closer to the title, a bit more room above the button */
  max-width: 46ch;
  color: rgba(255, 255, 255, .86);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.55;
  text-wrap: pretty;
}

/* Slide dots: a 3px bar inside a taller hit area. */
.hero__dots {
  display: flex;
  gap: 8px;
  align-self: flex-start;
}
.hero__dot {
  position: relative;
  width: 16px;
  height: 19px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: width .3s;
}
.hero__dot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 3px;
  background: rgba(255, 255, 255, .45);
  transition: background-color .3s;
}
.hero__dot.is-active { width: 40px; }
.hero__dot.is-active::before,
.hero__dot:hover::before { background: var(--white); }
.hero__dot:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

/* Featured project ticker: a simple translucent Navy box pinned to the
   bottom-right of the hero content box, with a white bar on the left. Slides
   are stacked in one grid cell and cross-fade. */
.hero-projects {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(40px, 5vw, 64px);
  width: min(360px, 100%);
  display: grid;
  border-left: 3px solid var(--white);
  background: rgba(var(--scrim-rgb), .55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--white);
}

.hero-projects__slide {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 26px 22px;
  color: var(--white);
  opacity: 0;
  visibility: hidden;
  transition: opacity .6s ease, visibility 0s linear .6s;
}
.hero-projects__slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity .6s ease, visibility 0s;
}
.hero-projects__slide:hover { color: var(--white); }
.hero-projects__slide:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

.hero-projects__label {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, .7);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero-projects__name { font-size: 18px; font-weight: 500; line-height: 1.25; }
.hero-projects__loc { color: rgba(255, 255, 255, .7); font-size: 13px; }
.hero-projects__slide:hover .hero-projects__name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}


/* 7. About
   ========================================================================== */
.about {
  position: relative;
  overflow: hidden;
  padding: var(--section-pad) var(--gutter);
  background: var(--deep-blue);
  color: var(--white);
}

.about__grid {
  position: relative;               /* above the blueprint grid */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 6vw, 96px);
}

.about__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(32px, 4vw, 48px);
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  margin-top: auto;                 /* sits at the bottom of the column */
  padding-top: 28px;
  border-top: 1px solid var(--about-line);
}
.about-stats__item { display: flex; flex-direction: column; gap: 8px; }
.about-stats__num {
  font-variant-numeric: tabular-nums;   /* digits keep their width while counting */
  font-weight: 300;
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1;
  letter-spacing: -.02em;
}
.about-stats__label {
  color: var(--about-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.about__aside { display: flex; flex-direction: column; gap: 40px; }

.about__lead {
  margin: 0;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.5;
  text-wrap: pretty;
}

.about__photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--about-photo);
}
.about__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}


/* 8. Services
   ========================================================================== */
.services { padding: var(--section-pad) var(--gutter); }

.services__inner { display: flex; flex-direction: column; gap: 32px; }

.services__title,
.projects__title {
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--blue);
}

/* A row of panels aligned to the bottom; heights step so the tops form a
   skyline. The active panel grows wider (flex 3) and to full height. */
.svc-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: clamp(360px, 34vw, 460px);
  overflow-x: auto;
  scrollbar-width: none;
}
.svc-row::-webkit-scrollbar { display: none; }

.svc {
  --svc-h: 100%;
  position: relative;
  flex: 1 1 0;
  min-width: 132px;
  height: var(--svc-h);
  overflow: hidden;
  border-radius: 6px;
  color: var(--white);
  transition: flex .5s cubic-bezier(.2, .7, .2, 1), height .5s cubic-bezier(.2, .7, .2, 1);
}
.svc:hover { color: var(--white); }
.svc:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.svc.is-active { flex: 3 1 0; min-width: 260px; height: 100%; }

/* Panel colour (until a photo is added) and resting height */
.svc--0 { background: var(--navy); }
/* Colours are mixed from the palette's Navy and Blue so they follow it. */
.svc--1 { background: var(--blue); --svc-h: 86%; }
.svc--2 { background: color-mix(in srgb, var(--blue) 45%, var(--light-photo)); --svc-h: 92%; }
.svc--3 { background: color-mix(in srgb, var(--navy) 80%, var(--blue)); --svc-h: 80%; }
.svc--4 { background: color-mix(in srgb, var(--blue) 70%, var(--white)); --svc-h: 88%; }
.svc--5 { background: color-mix(in srgb, var(--navy) 65%, var(--light-photo)); --svc-h: 78%; }
.svc--6 { background: color-mix(in srgb, var(--navy) 88%, var(--blue)); --svc-h: 84%; }

.svc__caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}
.svc__name {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}
.svc__more {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;       /* text link, no fill */
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  white-space: nowrap;
}


/* 9. Featured projects
   ========================================================================== */
.projects {
  padding: var(--section-pad) var(--gutter);
  background: var(--light);
  color: var(--ink);
}

.projects__inner { display: flex; flex-direction: column; gap: clamp(32px, 4vw, 48px); }

/* Mosaic: 4 columns × 2 rows. Project 1 takes the left half (both rows),
   project 2 the top-right half, projects 3 + 4 one cell each below it. */
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, clamp(240px, 22vw, 300px));
  gap: 20px;
}
.project-grid__item--lg { grid-column: 1 / 3; grid-row: 1 / 3; }
.project-grid__item--wide { grid-column: 3 / 5; }

/* Photo card. Layers: photo → dark fade (bottom half) → category (top
   left) and name + location (bottom left).
   Hover: the photo zooms in slowly, the fade deepens, the text lifts and a
   Blue bar grows along the bottom edge. */
.project-card {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: 6px;
  background: var(--light-photo);
  color: var(--white);
}
.project-card:hover { color: var(--white); }
.project-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.project-card__photo {
  position: absolute;
  inset: 0;
  display: block;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}

.project-card__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(var(--shade-rgb), 0) 45%, rgba(var(--shade-rgb), .45) 72%, rgba(var(--shade-rgb), .9) 100%);
  pointer-events: none;
}
/* Deeper fade on hover (cross-faded so the gradient itself doesn't jump). */
.project-card__shade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(var(--shade-rgb), .15) 20%, rgba(var(--shade-rgb), .6) 60%, rgba(var(--shade-rgb), .95) 100%);
  opacity: 0;
  transition: opacity .4s ease;
}

.project-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}

.project-card__foot {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 16px;
  pointer-events: none;
  transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}

.project-card__body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.project-card__name { font-size: 20px; font-weight: 500; line-height: 1.2; }
.project-grid__item--lg .project-card__name { font-size: clamp(24px, 2.4vw, 32px); }
.project-card__loc { color: rgba(255, 255, 255, .78); font-size: 14px; }

/* Category: plain label in the top-left corner */
.project-card__cat {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1.2;
  text-transform: uppercase;
  pointer-events: none;
}

.project-card:hover .project-card__photo,
.project-card:focus-visible .project-card__photo { transform: scale(1.06); }
.project-card:hover .project-card__shade::after,
.project-card:focus-visible .project-card__shade::after { opacity: 1; }
.project-card:hover .project-card__foot,
.project-card:focus-visible .project-card__foot { transform: translateY(-6px); }
.project-card:hover::after,
.project-card:focus-visible::after { transform: scaleX(1); }


/* 10. Footer (contact card, links, legal)
   ========================================================================== */
.site-footer {
  --card-pad: clamp(24px, 6vw, 80px);   /* card inner padding; content below lines up with it */
  padding: var(--section-pad) var(--gutter) 20px;
  background: var(--navy);
  color: var(--white);
}

/* Blue contact card */
.contact-card {
  position: relative;
  overflow: hidden;
  padding: 56px var(--card-pad);
  border-radius: 6px;
  background: var(--blue);
  color: var(--white);
  scroll-margin-top: 72px;
}
.contact-card__head,
.contact-card__details { position: relative; }   /* above the grid */

.contact-card__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px 48px;
  padding-bottom: clamp(28px, 3.5vw, 44px);
  border-bottom: 1px solid rgba(255, 255, 255, .28);
}

.contact-card__title {
  margin: 0;
  max-width: 10em;                  /* "Have a structural / challenge?" */
  font-weight: 700;
  font-size: var(--h2-size);
  line-height: 1.05;
  letter-spacing: -.02em;
}

.contact-card__details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding-top: 28px;
}
.contact-card__item { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.contact-card__label { color: rgba(255, 255, 255, .78); font-size: 14px; }
.contact-card__value {
  color: var(--white);
  font-size: clamp(16px, 1.3vw, 18px);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  transition: text-decoration-color .2s ease;
}
.contact-card__value:hover { color: var(--white); text-decoration-color: currentColor; }
.contact-card__value:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* Logo + links */
.site-footer__main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px 48px;
  padding: var(--section-pad) var(--card-pad) 56px;
}
.site-footer__logo { display: block; width: auto; height: 48px; }

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  font-size: 16px;
}
.site-footer__links a { color: rgba(255, 255, 255, .85); }

/* Legal row */
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0 var(--card-pad);
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .6);
  font-size: 14px;
}
.site-footer__legal { display: flex; gap: 32px; }
.site-footer__bottom a { color: rgba(255, 255, 255, .6); }

.site-footer__links a:hover,
.site-footer__bottom a:hover { color: var(--white); }
.site-footer a:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }


/* 11. Design option: heading alignment
   --------------------------------------------------------------------------
   Set by the shared Design panel ("Headings" tab) on <html>:
     data-heading-align="left"    default (as designed)
     data-heading-align="center"  every heading centered; in Services and
                                  Projects the button moves below the cards,
                                  centered (the head wrapper is display:
                                  contents, so title / cards / button become
                                  siblings and the button is ordered last).
   ========================================================================== */
/* Headings: 25 characters wide at most, centered. */
html[data-heading-align="center"] .hero__title,
html[data-heading-align="center"] .about__title,
html[data-heading-align="center"] .services__title,
html[data-heading-align="center"] .projects__title,
html[data-heading-align="center"] .contact-card__title {
  max-width: 25ch;
  margin-left: auto;
  margin-right: auto;
}

/* Hero: copy and slide dots centered; the scrim evens out so text reads
   across the middle of the photo. */
html[data-heading-align="center"] .hero__copy { align-items: center; text-align: center; }
html[data-heading-align="center"] .hero__title,
html[data-heading-align="center"] .hero__lead { margin-left: auto; margin-right: auto; }
html[data-heading-align="center"] .hero__dots { align-self: center; }
/* Featured project box: hidden in the centered layout. */
html[data-heading-align="center"] .hero-projects { display: none; }
html[data-heading-align="center"] .hero__lead { max-width: 60ch; }
html[data-heading-align="center"] .hero__scrim {
  background:
    linear-gradient(180deg, rgba(var(--scrim-rgb), .55) 0, rgba(var(--scrim-rgb), 0) 180px),
    rgba(var(--scrim-rgb), .5);
}

/* About: one centered column — title, intro, button, then a wide photo with
   the three stats in a row underneath. */
html[data-heading-align="center"] .about__main,
html[data-heading-align="center"] .about__aside { display: contents; }
html[data-heading-align="center"] .about__grid {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "title" "lead" "btn" "photo" "stats";
  row-gap: 0;
  justify-items: center;
  text-align: center;
}
html[data-heading-align="center"] .about__title { grid-area: title; margin-bottom: 24px; }
html[data-heading-align="center"] .about__lead { grid-area: lead; max-width: 66ch; margin-bottom: 32px; }
html[data-heading-align="center"] .about__main > .btn { grid-area: btn; margin-bottom: clamp(48px, 6vw, 72px); }
html[data-heading-align="center"] .about__photo {
  grid-area: photo;
  width: 100%;
  aspect-ratio: 21 / 9;
}
html[data-heading-align="center"] .about-stats {
  grid-area: stats;
  width: 100%;
  margin-top: 0;
  padding-top: 32px;
  border-top: 0;
}
html[data-heading-align="center"] .about-stats__item { align-items: center; }
html[data-heading-align="center"] .about-stats__item + .about-stats__item { border-left: 1px solid var(--about-line); }

/* Services + Projects: centered title, cards, then the button. */
html[data-heading-align="center"] .split-head { display: contents; }
html[data-heading-align="center"] .services__title,
html[data-heading-align="center"] .projects__title,
html[data-heading-align="center"] .split-head__main { align-self: center; text-align: center; }
html[data-heading-align="center"] .section-intro { margin-left: auto; margin-right: auto; }
html[data-heading-align="center"] .split-head > .btn { order: 1; align-self: center; }

/* Footer card: title centered with the button under it; details centered. */
html[data-heading-align="center"] .contact-card__head { flex-direction: column; align-items: center; text-align: center; }
html[data-heading-align="center"] .contact-card__item { align-items: center; text-align: center; }


/* 12. Motion
   --------------------------------------------------------------------------
   Slight, one-time animations; all off with prefers-reduced-motion.
   - Hero: headline, lead, button and featured-project box fade up in turn on
     load; the active hero photo settles from a 4% zoom.
   - Scroll reveal: [data-reveal] elements fade up once when they enter the
     view (the page script marks them data-reveal="in"). Panels and project
     cards stagger. Uses animations (fill: backwards), not transitions, so
     the elements' own hover transitions are untouched.
   ========================================================================== */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes hero-settle {
  from { transform: scale(1.04); }
  to { transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__title,
  .hero__lead,
  .hero__copy .btn,
  .hero-projects { animation: rise-in .9s cubic-bezier(.2, .7, .2, 1) backwards; }
  .hero__title { animation-delay: .1s; }
  .hero__lead { animation-delay: .22s; }
  .hero__copy .btn { animation-delay: .34s; }
  .hero-projects { animation-delay: .5s; }

  .hero__slide.is-active .hero__photo { animation: hero-settle 7s cubic-bezier(.2, .7, .2, 1) both; }

  /* Hidden until revealed (only once the script is watching) */
  html.has-reveal [data-reveal=""] { opacity: 0; }
  html.has-reveal [data-reveal="in"] { animation: rise-in .8s cubic-bezier(.2, .7, .2, 1) var(--reveal-delay, 0s) backwards; }

  /* Stagger: service panels and project cards follow one another */
  .svc-row > :nth-child(2) { --reveal-delay: .06s; }
  .svc-row > :nth-child(3) { --reveal-delay: .12s; }
  .svc-row > :nth-child(4) { --reveal-delay: .18s; }
  .svc-row > :nth-child(5) { --reveal-delay: .24s; }
  .svc-row > :nth-child(6) { --reveal-delay: .3s; }
  .svc-row > :nth-child(7) { --reveal-delay: .36s; }
  .project-grid > :nth-child(2) { --reveal-delay: .08s; }
  .project-grid > :nth-child(3) { --reveal-delay: .16s; }
  .project-grid > :nth-child(4) { --reveal-delay: .24s; }
  .about__photo,
  .about-stats { --reveal-delay: .1s; }
}


/* 13. Responsive
   ========================================================================== */

/* Narrow desktops: the seven service panels get slimmer so the row still fits
   without scrolling. */
@media (max-width: 1200px) {
  .svc { min-width: 104px; }
  .svc.is-active { min-width: 220px; }
  .svc__caption { left: 12px; right: 12px; bottom: 12px; }
  .svc__name { font-size: 13px; }
}

/* Tablet: hamburger menu; About, Projects and Services re-flow. */
@media (max-width: 992px) {
  .site-nav { display: none; }
  .site-header__actions { gap: 12px; }
  .site-header__inner { padding-top: 18px; padding-bottom: 18px; }
  .site-header.is-solid .site-header__inner { padding-top: 12px; padding-bottom: 12px; }
  .site-header__logo-img { height: 40px; }
  .burger { display: flex; }

  .about__grid { grid-template-columns: 1fr; }
  html[data-heading-align="center"] .about__photo { aspect-ratio: 16 / 9; }
  .about-stats { margin-top: 8px; }

  /* Mosaic → 2 columns: large and wide cards full width, small ones side by side. */
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
  .project-grid__item--lg { grid-column: 1 / -1; grid-row: auto; }
  .project-grid__item--wide { grid-column: 1 / -1; }
  .project-card { height: clamp(220px, 34vw, 300px); }
  .project-grid__item--lg .project-card { height: clamp(280px, 50vw, 420px); }

  /* Services stack as horizontal bars; the active one opens to show its photo. */
  .svc-row {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    overflow: visible;
  }
  .svc,
  .svc.is-active {
    flex: none;
    min-width: 0;
    height: 88px;
    transition: height .5s cubic-bezier(.2, .7, .2, 1);
    border-radius:6px;
  }
  .svc.is-active { height: clamp(240px, 50vw, 340px); }
  .svc__caption { left: 16px; right: 16px; bottom: 16px; align-items: center; }
  .svc__name { font-size: 16px; }
  /* Collapsed bars: no empty-photo label behind the name. */
  .svc:not(.is-active) image-slot::part(empty) { display: none; }
}

/* Large phones */
@media (max-width: 768px) {
  .hero { min-height: 100vh; min-height: 100svh; }
  .hero__inner { padding-top: 120px; }
  /* Projects card: full width, in the flow below the hero button. */
  .hero-projects { position: static; width: 100%; }
  .hero__title { font-size: clamp(36px, 10vw, 52px); }
  /* Text spans the full width here, so the scrim runs top to bottom. */
  .hero__scrim {
    background: linear-gradient(180deg, rgba(var(--scrim-rgb), .78) 0%, rgba(var(--scrim-rgb), .55) 55%, rgba(var(--scrim-rgb), .72) 100%);
  }

  .contact-card__details { grid-template-columns: 1fr; gap: 20px; }
  .bp-grid { -webkit-mask-image: none; mask-image: none; opacity: .6; }
  .site-footer__main { flex-direction: column; }
  .site-footer__bottom { padding-right: var(--fab-space); }
}

/* Phones */
@media (max-width: 480px) {
  .site-header__logo-img { height: 34px; }
  .site-header__cta { min-height: 36px; padding: 0 14px; font-size: 13px; }

  .split-head { align-items: flex-start; flex-direction: column; }

  .about-stats { gap: 12px; }
  .about-stats__label { font-size: 10px; letter-spacing: .1em; }

  .project-grid { grid-template-columns: 1fr; gap: 16px; }
  .project-card,
  .project-grid__item--lg .project-card { height: 260px; }
  .project-card__foot { left: 20px; right: 20px; bottom: 20px; }
  .project-card__cat { top: 20px; left: 20px; right: 20px; }

  .site-footer { --card-pad: 24px; padding-left: 16px; padding-right: 16px; }
  .contact-card { padding-top: 44px; padding-bottom: 40px; }
  .contact-card__head { align-items: flex-start; flex-direction: column; }
  .site-footer__main { padding-top: 56px; padding-bottom: 40px; }
  .site-footer__logo { height: 40px; }
  .site-footer__links { flex-direction: column; gap: 14px; }
  .site-footer__bottom { flex-direction: column; }
}

/* Small phones: no room for the header button; Contact is in the menu. */
@media (max-width: 359px) {
  .site-header__cta { display: none; }
}

/* Touch screens: 44px minimum targets */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .site-footer__links a,
  .site-footer__legal a { display: inline-flex; align-items: center; min-height: 44px; }
  .site-footer__links { row-gap: 0; }
  .hero__dot { height: 44px; }
  .hero__dot::before { top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__slide,
  .svc,
  .btn,
  .site-header,
  .site-header__inner,
  .hero__dot,
  .project-card__photo,
  .project-card__foot,
  .project-card::after { transition: none; }
  .mobile-menu,
  .mobile-menu__link,
  .mobile-menu__contact { animation: none; }
}
