/* ==========================================================================
   ГК ПРОЕКТ — landing page
   Mobile-first. One breakpoint switches to the desktop layout: 900px.
   Spacing / fonts are deliberately rough: tune the tokens below.
   position:absolute is used only for decorative / overlay layers: hero photo,
   ribbon seams, image callouts, map pins + tooltips, review background photo.
   Everything else is flex / grid.
   ========================================================================== */

/* ---------- 0. TOKENS (palette from the Figma "Colors" page) ---------- */
:root {
  /* base */
  --c-black: #000;
  --c-white: #fff;
  --c-red: #ff3838;

  /* grey scale (names follow Figma: Grey/5 … Grey/1000) */
  --g-50: #f7f7f8;               /* page background */
  --g-100: #f3f3f3;              /* hover fill */
  --g-40: #a3a3a3;               /* disabled */
  --g-500: rgba(23, 23, 23, .6); /* placeholder / secondary text */
  --g-700: #232429;
  --g-800: #1c1d21;
  --g-900: #101016;
  --g-1000: #0d0b12;
  --border: rgba(23, 23, 23, .1);

  /* yellow */
  --y-500: #f2c230;
  --y-600: #ffc000;              /* pressed */

  /* semantic aliases used in the CSS below */
  --c-text: #171717;
  --c-ink: var(--g-1000);
  --c-ink-2: var(--g-700);
  --c-bg: var(--g-50);
  --c-yellow: var(--y-500);
  --c-yellow-press: var(--y-600);
  --c-disabled: var(--g-40);
  --c-hover: var(--g-100);
  --c-line: var(--border);

  --font-head: "Exo 2", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 1210px;
  --gutter: clamp(16px, 4.5vw, 65px);
  --section-y: clamp(48px, 7vw, 96px);
  --radius: 16px;
  --radius-sm: 10px;

  --header-h: 0px; /* height of the floating header (desktop only) */
}

@media (min-width: 900px) {
  :root { --header-h: 84px; }
}

/* ---------- self-hosted fonts ----------
   Files live in /fonts (a sibling of /css, /js, /img — see fonts/README.txt for the exact
   paths). Only the weights actually used on the page are declared: 400/500 for body text,
   500/700 for headings — .title etc. ask for weight 800, which browsers resolve to the
   nearest declared face (700) rather than synthesizing something heavier. */
@font-face {
  font-family: "Exo 2";
  src: url("../fonts/exo2/exo2_0_regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Exo 2";
  src: url("../fonts/exo2/exo2_0_medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Exo 2";
  src: url("../fonts/exo2/exo2_0_bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/openSans/OpenSans_SemiCondensed-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-stretch: semi-condensed;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/openSans/OpenSans_Condensed-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-stretch: condensed;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/openSans/OpenSans_Condensed-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-stretch: condensed;
  font-display: swap;
}

/* ---------- 1. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-white);
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, address { margin: 0; padding: 0; }
ul, ol { list-style: none; }
address { font-style: normal; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--c-yellow); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Utilities */
@media (max-width: 899.98px) { .only-desktop { display: none !important; } }
@media (min-width: 900px)    { .only-mobile  { display: none !important; } }

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

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--dark { background: var(--c-ink); color: var(--c-white); }

.accent { color: var(--c-yellow); }

.title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(24px, 3.2vw, 46px);
  line-height: 1.08;
  text-transform: uppercase;
  color: var(--c-ink);
}
.section--dark .title { color: var(--c-white); }

.icon { flex: none; }
.icon--flip { transform: scaleX(-1); }
.icon--arrow { width: 2.2em; height: .8em; }
.icon--check { width: 1.1em; height: .9em; color: var(--c-yellow); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .8em;
  padding: .95em 1.6em;
  border: 0;
  border-radius: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, box-shadow .15s, color .15s;
}
.btn--block { width: 100%; }

/* primary: default / hover (soft glow) / pressed / disabled */
.btn--primary { background: var(--c-yellow); color: var(--c-black); }
.btn--primary:hover,
.btn--primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(242, 194, 48, .35), 0 0 10px rgba(242, 194, 48, .7);
}
.btn--primary:active { background: var(--c-yellow-press); box-shadow: none; }
.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--c-disabled);
  color: var(--c-white);
  box-shadow: none;
  pointer-events: none;
  cursor: not-allowed;
}

/* text link with an arrow: default (inherits) / hover / pressed / disabled */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .9em;
  text-decoration: none;
  transition: color .15s;
}
.link-arrow:hover,
.link-arrow:focus-visible { color: var(--c-yellow); }
.link-arrow:active { color: var(--c-yellow-press); }
.link-arrow[aria-disabled="true"] { color: var(--c-disabled); pointer-events: none; }

/* slider arrows: default / hover / pressed.  --photo = variant for use on top of a photo */
.slider-btn {
  display: grid;
  place-items: center;
  width: 110px;
  height: 50px;
  border: 1px solid var(--c-ink);
  border-radius: 16px;
  background: var(--c-white);
  color: var(--c-ink);
  transition: background-color .15s, color .15s, border-color .15s;
}
.slider-btn:hover { background: var(--c-hover); }
.slider-btn:active { background: #e5e5e5; }
.slider-btn--photo {
  border-color: rgba(255, 255, 255, .85);
  background: rgba(35, 36, 41, .75);
  color: var(--c-white);
}
.slider-btn--photo:hover { background: var(--c-white); color: var(--c-ink); }
.slider-btn--photo:active { background: var(--c-hover); color: var(--c-ink); }

.chip {
  display: inline-block;
  padding: .6em 1em;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .1);
  font-size: .9em;
}
.chip--dark { background: var(--c-ink-2); color: var(--c-white); }

.tags { display: flex; flex-wrap: wrap; gap: .5em; }
.tags li {
  padding: .3em .8em;
  border-radius: 6px;
  background: var(--c-white);
  color: var(--c-ink);
  letter-spacing: .08em;
  font-size: .95em;
  transition: background-color .2s, color .2s;
}

/* Logo (an <img> from img/logo.svg, white) */
.logo { display: inline-flex; align-items: center; color: var(--c-white); text-decoration: none; font-size: 22px; }
.logo__img { display: block; height: 1.45em; width: auto; }
.logo--lg { font-size: clamp(20px, 2.4vw, 30px); }

/* ---------- 2. HEADER ---------- */
.header { position: sticky; top: 0; z-index: 50; background: var(--c-ink); }

.header__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-block: 12px;
}
.header__cta { display: none; }

.nav { order: 3; flex-basis: 100%; display: none; color: var(--c-white); }
.nav.is-open { display: block; }
.nav__list { display: grid; gap: 4px; padding-block: 8px 12px; }
.nav__list a {
  position: relative;
  display: inline-block;
  padding: 8px 0;
  text-decoration: none;
  transition: color .15s;
}
/* underline grows from the left on hover / current */
.nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width .25s ease;
}
.nav__list a:hover,
.nav__list a:focus-visible,
.nav__list a[aria-current] { color: var(--c-yellow); }
.nav__list a:hover::after,
.nav__list a:focus-visible::after,
.nav__list a[aria-current]::after { width: 100%; }
.nav__list a[aria-disabled="true"] { color: var(--c-disabled); pointer-events: none; }

.burger { display: grid; place-items: center; width: 44px; height: 44px; }
.burger__line,
.burger__line::before,
.burger__line::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-white);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.burger__line { position: relative; }
.burger__line::before, .burger__line::after { content: ""; position: absolute; left: 0; }
.burger__line::before { top: -7px; }
.burger__line::after  { top: 7px; }
.burger[aria-expanded="true"] .burger__line { background: transparent; }
.burger[aria-expanded="true"] .burger__line::before { top: 0; transform: rotate(45deg); }
.burger[aria-expanded="true"] .burger__line::after  { top: 0; transform: rotate(-45deg); }

@media (min-width: 900px) {
  .header { background: transparent; height: 0; overflow: visible; }
  .header__bar {
    flex-wrap: nowrap;
    height: 72px;
    margin-top: 6px;
    padding-inline: clamp(16px, 2vw, 28px);
    border-radius: 18px;
    background: rgba(24, 24, 28, .85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .header__cta { display: inline-flex; padding-block: .8em; }
  .nav { order: 0; flex-basis: auto; display: block; }
  .nav__list { display: flex; gap: clamp(20px, 3vw, 44px); padding: 0; }
  .nav__list a { padding: 0; }
  .nav__list a::after { bottom: -4px; }
  .burger { display: none; }
}

/* ---------- 3. HERO ---------- */
.hero {
  position: relative;
  isolation: isolate;
  background: var(--c-ink);
  color: var(--c-white);
  padding-block: clamp(40px, 9vw, 72px);
  text-align: center;
}

/* photo slideshow: on mobile it is a dimmed background, on desktop it sits on the right under the diagonal.
   Five images cross-fade in sequence; JS toggles .is-active every few seconds (see main.js). */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.hero__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero__slide.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero__slide { transition: none; }
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .86), rgba(0, 0, 0, .7));
}

.hero__content { display: grid; justify-items: center; gap: 24px; }

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .85em;
  max-width: 24em;
}

.hero__title {
  font-family: var(--font-head);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
  font-size: clamp(26px, 7vw, 58px);
}
.hero__title-accent { display: block; margin-top: .35em; font-size: .78em; }

.hero__lead { font-size: 1.15em; line-height: 1.6; }
.hero__lead .accent { display: block; }

.hero__chip { max-width: 22em; background: transparent; padding: 0; text-align: center; }

.hero__actions { display: grid; justify-items: center; gap: 24px; width: 100%; }

@media (max-width: 899.98px) {
  .hero__chip { padding-top: 140px; }
  .hero__eyebrow { padding-bottom: 64px; }
}

@media (min-width: 900px) {
  .hero {
    background: var(--c-white);
    padding-top: calc(var(--header-h) + clamp(32px, 4vw, 56px));
    padding-bottom: clamp(56px, 8vw, 120px);
    text-align: left;
  }
  .hero__media { inset: 0 0 0 auto; width: 62%; }
  .hero__slide { object-position: right center; }
  .hero__bg {
    background: linear-gradient(90deg, #000 0%, var(--c-ink) 100%);
    clip-path: polygon(0 0, 75.6% 0, 44.7% 100%, 0 100%);
  }
  .hero__content { justify-items: start; gap: clamp(16px, 2vw, 28px); max-width: 50vw; }
  .hero__eyebrow { max-width: none; }
  .hero__title { font-size: clamp(30px, 4vw, 58px); }
  .hero__lead .accent { display: inline; }
  .hero__chip { padding: .6em 1em; background: rgba(255, 255, 255, .1); text-align: left; }
  .hero__actions { justify-items: start; width: auto; padding-left: 1.2em; }
}

/* ---------- 4. STATS ---------- */
.stats { background: var(--c-white); padding-block: clamp(28px, 5vw, 56px); }

.stats__list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
.stat__value {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(22px, 2.6vw, 36px);
  line-height: 1.1;
  color: var(--c-ink);
}
.stat__label { margin-top: .6em; }

@media (min-width: 900px) {
  .stats { background: var(--c-bg); }
  .stats__list { grid-template-columns: repeat(4, 1fr); gap: 24px; }
}

/* ---------- 5. ADVANTAGES ---------- */
.advantages { background: var(--c-bg); }

.advantages__head { display: grid; gap: 16px; text-align: center; max-width: 60rem; margin-inline: auto; }
.advantages__lead { max-width: 52rem; margin-inline: auto; }

.advantages__grid { display: grid; gap: 12px; margin-top: clamp(24px, 4vw, 56px); }

.adv {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--g-700), var(--g-900));
  color: var(--c-white);
  font-size: .95em;
}
.adv__title {
  display: flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.35em;
  color: var(--c-yellow);
}
.adv__title::before { content: ""; width: .95em; height: .95em; border-radius: 50%; background: var(--c-yellow); }
/* mobile order differs from desktop */
.adv--scale   { order: 1; }
.adv--system  { order: 2; }
.adv--window  { order: 3; }
.adv--control { order: 4; }

@media (min-width: 900px) {
  /* the illustration + four callouts (overlay: absolute is justified) */
  .adv-scene { position: relative; margin-top: clamp(16px, 3vw, 40px); }
  .adv-scene__img { width: min(700px, 55%); height: auto; margin-inline: auto; }

  /* overlay grid: left stack (Системность, Единое окно) and right stack (Масштабируемость, Контроль).
     The cards flow inside their own column, so a longer text can never make them overlap. */
  .advantages__grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    gap: 12px 0;
    margin: 0;
    pointer-events: none;
  }
  .adv {
    align-content: start;
    gap: 8px;
    padding: 18px 20px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--g-700), var(--g-800));
    font-size: .95em;
    pointer-events: auto;
    order: 0;
  }
  .adv__title { color: var(--c-white); font-size: 1.3em; }
  .adv__title::before { display: none; }

  .adv--system  { grid-column: 1; grid-row: 1; justify-self: start; width: 69%; }
  .adv--window  { grid-column: 1; grid-row: 2; justify-self: start; width: 48%; }
  .adv--scale   { grid-column: 2; grid-row: 1; justify-self: end;   width: 55%; }
  .adv--control { grid-column: 2; grid-row: 2; justify-self: end;   width: 68%; }

  /* reveal: left pair first, then the right pair (class is added by JS on scroll) */
  .js .adv { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
  .js .adv-scene.is-in .adv--system,
  .js .adv-scene.is-in .adv--window,
  .js .adv-scene.is-in-2 .adv--scale,
  .js .adv-scene.is-in-2 .adv--control { opacity: 1; transform: none; }
}
@media (min-width: 900px) and (prefers-reduced-motion: reduce) {
  .js .adv { opacity: 1; transform: none; }
}

/* ---------- 6. ONE POINT OF RESPONSIBILITY ---------- */
.single__grid { display: grid; gap: 32px; grid-template-areas: "head" "media" "ribbon"; }
.single__head { grid-area: head; display: grid; gap: 16px; text-align: center; }
.single__media { grid-area: media; width: 100%; height: auto; max-height: 320px; object-fit: contain; }

/* the whole card — rounded top, small tabs at the two seams, pointed bottom — is one
   silhouette baked into img/ribbon-bg.svg (gradient included). It stretches to fill this
   box, so the three items below sit on top with no background, border or shape of their own. */
/* ribbon-bg.svg is 381x532: locking that ratio here means the box's height is always
   proportional to its width, so the percentage paddings below (which CSS always resolves
   against WIDTH, on every side, top/bottom included) end up as a correct, constant fraction
   of the shape at any size — instead of the fixed px clearance we had before, which had no
   relation to the box's actual (content-driven) height and let long copy run past the tip. */
.ribbon {
  grid-area: ribbon;
  display: grid;
  gap: 18px;
  aspect-ratio: 381 / 532;
  padding-bottom: 15%;   /* clears the pointed tip: it starts ~12.6% of the width up from the bottom */
  color: var(--c-black);
  background: url("../img/ribbon-bg.svg") center / 100% 100% no-repeat;
}
/* side padding clears the tabs baked into the shape (they protrude to ~9.4% of the card's
   width on each side); a flat 24px was narrower than that and let text run under them. */
.ribbon__item { display: grid; gap: 8px; padding: 18px clamp(28px, 10%, 40px) 0; }
.ribbon__title { font-family: var(--font-head); font-weight: 800; font-size: 1.15em; }

@media (min-width: 900px) {
  .single__grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 26rem);
    grid-template-areas: "head head" "media ribbon";
    gap: clamp(24px, 4vw, 56px);
  }
  .single__head { text-align: left; }
  .single__media { max-height: none; align-self: center; }
  .ribbon { align-self: end; }
}

/* ---------- 7. CASES (slider) ----------
   Mobile has no intro heading — the section is solid black end to end, holding only the
   case-1 "Решение" flow (see .case-feature below); the light heading + 4-case slider is
   desktop-only. */
.case { background: var(--c-ink); color: var(--c-white); }

.case__head { display: grid; gap: 16px; }
.case__head-text { display: grid; gap: 16px; }
.case__lead { max-width: 34rem; }

.cases { margin-top: clamp(20px, 3vw, 40px); }
.cases__track {
  --pad: var(--gutter);
  --slide-w: min(86vw, 330px);
  gap: 12px;
}

.case-slide {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
}
.case-slide--light { background: var(--c-white); color: var(--c-text); border: 1px solid var(--c-ink); }
.case-slide--dark  { background: var(--g-900); color: var(--c-white); }

/* mobile: the photo is a faded backdrop at the top of the card (overlay: absolute is justified) */
.case-slide__img {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: -1;
  width: 100%;
  height: 62%;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(180deg, #000 25%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 25%, transparent 100%);
}
.case-slide--light .case-slide__img { opacity: .35; }
.case-slide--dark  .case-slide__img { opacity: .55; }

.case-slide__body { display: grid; gap: 14px; align-content: start; padding: 16px; }
.case-slide__title { font-family: var(--font-head); font-weight: 800; font-size: 1.5em; line-height: 1.15; }
.case-slide__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.case-slide__tags li {
  padding: .35em .8em;
  border-radius: 8px;
  letter-spacing: .08em;
  font-size: .85em;
}
.case-slide--light .case-slide__tags li { background: var(--c-ink); color: var(--c-white); }
.case-slide--dark  .case-slide__tags li { background: var(--c-white); color: var(--c-ink); }

.case-slide__cols { display: grid; gap: 14px; }
.case-slide__label { font-family: var(--font-head); font-weight: 800; font-size: 1.25em; margin-bottom: .35em; }
.case-slide__label--accent { color: var(--c-yellow); }
.case-slide__list { display: grid; gap: .1em; margin-top: .2em; }
.case-slide__list li { position: relative; padding-left: 1.3em; }
.case-slide__list li::before { content: "•"; position: absolute; left: .4em; }

/* the first slide is mobile-only content (.case-feature) sitting directly on the section's
   black background, so on mobile it drops the white card look the other slides use */
.case-slide--feature { background: transparent; border: none; }

.case-feature { display: grid; }
.case-feature__title {
  margin-bottom: 24px;
  font-family: var(--font-head);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.15;
  font-size: clamp(22px, 7vw, 32px);
  color: var(--c-white);
}
.case-feature__card { display: grid; gap: 8px; padding: 18px 20px; border-radius: 16px; background: var(--c-white); color: var(--c-text); }
.case-feature__label { font-family: var(--font-head); font-weight: 800; font-size: 1.15em; }
.case-feature__circle {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .5em;
  width: min(80%, 300px);
  aspect-ratio: 1;
  margin: 8px auto;
  padding: 15%;
  border-radius: 50%;
  background: var(--c-yellow);
  color: var(--c-black);
  text-align: center;
}
.case-feature__chev { display: block; width: 42px; height: 16px; margin: 14px auto; color: var(--c-yellow); }
.case-feature > .btn { margin-top: 24px; }

@media (min-width: 900px) {
  .case { background: var(--c-bg); color: var(--c-text); }
  .case-slide--feature { background: var(--c-white); border: 1px solid var(--c-ink); }

  .case__head { grid-template-columns: 1fr auto; align-items: start; gap: 24px; }

  /* desktop: the track is exactly one container wide, so only the current case is visible */
  .cases__track {
    --pad: 0px;
    --slide-w: 100%;
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
    gap: 24px;
  }
  .case-slide { display: grid; grid-template-columns: 54.5% minmax(0, 1fr); border-radius: 20px; }
  .case-slide__img {
    position: static;
    z-index: auto;
    height: 100%;
    min-height: 320px;
    opacity: 1 !important;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .case-slide__body { gap: clamp(12px, 1.6vw, 20px); padding: clamp(20px, 3.5vw, 56px) clamp(20px, 3vw, 44px); align-content: center; }
  .case-slide__title { font-size: clamp(24px, 2.7vw, 38px); }
  .case-slide__tags li { font-size: .9em; }
  .case-slide__cols { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(16px, 2.5vw, 32px); }
  .case-slide__label { font-size: 1.35em; }
}

/* shared slider bits */
.slider__track {
  position: relative;
  display: flex;
  padding: 4px var(--pad, var(--gutter));
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pad, var(--gutter));
  scrollbar-width: none;
}
.slider__track::-webkit-scrollbar { display: none; }
.slider__track > * { flex: 0 0 var(--slide-w); scroll-snap-align: start; }

.slider__nav { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 16px; }
.slider__dots { display: flex; gap: 6px; }
.slider__dot { width: 40px; height: 4px; padding: 0; border-radius: 4px; background: #d5d5d5; transition: background-color .2s; }
.slider__dot.is-active { background: var(--c-yellow); }
.slider__arrows { display: flex; justify-content: center; gap: 12px; min-height: 50px; }

/* ---------- 8. SYSTEM VS CHAOS (desktop only) ---------- */
.chaos__head { display: grid; gap: 12px; text-align: center; max-width: 42rem; margin-inline: auto; }

.chaos__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 4vw, 64px);
  margin-top: clamp(24px, 4vw, 56px);
}
.chaos__bolt { width: clamp(40px, 6vw, 80px); aspect-ratio: 80 / 210; height: auto; color: var(--c-white); }

.panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 20px;
  min-height: clamp(320px, 34vw, 480px);
  padding: clamp(16px, 2.5vw, 32px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--g-700), #000 55%);
}
.panel--good { border-color: rgba(244, 196, 48, .7); }
/* picture at the top of the panel, fading into black */
.panel__img {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: -1;
  width: 100%;
  height: 62%;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
}
.panel__title { font-family: var(--font-head); font-weight: 800; font-size: 1.25em; }
.panel__logo { align-self: flex-start; height: clamp(28px, 3vw, 40px); }

.cause-list { display: grid; gap: 8px; }
.cause-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(48px, 7vw, 96px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.cause-list em { font-style: normal; color: var(--c-red); }
.cause-list .icon--arrow { width: 100%; height: .8em; }

.check-list { display: grid; gap: 14px; }
.check-list li { display: flex; align-items: center; gap: .8em; }

/* ---------- 9. ENGINEERING SYSTEMS ---------- */
.systems { background: var(--c-bg); }

.systems__grid  { display: flex; flex-direction: column; gap: 20px; }
.systems__intro { display: flex; flex-direction: column; gap: 16px; }
.systems__list  { display: grid; gap: 12px; }

.systems__notes { display: flex; flex-wrap: wrap; gap: 12px; }
.note {
  padding: .5em .9em;
  border: 1px solid var(--c-ink);
  border-radius: var(--radius-sm);
  font-size: .85em;
  line-height: 1.35;
}
.note--tag { display: grid; place-items: center; padding-inline: 2.4em; font-size: .95em; }

/* Card: dark by default; yellow gradient = open (mobile) / hover (desktop) */
.acc {
  border-radius: 10px;
  background: linear-gradient(135deg, #2b2c31, var(--c-ink-2));
  color: var(--c-white);
  transition: color .2s;
  position: relative;
  isolation: isolate;
}
/* the yellow layer fades in over the dark one (gradients can't be transitioned directly) */
.acc::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--y-500) 0%, #fff3d0 100%);
  opacity: 0;
  transition: opacity .25s;
}
.acc.is-open { color: var(--c-black); }
.acc.is-open::before { opacity: 1; }
.acc.is-open .tags li { background: var(--c-black); color: var(--c-white); }

.acc__head {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr auto;
  grid-template-areas: "num chev" "title chev";
  align-items: center;
  gap: 6px 16px;
  padding: 16px;
}
.acc__num   { grid-area: num; font-family: var(--font-head); font-weight: 800; font-size: 2em; line-height: 1; }
.acc__title { grid-area: title; font-family: var(--font-head); font-weight: 700; font-size: 1.1em; line-height: 1.25; }
.acc__chev  { grid-area: chev; width: 1.1em; height: .7em; transition: transform .2s; }
.acc.is-open .acc__chev { transform: rotate(180deg); }

.acc__panel { display: none; padding: 0 16px 16px; }
.acc.is-open .acc__panel { display: grid; gap: 12px; }

@media (min-width: 900px) {
  /* #services-pin-wrapper is made taller than #services itself (in JS, based on how much
     .systems__list needs to scroll) purely to give the sticky section real runway to be
     pinned against — see main.js §9. */
  #services-pin-wrapper { position: relative; }
  #services { position: sticky; top: var(--header-h); }

  .systems__grid {
    flex-direction: row;
    align-items: flex-start; /* .systems__intro keeps its own natural height, not stretched to match the list */
    column-gap: clamp(24px, 5vw, 72px);
  }
  .systems__intro {
    flex: 1 1 0;
    min-width: 0;
    gap: 20px;
  }
  .systems__cta { width: min(100%, 17rem); margin-top: clamp(24px, 6vw, 96px); }

  /* max-height is set inline by JS (main.js §9) to match .systems__intro's own natural
     height, so the list never ends up taller than the intro column and there's no leftover
     space either way. This calc() is just a same-viewport fallback until JS runs. */
  .systems__list {
    flex: 1 1 0;
    min-width: 0;
    gap: 10px;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .systems__list::-webkit-scrollbar { display: none; }

  /* desktop cards are always open; the yellow state is hover / focus only */
  .acc[data-always-open] { --num-w: clamp(56px, 6vw, 80px); }
  .acc[data-always-open].is-open { color: var(--c-white); }
  .acc[data-always-open].is-open::before { opacity: 0; }
  .acc[data-always-open].is-open .tags li { background: var(--c-white); color: var(--c-ink); }
  .acc[data-always-open].is-open:hover,
  .acc[data-always-open].is-open:focus-within { color: var(--c-black); }
  .acc[data-always-open].is-open:hover::before,
  .acc[data-always-open].is-open:focus-within::before { opacity: 1; }
  .acc[data-always-open].is-open:hover .tags li,
  .acc[data-always-open].is-open:focus-within .tags li { background: var(--c-black); color: var(--c-white); }

  .acc[data-always-open] .acc__head {
    grid-template-columns: var(--num-w) 1fr;
    grid-template-areas: "num title";
    column-gap: 16px;
    padding: 16px 20px 6px;
    cursor: default;
  }
  .acc[data-always-open] .acc__num { font-size: clamp(32px, 3.6vw, 48px); }
  .acc[data-always-open] .acc__title { font-size: clamp(16px, 1.5vw, 20px); align-self: start; }
  .acc[data-always-open] .acc__chev { display: none; }
  .acc[data-always-open] .acc__panel { display: grid; gap: 12px; padding: 0 20px 18px calc(var(--num-w) + 36px); font-size: .9em; }
}

/* ---------- 10. EXPERIENCE ---------- */
.experience { background: var(--c-ink); color: var(--c-white); }
.experience .title { color: var(--c-white); }   /* dark section on mobile */
.experience__head { display: grid; gap: 12px; text-align: center; }

/* mobile: grouped accordions (closed: dark, open: yellow) */
.groups { display: grid; gap: 12px; margin-top: 28px; }
.groups__title { font-family: var(--font-head); font-weight: 800; font-size: 1.4em; margin-top: 12px; }
.groups__list { display: grid; gap: 12px; }
.acc--mini { background: var(--c-ink-2); }
.acc--mini::before { background: var(--c-yellow); }
.acc--mini .acc__head { grid-template-columns: 1fr auto; grid-template-areas: "title chev"; padding: 18px 16px; }
.acc--mini .acc__title { font-size: .95em; }
.acc--mini .acc__panel { padding-top: 0; }

/* key/value rows: mobile accordions + map tooltip */
.facts { display: grid; gap: 12px; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; }
.facts dd { font-weight: 600; text-align: right; white-space: nowrap; }

@media (min-width: 900px) {
  .experience { background: var(--c-bg); color: var(--c-text); }
  .experience .title { color: var(--c-ink); }
  .experience__head { max-width: 60rem; margin-inline: auto; }
}

/* map: picture + pins (absolute is justified: markers sit over the picture) */
.geo { position: relative; max-width: 1112px; margin: clamp(24px, 4vw, 56px) auto 0; }
.geo__img { width: 100%; height: auto; }

.geo__pin {
  --size: clamp(24px, 3.5vw, 50px);
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  padding: 0;
  border: calc(var(--size) * .24) solid var(--c-yellow);   /* yellow ring, white centre */
  border-radius: 50%;
  background: var(--c-white);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: border-color .15s;
}
.geo__pin:hover,
.geo__pin:focus-visible,
.geo__pin.is-active { border-color: var(--c-ink-2); }   /* dark ring */

.geo__tip {
  --r: calc(clamp(24px, 3.5vw, 50px) / 2);
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 3;
  display: grid;
  gap: 12px;
  width: clamp(200px, 19vw, 273px);
  padding: clamp(12px, 1.3vw, 18px) clamp(14px, 1.4vw, 20px);
  border-radius: 8px;
  background: var(--c-ink-2);
  color: var(--c-white);
  font-size: clamp(12px, 1vw, 14px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
  pointer-events: none;
  transform: translate(calc(var(--r) * .7), -100%);      /* default: above-right */
}
.geo__tip[data-pos="tl"] { transform: translate(calc(-100% - var(--r) * .7), -100%); }
.geo__tip[data-pos="tc"] { transform: translate(-50%, calc(-100% - var(--r) * .9)); }
.geo__tip[data-pos="br"] { transform: translate(calc(var(--r) * .5), calc(var(--r) * .4)); }
.geo__tip[data-pos="bl"] { transform: translate(calc(-100% - var(--r) * .4), calc(var(--r) * .3)); }
.geo__tip-title { font-family: var(--font-body); font-weight: 600; font-size: 1.1em; line-height: 1.3; }
.geo__tip .facts { gap: 8px; }
.geo__tip .facts dt { font-weight: 400; }

/* ---------- 11. REVIEWS ---------- */
.reviews { position: relative; isolation: isolate; overflow-x: clip; background: var(--c-bg); padding-bottom: 0; }
.reviews__title { text-align: center; }

/* background photo, bottom-left, fading out (desktop only) */
.reviews__bg {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: -1;
  width: min(57%, 820px);
  height: auto;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 28%), linear-gradient(90deg, #000 60%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, transparent 0, #000 28%), linear-gradient(90deg, #000 60%, transparent 100%);
  mask-composite: intersect;
}

.quote-card {
  display: flex;
  flex-direction: column;
  gap: 1em;
  padding: clamp(16px, 2vw, 24px);
  border: 3px solid var(--c-yellow);
  border-radius: 18px;
  background: var(--c-white);
}
.quote-card__icon { width: 2em; height: 1.65em; color: var(--c-ink); }
.quote-card__text { line-height: 1.55; }
.quote-card__author { display: grid; gap: .3em; margin-top: auto; letter-spacing: .12em; font-size: .9em; }

.reviews__track { --pad: var(--gutter); --slide-w: min(86vw, 30rem); gap: 16px; margin-top: clamp(24px, 4vw, 40px); }
.reviews__wrap .slider__nav { padding-bottom: var(--section-y); }

@media (min-width: 900px) {
  /* desktop: a deck. All cards share one grid cell; data-o (offset from the active card) sets the transform. */
  .reviews__track {
    --card-w: min(38vw, 34rem);
    display: grid;
    width: var(--card-w);
    margin-inline: auto;
    padding: 4px 0;
    overflow: visible;
    scroll-snap-type: none;
  }
  .reviews__track > .quote-card {
    grid-area: 1 / 1;
    transform-origin: left center;
    transition: transform .45s ease, opacity .45s ease;
    opacity: 0;
    pointer-events: none;
  }
  .reviews__track > .quote-card[data-o="0"]  { opacity: 1; transform: none; pointer-events: auto; z-index: 5; }
  .reviews__track > .quote-card[data-o="1"]  { opacity: .55; transform: translateX(86%) scale(.74); z-index: 4; }
  .reviews__track > .quote-card[data-o="2"]  { opacity: .28; transform: translateX(160%) scale(.55); z-index: 3; }
  .reviews__track > .quote-card[data-o="-1"] { opacity: 0; transform: translateX(-30%) scale(.9); }
  .reviews__track > .quote-card[data-o="3"]  { opacity: 0; transform: translateX(200%) scale(.4); }

  .reviews__wrap .slider__nav { padding-top: 20px; }
}

/* ---------- 12. REQUEST FORM ---------- */
.lead { background: var(--c-bg); padding-top: 0; padding-bottom: 0; }
.lead__grid { display: grid; gap: 24px; grid-template-areas: "intro" "ceo" "form"; }
.lead__intro { grid-area: intro; display: grid; gap: 16px; align-content: start; }
.lead__intro .chip { justify-self: start; }

.lead__ceo { grid-area: ceo; display: grid; justify-items: center; }
.lead__photo { position: relative; z-index: 2; width: min(70%, 260px); height: auto; margin-bottom: -6px; }
.lead__quote { width: 100%; }

/* the header CTA anchors straight to the form (#request-form), so it needs its own scroll
   offset — landing flush at its top would tuck the first fields under the sticky header. */
#request-form { scroll-margin-top: 72px; }
@media (min-width: 900px) {
  #request-form { scroll-margin-top: calc(var(--header-h) + 20px); }
}

.form { grid-area: form; display: grid; gap: 16px; align-content: start; padding-bottom: var(--section-y); }
.field { display: grid; gap: 8px; align-content: start; min-width: 0; } /* without min-width:0, a grid item won't shrink below its content's natural width, so long selected text in .ms__value would stretch this column instead of truncating */
.field__label { font-weight: 600; }

/* text field states: default / hover / focus / focus+hover / error / disabled */
.field__control {
  --bc: #e6e6e6;
  width: 100%;
  min-height: 3em;
  padding: .7em 1em;
  border: 2px solid var(--bc);
  border-radius: 12px;
  background: var(--c-white);
  color: var(--c-text);
  transition: border-color .15s, background-color .15s;
}
.field__control::placeholder { color: var(--g-500); }
.field__control:hover { --bc: #9b9b9b; }
.field__control:focus,
.field__control:focus-visible,
.ms.is-open .field__control { --bc: #1f1f1f; outline: none; }
.field__control:focus:hover,
.ms.is-open .field__control:hover { background: var(--c-hover); }
.field.is-invalid .field__control { --bc: var(--c-red); }
.field.is-invalid .field__control:hover { background: var(--c-hover); }
.field__control:disabled { --bc: #e2e2e2; background: var(--c-hover); color: #c4c4c4; cursor: not-allowed; }

.field__control--select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.6em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 1.5 8 8l6.5-6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1em center;
  background-size: .9em;
}
.field__control--select:invalid { color: var(--g-500); }   /* placeholder option */

/* text input + clear (x) button */
.field__wrap { position: relative; }
.field__wrap .field__control { padding-right: 2.8em; }
.field__clear {
  position: absolute;
  right: 12px;
  top: 50%;
  display: none;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: #6b6b6b;
}
.field__clear:hover { color: var(--c-text); }
.field__clear .icon { width: 100%; height: 100%; }
.field__wrap.has-value .field__clear { display: block; }

.field__unit { position: relative; }
.field__unit .field__control { padding-right: 3.2em; }
.field__suffix { position: absolute; right: 1em; top: 50%; transform: translateY(-50%); pointer-events: none; }

.field__error { font-size: .85em; color: var(--c-red); }
.field__error:empty { display: none; }

/* multi-select with checkboxes */
.ms { position: relative; min-width: 0; }
.ms__trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; }
.ms__value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms__value[data-empty] { color: var(--g-500); }
.ms__chev { width: .9em; height: .6em; transition: transform .2s; }
.ms.is-open .ms__chev { transform: rotate(180deg); }   /* chevron down -> up */
.ms__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: grid;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 8px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--c-white);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}

/* checkbox: default / hover / checked / checked + hover */
.check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color .15s;
}
.check:hover { background: var(--c-hover); }
.check__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.check__box {
  display: grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid #d9d9d9;
  border-radius: 4px;
  background: var(--c-white);
  color: var(--c-white);
  transition: background-color .15s, border-color .15s;
}
.check__box .icon { width: 11px; height: 9px; opacity: 0; }
.check:hover .check__box { border-color: #9b9b9b; }
.check__input:checked + .check__box { background: #171717; border-color: #171717; }
.check__input:checked + .check__box .icon { opacity: 1; }
.check:hover .check__input:checked + .check__box { background: #2f2f2f; border-color: #2f2f2f; }
.check__input:focus-visible + .check__box { outline: 2px solid var(--c-yellow); outline-offset: 2px; }

.form__consent { text-align: center; font-size: .75em; line-height: 1.4; }
.form__status { padding: .8em 1em; border-radius: var(--radius-sm); background: var(--c-ink); color: var(--c-white); text-align: center; }

@media (min-width: 640px) {
  .form { grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .field--full { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .lead { padding-top: var(--section-y); }
  .lead__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    grid-template-areas: "intro form" "ceo form";
    column-gap: clamp(24px, 5vw, 72px);
    align-items: start;
  }
  /* portrait sits in front of the card (slightly overlapping its left edge) and touches the footer */
  .lead__ceo {
    --photo-w: clamp(180px, 22vw, 300px);
    --overlap: calc(var(--photo-w) * .09);
    align-self: end;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    margin-top: clamp(16px, 3vw, 40px);
  }
  .lead__photo { width: var(--photo-w); margin: 0; flex: none; }
  .lead__quote {
    width: min(100%, 20rem);
    margin: 0 0 clamp(24px, 4vw, 56px) calc(var(--overlap) * -1);
    padding-left: calc(var(--overlap) + clamp(16px, 2vw, 24px));   /* text starts right of the portrait */
  }
}

/* ---------- 13. FOOTER ---------- */
.footer { background: #050506; color: var(--c-white); padding-block: clamp(32px, 5vw, 56px); }

.footer__grid { display: grid; gap: 24px; }
.footer__brand { display: grid; gap: 16px; align-content: start; max-width: 34rem; }
.footer__brand p { line-height: 1.6; }

.footer__col { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; align-items: start; }
.footer__label { font-weight: 400; letter-spacing: .12em; }
.footer__values { display: grid; gap: 1.2em; }
.footer__values a { text-decoration: none; }

@media (min-width: 900px) {
  .footer__grid { grid-template-columns: minmax(0, 1.8fr) auto auto; gap: clamp(24px, 6vw, 96px); }
  .footer__col { grid-template-columns: 1fr; gap: 24px; }
}
