/* ============================================================================
   MZ-112 — site design system (DESIGN.md)
   Cinematic-engineering editorial. Navy + paper + gold. Sharp 2px. Rhombus.
   ========================================================================== */

:root {
  /* Color (aligned to official logo) */
  --navy: #050a4b;
  --navy-deep: #03062e;
  --navy-soft: #161c5e;
  --paper: #eceae3;
  --paper-2: #e2dfd6;
  --gold: #d2a24c;
  --gold-bright: #e4b860;
  --on-navy: #eceae3;
  --on-navy-muted: rgba(236, 234, 227, 0.66);
  --on-paper: #050a4b;
  --on-paper-muted: rgba(5, 10, 75, 0.62);
  --hair-navy: rgba(236, 234, 227, 0.14);
  --hair-paper: rgba(5, 10, 75, 0.12);

  /* Semantic surface tokens — light by default; dark sections opt in via .on-dark */
  --text: var(--on-paper);
  --text-muted: var(--on-paper-muted);
  --accent-text: var(--on-paper); /* gold reads poorly on light → navy for label/number TEXT; flips to gold on dark */
  --hair: var(--hair-paper);
  --surface: #ffffff;
  --surface-hover: var(--paper-2);
  --card-shadow: 0 1px 2px rgba(5, 10, 75, 0.05), 0 10px 30px rgba(5, 10, 75, 0.07);

  /* Spacing (8px base) */
  --sp-2xs: 2px; --sp-xs: 4px; --sp-sm: 8px; --sp-md: 16px;
  --sp-lg: 24px; --sp-xl: 32px; --sp-2xl: 48px; --sp-3xl: 64px;
  --gutter: 32px;
  --maxw: 1240px;

  /* Type */
  --f-display: "Saira Condensed", system-ui, sans-serif;
  --f-body: "Onest", system-ui, sans-serif;
  --f-eyebrow: "Oswald", system-ui, sans-serif;
  --f-sub: "Manrope", system-ui, sans-serif;

  --radius: 2px;

  /* Motion */
  --t-fast: 120ms;
  --t-short: 200ms;
  --t-med: 360ms;
}

* { box-sizing: border-box; }

/* Keyboard focus ring — uses --accent-text so it is always high-contrast
   (navy on light surfaces, gold on navy ones). Mouse clicks stay ring-free. */
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: var(--radius); }
:focus:not(:focus-visible) { outline: none; }

/* Skip-to-content link — visible only when focused. */
.skip-link {
  position: absolute; left: var(--sp-md); top: -48px; z-index: 9000;
  background: var(--gold); color: var(--navy-deep); border-radius: var(--radius);
  font-family: var(--f-eyebrow); text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 13px; padding: 10px 16px; transition: top var(--t-short) ease;
}
.skip-link:focus { top: var(--sp-md); }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.005em;
  line-height: 1.02;
  margin: 0;
  text-transform: uppercase;
}
h1 { font-size: clamp(46px, 7.2vw, 98px); }
h2 { font-size: clamp(30px, 4.4vw, 46px); }
h3 { font-size: clamp(21px, 2.4vw, 23px); font-weight: 700; }

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

.eyebrow {
  font-family: var(--f-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 13px;
  color: var(--accent-text);
  margin: 0 0 var(--sp-md);
}

.section { padding: clamp(64px, 9vw, 110px) 0; color: var(--text); }
.section--navy { background: var(--navy); }
.section--deep { background: var(--navy-deep); }
.section--paper { background: var(--paper); }

/* Dark accent blocks: navy backgrounds keep light text/surfaces via token remap. */
.site-header,
.home-hero,
.cta-band,
.site-footer,
.lightbox,
.section--navy,
.section--deep {
  --text: var(--on-navy);
  --text-muted: var(--on-navy-muted);
  --accent-text: var(--gold);
  --hair: var(--hair-navy);
  --surface: var(--navy-soft);
  --surface-hover: var(--navy-soft);
  --card-shadow: none;
  color: var(--text);
}

/* ---------------------------------------------------------------- Rhombus -- */
.rhombus {
  width: 12px; height: 12px;
  background: var(--gold);
  border-radius: 2px;
  transform: rotate(45deg);
  display: inline-block;
}

/* ----------------------------------------------------------------- Logo ---- */
/* Strict lockup — every dimension is em-relative to the wordmark font-size.
   Scale ONLY by changing font-size on .lockup. Ratios per DESIGN.md. */
.lockup { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.lockup__tov {
  font-family: var(--f-eyebrow); font-weight: 500; text-transform: uppercase;
  font-size: 0.12037em; letter-spacing: 0.3em; margin-bottom: 0.12963em;
}
.lockup__bridge { width: 3.05556em; height: auto; }
.lockup__wm {
  font-family: var(--f-display); font-weight: 800;
  font-size: 1em; margin-top: 0.09259em; line-height: 0.82; letter-spacing: 0.005em;
}
.lockup__rule { width: 2.59259em; height: 0.01852em; margin-top: 0.07407em; background: currentColor; }
.lockup__sub {
  font-family: var(--f-sub); font-weight: 700; text-transform: uppercase;
  font-size: 0.09722em; margin-top: 0.09259em; letter-spacing: 0.18em; text-align: center;
}
/* Header variant: bridge + wordmark only */
.lockup--header { font-size: 24px; }
.lockup--header .lockup__tov,
.lockup--header .lockup__rule,
.lockup--header .lockup__sub { display: none; }
/* Footer variant: full lockup */
.lockup--full { font-size: 76px; }

/* --------------------------------------------------------------- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-sm);
  font-family: var(--f-eyebrow); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 14px; line-height: 1;
  padding: 15px 22px; min-height: 44px; justify-content: center;
  border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; transition: background var(--t-short) ease, color var(--t-short) ease,
    border-color var(--t-short) ease, transform var(--t-short) ease;
}
.btn--primary { background: var(--gold); color: var(--navy-deep); }
.btn--primary:hover { background: var(--gold-bright); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--hair); }
.btn--ghost:hover { border-color: var(--gold); color: var(--accent-text); }
.btn__arrow { transition: transform var(--t-short) ease; }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---------------------------------------------------------------- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 10, 75, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hair);
}
.site-header .nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-lg); min-height: 76px;
}
.brand { display: inline-flex; align-items: center; }
.nav__menu { display: flex; align-items: center; gap: var(--sp-xl); }
.nav__links {
  display: flex; align-items: center; gap: var(--sp-lg);
  list-style: none; margin: 0; padding: 0;
}
.nav__links a {
  font-family: var(--f-eyebrow); font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 13px; color: var(--text-muted);
  padding: 6px 0; transition: color var(--t-short) ease;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a.is-active { box-shadow: inset 0 -2px 0 var(--gold); }
.nav__toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--hair);
  border-radius: var(--radius); background: transparent; cursor: pointer; position: relative;
}
.nav__toggle span, .nav__toggle span::before, .nav__toggle span::after {
  position: absolute; width: 20px; height: 2px;
  background: var(--text); transition: transform var(--t-short) ease;
}
/* Middle bar sits at 12px; the pseudo bars are positioned relative to it, so
   they use left:0 (not 12px) to stay vertically aligned, not double-offset. */
.nav__toggle span { left: 12px; top: 21px; }
.nav__toggle span::before, .nav__toggle span::after { content: ""; left: 0; }
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after { top: 6px; }

/* Language switch (UA / EN). */
.lang-switch {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 36px; padding: 0 12px;
  font-family: var(--f-eyebrow); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 12px; color: var(--text-muted);
  border: 1px solid var(--hair); border-radius: var(--radius);
  transition: color var(--t-short) ease, border-color var(--t-short) ease;
}
.lang-switch:hover { color: var(--text); border-color: var(--text-muted); }

/* ----------------------------------------------------------------- Hero ---- */
.page-hero { position: relative; background: var(--paper); border-bottom: 1px solid var(--hair); overflow: hidden; }
.page-hero::after {
  /* faint rhombus field */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--hair) 1px, transparent 1px);
  background-size: 28px 28px; opacity: 0.5; pointer-events: none;
}
/* Vertical padding only — horizontal gutter comes from .container so the hero
   text keeps its side margins on mobile. */
.page-hero__inner { position: relative; z-index: 1; padding-top: clamp(72px, 11vw, 140px); padding-bottom: clamp(48px, 7vw, 84px); }
.page-hero .breadcrumbs {
  font-family: var(--f-eyebrow); text-transform: uppercase; letter-spacing: 0.2em;
  font-size: 12px; color: var(--text-muted); margin-bottom: var(--sp-lg);
}
.page-hero .breadcrumbs a:hover { color: var(--accent-text); text-decoration: underline; }
.page-hero h1 { max-width: 18ch; font-size: clamp(32px, 4.2vw, 54px); }
.page-hero .lede {
  max-width: 56ch; margin-top: var(--sp-lg); font-size: 19px; color: var(--text-muted);
}
/* Compact variant — shorter navy block + smaller headline (e.g. contact page). */
.page-hero--compact .page-hero__inner { padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(32px, 4.5vw, 48px); }
.page-hero--compact h1 { font-size: clamp(34px, 4.4vw, 56px); }
.hero-contact {
  display: inline-flex; align-items: center; gap: var(--sp-sm); margin-top: var(--sp-xl);
  font-family: var(--f-eyebrow); text-transform: uppercase; letter-spacing: 0.14em; font-size: 14px;
  color: var(--text);
}
.hero-contact b { color: var(--accent-text); letter-spacing: 0.04em; }
.hero-contact--inline { margin-left: var(--sp-lg); }
.grid--spaced { margin-top: var(--sp-2xl); }

/* ------------------------------------------------------------- Home hero --- */
.home-hero { position: relative; min-height: 90vh; display: flex; align-items: flex-end; overflow: hidden; }
.home-hero__bg { position: absolute; inset: 0; z-index: 0; }
.home-hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.home-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(110deg, rgba(3,6,46,0.94) 0%, rgba(3,6,46,0.72) 38%, rgba(3,6,46,0.25) 70%, rgba(3,6,46,0.5) 100%);
}
.home-hero__inner {
  position: relative; z-index: 2; max-width: none; margin: 0;
  padding: clamp(96px, 14vh, 180px) var(--gutter) clamp(56px, 8vh, 96px) clamp(24px, 5vw, 88px);
}
.home-hero h1 { max-width: 18ch; font-size: clamp(38px, 5.4vw, 72px); }
.home-hero .lede { max-width: 56ch; margin-top: var(--sp-lg); font-size: 19px; color: var(--text-muted); }
.home-hero__cta { display: flex; flex-wrap: wrap; gap: var(--sp-md); margin-top: var(--sp-2xl); }

/* ----------------------------------------------------------------- Stats --- */
.stats-band { padding: clamp(40px, 5vw, 56px) 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-xl); }
.stat__n { font-family: var(--f-display); font-weight: 800; font-size: clamp(34px, 4vw, 52px); color: var(--accent-text); line-height: 1; }
.stat__l { color: var(--text-muted); font-size: 15px; margin-top: var(--sp-sm); max-width: 22ch; }

/* -------------------------------------------------------------- Services --- */
.srows { margin-top: var(--sp-2xl); border-top: 1px solid var(--hair); }
.srow {
  display: flex; align-items: center; gap: var(--sp-lg);
  padding: var(--sp-lg) var(--sp-md); border-bottom: 1px solid var(--hair);
  color: var(--text); transition: background var(--t-short) ease, padding-left var(--t-short) ease;
}
.srow:hover { background: var(--surface-hover); padding-left: var(--sp-xl); }
.srow__n { font-family: var(--f-display); font-weight: 800; font-size: 22px; color: var(--accent-text); min-width: 2ch; }
.srow__body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.srow__t { font-family: var(--f-display); font-weight: 700; text-transform: uppercase; font-size: clamp(19px, 2vw, 24px); letter-spacing: -0.005em; }
.srow__d { color: var(--text-muted); font-size: 15px; }
.srow .btn__arrow { color: var(--accent-text); opacity: 0; transition: opacity var(--t-short) ease, transform var(--t-short) ease; }
.srow:hover .btn__arrow { opacity: 1; transform: translateX(4px); }

/* -------------------------------------------------------------- Projects --- */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-lg); margin-top: var(--sp-2xl); }
.project { display: block; color: var(--on-paper); }
.project__media { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--radius); background: var(--paper-2); }
.project__media .rhombus { position: absolute; top: 14px; left: 14px; z-index: 1; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.project__media img { width: 100%; height: 100%; object-fit: cover; object-position: left center; transition: transform var(--t-med) ease; }
.project:hover .project__media img { transform: scale(1.06); }
.project__meta { padding-top: var(--sp-md); }
.project__tag { font-family: var(--f-eyebrow); text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; color: var(--accent-text); }
.project__title { font-size: clamp(20px, 2.2vw, 24px); margin-top: 6px; color: var(--text); }
.project__loc { color: var(--text-muted); font-size: 15px; }

/* --------------------------------------------------------------- Filters --- */
.filterbar {
  position: sticky; top: 76px; z-index: 40;
  background: rgba(236, 234, 227, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hair);
}
.filters {
  display: flex; flex-wrap: wrap; gap: var(--sp-sm);
  padding-top: var(--sp-md); padding-bottom: var(--sp-md);
}
/* Mobile category dropdown (hidden on desktop, where chips are used instead).
   This is the primary filter control on phones, so it is large and tappable. */
.filter-select {
  display: none; width: 100%; margin: var(--sp-md) 0;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  color: var(--text); font-family: var(--f-eyebrow); text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 15px; font-weight: 600;
  padding: 16px 44px 16px 16px; min-height: 56px;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23050a4b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.filter {
  font-family: var(--f-eyebrow); font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 12px; color: var(--text-muted);
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 8px 16px; border: 1px solid var(--hair); border-radius: var(--radius);
  background: transparent; cursor: pointer; white-space: nowrap;
  transition: color var(--t-short) ease, border-color var(--t-short) ease, background var(--t-short) ease;
}
.filter:hover { color: var(--text); border-color: var(--text-muted); }
.filter.is-active { color: var(--navy-deep); background: var(--gold); border-color: var(--gold); }

/* ---------------------------------------------------------------- Catalog -- */
.catwrap { padding: clamp(48px, 7vw, 84px) 0 clamp(64px, 9vw, 110px); }
.cat { margin-top: var(--sp-3xl); }
.cat:first-child { margin-top: 0; }
.cat.is-hidden { display: none; }
.cat__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--sp-xs) var(--sp-md); margin-bottom: var(--sp-xl); }
.cat__head h2 { font-size: clamp(26px, 3.2vw, 34px); }
.cat__count { color: var(--text-muted); font-family: var(--f-body); font-size: 15px; }
.subcat { font-family: var(--f-eyebrow); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.18em; font-size: 13px; color: var(--accent-text);
  margin: var(--sp-2xl) 0 var(--sp-lg); }
.subcat:first-of-type { margin-top: 0; }

.grid {
  display: grid; gap: var(--sp-lg);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform var(--t-med) ease, border-color var(--t-med) ease, box-shadow var(--t-med) ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(210, 162, 76, 0.5); }
.card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-med) ease; }
.card:hover .card__media img { transform: scale(1.06); }
.card__media .rhombus { position: absolute; top: 12px; left: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.card__noimg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-family: var(--f-eyebrow); text-transform: uppercase;
  letter-spacing: 0.16em; font-size: 12px;
}
.card__body { display: flex; flex-direction: column; flex: 1; padding: var(--sp-lg); }
.card__name { font-family: var(--f-display); font-weight: 700; text-transform: uppercase;
  font-size: 20px; line-height: 1.05; letter-spacing: -0.005em; }
.card__desc { color: var(--text-muted); font-size: 15px; margin-top: var(--sp-sm); }
.card__specs { list-style: none; margin: var(--sp-md) 0 0; padding: 0; display: grid; gap: 4px; }
.card__specs li {
  position: relative; padding-left: 16px; font-size: 14px; color: var(--text);
}
.card__specs li::before {
  content: ""; position: absolute; left: 0; top: 8px; width: 5px; height: 5px;
  background: var(--gold); transform: rotate(45deg);
}
.card__cta {
  margin-top: auto; padding-top: var(--sp-lg);
  display: inline-flex; align-items: center; gap: var(--sp-sm);
  font-family: var(--f-eyebrow); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 13px; color: var(--accent-text);
}
.card__cta:hover { opacity: 0.7; }
.card__cta .btn__arrow { transition: transform var(--t-short) ease; }
.card:hover .card__cta .btn__arrow { transform: translateX(4px); }

/* ------------------------------------------------------------ How it works - */
.steps { display: grid; gap: var(--sp-md); grid-template-columns: repeat(3, 1fr); margin-top: var(--sp-2xl); }
.step { border-top: 1px solid var(--hair); padding-top: var(--sp-lg); }
.step__n { font-family: var(--f-display); font-weight: 800; font-size: 40px; color: var(--accent-text); line-height: 1; }
.step h3 { margin-top: var(--sp-md); }
.step p { margin: var(--sp-sm) 0 0; color: var(--text-muted); font-size: 16px; }

/* ------------------------------------------------------------------ CTA ---- */
.cta-band { background: var(--navy-deep); text-align: center; position: relative; }
.cta-band .rhombus { width: 18px; height: 18px; margin: 0 auto var(--sp-lg); }
.cta-band h2 { max-width: 18ch; margin: 0 auto; }
.cta-band .btn { margin-top: var(--sp-xl); }

/* ---------------------------------------------------------------- Footer --- */
.site-footer { background: var(--navy-deep); border-top: 1px solid var(--hair); padding: clamp(56px, 8vw, 88px) 0 var(--sp-2xl); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--sp-2xl); align-items: start; }
.footer-lockup { color: var(--text); }
.footer-col h4 { font-family: var(--f-eyebrow); text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 13px; color: var(--text-muted); margin: 0 0 var(--sp-md); font-weight: 600; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-sm); }
.footer-col a, .footer-col li { color: var(--text-muted); font-size: 15px; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { display: flex; justify-content: space-between; gap: var(--sp-md);
  margin-top: var(--sp-2xl); padding-top: var(--sp-lg); border-top: 1px solid var(--hair);
  color: var(--text-muted); font-size: 13px; }

/* ------------------------------------------------------ Product cards ----- */
.pcard {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--radius); padding: var(--sp-xl) var(--sp-lg) var(--sp-lg);
  box-shadow: var(--card-shadow);
  transition: transform var(--t-med) ease, border-color var(--t-med) ease, box-shadow var(--t-med) ease;
}
.pcard:hover { transform: translateY(-4px); border-color: rgba(210, 162, 76, 0.5); }
.pcard > .rhombus { position: absolute; top: var(--sp-lg); right: var(--sp-lg); }
.pcard .card__cta { margin-top: var(--sp-lg); }
.pcard .project__tag { margin-bottom: 8px; }
.pcard .card__meta { margin-top: auto; padding-top: var(--sp-md); color: var(--text-muted); font-size: 14px; }

/* Section lede + "see all" row (under a section heading) */
.section-lede { max-width: 64ch; margin-top: var(--sp-md); font-size: 18px; color: var(--text-muted); }
.section-more { margin-top: var(--sp-2xl); }

/* ---------------------------------------------------------------- Gallery -- */
.gallery-group { margin-top: var(--sp-3xl); }
.gallery-group:first-child { margin-top: 0; }
.gallery-group__head { display: flex; align-items: baseline; gap: var(--sp-md); margin-bottom: var(--sp-lg); }
.gallery-group__head h2 { font-size: clamp(24px, 3vw, 32px); }
.gallery-grid { display: grid; gap: var(--sp-sm); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gtile {
  position: relative; aspect-ratio: 4 / 3; padding: 0; border: 0; cursor: pointer;
  background: var(--paper-2); border-radius: var(--radius); overflow: hidden;
}
.gtile img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform var(--t-med) ease, opacity var(--t-short) ease; }
.gtile:hover img { transform: scale(1.06); opacity: 0.92; }

.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: rgba(3, 6, 46, 0.92); backdrop-filter: blur(8px);
}
.lightbox.is-open { display: flex; }
.lightbox__img { max-width: 90vw; max-height: 86vh; border-radius: var(--radius); box-shadow: 0 20px 80px rgba(0,0,0,.5); }
.lightbox__close, .lightbox__nav {
  position: absolute; background: rgba(236,234,227,0.1); color: var(--text);
  border: 1px solid var(--hair); border-radius: var(--radius); cursor: pointer;
  width: 48px; height: 48px; font-size: 28px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background var(--t-short) ease;
}
.lightbox__close:hover, .lightbox__nav:hover { background: var(--gold); color: var(--navy-deep); }
.lightbox__close { top: 24px; right: 24px; }
.lightbox__prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 24px; top: 50%; transform: translateY(-50%); }

/* --------------------------------------------------------------- Timeline -- */
.timeline { margin-top: var(--sp-2xl); border-left: 2px solid var(--hair); padding-left: var(--sp-xl); display: grid; gap: var(--sp-2xl); }
.tl-item { position: relative; }
.tl-item::before { content: ""; position: absolute; left: calc(-1 * var(--sp-xl) - 6px); top: 8px; width: 10px; height: 10px; background: var(--gold); transform: rotate(45deg); }
.tl-year { font-family: var(--f-display); font-weight: 800; font-size: 30px; color: var(--accent-text); line-height: 1; }
.tl-body h3 { margin-top: var(--sp-sm); }
.tl-body p { margin: 6px 0 0; color: var(--text-muted); font-size: 16px; max-width: 60ch; }

/* ------------------------------------------------------------ Facilities -- */
.facilities { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-md); margin-top: var(--sp-2xl); }
.facility { display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-lg); background: var(--paper-2); border-radius: var(--radius); font-weight: 600; }

/* -------------------------------------------------------------- Contacts -- */
.contact-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--sp-2xl); align-items: start; }
.contact-form { display: grid; gap: var(--sp-md); }
.field { display: grid; gap: 6px; }
.field span { font-family: var(--f-eyebrow); text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; color: var(--text-muted); }
.field input, .field select, .field textarea {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  color: var(--text); font-family: var(--f-body); font-size: 16px; padding: 12px 14px; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.contact-form .btn { justify-self: start; margin-top: var(--sp-sm); }
.form-note { color: var(--accent-text); font-size: 14px; margin: var(--sp-sm) 0 0; }
.contact-info { display: grid; gap: var(--sp-xl); padding: var(--sp-xl); background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.cinfo { display: grid; gap: 4px; }
.cinfo .eyebrow { margin: 0 0 4px; }
.cinfo__big { font-family: var(--f-display); font-weight: 800; font-size: 28px; color: var(--text); }
.cinfo__big:hover { color: var(--gold); }
.cinfo__sub { color: var(--text-muted); font-size: 14px; }
.cinfo__lk { color: var(--text); }
a.cinfo__lk:hover { color: var(--accent-text); text-decoration: underline; }

/* Team / department contact cards */
.people-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-md); margin-top: var(--sp-2xl);
}
.person {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: var(--sp-lg); box-shadow: var(--card-shadow);
}
.person__name { font-size: 18px; margin: 0; }
.person__role { color: var(--text-muted); font-size: 14px; margin: 2px 0 var(--sp-sm); }
.person__phone { font-family: var(--f-display); font-weight: 700; font-size: 18px; color: var(--text); }
.person__email { color: var(--accent-text); font-size: 14px; word-break: break-all; margin-top: 2px; }
.person__email:hover { text-decoration: underline; }

/* ----------------------------------------------------------------- Reveal -- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--t-med) ease, transform var(--t-med) ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ------------------------------------------------------------ Intro splash -- */
/* Full-screen animated-logo overlay shown once per visitor (gated in <head>).
   Dimensions/timings ported verbatim from logo/«МЗ-112 — анімація логотипа». */
.intro { display: none; }
html.intro-on { overflow: hidden; }
html.intro-on .intro {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy); cursor: pointer;
  transition: opacity 600ms ease;
}
.intro.is-done { opacity: 0; pointer-events: none; }
.intro__scaler { transform-origin: center center; }
.intro__logo { display: inline-flex; flex-direction: column; align-items: center; }
.intro__tov {
  font-family: var(--f-eyebrow); font-weight: 500; text-transform: uppercase;
  font-size: 14px; letter-spacing: 0.34em; color: #fff; margin-bottom: 18px; opacity: 0;
}
.intro__bridge-wrap { position: relative; width: 392px; height: auto; }
.intro__bridge-wrap img { display: block; width: 100%; height: auto; }
.intro__edge {
  position: absolute; top: -4%; left: 0; width: 3px; height: 108%;
  background: #fff; box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.7); opacity: 0;
}
.intro__wm {
  font-family: var(--f-display); font-weight: 800; font-size: 128px; line-height: 0.82;
  letter-spacing: 0.005em; color: #fff; margin-top: 12px; padding-right: 16px; margin-right: -16px;
}
.intro__rule {
  width: 312px; height: 2px; background: #fff; margin-top: 10px;
  transform: scaleX(0); transform-origin: left center;
}
.intro__sub {
  font-family: var(--f-sub); font-weight: 700; text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.2em; color: #aeb4c2; margin-top: 12px; text-align: center; opacity: 0;
}
/* Before the animation starts (fonts still loading), keep the bridge mark and
   wordmark hidden in the same clipped state the wipe begins from — otherwise the
   fully-assembled logo flashes for a moment, then resets and plays. */
html.intro-on .intro:not(.is-playing) .intro__bridge-wrap,
html.intro-on .intro:not(.is-playing) .intro__wm { clip-path: inset(0 100% 0 0); }
.intro.is-playing .intro__tov { animation: introFadeDown 0.7s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.intro.is-playing .intro__bridge-wrap { animation: introWipe 1.25s 0.4s cubic-bezier(0.76, 0, 0.24, 1) both; }
.intro.is-playing .intro__edge { animation: introEdge 1.25s 0.4s cubic-bezier(0.76, 0, 0.24, 1) both; }
.intro.is-playing .intro__wm { animation: introWipe 1s 1.45s cubic-bezier(0.76, 0, 0.24, 1) both; }
.intro.is-playing .intro__rule { animation: introDraw 0.55s 2.35s cubic-bezier(0.7, 0, 0.3, 1) both; }
.intro.is-playing .intro__sub { animation: introFadeUp 0.6s 2.7s ease both; }
@keyframes introWipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes introEdge {
  0% { opacity: 0; transform: translateX(0); }
  8% { opacity: 1; } 92% { opacity: 1; }
  100% { opacity: 0; transform: translateX(392px); }
}
@keyframes introDraw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes introFadeDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes introFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ------------------------------------------------------------- Responsive -- */
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: 1fr 1fr; }
  .facilities { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  /* Filter: one swipeable row instead of a tall wrapped block. */
  /* Mobile: replace the 18 category chips with a single dropdown. */
  .filterbar { position: static; }
  .filters { display: none; }
  .filter-select { display: block; }
  .nav__toggle { display: block; }
  .nav__menu {
    position: absolute; top: 76px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--navy-deep); border-bottom: 1px solid var(--hair);
    padding: var(--sp-md) var(--gutter) var(--sp-lg);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity var(--t-short) ease, transform var(--t-short) ease;
  }
  .nav__menu.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__links a { display: flex; align-items: center; min-height: 52px; padding: 0; font-size: 15px; border-bottom: 1px solid var(--hair); }
  .nav__links a.is-active { box-shadow: inset 3px 0 0 var(--gold); padding-left: var(--sp-sm); }
  .nav__menu .btn { margin-top: var(--sp-md); justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .projects { grid-template-columns: 1fr; }
  .home-hero { min-height: 76vh; }
  .cta-band .hero-contact { display: block; margin: var(--sp-lg) 0 0 !important; }
  .facilities { grid-template-columns: 1fr; }
  .lightbox__close, .lightbox__nav { width: 44px; height: 44px; font-size: 22px; }
  .lightbox__prev { left: 8px; } .lightbox__next { right: 8px; } .lightbox__close { top: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
