/* Шрифт Geist (лицензия SIL OFL 1.1) хранится на сайте, без обращения к Google Fonts */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/geist-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/geist-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --background: #f3f3f3;
  --white: #fff;
  --black: #333;
  --gray: #7a7a7a;
  --primary: #1865ff;
  --primary-hover: #0f55e0;
  --secondary: #e4edff;
  --secondary-hover: #d3e1ff;
  --radius-lg: 24px;
  --radius-md: 16px;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--background);
  color: var(--black);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 100px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .2s;
}
.btn img { flex-shrink: 0; }
.btn--primary { background: var(--primary); color: var(--white); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--secondary { background: var(--secondary); color: var(--primary); }
.btn--secondary:hover { background: var(--secondary-hover); }
.btn--sm { height: 40px; padding: 0 20px; gap: 8px; border-radius: 12px; font-size: 16px; }
.btn--lg { height: 60px; width: 190px; padding: 20px 26px; gap: 12px; border-radius: 16px; font-size: 20px; }

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
}
.header__logo img { width: 40px; height: 39.571px; }
.header__actions { display: flex; gap: 12px; }
.header__actions .btn--secondary { width: 142px; }

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  margin-top: -40px; /* в макете шапка и hero в одной группе с gap 40px */
  text-align: center;
}
.hero__avatar {
  width: 231.466px;
  height: 231.466px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__avatar img { width: 86.4%; height: 86.4%; }
.hero__text { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.hero__titles { display: flex; flex-direction: column; align-items: center; gap: 16px; font-weight: 600; line-height: .95; }
.hero__hello { font-size: 32px; letter-spacing: -.02em; color: var(--gray); }
.hero__title { max-width: 856px; font-size: 68px; font-weight: 600; letter-spacing: -.02em; }
.hero__lead { max-width: 708px; font-size: 24px; line-height: 1.2; letter-spacing: -.02em; color: var(--gray); }
.hero__actions { display: flex; gap: 20px; }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.card--primary { background: var(--primary); color: var(--white); gap: 64px; }
.card__title { font-size: 24px; font-weight: 600; line-height: .95; letter-spacing: -.02em; }
.card__text { font-size: 16px; line-height: 1.4; letter-spacing: -.02em; }
.card__text--muted { color: var(--gray); }

/* About */
.about { display: flex; gap: 20px; }
.about__main,
.about__side { flex: 1 1 0; min-width: 0; }
.about__side { display: flex; flex-direction: column; gap: 20px; }
.about__card { flex: 1 1 0; }
.about__stats { display: flex; flex-wrap: wrap; gap: 24px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat--short { width: 146px; }
.stat--long { width: 174px; }
.stat__value { font-size: 68px; font-weight: 700; line-height: .95; letter-spacing: -.02em; }
.stat__label { font-size: 16px; line-height: 1.4; letter-spacing: -.02em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--secondary);
  color: var(--primary);
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.progress { display: flex; gap: 12px; }
.progress span {
  position: relative;
  flex: 1;
  height: 12px;
  border-radius: 20px;
  background: var(--secondary);
  overflow: hidden;
}
.progress span::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--primary);
  transform-origin: left;
}
/* При наведении этапы заново заполняются по очереди: требования → прототипы → контроль вёрстки */
.about__card:hover .progress span::before {
  animation: progress-fill .45s cubic-bezier(.4, 0, .2, 1) both;
}
.about__card:hover .progress span:nth-child(2)::before { animation-delay: .35s; }
.about__card:hover .progress span:nth-child(3)::before { animation-delay: .7s; }
@keyframes progress-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
  .about__card:hover .progress span::before { animation: none; }
}

/* Works */
.works { display: flex; flex-direction: column; gap: 32px; }
.works__title { font-size: 40px; font-weight: 600; line-height: .95; letter-spacing: -.02em; }
.works__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.work {
  position: relative;
  height: 500px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--white);
  isolation: isolate;
}
.work__media {
  position: absolute;
  left: calc(50% + 2px);
  top: calc(50% + 45.38px);
  width: 665px;
  height: 793px;
  transform: translate(-50%, -50%);
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.work__media img {
  position: absolute;
  max-width: none;
  transition: transform .4s ease;
}
.work:hover .work__media img { transform: scale(1.03); }

.work__body { display: flex; flex-direction: column; align-items: flex-end; }
.work__tags {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 0 12px;
  margin-bottom: -12px;
}
.work__tags li {
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--secondary);
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.work__info {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 24px 28px;
  border-radius: var(--radius-md);
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.work__name { display: flex; align-items: center; gap: 8px; }
.work__name h3 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.work__desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--gray);
}

.work__logo {
  position: relative;
  flex-shrink: 0;
  width: 28.053px;
  height: 28.053px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.work__logo--bare img { width: 28px; height: 28px; }
.work__logo--volt img {
  position: absolute;
  left: 6.46px;
  top: -7.7px;
  width: 18.57px;
  height: 32.27px;
  max-width: none;
}
.work__logo--masterkley img {
  position: absolute;
  left: 11.61%;
  top: 31.17%;
  width: 77.6%;
  height: 38.19%;
}
.hms-logo { position: relative; width: 22px; height: 9px; }
.hms-logo__top { position: absolute; inset: 0 0 28.83% 0; width: 100%; height: 71.17%; }
.hms-logo__bottom { position: absolute; inset: 78.43% 0 .28% 0; width: 100%; height: 21.29%; }

/* CTA */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px;
  border-radius: var(--radius-lg);
  background: var(--white);
}
.cta__text { font-size: 32px; font-weight: 600; line-height: 1; }

/* Responsive */
@media (max-width: 1200px) {
  .page { padding: 32px 40px; }
  .hero__title { font-size: 56px; }
}

@media (max-width: 960px) {
  .about { flex-direction: column; }
  .works__grid { grid-template-columns: minmax(0, 1fr); }
  .cta { flex-direction: column; align-items: flex-start; }
  .cta__text { font-size: 28px; line-height: 1.1; }
}

@media (max-width: 640px) {
  .page { padding: 20px 16px; gap: 56px; }
  .main { gap: 56px; }
  .hero { gap: 28px; margin-top: -24px; }
  .hero__avatar { width: 170px; height: 170px; }
  .hero__hello { font-size: 20px; }
  .hero__title { font-size: 36px; }
  .hero__lead { font-size: 18px; }
  .hero__actions { flex-direction: column; width: 100%; gap: 12px; }
  .btn--lg { width: 100%; }
  .header__actions .btn--secondary { width: auto; }
  .header__actions .btn--sm { padding: 0 14px; }
  .stat__value { font-size: 52px; }
  .about__stats { flex-direction: column; gap: 16px; }
  .works__title { font-size: 32px; }
  .work { height: 440px; padding: 16px; }
  /* картинка рассчитана на десктопную карточку 610px: на телефоне уменьшаем, чтобы устройство помещалось целиком */
  .work__media { top: calc(50% + 32px); transform: translate(-50%, -50%) scale(.72); }
  .work__info { padding: 18px 20px; }
  .work__name h3 { font-size: 20px; }
  .work__tags { flex-wrap: wrap; justify-content: flex-end; }
  .cta { padding: 24px; }
  .cta__text { font-size: 24px; }
}

/* ===== Case pages ===== */
.case-intro { display: flex; flex-direction: column; gap: 12px; }
.case-intro__row { display: flex; justify-content: space-between; gap: 40px; }
.case-intro__head { display: flex; flex-direction: column; gap: 12px; flex: 0 1 620px; min-width: 0; }
.case-intro__titles { display: flex; flex-direction: column; gap: 8px; }
.case-intro__title {
  max-width: 584px;
  font-size: 68px;
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.case-intro__subtitle { font-size: 16px; font-weight: 500; line-height: 1.2; letter-spacing: -.02em; }

.case-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.case-tags li {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--secondary-hover);
  color: var(--primary);
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.case-text {
  flex: 0 0 620px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -.02em;
}
.case-text section { display: flex; flex-direction: column; gap: 8px; }
.case-text h2 { font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.case-text h3 { font-size: 14px; font-weight: 600; line-height: 1.5; }
.case-text ul,
.case-text ol { padding-left: 21px; }
.case-text ul { list-style: disc; }
.case-text ol { list-style: decimal; }
.case-text li + li { margin-top: 4px; }
.case-text li > ul { margin-top: 4px; }
.case-text li::marker { font-size: .9em; }
.case-text b { font-weight: 600; }
.case-text__step { display: flex; flex-direction: column; gap: 8px; }
.case-text li:has(> .case-text__step)::marker { font-weight: 600; }
.case-text li:has(> .case-text__step) + li { margin-top: 8px; }

/* Gallery: карточки со скриншотами, кадрирование задано в процентах — масштабируется вместе с шириной */
.case-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.case-gallery__col { display: flex; flex-direction: column; gap: 20px; }
.shot--stretch { align-self: stretch; }
.shot {
  position: relative;
  overflow: hidden;
  border-radius: 40px;
  background: var(--gray);
  aspect-ratio: 610 / 700;
}
.shot--wide { grid-column: 1 / -1; }
.shot--plain { background: none; border-radius: 0; }
.shot img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  max-width: none;
}

@media (max-width: 1200px) {
  .case-text { flex-basis: 52%; }
  .case-intro__title { font-size: 56px; }
}

@media (max-width: 960px) {
  .case-intro__row { flex-direction: column; gap: 32px; }
  .case-intro__head,
  .case-text { flex: none; }
  .case-gallery { grid-template-columns: minmax(0, 1fr); }
  .shot--stretch { aspect-ratio: var(--ar) !important; }
}

@media (max-width: 640px) {
  .case-intro__title { font-size: 40px; }
  .shot { border-radius: 24px; }
}

@media (max-width: 420px) {
  .hero__title { font-size: 34px; }
  .case-intro__title { font-size: 34px; }
  .cta__text { font-size: 22px; }
}

@media (max-width: 360px) {
  .hero__title { font-size: 28px; }
}

/* ===== Lightbox ===== */
.case-gallery .shot { cursor: zoom-in; }
.case-gallery .shot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background-color .2s;
}
.case-gallery .shot:hover::after { background: rgba(0, 0, 0, .06); }
.case-gallery .shot:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

.lightbox-open,
.lightbox-open body { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 20, 20, .92);
}
.lightbox[hidden] { display: none; }
.lightbox__scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 72px;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  cursor: default;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}
/* Длинный скриншот: по ширине экрана (не шире 1200px) и прокрутка вниз */
.lightbox.is-tall .lightbox__scroll { align-items: flex-start; }
.lightbox.is-tall .lightbox__img { width: min(1200px, 100%); max-height: none; }

.lightbox__btn {
  position: fixed;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font: 400 32px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: background-color .2s;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .28); }
.lightbox__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lightbox__btn[hidden] { display: none; }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev,
.lightbox__next { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 12px; }
.lightbox__next { right: 12px; }
.lightbox__counter {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 14px;
}

@media (max-width: 640px) {
  .lightbox__scroll { padding: 64px 8px 56px; }
  .lightbox__img { border-radius: 8px; }
  .lightbox__prev,
  .lightbox__next { top: auto; bottom: 8px; transform: none; width: 40px; height: 40px; }
  .lightbox__counter { bottom: 16px; }
}

/* Карточка «Обо мне»: цифры не прыгают по ширине во время отсчёта */
.stat__value { font-variant-numeric: tabular-nums; }

/* Карточка «Создаю дизайн»: при наведении теги по очереди подсвечиваются волной */
.about__card:hover .chip { animation: chip-wave .6s ease both; }
.about__card:hover .chip:nth-child(2) { animation-delay: .08s; }
.about__card:hover .chip:nth-child(3) { animation-delay: .16s; }
.about__card:hover .chip:nth-child(4) { animation-delay: .24s; }
.about__card:hover .chip:nth-child(5) { animation-delay: .32s; }
.about__card:hover .chip:nth-child(6) { animation-delay: .40s; }
@keyframes chip-wave {
  0%, 100% { transform: none; background: var(--secondary); color: var(--primary); }
  40% { transform: translateY(-4px); background: var(--primary); color: var(--white); }
}
@media (prefers-reduced-motion: reduce) {
  .about__card:hover .chip { animation: none; }
}

/* ===== Подвал с документами ===== */
.legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: -48px;
  color: var(--gray);
  font-size: 16px;
  line-height: 1.4;
}
.legal__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.legal a { transition: color .2s; }
.legal a:hover { color: var(--primary); }

/* ===== Страница политики ===== */
.legal-doc {
  max-width: 820px;
  padding: 40px;
  border-radius: var(--radius-lg);
  background: var(--white);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -.01em;
}
.legal-doc h1 { font-size: 40px; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
.legal-doc__date { margin-top: 12px; color: var(--gray); }
.legal-doc section { margin-top: 32px; scroll-margin-top: 24px; }
.legal-doc h2 { margin-bottom: 8px; font-size: 20px; font-weight: 600; line-height: 1.2; }
.legal-doc p + p { margin-top: 8px; }
.legal-doc ul { margin: 8px 0; padding-left: 21px; list-style: disc; }
.legal-doc li + li { margin-top: 4px; }
.legal-doc a { color: var(--primary); }
.legal-doc section:target h2 { color: var(--primary); }

@media (max-width: 640px) {
  .legal { margin-top: -32px; flex-direction: column; font-size: 14px; }
  .legal__links { flex-direction: column; }
  .legal-doc { padding: 24px 20px; font-size: 15px; }
  .legal-doc h1 { font-size: 28px; }
}
