/* Inter лежит рядом с сайтом: страница не обращается к чужим серверам. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-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 {
  /* «only» запрещает браузеру самому перекрашивать страницу в тёмную. */
  color-scheme: only light;

  --bg: #ffffff;
  --ink: #0b0b0c;
  --text: #3d4046;
  --muted: #6b6f76;
  --soft: #8a8d94;
  --line: #e6e6ea;
  --tg: #229ed9;
  --tg-hover: #1b8ac0;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --page: 1180px;
  --gutter: max(20px, 5vw);
  --radius: 12px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Заголовки: один шрифт, плотный трекинг вместо отдельного узкого начертания. */
h1,
.contact__title {
  color: var(--ink);
  font-size: clamp(2.25rem, 5.2vw, 3.875rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  overflow-wrap: break-word;
}

h2 {
  color: var(--ink);
  font-size: clamp(1.75rem, 3.3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

h3 {
  color: var(--ink);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* ---------- каркас ---------- */

.top,
main > section,
.foot {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

.skip {
  position: absolute;
  top: 0.5rem;
  left: -9999px;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: #fff;
}

.skip:focus {
  left: var(--gutter);
}

.sprite {
  position: absolute;
}

/* ---------- кнопка Telegram: единственный цветной элемент оформления ---------- */

.tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.7rem 1.5rem 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--tg);
  color: #fff;
  /* Не мельче 19 пикселей и жирно: только так белое на этом голубом проходит по контрасту. */
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color 0.15s ease;
}

.tg:hover {
  background: var(--tg-hover);
}

.tg svg {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.tg--small {
  min-height: 2.75rem;
  padding: 0.4rem 1.1rem 0.4rem 0.75rem;
}

/* На телефоне поля уже: «Написать @KrysovAleksandr» должно уместиться в одну строку. */
.tg--large {
  min-height: 3.75rem;
  padding: 0.9rem 1.25rem 0.9rem 1rem;
}

/* ---------- шапка ---------- */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.25rem;
}

.top__name {
  color: var(--ink);
  font-weight: 500;
}

.top__nav {
  display: none;
  gap: 1.75rem;
  margin-left: auto;
}

.top__nav a {
  padding-block: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}

.top__nav a:hover {
  color: var(--ink);
}

/* ---------- первый экран ---------- */

.hero {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
}

h1 span {
  display: block;
  text-wrap: balance;
}

.h-soft {
  color: var(--soft);
}

.lead {
  max-width: 34rem;
  margin-top: 1.75rem;
  font-size: 1.1875rem;
  line-height: 1.45;
  /* Не оставлять последнее слово абзаца на строке в одиночестве. */
  text-wrap: pretty;
}

.cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 2rem;
}

.textlink {
  display: inline-block;
  align-self: flex-start;
  padding-block: 0.625rem;
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

/* ---------- общий вид блока ---------- */

.block {
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

/* Номер и подпись — две колонки: длинная подпись переносится внутри своей, номер остаётся рядом. */
.eyebrow {
  display: flex;
  gap: 0.9rem;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}

.eyebrow__n {
  flex: none;
  color: var(--ink);
  font-weight: 500;
}

/* ---------- что я могу сделать ---------- */

.cards {
  display: grid;
  gap: 2rem;
  margin-top: 2.25rem;
}

.card p {
  margin-top: 0.6rem;
}

/* Строка под карточками: список направлений открытый, и это сказано прямо. */
.cards-note {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

/* ---------- кейсы ---------- */

.case__grid {
  display: grid;
  gap: 1.75rem;
  margin-top: 2.25rem;
}

.case__head p {
  margin-top: 1.1rem;
}

.facts li {
  padding-block: 0.7rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.facts li:last-child {
  border-bottom: 1px solid var(--line);
}

.case__body .textlink {
  margin-top: 0.5rem;
}

.inside {
  color: var(--text);
  font-size: 0.9375rem;
}

.inside summary {
  display: inline-block;
  min-height: 2.75rem;
  padding-block: 0.625rem;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.inside summary::-webkit-details-marker {
  display: none;
}

.inside summary::before {
  content: '+\00a0';
}

.inside[open] summary::before {
  content: '\2212\00a0';
}

.inside p {
  max-width: 34rem;
}

.shot {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 28px 60px -34px rgba(11, 11, 12, 0.35);
}

.shot--main {
  width: 100%;
}

/* Телефон заходит на нижний край большого снимка: видно, что это один и тот же сайт. */
.shot--phone {
  position: relative;
  width: 30%;
  margin: -18% 6% 0 auto;
}

.shot--wide {
  width: 72%;
  margin: 1rem 0 0 auto;
}

/* ---------- как я работаю ---------- */

.steps {
  display: grid;
  gap: 1.75rem;
  margin-top: 2.25rem;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: 'Шаг ' counter(step);
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
}

.steps h3,
.steps p {
  margin-top: 0.4rem;
}

.steps p {
  font-size: 0.9375rem;
}

.notes {
  display: grid;
  gap: 1rem 3rem;
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.notes strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- связь и подвал ---------- */

.contact {
  padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
}

.contact__title {
  margin-top: 2rem;
}

.contact .tg {
  display: flex;
  margin-top: 2rem;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------- планшет ---------- */

@media (min-width: 700px) {
  body {
    font-size: 1.0625rem;
  }

  .top__nav {
    display: flex;
  }

  .lead {
    font-size: 1.25rem;
  }

  .cta {
    flex-direction: row;
    align-items: center;
    gap: 1.75rem;
  }

  .contact .tg {
    display: inline-flex;
  }

  .tg--large {
    padding: 0.9rem 2rem 0.9rem 1.4rem;
    font-size: 1.375rem;
  }

  .tg--large svg {
    width: 1.875rem;
    height: 1.875rem;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 2.5rem;
  }

  .notes {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- компьютер ---------- */

@media (min-width: 1000px) {
  .case__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    grid-template-areas:
      'head media'
      'body media';
    align-items: start;
    gap: 1.25rem 3.5rem;
  }

  .case--rev .case__grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    grid-template-areas:
      'media head'
      'media body';
  }

  .case__head {
    grid-area: head;
  }

  .case__media {
    grid-area: media;
  }

  .case__body {
    grid-area: body;
  }

  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
}
