/* ============================================================
   ЕГЦ BRICS — Design System
   ============================================================ */

/* Typed custom properties so they substitute & update reliably
   inside transform (un-typed vars can fail to refresh the matrix). */
@property --rx { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --ry { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --lift { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --reveal-y { syntax: "<length>"; inherits: false; initial-value: 34px; }
@property --mx { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
@property --my { syntax: "<percentage>"; inherits: false; initial-value: 50%; }

:root {
  /* Color — core */
  --navy-900: #08182E;
  --navy-800: #0B1F3A;
  --navy-700: #13294A;
  --navy-600: #1C3556;
  --ivory:    #F7F5F0;
  --ivory-2:  #EFEBE1;
  --paper:    #FCFBF8;
  --slate:    #64748B;
  --slate-2:  #8A97A8;
  --ink:      #16202E;

  /* Accent — copper / bronze */
  --copper:    #C17F3A;
  --copper-2:  #D69A56;
  --copper-soft: rgba(193,127,58,0.12);

  /* Lines */
  --line:        rgba(11,31,58,0.10);
  --line-strong: rgba(11,31,58,0.18);
  --line-light:  rgba(247,245,240,0.14);

  /* Type */
  --display: "Cormorant Garamond", Georgia, serif;
  --ui: "Manrope", system-ui, -apple-system, sans-serif;

  /* Spacing scale */
  --container: 1280px;
  --gutter: clamp(20px, 5vw, 64px);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(8,24,46,0.06), 0 2px 8px rgba(8,24,46,0.05);
  --shadow-md: 0 8px 28px rgba(8,24,46,0.10), 0 2px 8px rgba(8,24,46,0.06);
  --shadow-lg: 0 24px 60px rgba(8,24,46,0.16), 0 8px 20px rgba(8,24,46,0.08);
  --shadow-navy: 0 30px 70px rgba(8,24,46,0.45);

  --radius: 4px;
  --radius-lg: 8px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--ui);
  background: var(--ivory);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--copper); color: var(--ivory); }

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

.section { padding-block: clamp(72px, 9vw, 140px); }
.section--tight { padding-block: clamp(56px, 7vw, 100px); }

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--copper);
  display: inline-block;
}
.eyebrow--center::after {
  content: "";
  width: 28px; height: 1px;
  background: var(--copper);
  display: inline-block;
}

h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -0.01em; line-height: 1.05; margin: 0; }

.h-display {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(42px, 6.2vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.h-section {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 4.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.01em;
}
.lede {
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.55;
  color: var(--slate);
  font-weight: 400;
  max-width: 56ch;
  text-wrap: pretty;
}
.text-copper { color: var(--copper); }
.serif-em { font-family: var(--display); font-style: italic; font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: var(--radius);
  font-family: var(--ui);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), background .3s, color .3s, border-color .3s, box-shadow .3s;
  will-change: transform;
}
.btn > * { position: relative; z-index: 1; }
.btn svg { width: 17px; height: 17px; transition: transform .35s cubic-bezier(.2,.7,.2,1); position: relative; z-index: 1; }
.btn:hover svg { transform: translateX(4px); }
/* shine sweep on hover */
.btn--primary::after {
  content: ""; position: absolute; top: 0; left: 0; width: 60%; height: 100%; z-index: 0;
  background: linear-gradient(100deg, transparent, rgba(247,245,240,0.45), transparent);
  transform: translateX(-180%) skewX(-18deg); pointer-events: none;
}
.btn--primary:hover::after { transition: transform .85s cubic-bezier(.2,.7,.2,1); transform: translateX(320%) skewX(-18deg); }

.btn--primary {
  background: var(--copper);
  color: var(--ivory);
  box-shadow: 0 8px 24px rgba(193,127,58,0.28);
}
.btn--primary:hover { background: var(--copper-2); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(193,127,58,0.34); }

.btn--ghost {
  background: transparent;
  color: var(--navy-800);
  border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--navy-800); transform: translateY(-2px); }

.btn--ghost-light {
  background: transparent;
  color: var(--ivory);
  border-color: var(--line-light);
}
.btn--ghost-light:hover { border-color: rgba(247,245,240,0.5); background: rgba(247,245,240,0.06); transform: translateY(-2px); }

.btn--lg { padding: 18px 34px; font-size: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background .4s, box-shadow .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(247,245,240,0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(8,24,46,0.02);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.brand { display: flex; align-items: center; gap: 13px; color: var(--ivory); transition: color .4s; }
.is-scrolled .brand { color: var(--navy-800); }
.brand__mark { width: 38px; height: 38px; flex: none; }
.brand__name { font-family: var(--display); font-size: 21px; font-weight: 600; line-height: 1; letter-spacing: 0.01em; }
.brand__sub { font-family: var(--ui); font-size: 10.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--copper); line-height: 1; margin-top: 4px; }

.nav__links { display: flex; align-items: center; gap: 34px; }
.nav__link {
  font-size: 14.5px; font-weight: 500;
  color: rgba(247,245,240,0.82);
  transition: color .25s;
  position: relative;
}
.is-scrolled .nav__link { color: var(--slate); }
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 1.5px; background: var(--copper); transition: width .3s;
}
.nav__link:hover { color: var(--copper); }
.is-scrolled .nav__link:hover { color: var(--navy-800); }
.nav__link:hover::after { width: 100%; }

.nav__right { display: flex; align-items: center; gap: 20px; }
.nav__phone { font-size: 14.5px; font-weight: 600; color: var(--ivory); transition: color .4s; white-space: nowrap; }
.is-scrolled .nav__phone { color: var(--navy-800); }
.nav__phone:hover { color: var(--copper); }

.nav__toggle { display: none; background: none; border: none; padding: 8px; color: inherit; }
.nav__toggle svg { width: 26px; height: 26px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--navy-800);
  color: var(--ivory);
  padding-top: 160px;
  padding-bottom: clamp(80px, 10vw, 140px);
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero__grid { position: absolute; inset: 0; opacity: 0.5;
  background-image:
    linear-gradient(rgba(247,245,240,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247,245,240,0.035) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 90% 80% at 70% 30%, #000 30%, transparent 75%);
}
.hero__glow {
  position: absolute; width: 760px; height: 760px; right: -180px; top: -220px;
  background: radial-gradient(circle, rgba(193,127,58,0.22), transparent 62%);
  filter: blur(8px);
}
.hero__glow2 {
  position: absolute; width: 520px; height: 520px; left: -160px; bottom: -200px;
  background: radial-gradient(circle, rgba(28,53,86,0.7), transparent 65%);
}
.hero .container { position: relative; z-index: 2; }

.hero__inner { max-width: 980px; }
.hero__tag {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; border: 1px solid var(--line-light); border-radius: 100px;
  font-size: 13px; font-weight: 500; letter-spacing: 0.02em; color: rgba(247,245,240,0.85);
  margin-bottom: 32px;
}
.hero__tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--copper); box-shadow: 0 0 0 4px rgba(193,127,58,0.2); }

.hero h1 { margin-bottom: 28px; }
.hero h1 .line2 { color: var(--copper-2); }
.hero__lede { font-size: clamp(18px, 1.9vw, 23px); line-height: 1.5; color: rgba(247,245,240,0.78); max-width: 60ch; font-weight: 400; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 44px; }

.hero__stats {
  display: flex; flex-wrap: wrap; gap: clamp(28px, 5vw, 72px);
  margin-top: clamp(56px, 7vw, 96px);
  padding-top: 40px;
  border-top: 1px solid var(--line-light);
}
.hstat__num { font-family: var(--display); font-size: clamp(34px, 4vw, 52px); font-weight: 500; line-height: 1; color: var(--ivory); }
.hstat__num .unit { color: var(--copper-2); }
.hstat__label { font-size: 14px; color: rgba(247,245,240,0.6); margin-top: 10px; max-width: 22ch; }

/* ---------- Generic section head ---------- */
.section-head { max-width: 760px; margin-bottom: clamp(44px, 5vw, 72px); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head .h-section { margin-top: 18px; }
.section-head p { margin-top: 22px; }

/* ---------- Segments ---------- */
.segments-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.seg-card {
  position: relative;
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --lift: 0px;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transform-style: preserve-3d;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 38px 34px 34px;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .45s, border-color .45s;
}
/* spotlight that follows the cursor */
.seg-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(193,127,58,0.10), transparent 60%);
  opacity: 0; transition: opacity .4s; pointer-events: none;
}
.seg-card > * { position: relative; z-index: 2; }
.seg-card:hover { box-shadow: var(--shadow-lg); border-color: transparent; --lift: -8px; }
.seg-card:hover::after { opacity: 1; }
.seg-card__top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }
.seg-card__icon { width: 46px; height: 46px; color: var(--navy-800); transition: transform .5s cubic-bezier(.2,.7,.2,1), color .4s; transform-origin: left center; }
.seg-card:hover .seg-card__icon { transform: scale(1.12) rotate(-6deg); color: var(--copper); }
.seg-card__amt .v { transition: transform .45s cubic-bezier(.2,.7,.2,1); display:inline-block; }
.seg-card:hover .seg-card__amt .v { transform: scale(1.06); }
.seg-card__amt { text-align: right; }
.seg-card__amt .v { font-family: var(--display); font-size: 30px; font-weight: 600; color: var(--copper); line-height: 1; }
.seg-card__amt .k { font-size: 12px; color: var(--slate); letter-spacing: 0.04em; margin-top: 6px; }
.seg-card h3 { font-size: 30px; margin-bottom: 14px; }
.seg-card .pain { font-size: 15px; color: var(--slate); line-height: 1.55; margin-bottom: 26px; min-height: 4.2em; }
.seg-card__link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; color: var(--navy-800); }
.seg-card__link svg { width: 16px; height: 16px; transition: transform .3s; }
.seg-card:hover .seg-card__link svg { transform: translateX(4px); }
.seg-card__line { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--copper); transition: width .5s cubic-bezier(.2,.7,.2,1); }
.seg-card:hover .seg-card__line { width: 100%; }
.seg-card__badge { position:absolute; top:34px; right:34px; }

/* ---------- Products table ---------- */
.products { background: var(--navy-800); color: var(--ivory); }
.products .eyebrow { color: var(--copper-2); }
.products .eyebrow::before { background: var(--copper-2); }
.ptable { border-top: 1px solid var(--line-light); }
.prow {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 28px 4px;
  border-bottom: 1px solid var(--line-light);
  transition: background .35s, padding-left .35s;
}
.prow:hover { background: rgba(247,245,240,0.035); padding-left: 16px; }
.prow__head { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(247,245,240,0.5); font-weight: 600; padding-block: 16px; }
.prow__head:hover { background: none; padding-left: 4px; }
.prow__name { font-family: var(--display); font-size: 26px; font-weight: 500; }
.prow__name small { display: block; font-family: var(--ui); font-size: 13px; color: rgba(247,245,240,0.55); font-weight: 400; margin-top: 4px; letter-spacing: 0; }
.prow__val { font-size: 16px; font-weight: 500; }
.prow__val .x { font-family: var(--display); font-size: 24px; font-weight: 600; color: var(--copper-2); }
.prow__val span.lbl { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(247,245,240,0.45); margin-bottom: 5px; font-weight: 600; }
.prow__cta { color: var(--copper-2); }
.prow__cta svg { width: 22px; height: 22px; }

/* ---------- Process timeline ---------- */
.proc-wrap { position: relative; }
.proc-track {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
  position: relative;
}
.proc-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 27px;
  height: 1px; background: var(--line-strong);
}
.proc-fill {
  position: absolute; left: 0; top: 27px; height: 1px; width: 0;
  background: var(--copper); transition: width 1.4s cubic-bezier(.4,0,.1,1);
}
.proc-step { position: relative; }
.proc-node {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--ivory); border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--navy-800);
  position: relative; z-index: 2; margin-bottom: 28px;
  transition: background .4s, color .4s, border-color .4s, box-shadow .4s;
}
.proc-step.lit .proc-node { background: var(--navy-800); color: var(--ivory); border-color: var(--navy-800); box-shadow: 0 0 0 6px rgba(11,31,58,0.06); }
.proc-step h3 { font-size: 23px; margin-bottom: 12px; }
.proc-step p { font-size: 14.5px; color: var(--slate); line-height: 1.55; }
.proc-step .free { display:inline-block; margin-top:14px; font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--copper); }

/* ---------- Payment model ---------- */
.pay { background: var(--navy-800); color: var(--ivory); position: relative; overflow: hidden; }
.pay__glow { position:absolute; width:600px; height:600px; left:50%; top:-30%; transform:translateX(-50%); background:radial-gradient(circle,rgba(193,127,58,0.14),transparent 62%); pointer-events:none; }
.pay .container { position: relative; z-index: 2; }
.pay .eyebrow { color: var(--copper-2); }
.pay .eyebrow::before, .pay .eyebrow--center::after { background: var(--copper-2); }
.pay__flow {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; margin-top: clamp(48px, 6vw, 80px);
  border: 1px solid var(--line-light); border-radius: var(--radius-lg);
  overflow: hidden;
}
.pflow {
  position: relative; padding: 40px 32px;
  border-right: 1px solid var(--line-light);
  transition: background .4s;
}
.pflow:last-child { border-right: none; }
.pflow:hover { background: rgba(247,245,240,0.03); }
.pflow.is-key { background: rgba(193,127,58,0.10); }
.pflow.is-key:hover { background: rgba(193,127,58,0.14); }
.pflow__step { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--copper-2); margin-bottom: 22px; display:flex; align-items:center; gap:10px;}
.pflow__step .n { width:24px;height:24px;border-radius:50%;border:1px solid var(--copper-2); display:flex;align-items:center;justify-content:center;font-size:12px; }
.pflow__amt { font-family: var(--display); font-size: clamp(30px, 3.4vw, 44px); font-weight: 600; line-height: 1; margin-bottom: 16px; }
.pflow__amt.muted { color: rgba(247,245,240,0.5); }
.pflow__amt .small { font-size: 0.5em; }
.pflow__desc { font-size: 14px; color: rgba(247,245,240,0.62); line-height: 1.5; }
.pflow__arrow { position: absolute; right: -11px; top: 50%; transform: translateY(-50%); z-index: 4; width: 22px; height: 22px; color: var(--copper-2); background: var(--navy-800); border-radius: 50%; }
.pay__note { margin-top: 34px; display:flex; gap:14px; align-items:flex-start; font-size: 15px; color: rgba(247,245,240,0.72); max-width: 60ch; }
.pay__note svg { width: 20px; height: 20px; color: var(--copper-2); flex: none; margin-top: 2px; }

/* ---------- Results / stats + cases ---------- */
.stats-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: clamp(56px, 7vw, 88px); }
.stat {
  position: relative; overflow: hidden;
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --lift: 0px;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .45s, border-color .45s;
  padding: 34px 30px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--paper);
}
.stat::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(360px circle at var(--mx) var(--my), rgba(193,127,58,0.10), transparent 60%);
  opacity: 0; transition: opacity .4s;
}
.stat:hover { box-shadow: var(--shadow-md); border-color: transparent; --lift: -6px; }
.stat:hover::after { opacity: 1; }
.stat > * { position: relative; z-index: 1; }
.stat__num { font-family: var(--display); font-size: clamp(40px, 4.6vw, 62px); font-weight: 600; line-height: 1; color: var(--navy-800); }
.stat__num .unit { color: var(--copper); font-size: 0.5em; margin-left: 6px; }
.stat__label { font-size: 14px; color: var(--slate); margin-top: 14px; line-height: 1.45; }

.cases-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.case-card {
  position: relative;
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --lift: 0px;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transform-style: preserve-3d;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .45s, border-color .45s;
  display: flex; flex-direction: column;
}
.case-card:hover { box-shadow: var(--shadow-lg); border-color: transparent; --lift: -8px; }
.case-card__media { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.case-card__media .ph { transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.case-card:hover .case-card__media .ph { transform: scale(1.08); }
.case-card__media::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(247,245,240,0.35) 48%, transparent 60%);
  transform: translateX(-120%); transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.case-card:hover .case-card__media::after { transform: translateX(120%); }
.case-card:hover .case-card__amt { color: var(--copper); }
.case-card__badge {
  position: absolute; left: 18px; top: 18px; z-index: 2;
  background: rgba(8,24,46,0.82); color: var(--ivory); backdrop-filter: blur(4px);
  font-size: 12px; font-weight: 600; letter-spacing: 0.03em; padding: 7px 13px; border-radius: 100px;
}
.case-card__body { padding: 26px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.case-card__amt { font-family: var(--display); font-size: 34px; font-weight: 600; color: var(--navy-800); line-height: 1; transition: color .4s; }
.case-card__amt .unit { color: var(--copper); font-size: 0.55em; }
.case-card__title { font-size: 16.5px; font-weight: 600; color: var(--ink); margin-top: 16px; line-height: 1.4; flex: 1; }
.case-card__meta { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--slate); }
.case-card__meta svg { width: 15px; height: 15px; color: var(--copper); }

/* ---------- Principles ---------- */
.principles { background: var(--ivory-2); }
.princ-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 6vw, 88px); align-items: start; }
.princ-list { display: flex; flex-direction: column; gap: 4px; }
.princ-item { display: flex; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.princ-item:last-child { border-bottom: none; }
.princ-item__n { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--copper); line-height: 1; flex: none; width: 40px; }
.princ-item h3 { font-size: 24px; margin-bottom: 10px; }
.princ-item p { font-size: 15px; color: var(--slate); line-height: 1.55; margin: 0; }

/* ---------- Team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.team-card { }
.team-card__photo { aspect-ratio: 3/4; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px; position: relative; }
.team-card__photo .ph, .team-card__photo img { transition: transform .9s cubic-bezier(.2,.7,.2,1); width:100%; height:100%; }
.team-card:hover .team-card__photo .ph, .team-card:hover .team-card__photo img { transform: scale(1.07); }
.team-card__photo::before {
  content:""; position:absolute; inset:0; z-index:2; pointer-events:none;
  background: linear-gradient(180deg, transparent 55%, rgba(193,127,58,0.0) 100%);
  transition: background .5s;
}
.team-card:hover .team-card__photo::before { background: linear-gradient(180deg, transparent 45%, rgba(193,127,58,0.28) 100%); }
.team-card__photo::after { content:""; position:absolute; inset:0; box-shadow: inset 0 -60px 60px -40px rgba(8,24,46,0.4); }
.team-card h3 { font-size: 22px; margin-bottom: 4px; }
.team-card .role { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--copper); }
.team-card .spec { font-size: 14px; color: var(--slate); margin-top: 10px; line-height: 1.5; }

/* ---------- FAQ ---------- */
.faq-wrap { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(40px, 6vw, 88px); align-items: start; }
.faq-list { border-top: 1px solid var(--line-strong); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 26px 0; font-family: var(--display); font-size: clamp(20px, 2.1vw, 26px); font-weight: 500; color: var(--navy-800);
  transition: color .25s;
}
.faq-q:hover { color: var(--copper); }
.faq-icon { flex: none; width: 26px; height: 26px; position: relative; }
.faq-icon::before, .faq-icon::after { content:""; position:absolute; background: var(--copper); transition: transform .35s, opacity .35s; }
.faq-icon::before { left: 0; right: 0; top: 50%; height: 1.5px; transform: translateY(-50%); }
.faq-icon::after { top: 0; bottom: 0; left: 50%; width: 1.5px; transform: translateX(-50%); }
.faq-item.open .faq-icon::after { transform: translateX(-50%) scaleY(0); opacity: 0; }
.faq-a { overflow: hidden; max-height: 0; transition: max-height .45s cubic-bezier(.4,0,.1,1); }
.faq-a__inner { padding: 2px 60px 30px 0; font-size: 16px; color: var(--slate); line-height: 1.6; }
.faq-a__inner br { content: ""; display: block; margin-bottom: 6px; }

/* ---------- Contact ---------- */
.contact { background: var(--navy-800); color: var(--ivory); position: relative; overflow: hidden; }
.contact__glow { position:absolute; width:700px;height:700px; right:-200px; bottom:-300px; background:radial-gradient(circle,rgba(193,127,58,0.14),transparent 62%); pointer-events:none; }
.contact .container { position: relative; z-index: 2; }
.contact .eyebrow { color: var(--copper-2); }
.contact .eyebrow::before { background: var(--copper-2); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(44px, 6vw, 88px); align-items: start; }
.contact__lede { font-size: clamp(18px,1.7vw,21px); color: rgba(247,245,240,0.78); line-height: 1.55; margin-top: 22px; max-width: 44ch; }
.contact-channels { margin-top: 44px; display: flex; flex-direction: column; gap: 4px; }
.cchan { display: flex; align-items: center; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line-light); transition: padding-left .35s; }
.cchan:hover { padding-left: 10px; }
.cchan:first-child { border-top: 1px solid var(--line-light); }
.cchan__ic { width: 44px; height: 44px; border: 1px solid var(--line-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; color: var(--copper-2); transition: background .3s, border-color .3s; }
.cchan:hover .cchan__ic { background: var(--copper); border-color: var(--copper); color: var(--ivory); }
.cchan__ic svg { width: 19px; height: 19px; }
.cchan__k { font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(247,245,240,0.5); font-weight: 600; }
.cchan__v { font-size: 17px; font-weight: 600; color: var(--ivory); margin-top: 3px; }

/* Form */
.lead-form {
  background: var(--paper); color: var(--ink);
  border-radius: var(--radius-lg); padding: clamp(28px, 3.5vw, 44px);
  box-shadow: var(--shadow-navy);
}
.lead-form h3 { font-size: 28px; margin-bottom: 6px; }
.lead-form .sub { font-size: 14.5px; color: var(--slate); margin-bottom: 26px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; letter-spacing: 0.01em; }
.field label .req { color: var(--copper); }
.field input, .field select, .field textarea {
  width: 100%; padding: 14px 16px; font-family: var(--ui); font-size: 15px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--ink);
  transition: border-color .25s, box-shadow .25s;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px var(--copper-soft);
}
.field input.invalid, .field select.invalid { border-color: #C0392B; box-shadow: 0 0 0 3px rgba(192,57,43,0.1); }
.field .err { display: none; font-size: 12.5px; color: #C0392B; margin-top: 6px; }
.field.show-err .err { display: block; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.consent { display: flex; align-items: flex-start; gap: 11px; margin: 6px 0 22px; }
.consent input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--copper); }
.consent label { font-size: 12.5px; color: var(--slate); line-height: 1.5; }
.consent a { color: var(--copper); text-decoration: underline; text-underline-offset: 2px; }
.form-success { display: none; text-align: center; padding: 30px 10px; }
.form-success.show { display: block; }
.form-success__ic { width: 60px; height: 60px; border-radius: 50%; background: var(--copper-soft); color: var(--copper); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.form-success__ic svg { width: 30px; height: 30px; }
.form-success h3 { font-size: 26px; margin-bottom: 10px; }
.form-success p { font-size: 15px; color: var(--slate); }

/* ---------- Footer ---------- */
.footer { background: var(--navy-900); color: rgba(247,245,240,0.6); padding-block: 64px 32px; }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; padding-bottom: 44px; border-bottom: 1px solid var(--line-light); }
.footer .brand { color: var(--ivory); margin-bottom: 20px; }
.footer__about { font-size: 14px; line-height: 1.6; max-width: 38ch; }
.footer__col h4 { font-family: var(--ui); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(247,245,240,0.45); margin: 0 0 18px; }
.footer__col a, .footer__col p { display: block; font-size: 14.5px; color: rgba(247,245,240,0.7); margin-bottom: 12px; transition: color .25s; }
.footer__col a:hover { color: var(--copper-2); }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 28px; font-size: 13px; }
.footer__legal { display: flex; flex-wrap: wrap; gap: 20px; }
.footer__legal span { color: rgba(247,245,240,0.4); }

/* ---------- Sticky CTA (mobile) ---------- */
.sticky-cta {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  display: none; gap: 12px;
  transform: translateY(140%); transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.sticky-cta.show { transform: translateY(0); }
.sticky-cta .btn { flex: 1; justify-content: center; box-shadow: var(--shadow-lg); }

/* ---------- Placeholder media ---------- */
.ph {
  width: 100%; height: 100%; position: relative;
  background:
    repeating-linear-gradient(135deg, rgba(11,31,58,0.05) 0 10px, rgba(11,31,58,0.02) 10px 20px),
    var(--ivory-2);
  display: flex; align-items: center; justify-content: center;
}
.ph--navy {
  background:
    repeating-linear-gradient(135deg, rgba(247,245,240,0.05) 0 10px, rgba(247,245,240,0.015) 10px 20px),
    var(--navy-700);
}
.ph__tag {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px; letter-spacing: 0.04em; color: var(--slate);
  background: rgba(247,245,240,0.85); padding: 6px 11px; border-radius: 3px;
  border: 1px solid var(--line);
}
.ph--navy .ph__tag { color: rgba(247,245,240,0.7); background: rgba(8,24,46,0.5); border-color: var(--line-light); }

/* ---------- Reveal animation ---------- */
:root { --reveal-ease: cubic-bezier(.16,.84,.28,1); }

.reveal {
  opacity: 0;
  transform: translateY(34px);
  filter: blur(6px);
  transition:
    opacity .9s var(--reveal-ease),
    transform 1s var(--reveal-ease),
    filter .9s var(--reveal-ease);
  will-change: opacity, transform, filter;
}
.reveal.in { opacity: 1; transform: none; filter: blur(0); }

/* Directional variants */
.reveal--left  { transform: translateX(-46px); }
.reveal--right { transform: translateX(46px); }
.reveal--scale { transform: translateY(28px) scale(.94); }
.reveal--up    { transform: translateY(58px); }
.reveal--left.in, .reveal--right.in, .reveal--scale.in, .reveal--up.in { transform: none; }

/* Stagger — children of a [data-stagger] container animate in sequence.
   The active delay is injected via --i by JS (index of the child). */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(36px) scale(.97);
  filter: blur(7px);
  transition:
    opacity .8s var(--reveal-ease),
    transform .85s var(--reveal-ease),
    filter .8s var(--reveal-ease);
  transition-delay: calc(var(--i, 0) * 90ms);
  will-change: opacity, transform, filter;
}
[data-stagger].in > * { opacity: 1; transform: none; filter: blur(0); }

.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"] { transition-delay: .40s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, [data-stagger] > * { opacity: 1 !important; transform: none !important; filter: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .segments-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .cases-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-band { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .princ-grid { grid-template-columns: 1fr; }
  .faq-wrap { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav__links, .nav__phone { display: none; }
  .nav__toggle { display: inline-flex; }
  .proc-track { grid-template-columns: 1fr 1fr; gap: 40px 28px; }
  .proc-track::before, .proc-fill { display: none; }
  .pay__flow { grid-template-columns: 1fr; }
  .pflow { border-right: none; border-bottom: 1px solid var(--line-light); }
  .pflow:last-child { border-bottom: none; }
  .pflow__arrow { display: none; }
  .prow { grid-template-columns: 1fr 1fr; gap: 14px; }
  .prow__name { grid-column: 1 / -1; }
  .prow__cta { display: none; }
  .prow__head { display: none; }
  .sticky-cta { display: flex; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .cases-grid, .stats-band, .team-grid, .field-row { grid-template-columns: 1fr; }
  .proc-track { grid-template-columns: 1fr; }
  .hero { padding-top: 130px; }
  .hero__stats { gap: 24px; }
  .hstat { flex: 1 1 40%; }
  .prow { grid-template-columns: 1fr; }

  /* ----- Компактная шапка: всё в одну строку, без переносов ----- */
  .nav { height: 62px; gap: 12px; }
  .brand { gap: 10px; min-width: 0; }
  .brand__mark { width: 34px; height: 34px; }
  .brand__name { font-size: 18px; }
  .brand__sub { display: none; }            /* подпись скрыта — освобождает ширину */
  .nav__right { gap: 10px; flex: none; }
  .nav__right .btn--primary {
    padding: 9px 16px;
    font-size: 13px;
    border-radius: var(--radius);
  }
  .nav__toggle { padding: 6px; margin-right: -6px; }
  .nav__toggle svg { width: 24px; height: 24px; }
}

/* ---------- Mobile reveal fix: убираем blur (ломает iOS Safari) ---------- */
@media (max-width: 860px) {
  .reveal {
    filter: none;
    transition: opacity .9s var(--reveal-ease), transform 1s var(--reveal-ease);
    will-change: opacity, transform;
  }
  .reveal.in { filter: none; }

  [data-stagger] > * {
    filter: none;
    transition:
      opacity .8s var(--reveal-ease),
      transform .85s var(--reveal-ease);
    transition-delay: calc(var(--i, 0) * 90ms);
    will-change: opacity, transform;
  }
  [data-stagger].in > * { filter: none; }
}

/* Mobile menu panel */
.m-menu {
  position: fixed; inset: 0; z-index: 200; background: var(--navy-800); color: var(--ivory);
  display: flex; flex-direction: column; padding: 28px var(--gutter);
  transform: translateY(-100%); transition: transform .5s cubic-bezier(.4,0,.1,1); visibility: hidden;
}
.m-menu.open { transform: translateY(0); visibility: visible; }
.m-menu__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.m-menu__close { background: none; border: none; color: var(--ivory); padding: 8px; }
.m-menu__close svg { width: 28px; height: 28px; }
.m-menu nav { display: flex; flex-direction: column; gap: 4px; }
.m-menu nav a { font-family: var(--display); font-size: 30px; font-weight: 500; padding: 12px 0; border-bottom: 1px solid var(--line-light); }
.m-menu__foot { margin-top: auto; display: flex; flex-direction: column; gap: 16px; }
.m-menu__phone { font-size: 20px; font-weight: 700; color: var(--copper-2); }

/* ============================================================
   Reconcile reveal entrance with 3D tilt hover
   ------------------------------------------------------------
   Cards carry BOTH .reveal and the tilt classes. Without this,
   .reveal.in { transform: none } overrides the card's tilt
   transform and kills both the pointer tilt and the hover lift.
   These combined selectors win (higher specificity + later in
   source) and fold the reveal entrance offset into --reveal-y,
   so the single `transform` property serves both jobs.
   ============================================================ */
.seg-card.reveal,
.stat.reveal {
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry))
             translateY(calc(var(--lift) + var(--reveal-y, 34px)));
  transition: transform .3s cubic-bezier(.2,.7,.2,1), opacity .9s var(--reveal-ease),
              filter .9s var(--reveal-ease), box-shadow .45s, border-color .45s;
}
.case-card.reveal {
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry))
             translateY(calc(var(--lift) + var(--reveal-y, 34px)));
  transition: transform .3s cubic-bezier(.2,.7,.2,1), opacity .9s var(--reveal-ease),
              filter .9s var(--reveal-ease), box-shadow .45s, border-color .45s;
}
.seg-card.reveal.in,
.stat.reveal.in,
.case-card.reveal.in { --reveal-y: 0px; }

@media (prefers-reduced-motion: reduce) {
  .seg-card.reveal, .stat.reveal, .case-card.reveal { transform: none !important; }
}
