:root {
  --bg: #000;
  --ink: #f3f0ea;        /* основной текст */
  --muted: #8d8a85;      /* второстепенный текст */
  --line: rgb(243 240 234 / .14);
  --card: #111;          /* карточки, пузыри */
  --accent: #f2a54a;     /* янтарный акцент */
  --accent-ink: #1d1100;

  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: var(--font);  /* шрифт крупных заголовков; темы меняют его */
  --gutter: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(.7, 0, .2, 1);

  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hero__title,
.reel__caption,
.loader__count,
.manifesto__text,
.marquee__inner,
.service h3,
.works__title,
.project__title,
.contact__title,
.about__title {
  font-family: var(--display);
}

/* Разбивка текста на буквы и слова (делает main.js) */
.split-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .08em;
  margin-bottom: -.08em;
}
.split-char,
.split-word { display: inline-block; will-change: transform; }

/* ---------- Прелоадер ---------- */

.loader { display: none; }

.js .loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: var(--gutter);
  background: var(--bg);
}

.loader__name {
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -.02em;
}

.loader__count {
  font-size: clamp(5rem, 18vw, 16rem);
  font-weight: 600;
  line-height: .8;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Шапка ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
  mix-blend-mode: difference;
  color: #fff;
}

.nav__logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.03em;
  text-decoration: none;
}

.nav nav { display: flex; gap: clamp(18px, 3vw, 40px); }

.nav__link {
  text-decoration: none;
  font-weight: 500;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .4s var(--ease);
}
.nav__link:hover { background-size: 100% 1px; }

/* ---------- Первый экран ---------- */

.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
}

.hero__title {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(84px, 13vh, 130px) var(--gutter) clamp(84px, 14vh, 140px);
  font-size: clamp(3rem, 10.4vw, 11rem);
  line-height: .9;
  letter-spacing: -.055em;
  font-weight: 600;
  pointer-events: none;
  mix-blend-mode: difference;
  color: #fff;
}

.hero__line { display: block; white-space: nowrap; }
.hero__line--2 { align-self: flex-end; }

/* Кадр-шоурил: на старте маленький в центре, при прокрутке раскрывается (main.js) */
.reel {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #0b0b0b;
  clip-path: inset(calc(50% - 9.5vw) calc(50% - 17vw) round 18px);
}

.reel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.reel img:first-child { opacity: 1; }

.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 55%, rgb(0 0 0 / .75));
}

.reel__caption {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(28px, 6vh, 56px);
  z-index: 1;
  max-width: 18ch;
  margin: 0;
  font-size: clamp(1.8rem, 4.2vw, 4rem);
  line-height: 1;
  letter-spacing: -.04em;
  font-weight: 600;
  opacity: 0;
}

.hero__note,
.hero__hint {
  position: absolute;
  z-index: 3;
  bottom: 24px;
  margin: 0;
  font-size: .9375rem;
  color: var(--muted);
}
.hero__note { left: var(--gutter); max-width: 30ch; }
.hero__hint { right: var(--gutter); }

.hero__hint::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 28px;
  margin-left: 12px;
  vertical-align: middle;
  background: currentColor;
  transform-origin: top;
  animation: hint 1.8s var(--ease) infinite;
}

@keyframes hint {
  0%   { transform: scaleY(0); }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- Манифест ---------- */

.manifesto {
  padding: clamp(120px, 24vh, 260px) var(--gutter);
}

.manifesto__text {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(2rem, 5.6vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 600;
}

/* ---------- Бегущая строка ---------- */

.marquee {
  overflow: hidden;
  padding-block: clamp(18px, 3vh, 32px);
  border-block: 1px solid var(--line);
}

.marquee__row { display: flex; }

.marquee__inner {
  display: flex;
  align-items: center;
  flex: none;
  white-space: nowrap;
  font-size: clamp(2.4rem, 7vw, 7rem);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1;
}

.marquee__inner span { padding-inline: .25em; }

.marquee__inner i {
  width: .32em;
  height: .32em;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Услуги ---------- */

.services {
  padding: clamp(80px, 16vh, 180px) var(--gutter);
}

.services__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.service {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px clamp(24px, 5vw, 80px);
  align-items: baseline;
  padding-block: clamp(22px, 3.6vh, 40px);
  border-bottom: 1px solid var(--line);
}

.service h3 {
  font-size: clamp(1.9rem, 4.4vw, 4.2rem);
  line-height: 1;
  letter-spacing: -.045em;
  transition: transform .5s var(--ease), color .4s;
}

.service p {
  margin: 0;
  max-width: 44ch;
  color: var(--muted);
}

@media (hover: hover) {
  .service:hover h3 { transform: translateX(.18em); color: var(--accent); }
}

/* ---------- Работы: код → сборка → результат ---------- */

.works__head {
  padding: clamp(80px, 14vh, 160px) var(--gutter) clamp(40px, 8vh, 80px);
}

.works__title {
  font-size: clamp(4rem, 17vw, 17rem);
  line-height: .85;
  letter-spacing: -.07em;
}

/* Каждый проект — экран, который закрепляется на время «сборки» (main.js).
   Сверху короткая строка о проекте, под ней большое окно редактора.
   После сборки окно раскрывается на весь экран. */
.project {
  position: relative;
  height: 100svh;
  min-height: 640px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
}

.project__text {
  position: absolute;
  top: 78px;
  left: var(--gutter);
  right: var(--gutter);
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  grid-template-areas:
    "kind  text"
    "title text"
    "title meta";
  column-gap: clamp(24px, 4vw, 64px);
  align-items: end;
}

.project__text > .project__kind {
  grid-area: kind;
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 500;
}

.project__title {
  grid-area: title;
  margin: 0;
  font-size: clamp(2.2rem, 4.4vw, 4.6rem);
  line-height: .92;
  letter-spacing: -.055em;
}

.project__text > p:not(.project__kind) {
  grid-area: text;
  margin: 0;
  max-width: 62ch;
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--muted);
}

.project__meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 14px;
}

.project__meta .action { margin-top: 0; }

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.tags li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .8125rem;
}

/* Окно редактора: занимает всё место под строкой проекта (--win-top считает main.js) */
.window {
  position: absolute;
  top: var(--win-top, 300px);
  left: var(--gutter);
  right: var(--gutter);
  bottom: 24px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow: 0 40px 120px -40px rgb(242 165 74 / .18);
}

.window__bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 42px;
  flex: none;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #111;
}

.window__dots { display: flex; gap: 7px; }
.window__dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2b2b2b;
}

.window__label {
  font: 400 .8125rem/1 "JetBrains Mono", ui-monospace, monospace;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Подпись окна меняется с имени файла на адрес результата */
.window__label--live {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 60%;
  padding: 5px 14px;
  border-radius: 8px;
  background: #1b1b1b;
  color: var(--ink);
}

.window__body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.code {
  margin: 0;
  height: 100%;
  padding: 18px 0;
  overflow: hidden;
  font: 400 clamp(.75rem, 1vw, 1rem)/1.65 "JetBrains Mono", ui-monospace, monospace;
  color: #d8d4cc;
  tab-size: 4;
}

.code code { position: relative; display: block; font: inherit; }

/* Строки кода (размечает main.js): номер + текст, который «печатается» */
.ln {
  position: relative;
  display: flex;
  white-space: pre;
}

.ln__no {
  flex: none;
  width: 3.4em;
  padding-right: 1.2em;
  text-align: right;
  color: #4a4744;
  user-select: none;
}

.ln__text {
  clip-path: inset(0 calc((1 - var(--p, 1)) * 100%) 0 0);
}

.caret {
  position: absolute;
  top: 0;
  left: 0;
  width: .6em;
  height: 1.3em;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}

/* Подсветка синтаксиса */
.tk-k { color: #ff8f6b; }   /* ключевые слова */
.tk-s { color: #a8d99a; }   /* строки */
.tk-c { color: #6d6a65; font-style: italic; }  /* комментарии */
.tk-n { color: #f2c46d; }   /* числа */
.tk-f { color: #7fc6ff; }   /* вызовы функций */
.tk-t { color: #e7a3ff; }   /* JSX-теги */

/* Строка сборки внизу окна */
.build {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgb(17 17 17 / .92);
  font: 400 .8125rem/1.3 "JetBrains Mono", ui-monospace, monospace;
  opacity: 0;
}

.build p { margin: 0; }
.build__cmd { color: var(--ink); }
.build__done { color: #a8d99a; opacity: 0; }

.build__bar {
  height: 3px;
  border-radius: 3px;
  background: #222;
  overflow: hidden;
}
.build__bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}

/* Готовый результат поверх кода. Без JS он виден сразу. */
.live {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.live img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live img.pixel { image-rendering: pixelated; }

.live--chat {
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
  cursor: default;
  background:
    radial-gradient(80% 60% at 50% 0%, rgb(242 165 74 / .08), transparent 70%),
    #050505;
}

/* Кнопки под текстом проекта */
.action {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 600 1rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .3s;
}

.action:hover { background: var(--accent); }

.action.play { padding-left: 14px; }

.action.play::before {
  content: "";
  width: 30px;
  height: 30px;
  margin: -8px 0;
  border-radius: 50%;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath fill-rule='evenodd' d='M15 0a15 15 0 1 1 0 30 15 15 0 0 1 0-30zM12 9v12l10-6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath fill-rule='evenodd' d='M15 0a15 15 0 1 1 0 30 15 15 0 0 1 0-30zM12 9v12l10-6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.action.play:hover::before { background: var(--accent-ink); }

/* Кнопка на готовом результате (появляется после сборки) */
.live__cta {
  position: absolute;
  right: clamp(16px, 2.4vw, 32px);
  bottom: clamp(16px, 2.4vw, 32px);
  z-index: 1;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 1rem/1 var(--font);
  box-shadow: 0 12px 40px rgb(0 0 0 / .45);
}

/* Телефон и планшет: строка проекта в столбик, окно ниже */
@media (max-width: 899px) {
  .project__text {
    top: 70px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "kind" "title" "text" "meta";
  }

  .project__title { font-size: clamp(2rem, 9vw, 3rem); margin: 0 0 8px; }

  .project__text > p:not(.project__kind) {
    font-size: .875rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .project .tags { display: none; }
  .project__meta { margin-top: 10px; }
  .action { padding: 11px 18px; }

  .window { bottom: 16px; }
  .window__label--live { max-width: 55%; }
  .code { font-size: .625rem; }
}

/* ---------- Переписка в боте ---------- */

.chat {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #0c0c0c;
  max-width: 520px;
  width: 100%;
  justify-self: center;
}

.chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.chat__head small { font-weight: 400; color: var(--muted); }

.chat__avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.chat__log {
  list-style: none;
  margin: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: .9375rem;
  line-height: 1.45;
}

.msg {
  max-width: 85%;
  padding: 9px 14px;
  border-radius: 16px;
}

.msg--bot {
  align-self: flex-start;
  background: #1c1c1c;
  border-bottom-left-radius: 4px;
}

.msg--me {
  align-self: flex-end;
  background: var(--ink);
  color: #111;
  border-bottom-right-radius: 4px;
}

.msg__buttons { display: flex; gap: 6px; margin-top: 10px; }

.msg__buttons span {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgb(243 240 234 / .07);
  text-align: center;
  font-size: .8125rem;
}

.msg--voice { display: flex; align-items: center; gap: 10px; font-size: .8125rem; }

.voice__play {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #111;
}
.voice__play::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  border-left: 9px solid var(--ink);
  border-block: 6px solid transparent;
}

.voice__wave {
  width: 96px;
  height: 18px;
  background: #111;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 18' preserveAspectRatio='none'%3E%3Cpath d='M0 9h3V5h3v8h3V2h3v14h3V6h3v6h3V3h3v12h3V7h3v4h3V1h3v16h3V5h3v8h3V4h3v10h3V8h3v2h3V5h3v8h3V3h3v12h3V6h3v6h3V8h3v2h3V9z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 18' preserveAspectRatio='none'%3E%3Cpath d='M0 9h3V5h3v8h3V2h3v14h3V6h3v6h3V3h3v12h3V7h3v4h3V1h3v16h3V5h3v8h3V4h3v10h3V8h3v2h3V5h3v8h3V3h3v12h3V6h3v6h3V8h3v2h3V9z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  opacity: .8;
}

.msg--file { display: flex; align-items: center; gap: 12px; }

.file__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #2f7d4f;
  color: #fff;
  font-size: .6875rem;
  font-weight: 600;
}

.msg--file b { display: block; font-weight: 500; }
.msg--file small { color: var(--muted); }

/* ---------- Связаться: форма → готовое сообщение в Telegram ---------- */

.contact {
  padding: clamp(100px, 16vh, 180px) var(--gutter);
}

.contact__title {
  font-size: clamp(2.6rem, 7vw, 7rem);
  line-height: .9;
  letter-spacing: -.05em;
}

.contact__lead {
  max-width: 52ch;
  margin: 18px 0 0;
  color: var(--muted);
}

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
  margin-top: clamp(32px, 6vh, 56px);
}

.contact__form {
  display: grid;
  gap: 26px;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / .02);
}

.field {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field label,
.field legend {
  padding: 0;
  font-weight: 500;
}

.field legend { margin-bottom: 10px; }

.field input[type="text"],
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #050505;
  color: var(--ink);
  font: inherit;
  transition: border-color .2s, box-shadow .2s;
}

.field textarea { min-height: 140px; resize: vertical; }

.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: .7; }

.field input[type="text"]:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.field textarea[aria-invalid="true"] { border-color: #ff7a6b; }

.field__error { margin: 0; color: #ff7a6b; font-size: .875rem; }

.field__note { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }

/* Поле ссылки или подсказка про файл под переключателем «ТЗ» */
.brief { display: grid; gap: 10px; margin-top: 14px; }
.brief[hidden] { display: none; }

.field input[aria-invalid="true"] { border-color: #ff7a6b; }

/* Выбор проекта — «таблетки» поверх обычных радиокнопок */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { position: relative; cursor: pointer; }

.chip input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chip span {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background-color .2s, color .2s, border-color .2s;
}

.chip:hover span { border-color: var(--muted); }
.chip input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

.contact__submit {
  justify-self: start;
  padding: 16px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 1rem/1 var(--font);
  cursor: pointer;
  transition: box-shadow .25s;
}
.contact__submit:hover { box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 45%, transparent); }

.contact__status { min-height: 1.5em; margin: -10px 0 0; color: var(--muted); font-size: .875rem; }

/* Предпросмотр: как сообщение будет выглядеть в Telegram */
.contact__preview { position: sticky; top: 96px; margin: 0; }
.contact__preview figcaption { margin-bottom: 12px; color: var(--muted); font-size: .875rem; }
.contact__preview .chat { max-width: none; }
.contact__message { max-width: 94%; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__hint { opacity: .5; }

.contact__direct { margin: 32px 0 0; color: var(--muted); }
.contact__direct a { color: var(--ink); }

@media (max-width: 899px) {
  .contact__grid { grid-template-columns: minmax(0, 1fr); }
  .contact__preview { position: static; }
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Окно с игрой ---------- */

.player {
  width: min(1280px, 100vw);
  height: min(820px, 100svh);
  max-width: 100vw;
  max-height: 100svh;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}

.player::backdrop { background: rgb(0 0 0 / .88); }

.player iframe {
  display: block;
  width: 100%;
  height: calc(100% - 48px);
  border: 0;
}

.player__close {
  width: 100%;
  height: 48px;
  border: 0;
  background: #0c0c0c;
  color: var(--muted);
  font: 500 .9375rem var(--font);
  cursor: pointer;
}
.player__close:hover { color: var(--ink); }

/* ---------- Телефон ---------- */

@media (max-width: 640px) {
  .hero__note { max-width: 22ch; font-size: .875rem; }
  .service { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .player { border-radius: 0; }

  /* Код для телефона — строки до 42 символов: кегль подстраивается под ширину экрана */
  .code { font-size: min(.75rem, calc((100vw - 34px) / 29.5)); }

  /* Названия проектов не шире экрана, даже на 320 px */
  .project__title { font-size: min(2.6rem, calc((100vw - 32px) / 10.6)); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__hint::after { animation: none; }
  .reel { clip-path: none; }
  .reel__caption { opacity: 1; }
}
