/* =========================================================================
   NIVAS — Static Site Stylesheet
   Single-file CSS. Hand-written. Mobile-first.
   Theming via custom properties at :root — change ~10 vars to retheme.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------------------- */
:root {
  /* Colour — Nivas brand: teal accent on clean neutrals */
  --color-bg:           #FFFFFF;   /* clean white — matches logo backdrop */
  --color-bg-alt:       #EEF4F6;   /* very light teal-tinted neutral for cards */
  --color-text:         #0E2A33;   /* deep teal-charcoal for primary text */
  --color-text-soft:    #3F5A63;   /* secondary / body */
  --color-text-mute:    #7A8C92;   /* tertiary / metadata */
  --color-accent:       #16768F;   /* brand teal sampled from logo */
  --color-accent-dark:  #0F5A6E;   /* hover state for accent */
  --color-line:         #D6E2E6;   /* hairline divider — cool neutral */
  --color-dark-bg:      #0E3A48;   /* deep teal — footer + dark CTA */
  --color-dark-text:    #E6EFF2;   /* text on dark sections */
  --color-dark-mute:    #8AA3AB;

  /* Typography */
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;

  /* Type scale — fluid */
  --fs-h1:   clamp(2.5rem, 6vw, 5rem);
  --fs-h2:   clamp(1.75rem, 4vw, 3rem);
  --fs-h3:   clamp(1.375rem, 2.5vw, 1.75rem);
  --fs-h4:   1.125rem;
  --fs-lead: clamp(1.0625rem, 1.4vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-eyebrow: 0.75rem;

  /* Spacing */
  --space-section:   clamp(4rem, 9vw, 7.5rem);
  --space-block:     clamp(2rem, 4vw, 3.5rem);
  --space-container: clamp(1.25rem, 5vw, 4rem);
  --max-w:           1280px;
  --max-w-narrow:    760px;

  /* Radii & shadows */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 16px;
  --shadow-soft: 0 1px 2px rgba(14, 58, 72, 0.04), 0 8px 24px rgba(14, 58, 72, 0.06);
  --shadow-card-hover: 0 1px 2px rgba(14, 58, 72, 0.04), 0 16px 40px rgba(14, 58, 72, 0.10);

  /* Motion */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t-fast:  0.18s;
  --t-base:  0.28s;
  --t-slow:  0.5s;
}

/* -------------------------------------------------------------------------
   2. Reset & base
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  font-family: var(--font-body);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

@media (min-width: 1024px) {
  body { font-size: 1.0625rem; }
}

img, svg, video { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
a { color: inherit; text-decoration: none; }

:where(input, select, textarea) {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  outline: 0;
}

/* Visible focus for accessibility */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* -------------------------------------------------------------------------
   3. Typography
   ------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

h1 { font-size: var(--fs-h1); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.015em; }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }

p { max-width: 65ch; }
.prose p + p { margin-top: 1em; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--color-text-soft);
  max-width: 60ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1.25rem;
}

.eyebrow svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* -------------------------------------------------------------------------
   4. Layout primitives
   ------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: var(--space-container);
}

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

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

/* Offset for anchor scroll so the fixed nav doesn't cover the target heading */
#projects { scroll-margin-top: 96px; }
.section--tight { padding-block: var(--space-block); }
.section--dark { background: var(--color-dark-bg); color: var(--color-dark-text); }
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--color-dark-text); }
.section--dark p { color: var(--color-dark-mute); }

.divider {
  height: 1px;
  background: var(--color-line);
  border: 0;
  margin: 0;
}

/* -------------------------------------------------------------------------
   5. Navigation
   ------------------------------------------------------------------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom-color: var(--color-line);
}

/* When the mobile menu is open, drop the scrolled blur. `backdrop-filter`
   establishes a containing block for fixed descendants, which would otherwise
   clip the full-screen .nav__overlay (position:fixed) to the nav bar's box —
   leaving the overlay background + links missing once the page is scrolled. */
.nav.open.scrolled {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.125rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: var(--space-container);
  position: relative;
  z-index: 100;   /* must sit above the overlay so the close X stays tappable */
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.nav__logo img {
  height: clamp(28px, 3.4vw, 38px);
  width: auto;
  display: block;
  transition: filter var(--t-base) var(--ease);
}
/* On the dark video hero (un-scrolled), brighten the logo so it reads
   clearly against the darker overlay. */
.has-hero-video .nav:not(.scrolled) .nav__logo img {
  filter: brightness(0) invert(1);
}

.nav__links {
  display: none;
  list-style: none;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 1024px) {
  .nav__links {
    display: flex;
    padding: 0.4rem 0.5rem 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    transition: background var(--t-base) var(--ease),
                border-color var(--t-base) var(--ease);
  }
  /* When the page background is light (scrolled or non-video pages),
     switch the pill to a subtle outlined-on-light treatment. */
  .nav.scrolled .nav__links,
  body:not(.has-hero-video) .nav__links {
    background: rgba(14, 42, 51, 0.04);
    border-color: var(--color-line);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.nav__link {
  position: relative;
  font-size: 0.9375rem;
  color: var(--color-text);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  transition: color var(--t-fast) var(--ease),
              background-color var(--t-base) var(--ease),
              transform var(--t-fast) var(--ease);
}

.nav__link:hover {
  color: var(--color-accent);
  background-color: rgba(22, 118, 143, 0.12);
  transform: translateY(-1px);
}

/* On the dark video hero, the hover pill needs a light tint instead */
.has-hero-video .nav:not(.scrolled) .nav__link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.14);
}

.nav__link[aria-current="page"] {
  color: var(--color-accent);
  background-color: rgba(22, 118, 143, 0.10);
}
.has-hero-video .nav:not(.scrolled) .nav__link[aria-current="page"] {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.18);
}

.nav__dropdown {
  position: relative;
}

.nav__dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9375rem;
}

.nav__dropdown-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--t-fast) var(--ease);
}

.nav__dropdown:hover .nav__dropdown-toggle::after,
.nav__dropdown:focus-within .nav__dropdown-toggle::after {
  transform: rotate(225deg) translateY(0);
}

.nav__dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-width: 240px;
  box-shadow: var(--shadow-soft);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease), visibility var(--t-base) var(--ease);
}

.nav__dropdown:hover .nav__dropdown-menu,
.nav__dropdown:focus-within .nav__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav__dropdown-menu a {
  display: block;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast) var(--ease);
}

.nav__dropdown-menu a:hover { background: var(--color-bg-alt); }

.nav__hamburger {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  margin-right: -0.5rem;
}

@media (min-width: 1024px) {
  .nav__hamburger { display: none; }
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--color-text);
  transition: transform var(--t-base) var(--ease), opacity var(--t-base) var(--ease);
}

.nav.open .nav__hamburger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.open .nav__hamburger span:nth-child(2) { opacity: 0; }
.nav.open .nav__hamburger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* When the overlay is open the bg is light, so the close X must match the
   overlay menu-link colour (same dark text used in .nav__overlay-links a). */
.nav.open .nav__hamburger span,
.has-hero-video .nav.open .nav__hamburger span,
.nav.open.scrolled .nav__hamburger span {
  background: var(--color-text) !important;
}

/* Mobile overlay */
.nav__overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 99;
  display: flex;
  align-items: flex-start;        /* anchor to top, not centre — less dead space */
  justify-content: center;
  padding-top: clamp(5.5rem, 14vh, 8rem); /* clears the nav bar with breathing room */
  padding-bottom: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease), visibility var(--t-base) var(--ease);
  overflow-y: auto;
}

.nav.open .nav__overlay {
  opacity: 1;
  visibility: visible;
}

.nav__overlay-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  text-align: center;
}

.nav__overlay-links a {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--color-text);
}

.nav__overlay-links .nav__overlay-sub {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-mute);
  margin-top: 0.25rem;
  display: block;
}

/* -------------------------------------------------------------------------
   6. Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  border-radius: 999px;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  white-space: nowrap;
}

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

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}
.btn--ghost:hover { background: var(--color-text); color: var(--color-bg); }

.btn--light {
  background: var(--color-bg);
  color: var(--color-text);
}
.btn--light:hover { background: #FFFEFA; }

.btn--dark {
  background: var(--color-text);
  color: var(--color-bg);
}
.btn--dark:hover { background: #000; }

.btn .arrow {
  width: 1em;
  height: 1em;
  transition: transform var(--t-fast) var(--ease);
}
.btn:hover .arrow { transform: translateX(4px); }

/* Text-link with arrow */
.tlink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-accent);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color var(--t-fast) var(--ease);
}
.tlink:hover { color: var(--color-accent-dark); }
.tlink .arrow { transition: transform var(--t-fast) var(--ease); }
.tlink:hover .arrow { transform: translateX(4px); }
.tlink--light { color: var(--color-dark-text); }
.tlink--light:hover { color: #fff; }

/* -------------------------------------------------------------------------
   7. Hero
   ------------------------------------------------------------------------- */
.hero {
  padding-top: clamp(7rem, 14vh, 9rem);
  padding-bottom: var(--space-block);
}

/* -------- Hero with background video -------- */
.hero--video {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: clamp(8rem, 18vh, 12rem);
  /* Extra bottom padding reserves room for the absolutely-positioned trust strip */
  padding-bottom: clamp(8rem, 16vh, 11rem);
  color: var(--color-dark-text);
  min-height: clamp(600px, 90vh, 860px);
  display: flex;
  align-items: center;
}

/* Trust strip anchored to the bottom of the video hero — positioned
   absolutely so it never touches the hero copy layout. */
.hero__trust {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding-block: 1.25rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(14, 42, 51, 0) 0, rgba(14, 42, 51, 0.4) 100%);
  z-index: 1;
}

/* Override the standalone .trust__label colour so it reads on dark video */
.hero__trust .trust__label {
  color: rgba(230, 239, 242, 0.7);
}
.hero__trust .trust__label::after {
  background: rgba(230, 239, 242, 0.25);
}

/* Logos are now pre-processed white silhouettes on transparent PNGs, so
   they sit directly on the dark hero with no card backdrop. */
.hero__trust .logo-marquee__item {
  background: transparent;
  padding: 0;
}
.hero__trust .logo-marquee__item img {
  filter: none;
  opacity: 0.7;
  transition: opacity var(--t-base) var(--ease);
}
.hero__trust .logo-marquee__item:hover img {
  opacity: 1;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Dark gradient — darker on the left where the copy sits, fading right.
   Plus a top vignette so the nav stays legible. */
.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(14, 42, 51, 0.55) 0, rgba(14, 42, 51, 0) 35%),
    linear-gradient(90deg,  rgba(14, 42, 51, 0.78) 0, rgba(14, 42, 51, 0.55) 45%, rgba(14, 42, 51, 0.2) 100%);
}

/* A second overlay layer we cross-fade in — gradients aren't natively
   interpolatable, so we fade an additional pane in/out for a glassy ease. */
.hero__overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(14, 42, 51, 0.7) 0, rgba(14, 42, 51, 0.15) 60%),
    linear-gradient(90deg,  rgba(14, 42, 51, 0.92) 0, rgba(14, 42, 51, 0.78) 50%, rgba(14, 42, 51, 0.55) 100%);
  transition: opacity 4.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When the clip has finished, deepen the overlay so the copy takes focus. */
.hero--video.hero--video-ended .hero__overlay::after { opacity: 1; }

/* Lighter-overlay variant — for pages where the video should breathe more */
.hero--video-light .hero__overlay {
  background:
    linear-gradient(180deg, rgba(14, 42, 51, 0.35) 0, rgba(14, 42, 51, 0) 40%),
    linear-gradient(90deg,  rgba(14, 42, 51, 0.55) 0, rgba(14, 42, 51, 0.35) 50%, rgba(14, 42, 51, 0.1) 100%);
}
.hero--video-light .hero__overlay::after {
  background:
    linear-gradient(180deg, rgba(14, 42, 51, 0.45) 0, rgba(14, 42, 51, 0.1) 60%),
    linear-gradient(90deg,  rgba(14, 42, 51, 0.68) 0, rgba(14, 42, 51, 0.5) 50%, rgba(14, 42, 51, 0.3) 100%);
}

/* Also slightly fade the video itself once it ends, so the still frame
   recedes behind the copy rather than competing with it. */
.hero__video {
  transition: opacity 4.5s cubic-bezier(0.4, 0, 0.2, 1),
              filter 4.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero--video.hero--video-ended .hero__video {
  opacity: 0.85;
  filter: saturate(0.85);
}

/* Text overrides on the video hero so the copy stays legible */
.hero--video .hero__heading,
.hero--video .hero__subheading,
.hero--video .hero__tagline {
  color: var(--color-dark-text);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.25);
}

.hero--video .hero__subheading { color: rgba(230, 239, 242, 0.92); }
.hero--video .hero__tagline    { color: rgba(230, 239, 242, 0.75); }

/* Light-on-dark variant of the secondary text-link */
.hero--video .tlink { color: var(--color-dark-text); }
.hero--video .tlink:hover { color: #fff; }

/* When the hero is a dark video, the un-scrolled nav needs light text */
.has-hero-video .nav:not(.scrolled) .nav__logo,
.has-hero-video .nav:not(.scrolled) .nav__link,
.has-hero-video .nav:not(.scrolled) .nav__dropdown-toggle {
  color: var(--color-dark-text);
}
.has-hero-video .nav:not(.scrolled) .nav__link:hover,
.has-hero-video .nav:not(.scrolled) .nav__link[aria-current="page"] {
  color: #fff;
}
.has-hero-video .nav:not(.scrolled) .nav__hamburger span {
  background: var(--color-dark-text);
}

.hero__heading {
  max-width: 18ch;
  margin-bottom: 1.5rem;
}

.hero__subheading {
  max-width: 58ch;
  margin-bottom: 2rem;
  color: var(--color-text-soft);
  font-size: var(--fs-lead);
  line-height: 1.5;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
}

.hero__tagline {
  margin-top: 1.75rem;
  max-width: 58ch;
  font-style: italic;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-mute);
  letter-spacing: 0.005em;
}

.hero__image {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-alt);
}

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

/* -------------------------------------------------------------------------
   8. Trust line
   ------------------------------------------------------------------------- */
.trust {
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  padding-block: 2rem;
  background: var(--color-bg);
}

.trust__text {
  text-align: center;
  font-size: 0.9375rem;
  color: var(--color-text-soft);
  max-width: none;
  margin: 0 auto;
}

/* "Trusted by" inline label + marquee strip */
.trust__inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.trust__label {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-mute);
  white-space: nowrap;
}

.trust__label::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 14px;
  margin-left: clamp(1rem, 2.5vw, 2.25rem);
  background: var(--color-line);
  vertical-align: middle;
}

.trust__inner .logo-marquee { flex: 1 1 auto; min-width: 0; }

@media (max-width: 720px) {
  .trust__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }
  .trust__label::after { display: none; }
}

/* Logo marquee — auto-scrolling logo strip */
.logo-marquee {
  position: relative;
  overflow: hidden;
  width: 100%;
  /* Soft fade on the edges */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}

.logo-marquee__track {
  display: flex;
  align-items: center;
  gap: clamp(3rem, 9vw, 8rem);
  width: max-content;
  animation: logo-marquee-scroll 45s linear infinite;
  will-change: transform;
}

.logo-marquee:hover .logo-marquee__track {
  animation-play-state: paused;
}

.logo-marquee__item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(36px, 4.5vw, 52px);
  /* Reserve uniform slot width so every logo gets the same visual real-estate */
  width: clamp(140px, 16vw, 200px);
}

.logo-marquee__item img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  opacity: 0.75;
  filter: grayscale(100%);
  transition: opacity var(--t-base) var(--ease), filter var(--t-base) var(--ease);
}

/* Per-logo optical-size normalisation — each source has different
   internal whitespace, so we scale to match visual weight, not pixel size. */
.logo-marquee__item img.logo--revit        { transform: scale(1.15); }
.logo-marquee__item img.logo--hamilton     { transform: scale(1.85); }
.logo-marquee__item img.logo--auckland     { transform: scale(0.95); }
.logo-marquee__item img.logo--waikato      { transform: scale(1.05); }
.logo-marquee__item img.logo--lbp          { transform: scale(1.10); }
.logo-marquee__item img.logo--buildingperf { transform: scale(1.05); }
.logo-marquee__item img.logo--hermpac      { transform: scale(1.15); }
.logo-marquee__item img.logo--gib          { transform: scale(0.90); }
.logo-marquee__item img.logo--jameshardie  { transform: scale(1.20); }

.logo-marquee__item:hover img {
  opacity: 1;
  filter: grayscale(0%);
}

@keyframes logo-marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .logo-marquee__track { animation: none; }
}

/* -------------------------------------------------------------------------
   9. Two-column narrative ("Why Nivas")
   ------------------------------------------------------------------------- */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (min-width: 1024px) {
  .split { grid-template-columns: 1.05fr 1fr; align-items: center; }
}

.split--reverse > :first-child { order: 2; }
@media (min-width: 1024px) {
  .split--reverse > :first-child { order: 0; }
}

.split__media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--color-bg-alt);
}
.split__media img { width: 100%; height: 100%; object-fit: cover; }

.split__body h2 { margin-bottom: 1.25rem; max-width: 18ch; }
.split__body .prose { color: var(--color-text-soft); }
.split__body .prose p { margin-bottom: 1em; }
.split__body .btn,
.split__body .tlink { margin-top: 1.5rem; }

/* -------------------------------------------------------------------------
   10. Stats block
   ------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 1.5rem;
}

@media (min-width: 768px) {
  .stats { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
}

.stat__value {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.stat__label {
  font-size: 0.875rem;
  color: var(--color-text-soft);
  max-width: 22ch;
  line-height: 1.4;
}

.stat__note {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--color-text-mute);
  font-style: italic;
}

/* -------------------------------------------------------------------------
   11. Section header (eyebrow + heading + body)
   ------------------------------------------------------------------------- */
.section-head { margin-bottom: var(--space-block); max-width: 56ch; }
.section-head h2 { margin-bottom: 1rem; }
.section-head .lead { margin-top: 0; }

.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head--center .lead { margin-inline: auto; }
.section-head--center .eyebrow { justify-content: center; }

/* -------------------------------------------------------------------------
   12. Service cards
   ------------------------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
  min-height: 230px;
}

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

.card__icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

.card__icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.4; }

.card__title {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.35;
  margin-top: auto;
}

.card__desc { font-size: 0.9375rem; color: var(--color-text-soft); line-height: 1.5; }

.card__arrow {
  position: absolute;
  top: 1.75rem;
  right: 1.75rem;
  width: 22px;
  height: 22px;
  color: var(--color-accent);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}

.card:hover .card__arrow { opacity: 1; transform: translate(0, 0); }

/* Card link wraps the whole card */
.card-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

/* -------------------------------------------------------------------------
   13. Project cards
   ------------------------------------------------------------------------- */
.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) { .projects { grid-template-columns: repeat(2, 1fr); gap: 2rem; } }
@media (min-width: 1024px) { .projects { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }

.project {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.project__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-alt);
  padding: 0;
  border: 0;
  cursor: pointer;
  width: 100%;
}

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

.project:hover .project__media img { transform: scale(1.02); }

/* Inline plan / drawing zoom button (used in the "What we deliver" split).
   Fills the surrounding .split__media so the plan covers the column edge to
   edge — image is `object-fit: cover` and crops as needed. Click opens the
   full uncropped plan in the lightbox. */
.plan-zoom {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: inherit;
  overflow: hidden;
  cursor: zoom-in;
}
.plan-zoom img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
  background: var(--color-bg-alt);
  transition: transform var(--t-slow) var(--ease);
}
.plan-zoom:hover img { transform: scale(1.02); }

.plan-zoom__hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  pointer-events: none;
}
.plan-zoom__hint svg { width: 14px; height: 14px; }
.plan-zoom:hover .plan-zoom__hint,
.plan-zoom:focus-visible .plan-zoom__hint {
  opacity: 1;
  transform: translateY(0);
}

/* "View gallery" hint pill, shown on hover when the media opens a lightbox */
.project__media-hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  pointer-events: none;
}
.project__media-hint svg { width: 14px; height: 14px; }
.project__media:hover .project__media-hint,
.project__media:focus-visible .project__media-hint {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------------------------------------------------------------
   Lightbox / image-gallery modal
   ------------------------------------------------------------------------- */
.gallery {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;        /* bullet-proof centring of the single child */
  grid-template-columns: 100%;
  background: rgba(8, 22, 28, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
  padding: clamp(1rem, 4vw, 3rem);
}

.gallery.is-open {
  opacity: 1;
  visibility: visible;
}

.gallery__stage {
  /* Absolute + translate(-50%, -50%) is the bullet-proof centring technique
     for every image modal on the site. Independent of parent flex/grid quirks,
     figure default margins, or intrinsic image width. */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: min(1200px, calc(100% - 2 * clamp(1rem, 4vw, 3rem)));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.gallery__img {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  object-fit: contain;
  border-radius: var(--radius);
  background: transparent;   /* no card behind the image — sits cleanly on the dark backdrop */
  box-shadow: none;
}

.gallery__caption {
  color: rgba(230, 239, 242, 0.75);
  font-size: 0.875rem;
  text-align: center;
  max-width: 60ch;
}

.gallery__close,
.gallery__nav {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.gallery__close { top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem); }
.gallery__nav--prev { left: clamp(1rem, 3vw, 2rem); top: 50%; transform: translateY(-50%); }
.gallery__nav--next { right: clamp(1rem, 3vw, 2rem); top: 50%; transform: translateY(-50%); }

.gallery__close:hover,
.gallery__nav:hover { background: rgba(255, 255, 255, 0.22); }
.gallery__nav--prev:hover { transform: translateY(-50%) translateX(-2px); }
.gallery__nav--next:hover { transform: translateY(-50%) translateX(2px); }

.gallery__close svg,
.gallery__nav svg { width: 22px; height: 22px; }

@media (max-width: 600px) {
  .gallery__nav--prev { left: 0.5rem; }
  .gallery__nav--next { right: 0.5rem; }
  .gallery__close { top: 0.75rem; right: 0.75rem; }
}

.project__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-text-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project__meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-text-mute);
}

.project__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.project__outcome {
  font-size: 0.9375rem;
  color: var(--color-text-soft);
  line-height: 1.45;
}

.project__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

/* -------------------------------------------------------------------------
   14. FAQ
   ------------------------------------------------------------------------- */
.faq {
  border-top: 1px solid var(--color-line);
}

.faq__item {
  border-bottom: 1px solid var(--color-line);
}

.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  line-height: 1.3;
  text-align: left;
  color: var(--color-text);
}

.faq__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  position: relative;
}

.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  background: var(--color-text);
  transition: transform var(--t-base) var(--ease), opacity var(--t-base) var(--ease);
}

.faq__icon::before {
  width: 16px;
  height: 1.5px;
  transform: translate(-50%, -50%);
}

.faq__icon::after {
  width: 1.5px;
  height: 16px;
  transform: translate(-50%, -50%);
}

.faq__item[aria-expanded="true"] .faq__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.faq__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-base) var(--ease);
}

.faq__a-inner {
  padding-bottom: 1.5rem;
  padding-right: 3rem;
  color: var(--color-text-soft);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 75ch;
}

/* -------------------------------------------------------------------------
   15. Final CTA block
   ------------------------------------------------------------------------- */
.cta-block {
  text-align: center;
  padding-block: clamp(5rem, 10vw, 8rem);
}

.cta-block h2 {
  max-width: 22ch;
  margin-inline: auto;
  margin-bottom: 1.25rem;
}

.cta-block p {
  max-width: 50ch;
  margin-inline: auto;
  margin-bottom: 2.25rem;
  color: var(--color-dark-mute);
  font-size: var(--fs-lead);
}

.cta-block__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: center;
  align-items: center;
}

/* -------------------------------------------------------------------------
   16. Footer
   ------------------------------------------------------------------------- */
.footer {
  background: var(--color-bg-alt);
  color: var(--color-text);
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
}

.footer__top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-line);
}

@media (min-width: 768px) {
  .footer__top { grid-template-columns: 1fr 1.4fr; }
}

/* Brand column — logo, about, contact list */
.footer__contact {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.footer__contact li,
.footer__contact a {
  font-size: 0.9375rem;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.5;
  transition: color var(--t-fast) var(--ease);
}
.footer__contact a:hover { color: var(--color-accent); }

/* Instagram profile card */
.footer__instagram {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  margin-top: 1.25rem;
  padding: 0.6rem 0.9rem 0.6rem 0.6rem;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 14px;
  color: var(--color-text);
  text-decoration: none;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  max-width: 100%;
}
.footer__instagram:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14, 58, 72, 0.08);
}

.footer__instagram-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.footer__instagram-avatar img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.footer__instagram-body {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.footer__instagram-handle {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}
.footer__instagram-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--color-text-mute);
  margin-top: 0.2rem;
}
.footer__instagram-cta svg { width: 12px; height: 12px; }

/* "Visit us" embedded map block in the footer */
.footer__map h4 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-mute);
  margin-bottom: 1rem;
}

.footer__map-address {
  display: inline-block;
  font-size: 0.9375rem;
  color: var(--color-text);
  margin-bottom: 0.875rem;
  transition: color var(--t-fast) var(--ease);
}
.footer__map-address:hover { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }

.footer__map-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  background: var(--color-bg-alt);
}

/* Animated shimmer placeholder shown until the map iframe has loaded — avoids
   the white "blink" while Google Maps fetches. Fades out once .is-loaded. */
.footer__map-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    100deg,
    var(--color-bg-alt) 30%,
    rgba(255, 255, 255, 0.55) 50%,
    var(--color-bg-alt) 70%
  );
  background-size: 200% 100%;
  animation: map-shimmer 1.5s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.5s var(--ease);
}

.footer__map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
}

/* Reveal: fade the map in and dismiss the shimmer. */
.footer__map-frame.is-loaded iframe { opacity: 1; }
.footer__map-frame.is-loaded::before {
  opacity: 0;
  animation: none;
}

@keyframes map-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .footer__map-frame::before { animation: none; }
}

.footer__logo {
  margin-bottom: 1.25rem;
  line-height: 1;
}
.footer__logo img {
  height: clamp(36px, 4vw, 46px);
  width: auto;
  display: block;
}

.footer__about {
  color: var(--color-text-soft);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 32ch;
}

.footer__signup {
  display: flex;
  gap: 0.5rem;
  max-width: 320px;
  padding: 0.25rem;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 999px;
}

.footer__signup input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  color: var(--color-text);
  font-size: 0.875rem;
}
.footer__signup input::placeholder { color: var(--color-text-mute); }

.footer__signup button {
  background: var(--color-accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background var(--t-fast) var(--ease);
}
.footer__signup button:hover { background: var(--color-accent-dark); }

.footer__col h4 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-mute);
  margin-bottom: 1.25rem;
}

.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.footer__col a {
  font-size: 0.9375rem;
  color: var(--color-text);
  transition: color var(--t-fast) var(--ease);
}
.footer__col a:hover { color: var(--color-accent); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  font-size: 0.8125rem;
  color: var(--color-text-mute);
}

/* -------------------------------------------------------------------------
   17. Tag / pill
   ------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(22, 118, 143, 0.1);
  border-radius: 999px;
}

/* -------------------------------------------------------------------------
   18. Service-detail page bits
   ------------------------------------------------------------------------- */
.bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.bullet-list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--color-text-soft);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 60ch;
}

.bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

.principles {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) { .principles { grid-template-columns: 1fr 1fr; gap: 2.5rem 3rem; } }

.principle h3 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.005em;
}

.principle p { color: var(--color-text-soft); }

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.timeline__step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--color-line);
}

.timeline__step:last-child { border-bottom: 0; }

.timeline__weeks {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-accent);
  /* Lock the column width so the body text starts at the same x on every
     row — independent of whether a step has a sub-note. */
  flex: 0 0 clamp(120px, 14vw, 160px);
  width: clamp(120px, 14vw, 160px);
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline__weeks-note {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--color-text-mute);
  line-height: 1.3;
  margin-top: 0.15rem;
}

.timeline__body h3 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.timeline__body p { color: var(--color-text-soft); }

.anxieties { display: flex; flex-direction: column; gap: 2rem; }

/* Centred variant — keeps Q/A text left-aligned (better for reading long
   answers) but centres each block horizontally so the column sits in the
   middle of the section instead of hugging the left edge. */
.anxieties--center > * { margin-inline: auto; width: 100%; max-width: 65ch; }
.anxieties--center .anxiety__q,
.anxieties--center .anxiety__a { max-width: none; }

.anxiety__q {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.anxiety__a { color: var(--color-text-soft); max-width: 65ch; }

/* -------------------------------------------------------------------------
   19. Article / guide layout (cross-lease)
   ------------------------------------------------------------------------- */
.article {
  max-width: 720px;
  margin-inline: auto;
}

.article__head {
  padding-top: clamp(6rem, 12vh, 8rem);
  padding-bottom: var(--space-block);
}

.article__title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 1.25rem;
}

.article__sub {
  font-size: var(--fs-lead);
  color: var(--color-text-soft);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.article__byline {
  font-size: 0.875rem;
  color: var(--color-text-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.article__body {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text);
  padding-bottom: var(--space-section);
}

.article__body p,
.article__body ul,
.article__body ol { color: var(--color-text-soft); max-width: none; margin-bottom: 1.25em; }

.article__body p strong { color: var(--color-text); }

.article__body .lead-para {
  font-size: 1.1875rem;
  color: var(--color-text);
  line-height: 1.55;
}

.article__body h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.article__body h3 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.005em;
}

.article__body ul, .article__body ol {
  padding-left: 1.25rem;
}

.article__body li { margin-bottom: 0.5em; }

/* -------------------------------------------------------------------------
   20. Case study page bits
   ------------------------------------------------------------------------- */
.facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem 2rem;
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  padding-block: 2rem;
}

@media (min-width: 640px) { .facts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .facts { grid-template-columns: repeat(3, 1fr); gap: 1.5rem 2.5rem; } }

.fact dt {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-mute);
  margin-bottom: 0.25rem;
}

.fact dd {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--color-text);
}

.case-section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

.case-section .prose { color: var(--color-text-soft); font-size: 1.0625rem; line-height: 1.6; }
.case-section .prose p { max-width: 65ch; }
.case-section + .case-section { margin-top: var(--space-block); }

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; } }

.gallery__cell {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg-alt);
}
.gallery__cell img { width: 100%; height: 100%; object-fit: cover; }

/* -------------------------------------------------------------------------
   21. Form
   ------------------------------------------------------------------------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 640px;
}

.form__group { display: flex; flex-direction: column; gap: 0.625rem; }

.form__label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.form__hint {
  font-size: 0.8125rem;
  color: var(--color-text-mute);
}

.form__input,
.form__select,
.form__textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--color-text);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.form__input:focus,
.form__select:focus,
.form__textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(22, 118, 143, 0.15);
}

.form__textarea { min-height: 140px; resize: vertical; }

.form__select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231A1A1A'><path d='M5.5 7.5L10 12l4.5-4.5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 18px;
  padding-right: 2.5rem;
}

.form__radios {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.form__radio {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.form__radio:hover { border-color: var(--color-text-mute); }

.form__radio input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-text-mute);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  margin-top: 0.15em;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease);
}

.form__radio input:checked { border-color: var(--color-accent); }
.form__radio input:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--color-accent);
}

.form__radio:has(input:checked) {
  border-color: var(--color-accent);
  background: rgba(22, 118, 143, 0.04);
}

.form__radio span { font-size: 0.9375rem; line-height: 1.4; }

.form__conditional {
  display: none;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height var(--t-base) var(--ease), opacity var(--t-base) var(--ease);
}

.form__conditional.is-visible {
  display: block;
  max-height: 1500px;
  opacity: 1;
}

.form__conditional-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 0.25rem;
}

.form__error {
  color: #B23434;
  font-size: 0.8125rem;
  display: none;
}

.form__error.is-visible { display: block; }

.form__input--error,
.form__select--error,
.form__textarea--error {
  border-color: #B23434;
}

.form__message {
  display: none;
  padding: 1rem 1.25rem;
  background: rgba(22, 118, 143, 0.1);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  color: var(--color-text);
}
.form__message.is-visible { display: block; }

.form__message--error {
  background: rgba(178, 52, 52, 0.08);
  border-left-color: #B23434;
  color: #7a2020;
}

.form__submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.5rem;
}

.form__below {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-line);
  font-size: 0.9375rem;
  color: var(--color-text-soft);
}

.form__below strong { color: var(--color-text); font-weight: 500; }

/* Honeypot — visually and assistively hidden, but still submitted by bots. */
.form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* -------------------------------------------------------------------------
   22. Thank you / 404 / link cards
   ------------------------------------------------------------------------- */
.link-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}
@media (min-width: 768px) { .link-cards { grid-template-columns: repeat(3, 1fr); } }

.link-card {
  display: block;
  padding: 1.5rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}

.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }

.link-card__eyebrow {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
  display: block;
}

.link-card__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.25;
}

/* -------------------------------------------------------------------------
   23. Steps list (numbered)
   ------------------------------------------------------------------------- */
.steps { display: flex; flex-direction: column; gap: 1.25rem; counter-reset: step; }

.steps li {
  list-style: none;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-accent);
  line-height: 1;
  width: 1.5rem;
}

/* -------------------------------------------------------------------------
   24. Utilities
   ------------------------------------------------------------------------- */
.is-hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Scroll-fade-in (set by JS via IntersectionObserver) */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------------------------------------------------------------
   First-paint intro cascade — pure-CSS choreography for premium feel.
   Hero elements ladder in via transition-delay on .fade-in (they get .is-in
   from the IntersectionObserver immediately since they're above the fold).
   The nav + logo strip use a one-shot @keyframes so they don't depend on JS.
   ------------------------------------------------------------------------- */
.hero .hero__heading.fade-in    { transition-delay: 0.10s; }
.hero .hero__subheading.fade-in { transition-delay: 0.28s; }
.hero .hero__ctas.fade-in       { transition-delay: 0.46s; }
.hero .hero__tagline.fade-in    { transition-delay: 0.62s; }

@keyframes intro-down {
  /* opacity-only fade — must NOT leave a transform on .nav, otherwise
     descendant position:fixed (the mobile overlay) gets contained to .nav's
     box and the full-screen menu background is clipped to a thin strip. */
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes intro-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav {
  animation: intro-down 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.05s;
}

.trust,
.hero__trust {
  animation: intro-up 1s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.85s;
}

/* The marquee logos themselves drift up + fade in one after the other */
.trust .logo-marquee__item:not([aria-hidden="true"]),
.hero__trust .logo-marquee__item:not([aria-hidden="true"]) {
  animation: intro-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.trust .logo-marquee__item:not([aria-hidden="true"]):nth-child(1),
.hero__trust .logo-marquee__item:not([aria-hidden="true"]):nth-child(1) { animation-delay: 1.05s; }
.trust .logo-marquee__item:not([aria-hidden="true"]):nth-child(2),
.hero__trust .logo-marquee__item:not([aria-hidden="true"]):nth-child(2) { animation-delay: 1.18s; }
.trust .logo-marquee__item:not([aria-hidden="true"]):nth-child(3),
.hero__trust .logo-marquee__item:not([aria-hidden="true"]):nth-child(3) { animation-delay: 1.31s; }
.trust .logo-marquee__item:not([aria-hidden="true"]):nth-child(4),
.hero__trust .logo-marquee__item:not([aria-hidden="true"]):nth-child(4) { animation-delay: 1.44s; }
.trust .logo-marquee__item:not([aria-hidden="true"]):nth-child(5),
.hero__trust .logo-marquee__item:not([aria-hidden="true"]):nth-child(5) { animation-delay: 1.57s; }

/* Prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .fade-in { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------------------
   25. Image onerror placeholder helper
   ------------------------------------------------------------------------- */
img[alt^="Image placeholder"] {
  background: var(--color-bg-alt);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* =========================================================================
   Page transitions — crossfade between pages (graceful, no-JS safe)
   ========================================================================= */
/* No whole-page fade-IN on load: each page's own intro cascade is the
   entrance, so it never competes with the hero video / choreography.
   We keep only the gentle fade-OUT when leaving a page. */
@media (prefers-reduced-motion: no-preference) {
  body.is-leaving {
    opacity: 0;
    transition: opacity 0.25s ease;
  }
}

/* -------------------------------------------------------------------------
   View Transitions — keep the persistent shell static during soft-nav.
   The client-side router swaps only #main but wraps it in a View Transition.
   By default a View Transition snapshots the ENTIRE viewport and cross-
   dissolves it, which makes the persistent header logo + hero background
   appear to "reload" on every navigation. Giving the shell its own
   view-transition-name lifts it out of the root snapshot, and zeroing its
   animation keeps it rock-solid while only #main crossfades.
   ------------------------------------------------------------------------- */
.nav    { view-transition-name: site-header; }
.footer { view-transition-name: site-footer; }

::view-transition-group(site-header),
::view-transition-group(site-footer),
::view-transition-old(site-header),
::view-transition-new(site-header),
::view-transition-old(site-footer),
::view-transition-new(site-footer) {
  animation: none !important;
  mix-blend-mode: normal;
}
