/* ============================================================
   ДИГ — Эволюция. Стили.
   Палитра-арка: тёмный землистый старт → чистый светлый финал.
   Акцент --accent выносится в одну переменную (замените на свой HEX).
   ============================================================ */

:root {
  /* Тёплый акцент ЭВОЛЮЦИИ (JS уводит его в фирменный синий на финале) */
  --accent: #e0a23b;
  --accent-deep: #b97c1f;

  /* === Фирменные цвета ДИГ (сняты с логотипа) === */
  --brand-ink: #0f172b;
  --brand-blue: #3b82f6;
  --brand-blue-deep: #1e40af;
  --brand-blue-light: #93c5fd;
  --world-bg: #f7f9fc;

  /* Эти переменные перекрашивает JS по ходу скролла (лерп между стадиями) */
  --bg: #15110d;
  --fg: #efe6d8;
  --scrim: rgba(0,0,0,.45);

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  --maxw: 1280px;
  --pad: clamp(20px, 5vw, 72px);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .25s linear, color .25s linear;
  overflow-x: clip;
}

h1, h2, h3, .display { font-family: var(--font-display); margin: 0; line-height: 1.02; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

/* грубая зернистая текстура поверх — характер «камня» в начале, исчезает к финалу */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: var(--grain, .22);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  transition: opacity .25s linear;
}

/* ---------- ВЕРХНЯЯ НАВИГАЦИЯ ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 18px var(--pad);
  font-family: var(--font-display);
  transition: background-color .3s, backdrop-filter .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  border-bottom-color: color-mix(in srgb, var(--fg) 14%, transparent);
}
.nav__brand { display: inline-flex; align-items: center; }
.nav__logo { height: 30px; width: auto; display: block; }
.nav__logo--light { display: none; }
.nav--light .nav__logo--dark { display: none; }
.nav--light .nav__logo--light { display: block; }
.nav--light.scrolled { background: color-mix(in srgb, #ffffff 80%, transparent); border-bottom-color: color-mix(in srgb, var(--brand-ink) 12%, transparent); }
.nav__links { display: flex; gap: 28px; font-family: var(--font-body); font-weight: 600; font-size: 14px; letter-spacing: .02em; color: var(--fg); transition: color .3s; }
.nav--light .nav__links { color: var(--brand-ink); }
.nav__links a { opacity: .72; transition: opacity .2s; }
.nav__links a:hover { opacity: 1; }
.nav__cta {
  font-family: var(--font-body); font-weight: 700; font-size: 14px;
  padding: 11px 20px; border-radius: 999px;
  background: var(--brand-blue); color: #fff;
  transition: transform .2s, filter .2s;
}
.nav__cta:hover { transform: translateY(-1px); filter: brightness(1.08); }
@media (max-width: 860px) { .nav__links { display: none; } }

/* ============================================================
   СЕКЦИЯ ЭВОЛЮЦИИ (sticky-сцена)
   ============================================================ */
.evo { position: relative; }

.evo-graphic {
  position: sticky; top: 0;
  height: 100vh; width: 100%;
  overflow: hidden;
}

/* живой фон, который светлеет (его красит JS через --bg на body, тут — виньетка/атмосфера) */
.evo-atmos {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 8%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%),
    radial-gradient(140% 120% at 50% 120%, var(--scrim), transparent 60%);
  transition: background .25s linear;
}

/* «земля», по которой идёт герой */
.evo-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22vh;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg) 65%, #000 40%), transparent);
}

/* сцена с фигурой — реальные иллюстрации, кроссфейд по скроллу */
.evo-figure {
  position: absolute;
  left: 62%; bottom: 7vh;
  width: 0; height: 80vh;
  transform: translateX(-50%);
  transform-origin: bottom center;
  z-index: 2;
}
.evo-figure .fig {
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  height: 100%; width: auto; max-width: none;
  opacity: 0;
  transition: opacity .18s linear;
  filter: drop-shadow(0 22px 38px rgba(0,0,0,.42));
  pointer-events: none; will-change: opacity;
}
.evo-figure .fig-0 { opacity: 1; }
@media (max-width: 760px) {
  .evo-figure { left: 50%; height: 40vh; bottom: 34vh; }
}

/* ---------- ТАЙМЛАЙН-СКРОЛЛБАР ---------- */
.evo-timeline {
  position: absolute; right: clamp(16px, 3vw, 40px); top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex; flex-direction: column; align-items: center;
  gap: 0;
}
.evo-timeline__track {
  position: relative; width: 2px; height: 46vh;
  background: color-mix(in srgb, var(--fg) 18%, transparent);
}
.evo-timeline__fill {
  position: absolute; top: 0; left: 0; width: 100%;
  background: var(--accent); height: 0%;
}
.evo-timeline__node {
  position: absolute; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px;
}
.evo-timeline__dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid color-mix(in srgb, var(--fg) 40%, transparent);
  transition: all .3s;
}
.evo-timeline__node.is-active .evo-timeline__dot {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent);
}
.evo-timeline__label {
  position: absolute; right: 22px; white-space: nowrap;
  font-family: var(--font-body); font-weight: 700; font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase;
  opacity: 0; transform: translateX(8px);
  transition: opacity .3s, transform .3s;
  color: var(--fg);
}
.evo-timeline__node.is-active .evo-timeline__label { opacity: .9; transform: translateX(0); }
@media (max-width: 760px) { .evo-timeline { display: none; } }

/* ---------- ШАГИ (текст, который проезжает мимо) ---------- */
.evo-steps {
  position: relative;
  margin-top: -100vh;   /* наложить поверх sticky-графики */
  z-index: 3;
  pointer-events: none;
}
.evo-step {
  height: 100vh;
  display: flex; align-items: center;
  padding: 0 var(--pad);
}
.evo-step__panel {
  max-width: 540px;
  pointer-events: auto;
}
.evo-step__eyebrow {
  font-family: var(--font-display); font-weight: 700;
  font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 22px;
}
.evo-step__eyebrow::before { content: ""; width: 32px; height: 2px; background: var(--accent); }
.evo-step__title {
  font-size: clamp(34px, 5.4vw, 76px);
  font-weight: 800; letter-spacing: -.01em;
  text-wrap: balance;
  text-shadow: 0 2px 40px var(--scrim);
}
.evo-step__sub {
  margin-top: 22px; font-size: clamp(16px, 1.5vw, 21px);
  line-height: 1.6; max-width: 460px;
  color: color-mix(in srgb, var(--fg) 84%, transparent);
  text-shadow: 0 1px 20px var(--scrim);
}
.evo-step__tag {
  display: inline-block; margin-top: 26px;
  font-family: var(--font-body); font-weight: 700; font-size: 13px;
  letter-spacing: .04em;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--fg) 26%, transparent);
  color: var(--fg);
}
.scroll-cue { margin-top: 32px; display: flex; flex-direction: column; gap: 4px; font-family: var(--font-body); font-weight: 700; font-size: 13px; letter-spacing: .04em; color: color-mix(in srgb, var(--fg) 78%, transparent); }
.scroll-cue__caret { font-size: 30px; line-height: .7; color: var(--brand-blue-light); animation: cueBounce 1.6s ease-in-out infinite; }
@keyframes cueBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@media (prefers-reduced-motion: reduce) { .scroll-cue__caret { animation: none; } }

/* финальный шаг: счётчики + CTA (компактно, чтобы влезало в экран) */
.evo-step--final .evo-step__panel { max-width: 560px; }
.evo-step--final .evo-step__eyebrow { margin-bottom: 14px; }
.evo-step--final .evo-step__title { font-size: clamp(27px, 3.6vw, 52px); }
.evo-step--final .evo-step__sub { margin-top: 12px; max-width: 460px; font-size: clamp(14px, 1.2vw, 18px); }
.evo-step--final .btn { padding: 13px 24px; font-size: 15px; }
.evo-stats { display: flex; gap: clamp(16px, 2.2vw, 34px); margin-top: clamp(14px, 2.2vh, 28px); flex-wrap: wrap; max-width: 470px; }
.evo-stat__num { font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 3.6vw, 50px); color: var(--accent); line-height: 1; }
.evo-stat__lbl { margin-top: 8px; font-size: 13px; font-weight: 600; opacity: .7; max-width: 150px; }
.evo-cta-row { display: flex; gap: 14px; margin-top: clamp(16px, 2.4vh, 30px); flex-wrap: wrap; }
.btn {
  font-family: var(--font-body); font-weight: 700; font-size: 16px;
  padding: 16px 30px; border-radius: 999px; cursor: pointer; border: none;
  white-space: nowrap;
  transition: transform .2s, filter .2s, background .2s, color .2s;
}
.btn--primary { background: var(--accent); color: #1a1207; }
.btn--primary:hover { transform: translateY(-2px); filter: brightness(1.07); }
.btn--ghost { background: transparent; color: var(--fg); border: 1px solid color-mix(in srgb, var(--fg) 32%, transparent); }
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.btn--max { background: transparent; color: #fff; border: 1px solid var(--brand-blue-light); }
.btn--max:hover { transform: translateY(-2px); background: var(--brand-blue-light); color: var(--brand-ink); }

@media (max-width: 760px) {
  .evo-step { align-items: flex-start; padding-top: 14vh; }
  .evo-step__panel { max-width: 100%; }
}

/* ============================================================
   ОБЫЧНЫЕ СЕКЦИИ (после hero) — чистый светлый «цивилизованный» мир
   ============================================================ */
.world {
  position: relative; z-index: 4;
  background: var(--world-bg); color: var(--brand-ink);
  --accent: var(--brand-blue);
  --accent-deep: var(--brand-blue-deep);
  --line: color-mix(in srgb, var(--brand-ink) 12%, transparent);
}
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(80px, 11vw, 160px) var(--pad); }
.section__kicker {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: .2em; text-transform: uppercase; color: var(--accent-deep);
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.section__kicker::before { content: ""; width: 30px; height: 2px; background: var(--accent-deep); }
.section__title { font-size: clamp(32px, 4.4vw, 60px); font-weight: 800; letter-spacing: -.015em; max-width: 16ch; text-wrap: balance; }
.section__lead { margin-top: 20px; font-size: clamp(17px, 1.6vw, 20px); max-width: 56ch; opacity: .76; }

/* услуги */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 60px; background: var(--line); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.service {
  background: #fff; padding: 38px 32px; min-height: 240px;
  display: flex; flex-direction: column;
  transition: background .25s, transform .25s;
}
.service:hover { background: #f3f7fe; }
.service__no { font-family: var(--font-display); font-weight: 800; font-size: 13px; letter-spacing: .1em; color: var(--accent-deep); opacity: .7; }
.service__name { font-family: var(--font-display); font-weight: 700; font-size: 23px; margin-top: 22px; letter-spacing: -.01em; }
.service__desc { margin-top: 14px; font-size: 15.5px; line-height: 1.55; opacity: .72; }
.service__stage { margin-top: auto; padding-top: 20px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-deep); opacity: .8; }
@media (max-width: 920px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .services { grid-template-columns: 1fr; } }

/* портфолио */
.portfolio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 60px; }
.case {
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  background: #fff; display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.case:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -28px rgba(20,30,60,.28); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.case__media {
  aspect-ratio: 16/10; position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(45deg, #e9eef6, #e9eef6 11px, #dfe6f1 11px, #dfe6f1 22px);
  display: flex; align-items: center; justify-content: center;
}
.case__slot { font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: .05em; color: #93a0b6; text-transform: uppercase; text-align: center; padding: 12px; }
.case__body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.case__meta { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 5px 11px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-deep); }
.chip--nda { background: color-mix(in srgb, var(--brand-ink) 8%, transparent); color: var(--brand-ink); opacity: .7; }
.case__name { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-top: 4px; }
.case__desc { font-size: 14.5px; line-height: 1.5; opacity: .72; }
.case__more { margin-top: auto; font-weight: 700; font-size: 13px; color: var(--accent-deep); letter-spacing: .03em; }
@media (max-width: 920px) { .portfolio { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .portfolio { grid-template-columns: 1fr; } }

/* ---------- модалка кейса ---------- */
.case { cursor: pointer; }
.case__logo { max-width: 58%; max-height: 64%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 6px 16px rgba(10,15,28,.22)); }
.case-modal { position: fixed; inset: 0; z-index: 100; display: none; }
.case-modal.is-open { display: block; }
.case-modal__backdrop { position: absolute; inset: 0; background: rgba(10,15,28,.62); backdrop-filter: blur(5px); }
.case-modal__card { position: relative; z-index: 1; max-width: 640px; margin: 8vh auto; background: #fff; color: var(--brand-ink); border-radius: 22px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(10,15,28,.55); animation: cmIn .25s ease; }
@keyframes cmIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.case-modal__gallery { background: #0f172b; padding: 18px 18px 0; }
.case-modal__main { display: block; width: 100%; max-height: 52vh; object-fit: contain; border-radius: 12px; background: #0b1120; }
.case-modal__thumbs { display: flex; gap: 10px; padding: 14px 0; flex-wrap: wrap; }
.case-modal__thumb { width: 66px; height: 48px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: #0b1120; cursor: pointer; padding: 0; opacity: .55; transition: opacity .2s, border-color .2s; }
.case-modal__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.case-modal__thumb.is-active { opacity: 1; border-color: var(--brand-blue); }
.case-modal__head { display: flex; gap: 16px; align-items: center; }
.case-modal__logo { width: 54px; height: 54px; border-radius: 12px; object-fit: contain; padding: 6px; flex: 0 0 auto; }
.case-modal__body { padding: 28px 30px 32px; display: flex; flex-direction: column; gap: 14px; }
.case-modal__name { font-family: var(--font-display); font-weight: 700; font-size: clamp(20px, 3vw, 26px); letter-spacing: -.01em; }
.case-modal__head .case__meta { margin-top: 8px; }
.case-modal__desc { font-size: 16px; line-height: 1.6; opacity: .82; }
.case-modal__body .btn { margin-top: 6px; align-self: flex-start; }
.case-modal__close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; background: rgba(255,255,255,.88); color: var(--brand-ink); font-size: 24px; line-height: 1; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.case-modal__close:hover { background: #fff; }
@media (max-width: 600px) { .case-modal__card { margin: 0; min-height: 100%; border-radius: 0; } }

/* о нас */
.about { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(40px, 6vw, 90px); margin-top: 30px; align-items: start; }
.about__text p { font-size: 18px; line-height: 1.65; opacity: .82; margin-bottom: 20px; }
.about__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.about__list li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--line); font-size: 16px; font-weight: 600; }
.about__list li::before { content: ""; flex: 0 0 auto; width: 9px; height: 9px; margin-top: 7px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
@media (max-width: 820px) { .about { grid-template-columns: 1fr; } }

/* команда */
.team { margin-top: 50px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.member { display: flex; gap: 20px; align-items: flex-start; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.member__photo { flex: 0 0 auto; width: 88px; height: 88px; border-radius: 16px; object-fit: cover; display: block; background: #e9eef6; }
.member__name { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.member__role { font-size: 13px; font-weight: 700; color: var(--accent-deep); margin-top: 4px; letter-spacing: .02em; }
.member__exp { font-size: 12px; font-weight: 600; opacity: .55; margin-top: 2px; }
.member__bio { font-size: 14px; line-height: 1.5; opacity: .74; margin-top: 12px; }
.member__tg { display: inline-block; margin-top: 12px; font-weight: 700; font-size: 13px; color: var(--accent-deep); }

/* контакты */
.contacts { background: var(--brand-ink); color: #e8eef8; position: relative; z-index: 4; --accent: var(--brand-blue-light); }
.contacts .section__title { color: #fff; }
.section__kicker--light { color: var(--brand-blue-light); }
.section__kicker--light::before { background: var(--brand-blue-light); }
.contacts__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(40px, 6vw, 90px); margin-top: 40px; align-items: start; }
.contacts__cta-col { display: flex; flex-direction: column; gap: 26px; align-items: flex-start; }
.contacts__btns { display: flex; gap: 14px; flex-wrap: wrap; }
.contacts__lines { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.contacts__line { display: flex; flex-direction: column; gap: 4px; padding: 22px 0; border-top: 1px solid color-mix(in srgb, #e8eef8 14%, transparent); }
.contacts__line span { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .5; }
.contacts__line a, .contacts__line b { font-family: var(--font-display); font-weight: 700; font-size: clamp(15px, 2vw, 25px); white-space: nowrap; }
.contacts__line a:hover { color: var(--accent); }
@media (max-width: 820px) { .contacts__grid { grid-template-columns: 1fr; align-items: start; } }

.footer { max-width: var(--maxw); margin: 0 auto; padding: 36px var(--pad) 54px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-top: 1px solid color-mix(in srgb, #e8eef8 12%, transparent); }
.footer__logo { height: 28px; width: auto; opacity: .92; }
.footer__meta { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; opacity: .55; }

/* ---------- reduced motion: убираем переходы фигуры ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fig, body, .evo-atmos { transition: none !important; }
}

/* ---------- мобайл: дискретные снапы по стадиям ---------- */
@media (max-width: 760px) {
  html { scroll-snap-type: y proximity; }
  .evo-step { scroll-snap-align: center; }
}
