/* =========================================================================
   Kova — Studio Site Template
   Global stylesheet (framework-free: plain HTML + CSS + vanilla JS)
   Fonts: Manrope (headings + body) · JetBrains Mono (labels)
   Design rule: headings AND paragraphs use Manrope. --font-display is kept as a
   semantic alias for heading-scale type but now resolves to Manrope.

   CUSTOMIZE: brand colors and spacing live in :root below. Swap --accent and
   the --bg/--elevated greys to re-skin the whole site.
   ========================================================================= */

:root {
  --bg: #10322f;
  --bg-deep: #0b2624;
  --elevated: #0a1f1d;
  --elevated-hover: #0f2a27;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.06);
  --text: #ffffff;
  --muted: #c8d0c4;
  --muted-2: rgba(200, 208, 196, 0.62);
  --accent: #ac5e2a;
  --accent-bright: #c47a3e;
  /* Copper bright enough to clear WCAG AA 4.5:1 on the dark-green bg (4.67:1).
     Use for small / body-size copper TEXT (labels, units, the required *).
     Large accent fills and borders keep --accent. */
  --accent-text: #d4824a;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1560px;
  --nav-h: 92px;
  /* Native cursor by default. JS sets this to `none` (by adding
     .has-custom-cursor to <html>) only once the custom cursor is actually
     running, so if JS fails the OS cursor stays visible. (WCAG 2.4.7) */
  --cursor: auto;
  /* Distance from each viewport edge to the grid's vertical divider lines
     (grid inner width is min(95vw, --maxw), so the side gutter is this). */
  --grid-gutter: max(2.5vw, calc((100vw - var(--maxw)) / 2));
  --gutter: clamp(16px, 1.7vw, 30px);
  --font-display: "Manrope", system-ui, -apple-system, sans-serif;
  --font-ui: "Manrope", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ---------- Lenis smooth scroll ---------- */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: var(--cursor);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }
input, textarea { font-family: inherit; }
em { font-style: normal; }  /* design rule: no italics anywhere */

::selection { background: var(--accent); color: #08080a; }
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #26262c; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #34343c; }

/* ---------- Accessibility ---------- */
/* Skip link: the first thing a keyboard user reaches. Hidden off-screen until
   focused, then it drops into view so they can jump past the nav straight to
   the page content. (WCAG 2.4.1) */
.skip-link {
  position: fixed; top: 0; left: 0; z-index: 10001;
  transform: translateY(-130%);
  margin: 10px; padding: 12px 18px;
  background: var(--accent-bright); color: #08080a;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em;
  border-radius: 2px; text-decoration: none;
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); outline: 2px solid #fff; outline-offset: 2px; }

/* Visible keyboard focus ring for every interactive element that doesn't set
   its own. Shows only for keyboard users (:focus-visible), not on mouse click.
   (WCAG 2.4.7) */
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* ---------- Layout helpers ---------- */
.wrap {
  /* Span the same column as the grid-overlay vertical dividers
     (min(95vw, --maxw)), so the --gutter padding always sits INSIDE those
     lines. Without this, on viewports narrower than --maxw the content ran
     full-width with only --gutter (< --grid-gutter) and spilled past the
     dividers. Wide screens are unchanged: min() collapses to --maxw. */
  width: min(95vw, var(--maxw));
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: clamp(80px, 11vw, 150px) 0; }

/* ---------- Type helpers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .mark { color: var(--accent-text); }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.0;
  margin: 0;
}
.display em { font-style: normal; color: rgba(255, 255, 255, 0.58); }

/* ---------- Custom cursor ---------- */
/* JS adds this class to <html> once the custom cursor is live; only then do we
   hide the native cursor. No JS = native cursor stays. */
html.has-custom-cursor { --cursor: none; }
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0;
  z-index: 10000; pointer-events: none;
  opacity: 0;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent);
}
.cursor-ring {
  width: 34px; height: 34px;
  overflow: visible;
}
.cursor-ring rect {
  fill: none;
  stroke-width: 1;
}
.cursor-ring__base {
  stroke: rgba(255, 255, 255, 0.45);
}
.cursor-ring__draw {
  stroke: var(--accent);
  stroke-dasharray: 128;
  stroke-dashoffset: 128;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.5s ease;
}
.cursor-ring.is-hover .cursor-ring__draw {
  stroke-dashoffset: 0;
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 9000;
  background: var(--bg-deep);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(28px, 5vw, 56px);
}
.preloader__top { display: flex; align-items: center; gap: 13px; }
.preloader__name {
  font-size: 15px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
}
.preloader__bottom {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.preloader__meta {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted); line-height: 1.7;
}
.preloader__count { display: flex; align-items: baseline; gap: 6px; line-height: 0.9; }
.preloader__num {
  font-family: var(--font-display); font-size: clamp(64px, 13vw, 150px); letter-spacing: -0.02em;
}
.preloader__pct { font-family: var(--font-mono); font-size: 14px; color: var(--muted); }
.preloader__bar-track {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: rgba(255, 255, 255, 0.07);
}
.preloader__bar { height: 100%; width: 0%; background: var(--accent); transition: width 0.25s ease; }

/* Dot-matrix logo mark */
.dotmark {
  display: grid; grid-template-columns: repeat(3, 5px); grid-template-rows: repeat(3, 5px); gap: 3px;
}
.dotmark span { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); }
.dotmark span.on { background: var(--accent); }
.dotmark--sm { grid-template-columns: repeat(3, 4px); grid-template-rows: repeat(3, 4px); }
.dotmark--sm span { width: 4px; height: 4px; }
.preloader__top .dotmark span { animation: dotsPulse 1.4s ease-in-out infinite; }

/* ---------- Grid overlay ---------- */
.grid-overlay { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.grid-overlay__inner {
  position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(95vw, var(--maxw));
}
.grid-overlay__v { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-soft); }
.grid-overlay__v.left { left: 0; }
.grid-overlay__v.right { right: 0; }
.grid-overlay__h { position: absolute; left: -50vw; right: -50vw; top: 92px; height: 1px; background: rgba(255,255,255,0.05); }
.grid-overlay__node {
  position: absolute; top: 92px; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
}
.grid-overlay__node.left { left: 0; transform: translate(-50%, -50%); }
.grid-overlay__node.right { right: 0; transform: translate(50%, -50%); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 92px; display: flex; align-items: center;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(16,50,47,0.82), rgba(16,50,47,0));
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__logo { display: flex; align-items: center; gap: 12px; }
.nav__logo-text { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.nav__links { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 38px); }
.nav__link {
  position: relative; font-size: 14px; font-weight: 500;
  color: rgba(255, 255, 255, 0.78); padding: 6px 0;
  transition: color 0.3s ease;
}
.nav__link:hover { color: var(--text); }
.nav__link.active { color: var(--text); }
.nav__link.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--accent);
}
.nav__burger { display: none; }

/* "Book a call" button with a single employee avatar inside it that
   crossfades through the team (JS swaps .is-active on a timer). The avatar is
   a flex child of the .btn, so it reads as one unified button. */
.nav__avatar { position: relative; width: 22px; height: 22px; flex: none; border-radius: 50%; overflow: hidden; margin-left: -4px; background: var(--elevated); }
.nav__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.8s var(--ease); }
.nav__avatar img.is-active { opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14.5px; font-weight: 600; border-radius: 2px;
  padding: 15px 28px; cursor: var(--cursor); border: 1px solid transparent;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.btn .arr { font-size: 16px; }
.btn--solid { background: var(--accent); color: #fff; }
.btn--solid:hover { background: var(--accent-bright); transform: translateY(-2px); box-shadow: 0 16px 40px -16px rgba(172, 94, 42, 0.7); }
.btn--ghost { border-color: rgba(255, 255, 255, 0.16); color: var(--text); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.4); }
.btn--sm { padding: 10px 20px; font-size: 13.5px; background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.16); }
.btn--sm:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 120px 0 80px; overflow: hidden; }
.hero__svg { position: absolute; right: 0; top: 0; width: 62%; height: 100%; overflow: visible; opacity: 0.9; }
.hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; background-repeat: no-repeat; }
.hero__overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(16,50,47,0.92) 0%, rgba(16,50,47,0.72) 45%, rgba(16,50,47,0.45) 100%); }
.hero__content { position: relative; }
.hero__title { font-size: clamp(46px, 8vw, 116px); max-width: 16ch; }
.hero__title span { display: block; }
.hero__title em { color: var(--accent); }
.hero__sub { margin: 36px 0 0; max-width: 54ch; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.6; color: var(--muted); }
.hero__cta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 42px; }
.hero__scroll {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted-2); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
}
.hero__scroll .line { width: 1px; height: 30px; background: linear-gradient(180deg, rgba(255,255,255,0.5), transparent); animation: bob 2s ease-in-out infinite; }

/* ---------- Marquee ---------- */
/* ============================================================================
   MARQUEES — not used on any live page right now (removed from index & about).
   The full markup for all three (logo / model / team) is saved in
   marquees-archive.html; these styles are kept so that archive page renders and
   so a marquee can be pasted back into a page to restore it.
   ============================================================================ */
.marquee-band { position: relative; padding: 46px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: var(--bg); }
.marquee-band__label { margin-bottom: 26px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted-2); }
.marquee-viewport { overflow: hidden; }
.marquee { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee__group { display: flex; align-items: center; gap: 72px; padding-right: 72px; }
.marquee__group span { font-size: 22px; color: rgba(255, 255, 255, 0.5); white-space: nowrap; }
/* Model strip variant (home band): uniform words + copper separators */
.marquee--model .marquee__group { gap: clamp(26px, 3.4vw, 52px); padding-right: clamp(26px, 3.4vw, 52px); }
.marquee--model .marquee__group span { font-family: var(--font-display); font-weight: 500; font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -0.01em; color: var(--muted); }
.marquee--model .marquee__sep { color: var(--accent); font-weight: 400; }

/* ---------- Statement ---------- */
.statement__label { margin-bottom: 42px; }
.statement__text { max-width: 24ch; font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 4.4vw, 64px); line-height: 1.12; letter-spacing: -0.01em; margin: 0; }
.statement__text em { font-style: normal; color: rgba(255, 255, 255, 0.5); }
/* Scroll-driven glow sweep — words illuminate in reading order (JS sets per-word color/glow) */
.statement__text.is-sweep .word { color: rgba(255, 255, 255, 0.34); will-change: color, text-shadow; }
.statement__cta { margin-top: clamp(32px, 4vw, 48px); }
/* Mobile: the headline was bottoming out at ~30px, too small next to the button.
   Raise the floor so it stays the dominant element on phones. */
@media (max-width: 600px) { .statement__text { font-size: clamp(40px, 11vw, 56px); } }

/* ---------- Services ---------- */
.services__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 34px; margin-bottom: 48px; }
.services__head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 4vw, 52px); letter-spacing: -0.01em; }
.services__head p { margin: 0; font-size: 15px; color: var(--muted); max-width: 36ch; line-height: 1.55; }
.services__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
/* Industries section reuses the connect-item card markup; force 3 per row. */
#services .connect__grid { grid-template-columns: repeat(3, 1fr); }
/* Industries cards sit flush with the page background instead of the darker
   elevated teal; a subtle darken on hover keeps the interaction legible. */
#services .connect-item { background: var(--bg); }
#services .connect-item:hover { background: var(--bg-deep); }
/* KOVA signature accent: 4px copper line under the photo on each card. */
#services .connect-item__photo { border-bottom: 4px solid var(--accent); }
/* Tone the photos down so they sit calmer against the dark section. */
#services .connect-item__photo img { filter: brightness(0.8); transition: transform 0.7s var(--ease), filter 0.4s ease; }
#services .connect-item:hover .connect-item__photo img { filter: brightness(0.9); }
/* Industries cards: drop the "Sector · NN" label and tighten the text whitespace. */
#services .connect-item .service-card__idx { display: none; }
#services .connect-item__body { padding: clamp(18px, 1.5vw, 24px); }
#services .connect-item__body .service-card__top { margin-bottom: clamp(10px, 1vw, 16px); }
#services .connect-item__body h3 { margin-bottom: 8px; }
.service-card { display: flex; flex-direction: column; background: var(--elevated); padding: clamp(32px, 3.4vw, 52px); transition: background 0.4s ease; }
.service-card__photo { position: relative; margin-top: auto; padding-top: clamp(28px, 3vw, 40px); }
.service-card__photo span { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-deep); }
.service-card__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.service-card:hover .service-card__photo img { transform: scale(1.045); }
/* Photo tile that fills the empty grid space next to the last service card.
   Box stretches to the row height; the image is cropped (cover) to fill it. */
.service-photo { grid-column: span 2; position: relative; min-height: 240px; background: var(--elevated); overflow: hidden; }
.service-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 75%; display: block; }
@media (max-width: 939px) { .service-photo { grid-column: auto; min-height: 320px; } }
.service-card:hover { background: var(--elevated-hover); }
.service-card__top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 64px; }
.service-card__idx { font-family: var(--font-mono); font-size: 13px; color: var(--accent-text); letter-spacing: 0.1em; }
.service-card__arr { font-size: 22px; color: var(--muted-2); }
.service-card h3 { margin: 0 0 16px; font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -0.01em; }
.service-card p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--muted); max-width: 42ch; }

/* ---------- Join & Connect (image + text cards) ----------
   Each card is one link: image on top, text below, as a single unit. So they
   pair correctly at every width — 3-up on desktop, and on mobile they stack
   image-then-text per card (not all images first, then all text). */
.connect__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.connect-item { display: flex; flex-direction: column; background: var(--elevated); text-decoration: none; color: inherit; transition: background 0.4s ease; }
.connect-item:hover { background: var(--elevated-hover); }
.connect-item__photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-deep); }
.connect-item__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.connect-item:hover .connect-item__photo img { transform: scale(1.045); }
.connect-item__body { display: flex; flex-direction: column; flex: 1; padding: clamp(28px, 3vw, 44px); }
.connect-item__body .service-card__top { margin-bottom: clamp(24px, 3vw, 40px); }
.connect-item__body h3 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 400; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.01em; }
.connect-item__body p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.connect-item .service-card__arr { transition: transform 0.4s ease, color 0.4s ease; }
.connect-item:hover .service-card__arr { transform: translate(3px, -3px); color: var(--accent); }

/* Team page: section divider rules span the full viewport width instead of the
   content wrapper. Keep the original border for spacing but hide it, then draw a
   100vw line via a pseudo-element pinned where the border used to sit. */
.page-team .team__head,
.page-team .services__head,
.page-team .cta--split .inner { position: relative; border-top-color: transparent; }
.page-team .team__head::before,
.page-team .services__head::before,
.page-team .cta--split .inner::before {
  content: ""; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: 100vw; height: 1px; background: var(--line); pointer-events: none;
}

/* ---------- Image slot (placeholder) ---------- */
.image-slot {
  position: relative; width: 100%; background: var(--elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.image-slot::before {
  content: attr(data-placeholder);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted-2);
}
.image-slot--4x3 { aspect-ratio: 4 / 3; }
.image-slot--16x9 { aspect-ratio: 16 / 9; }
.image-slot--1x1 { aspect-ratio: 1 / 1; }
.image-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Image placeholder (TEMPLATE) ----------
   Drop <div class="ph" data-label="Image"></div> inside any fixed-ratio photo
   container (e.g. .team-card__photo, .connect-item__photo) to show a labeled
   placeholder. Replace the whole .ph div with <img src="..." alt="..."> when
   you have real assets — the surrounding container already crops to size. */
.ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--elevated); color: var(--muted-2);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.ph::after { content: attr(data-label); }

/* ---------- How we work — scroll-pinned full-bleed slider ----------
   .ss is a tall scroll track (one viewport of scroll per slide). Inside,
   .ss__stage pins to the top and fills the viewport while the JS maps scroll
   progress to the active slide. */
.ss { position: relative; height: 400vh; background: var(--bg-deep); }
.ss__stage {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

/* Stacked background images, crossfade + gentle zoom on the active one */
.ss__bgs { position: absolute; inset: 0; z-index: 0; }
.ss__bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.06); will-change: opacity, transform;
  transition: opacity 1s var(--ease), transform 1.4s var(--ease);
}
.ss__bg.is-active { opacity: 1; transform: scale(1.12); }

/* Teal gradient overlay — heaviest at bottom-left where the copy sits */
.ss__overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to top, rgba(6, 22, 20, 0.94) 0%, rgba(8, 28, 26, 0.55) 42%, rgba(16, 50, 47, 0.30) 100%),
    linear-gradient(to right, rgba(6, 22, 20, 0.86) 0%, rgba(6, 22, 20, 0.12) 58%, transparent 100%);
}

.ss__inner {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column;
  padding-top: clamp(110px, 15vh, 168px); padding-bottom: clamp(36px, 5vh, 60px);
}
.ss__eyebrow { margin-bottom: auto; }

/* Stacked text slides (occupy the same grid cell so the box sizes to the tallest) */
.ss__slides { display: grid; margin-bottom: clamp(36px, 5vh, 64px); }
.ss__slide {
  grid-area: 1 / 1; opacity: 0; visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
.ss__slide.is-active { opacity: 1; visibility: visible; }
.ss__slide > * { opacity: 0; transform: translateY(30px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.ss__slide.is-active > * { opacity: 1; transform: none; }
.ss__slide.is-active .ss__title { transition-delay: 0.06s; }
.ss__slide.is-active .ss__desc { transition-delay: 0.14s; }

.ss__index { display: flex; align-items: baseline; gap: 12px; margin-bottom: clamp(14px, 1.6vw, 22px); font-family: var(--font-mono); }
.ss__num { font-size: clamp(28px, 3.4vw, 44px); line-height: 1; color: var(--accent); letter-spacing: 0.02em; }
.ss__total { font-size: 14px; color: var(--muted-2); letter-spacing: 0.1em; }
.ss__title { margin: 0 0 clamp(14px, 1.6vw, 22px); font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 4vw, 52px); line-height: 1.05; letter-spacing: -0.01em; color: var(--text); }
.ss__desc { margin: 0; max-width: 54ch; font-size: 15px; line-height: 1.55; color: var(--muted); }

/* Right-side phase nav — vertical progress lines track scroll position within
   each slide. No labels: just the lines. */
.ss__nav {
  position: absolute; z-index: 2; top: 50%; right: var(--gutter);
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: clamp(12px, 1.6vh, 20px);
}
.ss__tab {
  appearance: none; background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
}
.ss__bar { position: relative; display: block; width: 2px; height: clamp(40px, 7vh, 70px); background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.ss__bar i { position: absolute; inset: 0; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform 0.12s linear; }

@media (max-width: 700px) {
  .ss__nav { right: 16px; gap: 10px; }
  .ss__bar { height: clamp(32px, 6vh, 56px); }
}

/* Tablet: keep the Industries grid two-up (was previously bundled with this section). */
@media (min-width: 620px) and (max-width: 1024px) {
  .services__grid, #services .connect__grid { grid-template-columns: repeat(2, 1fr); }
}
/* Mobile: keep the Industries grid two-up. minmax(0,1fr) lets both tracks shrink
   equally so neither column overflows (headings use non-breaking hyphens), which
   in turn keeps the fixed-ratio images the same size. Tighter padding + wrapping
   so the cramped two-up cards still fit. */
@media (max-width: 619px) {
  .services__grid, #services .connect__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #services .connect-item__body { padding: clamp(16px, 4vw, 24px); }
  #services .connect-item__body h3 { font-size: clamp(16px, 4.4vw, 20px); overflow-wrap: anywhere; }
  #services .connect-item__body p { font-size: 13px; }
}

/* ---------- References — horizontal project rail ----------
   Header sits in .wrap; the track scrolls horizontally within the framed
   column and is driven by arrows, drag, or wheel-over-the-rail. */
.refs__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 34px; margin-bottom: clamp(32px, 4vw, 56px); }
.refs__head h2 { margin: 14px 0 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 4vw, 52px); letter-spacing: -0.01em; }
.refs__head p { margin: 14px 0 0; font-size: 15px; color: var(--muted); max-width: 40ch; line-height: 1.55; }
.refs__controls { display: flex; gap: 12px; }
.refs__arrow {
  appearance: none; width: 52px; height: 52px; border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.03);
  color: var(--text); font-size: 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.refs__arrow:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.refs__arrow[disabled] { opacity: 0.28; pointer-events: none; }

/* The track shares the same centered content column as the section header
   (.wrap), so the first card's left edge lines up exactly with the title.
   scroll-padding-left keeps snapping aligned to that same edge. */
.refs__track {
  /* Match .wrap's column exactly so the first card lines up with the title. */
  width: min(95vw, var(--maxw)); max-width: var(--maxw); margin: 0 auto;
  display: flex; gap: clamp(8px, 0.7vw, 12px);
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding: 4px var(--gutter); scroll-padding-left: var(--gutter);
  -ms-overflow-style: none; scrollbar-width: none; cursor: grab;
}
.refs__track::-webkit-scrollbar { display: none; }
.refs__track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.refs__track.is-dragging .ref-card { pointer-events: none; }

/* Full-bleed photo cards in the horizontal rail: the image is the card
   background and the title/description sit over a bottom gradient. The first
   card is larger (hero) and widths vary down the rail. */
.ref-card {
  position: relative; display: block; overflow: hidden;
  flex: 0 0 clamp(260px, 24vw, 400px);
  height: clamp(420px, 48vw, 580px);
  scroll-snap-align: start; border: 1px solid var(--line);
  color: #fff; text-decoration: none;
}
.ref-card--md { flex-basis: clamp(320px, 32vw, 520px); }
.ref-card--lg { flex-basis: clamp(360px, 40vw, 660px); }
/* KOVA signature accent: a 4px copper line down the left edge of each card. */
.ref-card::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; background: var(--accent); z-index: 2; }
.ref-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.ref-card:hover .ref-card__img { transform: scale(1.05); }
.ref-card__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,20,18,0.9) 0%, rgba(8,20,18,0.45) 38%, rgba(8,20,18,0) 68%); }
.ref-card__arr { position: absolute; top: clamp(18px, 1.6vw, 26px); right: clamp(18px, 1.6vw, 26px); font-size: 22px; color: #fff; transition: transform 0.4s ease, color 0.4s ease; }
.ref-card:hover .ref-card__arr { transform: translate(3px, -3px); color: var(--accent); }
.ref-card__body { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(22px, 2vw, 34px); display: flex; flex-direction: column; gap: 5px; }
.ref-card__loc { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-text); }
.ref-card__body h3 { margin: 2px 0 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(20px, 2vw, 28px); letter-spacing: -0.01em; line-height: 1.1; color: #fff; }
.ref-card__meta { font-size: 13px; letter-spacing: 0.01em; color: rgba(255, 255, 255, 0.6); }
.ref-card__meta strong { font-weight: 500; color: rgba(255, 255, 255, 0.92); }

@media (max-width: 700px) {
  .ref-card, .ref-card--md, .ref-card--lg { flex-basis: 80vw; height: clamp(420px, 100vw, 540px); }
}

/* ---------- Why KOVA — image-backed reasons ----------
   Section header uses the same full-width top divider as the other section
   heads, so it "closes" the band and sits directly under References. Each
   reason is a full-width row: number + media (image or video) + text, with
   divider lines that close top and bottom. */
.why__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 34px; margin-bottom: clamp(28px, 3.5vw, 48px); }
.why__head h2 { margin: 14px 0 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 4vw, 52px); letter-spacing: -0.01em; }
.why__intro { margin: 14px 0 0; font-size: 15px; color: var(--muted); max-width: 42ch; line-height: 1.55; }
/* The Why KOVA and News heads sit inside .wrap (gutter-inset), so their plain
   border-top stops short of the grid-overlay vertical frame lines at
   min(95vw, maxw). Draw the divider as a centered pseudo-element spanning that
   same column so it closes neatly into the vertical lines. */
.why__head, .refs__head { position: relative; border-top-color: transparent; }
.why__head::before, .refs__head::before {
  content: ""; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: min(95vw, var(--maxw)); height: 1px; background: var(--line); pointer-events: none;
}
/* Bento: 6-col grid of varying-size tiles. The photo fills the whole tile
   (absolute) with a gradient scrim, and the text is overlaid at the bottom —
   so coverage is height-independent and single-row tiles aren't squashed. */
.why__grid { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: clamp(168px, 17vw, 224px); gap: clamp(10px, 1vw, 16px); }
.why-box { grid-column: span 2; grid-row: span 2; overflow: hidden; }
.why-box--feature { grid-column: span 4; grid-row: span 2; flex-direction: row; align-items: stretch; }
/* Feature card: image on the left (~half), text on the right, vertically centered. */
.why-box--feature .connect-item__photo { flex: 2 1 0; height: 100%; }
.why-box--feature .connect-item__body { flex: 1 1 0; display: flex; flex-direction: column; justify-content: center; }
.why-box--tall { grid-column: span 2; grid-row: span 2; }
/* Image fills the top of the card; the text sits in a solid block below it. */
.why-box .connect-item__photo { position: relative; flex: 1 1 auto; min-height: 0; aspect-ratio: auto; }
.why-box .connect-item__body { background: var(--elevated); padding: clamp(16px, 1.5vw, 24px); }
.why-box .connect-item__body .service-card__top { margin-bottom: clamp(10px, 1vw, 14px); }
.why-box .connect-item__body h3 { font-size: clamp(18px, 1.9vw, 23px); }
.why-box .connect-item__body p { font-size: 13.5px; line-height: 1.5; }
.why-box--feature .connect-item__body h3 { font-size: clamp(22px, 2.4vw, 30px); }
/* Text-only tile (image removed): center the copy in the solid block */
.why-box--plain .connect-item__body { justify-content: center; }

@media (max-width: 820px) {
  .why__grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: clamp(280px, 60vw, 340px); }
  .why-box, .why-box--feature, .why-box--tall { grid-column: span 1; grid-row: span 1; }
  .why-box--feature { flex-direction: column; }
  .why-box--feature .connect-item__photo { flex: 1 1 auto; height: auto; }
}

/* ---------- Stats ---------- */
.stats { padding: clamp(20px, 3vw, 40px) 0 clamp(70px, 9vw, 120px); border-bottom: 1px solid var(--line-soft); }
.stats__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 48px; }
/* KOVA signature accent: 4px copper line on the left of each stat. */
.stats__grid > * { border-left: 2px solid var(--accent); padding-left: clamp(16px, 1.4vw, 24px); }
/* Mobile: keep two stats per row instead of collapsing to one column. */
@media (max-width: 700px) { .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 36px 24px; } }
.stat__value { display: flex; align-items: baseline; gap: 2px; font-family: var(--font-display); font-size: clamp(48px, 6vw, 82px); line-height: 0.9; letter-spacing: -0.02em; }
.stat__value .plus { font-size: clamp(28px, 3.4vw, 46px); color: var(--accent); }
.stat__value .pct { color: var(--accent); }
.stat__value .unit { font-size: clamp(18px, 2.2vw, 28px); color: var(--accent-text); align-self: center; margin-left: 8px; letter-spacing: 0.02em; }
.stat__label { margin-top: 14px; font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: 0.02em; }
.stat__desc { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); max-width: 34ch; }

/* ---------- CTA ---------- */
.cta { text-align: center; }
/* CTA with a full-bleed photo background + dark overlay for legibility */
/* TEMPLATE: image-free CTA background. To use a photo, add it to the
   background-image stack, e.g.
   background-image: linear-gradient(rgba(6,6,8,.7), rgba(6,6,8,.82)), url("../Photos/your-image.jpg"); */
.cta--photo {
  position: relative;
  background-image: linear-gradient(rgba(11, 38, 36, 0.7), rgba(11, 38, 36, 0.82)), radial-gradient(120% 140% at 70% 0%, rgba(172,94,42,0.16), transparent 60%), url("../Photos/kova-1.webp");
  background-color: var(--bg-deep);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.cta h2 { margin: 0 auto; max-width: 18ch; font-family: var(--font-display); font-weight: 400; font-size: clamp(38px, 6.4vw, 92px); line-height: 1.03; letter-spacing: -0.015em; }
.cta h2 em { font-style: normal; color: rgba(255, 255, 255, 0.55); }
.cta p { margin: 20px auto 0; max-width: 52ch; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.6; color: var(--muted); }
.cta__btns { margin-top: 38px; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.cta--split { text-align: left; }
.cta--split .inner { border-top: 1px solid var(--line); padding-top: clamp(50px, 7vw, 90px); display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta--split h2 { margin: 0; max-width: 14ch; font-size: clamp(34px, 5.4vw, 76px); line-height: 1.02; }

/* ---------- About ---------- */
.page-hero { padding: clamp(150px, 18vw, 230px) 0 clamp(60px, 8vw, 100px); }
.page-hero .eyebrow { margin-bottom: 32px; }
.page-hero h1 { font-size: clamp(40px, 6.6vw, 98px); max-width: 18ch; }
.page-hero h1 span { display: block; }
/* Larger about-hero headline on phones. The global clamp pins it at 40px below ~600px;
   bump it to fill the width while keeping the three editorial lines intact. Ceiling is set
   by the widest line ("wastes nothing." ≈ 7.13em) so it never overflows: ~43px @360w → ~53px @430w. */
@media (max-width: 600px) { .page-hero--about h1 { font-size: clamp(42px, 11.5vw, 52px); } }
.about-story { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(40px, 6vw, 90px); align-items: start; }
.about-story__lead { margin: 0 0 26px; font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 32px); line-height: 1.3; color: rgba(255, 255, 255, 0.92); }
.about-story__lead em { font-style: normal; }
.about-story p { margin: 0 0 22px; font-size: 16px; line-height: 1.7; color: var(--muted); }
.about-story p:last-child { margin-bottom: 0; }

/* ---------- Legal / policy pages ---------- */
.legal { max-width: 780px; }
.legal__updated { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 36px; }
.legal__lead { font-family: var(--font-display); font-size: clamp(19px, 2.2vw, 25px); line-height: 1.5; color: rgba(255, 255, 255, 0.9); margin: 0 0 16px; }
.legal h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(21px, 2.8vw, 29px); letter-spacing: -0.01em; line-height: 1.2; margin: 52px 0 16px; color: var(--text); }
.legal h3 { font-size: 17px; font-weight: 600; margin: 28px 0 10px; color: rgba(255, 255, 255, 0.9); }
.legal p, .legal li { font-size: 16px; line-height: 1.75; color: var(--muted); }
.legal p { margin: 0 0 18px; }
.legal ul { margin: 0 0 18px; padding-left: 22px; display: flex; flex-direction: column; gap: 9px; }
.legal li::marker { color: var(--muted-2); }
.legal a { color: var(--accent-bright); transition: color 0.3s ease; }
.legal a:hover { color: var(--text); }
.legal strong { color: rgba(255, 255, 255, 0.92); font-weight: 600; }
.values { border-top: 1px solid var(--line-soft); }
.values h2 { margin: 0 0 56px; font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 3.6vw, 46px); letter-spacing: -0.01em; }
.values__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
/* Photo-paired variant (Careers "Why work at 1040"): fixed 3 columns so the
   image + text pairs stay aligned, collapsing to 2 then 1 on smaller screens. */
.values__grid--media { grid-template-columns: repeat(3, 1fr); }
.value-pair { display: flex; flex-direction: column; background: var(--line); gap: 1px; }
.value-pair__photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--elevated); }
.value-pair__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.value-pair .value { flex: 1; }
@media (max-width: 900px) {
  .values__grid--media { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .values__grid--media { grid-template-columns: 1fr; }
}
.value { background: var(--elevated); padding: clamp(28px, 2.8vw, 40px); }
.value__key { font-family: var(--font-mono); font-size: 12px; color: var(--accent-text); margin-bottom: 30px; }
.value h4 { margin: 0 0 10px; font-size: 20px; font-weight: 600; }
.value p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.locations__label { margin-bottom: 48px; }
.locations__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 32px; }
.location__meta { margin-top: 24px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.location h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 3vw, 38px); }
.location__country { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--muted-2); }
.location p { margin: 14px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }

/* ---------- Careers: open positions list ---------- */
.roles { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.role { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: clamp(24px, 2.8vw, 36px); background: var(--elevated); text-decoration: none; color: inherit; transition: background 0.4s ease; }
.role:hover { background: var(--elevated-hover); }
.role__main { max-width: 60ch; }
.role__title { margin: 0 0 8px; font-family: var(--font-display); font-weight: 400; font-size: clamp(22px, 2.6vw, 32px); letter-spacing: -0.01em; }
.role__desc { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.role__meta { display: flex; align-items: center; gap: clamp(16px, 2vw, 32px); flex-shrink: 0; }
.role__tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.role__tags span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }
.role__arr { font-size: 22px; color: var(--muted-2); }
@media (max-width: 720px) {
  .role { flex-direction: column; align-items: flex-start; gap: 16px; }
  .role__meta { width: 100%; justify-content: space-between; }
  .role__tags { justify-content: flex-start; }
}

/* ---------- Team ---------- */
.team__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 34px; margin-bottom: 48px; }
.team__head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 4vw, 52px); letter-spacing: -0.01em; }
.team__head p { margin: 0; font-size: 15px; color: var(--muted); max-width: 38ch; line-height: 1.55; }
.team__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); max-width: 1500px; margin: 0 auto; }
/* Mobile: keep two employee cards per row. minmax(0,1fr) keeps both tracks equal
   and within the viewport; tighter meta padding/text for the cramped two-up. */
@media (max-width: 619px) {
  .team__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-card__meta { padding: clamp(14px, 4vw, 20px); }
  .team-card__name { font-size: clamp(16px, 4.4vw, 20px); overflow-wrap: anywhere; }
}
/* Photo fills its area edge-to-edge; the name, role and links sit below on the
   card's solid background. */
.team-card { position: relative; overflow: hidden; background: var(--elevated); transition: background 0.4s ease; }
.team-card:hover { background: var(--elevated-hover); }
.team-card__top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; justify-content: flex-end; padding: 16px 18px; }
.team-card__idx { display: none; }
.team-card__arr { font-size: 20px; color: #fff; transition: transform 0.4s var(--ease), color 0.4s ease; }
.team-card:hover .team-card__arr { color: var(--accent); transform: translate(3px, -3px); }
.team-card__photo { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg-deep); }
.team-card__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 18%; transition: transform 0.7s var(--ease); }
.team-card:hover .team-card__photo img { transform: scale(1.045); }
.team-card__meta { padding: clamp(20px, 1.8vw, 28px); }
.team-card__name { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(20px, 1.8vw, 25px); letter-spacing: -0.01em; color: var(--text); }
.team-card__role { display: block; margin-top: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-text); }
.team-card__links { display: flex; gap: 10px; margin-top: 18px; }
.team-card__link { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); cursor: var(--cursor); transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease; }
.team-card__link:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.team-card__link svg { width: 16px; height: 16px; display: block; fill: currentColor; }

/* Whole card reads as clickable: the name is a real <button> whose stretched
   ::after covers the entire card, so a click anywhere opens the profile while
   the button gives keyboard focus, Enter/Space activation, and a screen-reader
   "button" role for free. The LinkedIn link sits above it (z-index) so it stays
   independently clickable. */
.team-card { position: relative; }
.team-card__open {
  appearance: none; -webkit-appearance: none;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; letter-spacing: inherit; text-align: left;
  cursor: var(--cursor);
}
.team-card__open::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.team-card__links { position: relative; z-index: 2; }
.team-card__open:focus-visible::after { outline: 2px solid var(--accent-bright); outline-offset: -2px; }

/* ---------- Team grid "dimmed" state ----------
   While a profile drawer is open, every card recedes: a solid teal cover rises
   from the bottom of each photo to fully hide it, a diagonal divider line then
   draws in, and the name/role fade to a muted teal so all attention shifts to
   the open profile. The cover + line live on every card (not just .is-dim) so
   they have a resting state to animate from. Reverts on close. */
.team-card__photo::after {            /* solid teal cover — rises bottom → top */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(160deg, #0e3d38 0%, #0a201e 100%);
  transform: scaleY(0); transform-origin: bottom center;
  transition: transform 0.9s var(--ease);
  pointer-events: none;
}
.team-card__photo::before {           /* diagonal divider line — fades in after */
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(135deg, transparent calc(50% - 0.6px), rgba(200, 208, 196, 0.34) 50%, transparent calc(50% + 0.6px));
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: none;
}
.team__grid.is-dim .team-card__photo::after  { transform: scaleY(1); }
.team__grid.is-dim .team-card__photo::before { opacity: 1; transition-delay: 0.62s; }
.team__grid.is-dim .team-card__arr  { opacity: 0; }
.team__grid.is-dim .team-card__name { color: rgba(150, 184, 175, 0.55); }
.team__grid.is-dim .team-card__role { color: rgba(150, 184, 175, 0.4); }
/* No hover affordances while a profile is open — only when fully reset */
.team__grid.is-dim .team-card:hover { background: var(--elevated); }
.team__grid.is-dim .team-card:hover .team-card__photo img { transform: none; }
.team__grid.is-dim .team-card:hover .team-card__arr { color: #fff; transform: none; }
.team-card__name, .team-card__role { transition: color 0.8s var(--ease); }
.team-card__arr { transition: transform 0.4s var(--ease), color 0.4s ease, opacity 0.5s ease; }

/* ---------- Team profile drawer ----------
   Slides in from the right, anchored to the grid's right vertical divider. It
   covers the navbar on its side with a blank teal strip that carries the same
   horizontal divider; the photo is a small thumbnail tucked in the top-right
   corner between that divider and the right vertical divider, while the left
   column reads Profile → name → role → description. The page keeps scrolling
   behind it. Populated from the clicked card by initTeamDrawer() in main.js. */
.team-drawer { position: fixed; inset: 0; z-index: 120; visibility: hidden; pointer-events: none;
  /* Stay visible through the slower slide-out so the close mirrors the open */
  transition: visibility 0s linear 2s; }
.team-drawer.is-open { visibility: visible; transition: visibility 0s; }

.team-drawer__panel {
  /* --drawer-cw is the readable content zone (left of the right divider);
     the panel itself runs --grid-gutter wider so it reaches the page edge. */
  --drawer-cw: min(460px, calc(100vw - 2 * var(--grid-gutter)));
  --drawer-photo: clamp(118px, 13vw, 148px);
  position: absolute; top: 0; right: 0;
  height: 100vh;
  width: calc(var(--drawer-cw) + var(--grid-gutter));
  background: var(--bg); /* match the site background */
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.45);
  transform: translateX(calc(100% + 4px));
  transition: transform 2s var(--ease); /* slower slide-out on close */
  display: flex; flex-direction: column;
  pointer-events: auto;
}
.team-drawer.is-open .team-drawer__panel { transform: translateX(0); transition: transform 0.95s var(--ease); }

/* The right vertical divider stays at its grid position (--grid-gutter in from
   the page edge); the strip carries the horizontal nav divider. The strip of
   blank teal to the right of this line is the panel reaching the page edge. */
.team-drawer__panel::after {
  content: ""; position: absolute; top: 0; bottom: 0;
  right: var(--grid-gutter); width: 1px; background: var(--line);
  z-index: 4; pointer-events: none;
}

/* Blank teal strip over the navbar; its bottom edge continues the nav divider */
.team-drawer__strip {
  flex: none; height: var(--nav-h); position: relative;
  border-bottom: 1px solid var(--line);
}
.team-drawer__close {
  position: absolute; top: 50%; right: calc(var(--grid-gutter) + 18px); transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(16, 50, 47, 0.55); border: 1px solid var(--line);
  color: #fff; cursor: var(--cursor);
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}
.team-drawer__close:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-50%) rotate(90deg); }
.team-drawer__close svg { width: 18px; height: 18px; fill: currentColor; }

/* Small photo pinned to the top-right corner — flush under the horizontal
   divider and against the right vertical divider. */
.team-drawer__photo {
  position: absolute; top: var(--nav-h); right: var(--grid-gutter); z-index: 3;
  width: var(--drawer-photo); height: var(--drawer-photo);
  overflow: hidden; background: var(--bg-deep);
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.team-drawer__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }

/* Left column: Profile → name → role → description. No scroll; sized to fit. */
.team-drawer__content { flex: 1 1 auto; overflow: hidden; padding-bottom: clamp(26px, 3vw, 36px); }
.team-drawer__head {
  padding: clamp(24px, 2.8vw, 32px) calc(var(--drawer-photo) + clamp(18px, 2.4vw, 26px)) 0 clamp(26px, 3vw, 38px);
  min-height: var(--drawer-photo); /* keeps the description below the photo */
}
.team-drawer__eyebrow {
  display: block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-2);
}
.team-drawer__name { margin: clamp(16px, 1.8vw, 22px) 0 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 2.6vw, 31px); letter-spacing: -0.015em; color: var(--text); line-height: 1.12; }
.team-drawer__role { display: block; margin-top: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-text); }
.team-drawer__bio { margin: clamp(20px, 2.4vw, 28px) 0 0; padding: 0 calc(var(--grid-gutter) + clamp(26px, 3vw, 38px)) 0 clamp(26px, 3vw, 38px); font-size: 15.5px; line-height: 1.7; color: var(--muted); }
.team-drawer__links { display: flex; gap: 10px; margin-top: clamp(22px, 2.6vw, 30px); padding: 0 calc(var(--grid-gutter) + clamp(26px, 3vw, 38px)) 0 clamp(26px, 3vw, 38px); }
.team-drawer__links .team-card__link { width: 42px; height: 42px; }

/* Staggered content reveal: the panel slides in blank first, then the photo
   reveals, then Profile/name/role/bio/links rise in one after another. Matches
   the site's reveal language (opacity + upward translate on --ease). On close
   the base rule (no delay) applies, so content clears with the panel. */
.team-drawer__photo, .team-drawer__eyebrow, .team-drawer__name,
.team-drawer__role, .team-drawer__bio, .team-drawer__links {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.team-drawer__panel.is-revealing .team-drawer__photo   { opacity: 1; transform: none; transition-delay: 0.72s; }
.team-drawer__panel.is-revealing .team-drawer__eyebrow { opacity: 1; transform: none; transition-delay: 0.88s; }
.team-drawer__panel.is-revealing .team-drawer__name    { opacity: 1; transform: none; transition-delay: 1.00s; }
.team-drawer__panel.is-revealing .team-drawer__role    { opacity: 1; transform: none; transition-delay: 1.12s; }
.team-drawer__panel.is-revealing .team-drawer__bio     { opacity: 1; transform: none; transition-delay: 1.26s; }
.team-drawer__panel.is-revealing .team-drawer__links   { opacity: 1; transform: none; transition-delay: 1.40s; }
/* Used for one frame on open to snap content back to hidden without a visible
   transition, so the reveal can replay from scratch on every open. */
.team-drawer__panel.is-resetting .team-drawer__photo,
.team-drawer__panel.is-resetting .team-drawer__eyebrow,
.team-drawer__panel.is-resetting .team-drawer__name,
.team-drawer__panel.is-resetting .team-drawer__role,
.team-drawer__panel.is-resetting .team-drawer__bio,
.team-drawer__panel.is-resetting .team-drawer__links { transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .team-drawer,
  .team-card__photo::after, .team-card__photo::before,
  .team-drawer__panel,
  .team-drawer__photo, .team-drawer__eyebrow, .team-drawer__name,
  .team-drawer__role, .team-drawer__bio, .team-drawer__links { transition-duration: 0.001s; transition-delay: 0s; }
}

/* ---------- Contact ---------- */
.contact-hero h1 { font-size: clamp(46px, 8vw, 118px); margin: 0 0 clamp(50px, 7vw, 90px); }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(40px, 6vw, 80px); align-items: start; }
.contact-info__lead { margin: 0 0 44px; font-size: 17px; line-height: 1.65; color: var(--muted); max-width: 40ch; }
.contact-info__rows { display: flex; flex-direction: column; gap: 30px; }
.contact-info__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 8px; }
.contact-info__email { font-size: 18px; font-weight: 500; border-bottom: 1px solid rgba(255, 255, 255, 0.2); padding-bottom: 2px; transition: border-color 0.3s ease; }
.contact-info__email:hover { border-color: var(--accent); }
.contact-info__offices { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 30px; }
.contact-info__offices p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.contact-info__offices .dim { color: var(--muted-2); }

.form { border: 1px solid rgba(255, 255, 255, 0.1); background: var(--elevated); padding: clamp(30px, 3.4vw, 48px); display: flex; flex-direction: column; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 9px; }
.field label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.field label .req { color: var(--accent-text); }
.field input, .field textarea {
  background: transparent; border: none; border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text); font-size: 16px; padding: 8px 0; outline: none; cursor: text;
  transition: border-color 0.3s ease;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
/* Validation error state (required fields left empty) */
.field--invalid input, .field--invalid textarea { border-bottom-color: #e0623f; }
.field__error { display: none; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: #e0623f; }
.field--invalid .field__error { display: block; }
.form__error { margin: 4px 0 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: #e0623f; }
.form .btn { align-self: flex-start; margin-top: 6px; }
.form__success {
  border: 1px solid rgba(255, 255, 255, 0.12); background: var(--elevated);
  padding: clamp(36px, 4vw, 56px); display: none; flex-direction: column; align-items: flex-start;
  gap: 18px; min-height: 340px; justify-content: center;
}
.form__success.show { display: flex; }
.form.hide { display: none; }
.form__success-check { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--accent); display: flex; align-items: center; justify-content: center; color: var(--accent-text); font-size: 20px; }
.form__success h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 3vw, 38px); }
.form__success p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); max-width: 38ch; }

/* ---------- Footer ---------- */
.footer { position: relative; z-index: 3; border-top: 1px solid var(--line); padding: clamp(70px, 8vw, 110px) 0 40px; background: var(--bg-deep); }
.footer__grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: clamp(48px, 6vw, 90px); margin-bottom: clamp(50px, 7vw, 90px); }
.footer__brand { flex: 1 1 300px; max-width: 420px; }
.footer__cols { display: flex; flex-wrap: wrap; gap: clamp(40px, 5vw, 80px); }
.footer__cols > div { min-width: 140px; }
.footer__brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.footer__brand-row .nav__logo-text { font-size: 16px; }
.footer__tag { margin: 0; font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; color: rgba(255, 255, 255, 0.85); max-width: 20ch; }
.footer__col-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 20px; }
.footer__col-links { display: flex; flex-direction: column; gap: 13px; font-size: 14.5px; }
.footer__col-links a, .footer__col-links span { color: var(--muted); transition: color 0.3s ease; }
.footer__col-links a:hover { color: var(--text); }
.footer__bottom { border-top: 1px solid var(--line-soft); padding-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted-2); }
.footer__legal { display: flex; gap: 22px; flex-wrap: wrap; }
.footer__legal a { color: var(--muted-2); transition: color 0.3s ease; }
.footer__legal a:hover { color: var(--text); }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.is-visible { opacity: 1; transform: none; transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.enter { opacity: 0; transform: translateY(30px); }
.enter.is-in { opacity: 1; transform: none; transition: opacity 1.1s var(--ease), transform 1.2s var(--ease); }

/* ---------- Keyframes ---------- */
@keyframes dotsPulse { 0% { opacity: 0.25; } 50% { opacity: 1; } 100% { opacity: 0.25; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes bob { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(8px); opacity: 1; } }

.hero__svg line.l1 { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 2.4s var(--ease) 0.4s forwards; }
.hero__svg line.l2 { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.6s var(--ease) 1.6s forwards; }

/* Electric pulse travelling along the hero line (total path length ~1080u) */
.hero__pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 90 990;
  stroke-dashoffset: 1080;
  filter: drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 9px var(--accent));
  animation: heroPulse 3.6s linear 2.4s infinite;
  will-change: stroke-dashoffset;
}
/* A thinner, brighter spark that leads the pulse and crackles */
.hero__pulse--spark {
  stroke: var(--accent-bright);
  stroke-width: 1;
  stroke-dasharray: 22 1058;
  filter: drop-shadow(0 0 4px var(--accent-bright)) drop-shadow(0 0 14px var(--accent));
  animation: heroPulse 3.6s linear 2.1s infinite, heroFlicker 0.22s steps(2, end) infinite;
}
@keyframes heroPulse { from { stroke-dashoffset: 1080; } to { stroke-dashoffset: 0; } }
@keyframes heroFlicker { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav__links { position: fixed; inset: 92px 0 auto 0; flex-direction: column; align-items: flex-start;
    gap: 4px; padding: 18px var(--gutter) 28px; background: rgba(11,38,36,0.96); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line); transform: translateY(-130%); transition: transform 0.45s var(--ease);
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links .nav__link { font-size: 22px; font-family: var(--font-display); padding: 10px 0; }
  .nav__links .btn { margin-top: 12px; }
  .nav__burger { display: flex; flex-direction: column; gap: 5px; background: none; border: none; cursor: var(--cursor); padding: 8px; }
  .nav__burger span { width: 24px; height: 1.5px; background: var(--text); transition: transform 0.3s ease, opacity 0.3s ease; }
  .nav__burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav__burger.open span:nth-child(2) { opacity: 0; }
  .nav__burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

@media (hover: none) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none !important; }
  input, textarea, .field input, .field textarea { cursor: text; }
  .btn, button, a { cursor: pointer; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .enter { opacity: 1 !important; transform: none !important; }
  .hero__svg line, .marquee { animation: none !important; }
  .hero__pulse { animation: none !important; stroke-dasharray: none; stroke-dashoffset: 0; opacity: 0.4; }
  .hero__pulse--spark { display: none; }
  .ss__bg { transition: opacity 0.3s linear !important; }
  .ss__bg.is-active { transform: none !important; }
  .ss__slide > * { transition: none !important; }
}
