/* ─── TOKENS ─────────────────────────────────────────────────── */
:root {
  --bg:           #FAFAF7;
  --bg-soft:      #F2F1EC;
  --fg:           #0F1012;
  --fg-mute:      #5E5E59;
  --line:         #E4E2DB;
  --line-strong:  #C9C6BC;
  /* Sampled from the ring in images/logo.png — was #2BA7E0, a lighter cyan
     that never actually appeared in the logo. */
  --accent:       #2993D1;
  /* Darkened for small text: #2993D1 on --bg is only 3.25:1, below WCAG AA
     for body sizes. This is 5.25:1. Use it for labels/counters, not rules. */
  --accent-ink:   #1B7099;
  --card:         #FFFFFF;
  --font-display: 'Space Grotesk', Helvetica, sans-serif;
  --font-body:    'IBM Plex Sans', Helvetica, sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;
}

/* ─── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ─── THUMB-ONLY SCROLLBAR (no track/route visible) ──────────── */
/* Firefox */
html { scrollbar-width: thin; scrollbar-color: rgba(15,16,18,0.45) transparent; }
/* WebKit (Chrome / Safari / Edge) */
::-webkit-scrollbar { width: 6px; height: 6px; background: transparent; }
::-webkit-scrollbar-track,
::-webkit-scrollbar-track-piece {
  background: transparent !important;
  border: none;
  box-shadow: none;
}
::-webkit-scrollbar-thumb {
  background: rgba(15,16,18,0.4);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(15,16,18,0.65); }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-corner { background: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── ACCESSIBILITY HELPERS ──────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.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;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--fg); color: var(--bg);
  padding: 10px 16px; font-size: 13px;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ─── LAYOUT ─────────────────────────────────────────────────── */
.shell { max-width: 1360px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 720px) { .shell { padding: 0 20px; } }

/* ─── NAV ────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
/* 3-track grid so the menu sits dead-centre regardless of logo/burger width */
.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 72px;
}
/* explicit placement: on mobile .nav-links goes abs-positioned and would
   otherwise leave .nav-right auto-placed into the middle track */
.nav-inner > .nav-right { grid-column: 3; justify-self: end; }
.nav .nav-links { grid-column: 2; justify-content: center; }
.nav-logo { height: 47px; }
.nav-links {
  display: flex;
  gap: 32px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--fg-mute);
}
.nav-links a:hover { color: var(--fg); }
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Mobile menu button (hidden on desktop) */
.nav-burger { display: none; }
.nav-burger span {
  display: block; width: 22px; height: 2px;
  background: var(--fg);
  transition: transform .2s, opacity .2s;
}
@media (max-width: 860px) {
  .nav-burger {
    display: inline-flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 5px;
    width: 42px; height: 38px; padding: 0;
    background: transparent; border: 1px solid var(--line-strong);
    border-radius: 4px; cursor: pointer; flex-shrink: 0;
  }
  .nav-burger:hover { border-color: var(--accent); }
  .nav .nav-links {
    display: none; flex-direction: column; gap: 0;
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(0,0,0,0.07);
    padding: 4px 20px 16px;
  }
  .nav .nav-links a { padding: 15px 0; border-top: 1px solid var(--line); font-size: 15px; }
  .nav .nav-links a:first-child { border-top: none; }
  .nav.open .nav-links { display: flex; }
  .nav.open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .nav-burger span:nth-child(2) { opacity: 0; }
  .nav.open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  /* keep footer sitemap visible + wrapping on small screens */
  .foot .nav-links { flex-wrap: wrap; gap: 14px 20px; }
}

/* Language switch — sits left of the burger, visible at every breakpoint */
.nav-lang {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.nav-lang:hover { border-color: var(--accent); color: var(--accent); }
.nav-lang:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── HERO ───────────────────────────────────────────────────── */
.hero {
  padding: 28px 0 72px;
  border-bottom: 1px solid var(--line);
}

/* Full-bleed plate (slideshow). Width-driven aspect ratio so the crop
   stays consistent across viewports (fixes odd mobile proportions). */
.hero-plate {
  position: relative;
  margin: 0 0 40px;
  width: 100%;
  aspect-ratio: 16 / 7;
  max-height: 620px;
  overflow: hidden;
  background: var(--bg-soft);
}
/* Banner off — the default. The admin "Show hero banner" switch (mep_content
   key hero.banner.visible) is the only thing that brings it back. */
.hero-plate.is-off { display: none; }
/* Hold the hero blank until we know whether DB banners exist — otherwise the
   static fallback slide paints first and visibly swaps ~1s later. main.js
   clears .is-pending as soon as the banner query resolves (or times out). */
.hero-plate.is-pending .hero-plate-slide.active,
.hero-plate.is-pending .hero-plate-cap { opacity: 0; }
.hero-plate-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}
.hero-plate-slide.active { opacity: 1; pointer-events: auto; }
.hero-plate-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-soft);
}
/* Video hero: fills the plate exactly like a slide image would */
.hero-plate-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  background: var(--bg-soft);
}
.hero-plate-dots {
  position: absolute;
  left: 24px; bottom: 12px;
  display: flex; gap: 6px;
  z-index: 3;
}
.hero-plate-dot {
  width: 28px; height: 2px;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  border: none; padding: 0;
  transition: background 0.3s;
}
.hero-plate-dot.active { background: #fff; }
.hero-plate-dot:hover { background: rgba(255,255,255,0.7); }
.hero-plate-dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.hero-plate-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0));
}
.hero-plate-cap span + span { text-align: right; }

/* Mobile hero: landscape frame matched to the banner photos + readable caption */
@media (max-width: 720px) {
  .hero-plate { aspect-ratio: 4 / 3; max-height: 72vh; margin-bottom: 28px; }
  .hero-plate-cap {
    flex-direction: column; align-items: flex-start; gap: 3px;
    padding: 10px 16px;
  }
  .hero-plate-cap span + span { text-align: left; }
  .hero-plate-dots { left: 16px; bottom: 8px; }
  .hero-plate-dot { height: 4px; }
  /* The reel is 16:9 — the 4:3 photo crop would cut its sides off. */
  .hero-plate[data-hero-video] { aspect-ratio: 16 / 9; max-height: none; }
}

/* Headline + description two-column block */
.hero-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: start;
}
.hero-body-right { min-width: 0; }
.hero-rule {
  height: 1px;
  background: var(--line);
  margin-bottom: 28px;
}
@media (max-width: 900px) {
  .hero-body { grid-template-columns: 1fr; gap: 32px; }
}
.hero-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 3.75vw, 62px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  padding: 0 0 36px;
}
.hero-headline em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}
.hero-sub-copy {
  font-size: clamp(17px, 1.4vw, 22px);
  line-height: 1.45;
  max-width: 62ch;
  color: var(--fg);
}
.hero-sub-copy strong { font-weight: 500; }
.hero-actions { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border: 1px solid var(--line-strong);
  color: var(--fg);
  font-size: 14px;
}
.btn-ghost:hover { border-color: var(--fg); }

/* ─── STATS ──────────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}
.stat { padding: 48px 32px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat-n {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-n sup {
  font-size: 0.4em;
  color: var(--accent);
  margin-left: 4px;
  vertical-align: top;
  font-family: var(--font-mono);
  font-weight: 400;
  top: 0.6em;
  position: relative;
}
.stat-l {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-top: 16px;
}
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--line); }
  .stat:nth-child(2) { border-right: none; }
}

/* ─── SECTION SHARED ─────────────────────────────────────────── */
.section { padding: 72px 0; border-bottom: 1px solid var(--line); }
.section-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding-bottom: 64px;
  align-items: end;
}
.section-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.section-index::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 10px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 4.5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}
/* Matches .hero-headline em — italic accent is the one emphasis treatment. */
.section-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}
@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; gap: 16px; }
  .section { padding: 80px 0; }
}

/* ─── SERVICES ───────────────────────────────────────────────── */
.services {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
}
.svc {
  padding: 40px 28px 32px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background .2s;
}
.svc:nth-child(5n) { border-right: none; }
.svc:hover { background: var(--bg-soft); }
.svc-n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
}
.svc-icon { width: 48px; height: 48px; margin: 20px 0 28px; color: var(--accent); }
/* Rendered as <h3> for document outline — reset the UA heading margins. */
.svc-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}
.svc-desc {
  font-size: 13px;
  color: var(--fg-mute);
  margin-top: 10px;
  line-height: 1.5;
}
@media (max-width: 1100px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  /* 2-col dividers: left column keeps its right border (overrides the 5-col :nth-child(5n) rule), right column drops it */
  .svc:nth-child(odd) { border-right: 1px solid var(--line); }
  .svc:nth-child(even) { border-right: none; }
}
@media (max-width: 600px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .svc { padding: 26px 16px; min-height: 200px; }
  .svc-icon { width: 38px; height: 38px; margin: 16px 0 20px; }
  .svc-title { font-size: 18px; }
}

/* ─── APPROACH ───────────────────────────────────────────────── */
.approach {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.step {
  padding: 40px 28px 80px;
  border-right: 1px solid var(--line);
}
.step:last-child { border-right: none; }
.step-n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.step-t {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  margin-top: 32px;
  letter-spacing: -0.02em;
}
.step-d {
  color: var(--fg-mute);
  font-size: 14px;
  margin-top: 14px;
  line-height: 1.55;
}
@media (max-width: 860px) {
  .approach { grid-template-columns: 1fr; }
  .step { border-right: none; border-bottom: 1px solid var(--line); padding-bottom: 40px; }
}

/* ─── PROJECTS ───────────────────────────────────────────────── */
.projects {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.project {
  border: 1px solid var(--line);
  background: var(--card);
  display: flex;
  flex-direction: column;
  transition: transform .2s, border-color .2s, box-shadow .4s ease;
}
.project:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06); }
.project-img {
  aspect-ratio: 3/4;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.project-body { padding: 16px 20px 18px; }
.project-kind {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
/* Rendered as <h3> for document outline — reset the UA heading margins. */
.project-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin: 10px 0 0;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.project-meta {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
}
.project-desc {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-mute);
}
.projects-cta {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}
.btn-all-projects {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 32px;
  border: 1px solid var(--fg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background .15s, color .15s;
}
.btn-all-projects:hover { background: var(--fg); color: var(--bg); }
@media (max-width: 960px) { .projects { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) {
  .projects { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .project-body { padding: 12px 14px 14px; }
  .project-name { font-size: 17px; }
  .project-kind { font-size: 9px; }
  .project-meta { margin-top: 10px; }
}

/* ─── ABOUT ──────────────────────────────────────────────────── */
.quote-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
}
@media (max-width: 860px) { .quote-row { grid-template-columns: 1fr; gap: 16px; } }
.quote {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 400;
  max-width: 22ch;
}
.quote em { font-style: italic; color: var(--accent); }
.quote-attr {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 40px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.quote-attr::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--accent);
}

/* ─── CONTACT ────────────────────────────────────────────────── */
.contact-block { border-top: 1px solid var(--line); padding-top: 18px; }
.contact-block-l {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 10px;
}
.contact-block-v { font-size: 18px; line-height: 1.4; }
.contact-block-v a:hover { color: var(--accent); }

/* ─── FOOTER ─────────────────────────────────────────────────── */
.foot { padding: 48px 0 32px; }
/* Contact details live in the footer (the standalone contact section was removed) */
.foot-contact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-bottom: 44px;
}
@media (max-width: 860px) { .foot-contact { grid-template-columns: repeat(2, 1fr); gap: 24px 28px; } }
@media (max-width: 520px) { .foot-contact { grid-template-columns: 1fr; } }
.foot-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
  gap: 24px;
  flex-wrap: wrap;
}
.foot-logo { height: 28px; }
.foot-bot {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.05em;
  flex-wrap: wrap;
  gap: 12px;
}

/* ─── FADE-IN ─────────────────────────────────────────────────── */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity .55s ease, transform .55s ease; }
.fade-in.visible { opacity: 1; transform: none; }

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

/* ─── ACCENT PASS ─────────────────────────────────────────────
   Brings the logo blue out of hover-only states and into the page's
   structural furniture: counters, eyebrows, labels, focus rings.
   Grouped here so the intensity is easy to dial up or down in one place. */

/* Brand-tinted text selection */
::selection { background: var(--accent); color: #fff; }

/* On-brand focus ring, replacing the browser default */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Section eyebrows — a more present leading rule */
.section-index::before { height: 2px; width: 40px; }

/* Service counters 01/10 … 10/10 — repeats the accent ten times down the grid */
.svc-n { color: var(--accent-ink); font-weight: 500; }
.svc:hover { background: var(--bg-soft); box-shadow: inset 0 2px 0 var(--accent); }

/* Footer contact labels */
.contact-block-l { color: var(--accent-ink); }

/* Links resolve to blue rather than black */
.nav-links a:hover { color: var(--accent); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Scrollbar matches the custom blue scroller declared in index.html */
html { scrollbar-color: rgba(41,147,209,0.55) transparent; }
::-webkit-scrollbar-thumb { background: rgba(41,147,209,0.45); }
::-webkit-scrollbar-thumb:hover { background: rgba(41,147,209,0.85); }
