/* Портфолио Нікіти. Графит, молочный и свет цвета выбранной работы. */
/* Запасные шрифты той же ширины: пока грузится основной, строки переносятся так же и сцена не прыгает */
@font-face { font-family: "Display fallback"; src: local("Arial Bold"), local("Arial-BoldMT"); font-weight: 700 900; size-adjust: 82.5%; }
@font-face { font-family: "Body fallback"; src: local("Arial"), local("ArialMT"); font-weight: 400 500; size-adjust: 104.5%; }

:root {
  --bg: #0c0d0e;
  --raised: #17191b;
  --milk: #efebe3;
  --muted: #b3b0a8;
  --line: rgba(239, 235, 227, .16);
  --flowers: #a9c79b;
  --balloons: #93a9ff;
  --salon: #e88a62;
  --cafe: #e3b04b;
  --display: "Roboto Condensed", "Display fallback", sans-serif;
  --body: Onest, "Body fallback", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 64px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--milk); font: 400 1.0625rem/1.6 var(--body); }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 1.02; text-transform: uppercase; text-wrap: balance; overflow-wrap: break-word; }
h2 { font-size: clamp(2.2rem, 5vw, 4.75rem); }
p { text-wrap: pretty; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--milk); outline-offset: 4px; }
::selection { background: var(--milk); color: var(--bg); }

.wrap { width: 100%; max-width: 1480px; margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; z-index: 10; top: 8px; left: 8px; padding: 10px 16px; background: var(--milk); color: var(--bg); transform: translateY(-160%); }
.skip:focus { transform: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 54px; padding: 12px 28px;
  border: 1px solid transparent; border-radius: 2px;
  font-weight: 700; line-height: 1.2; text-decoration: none;
  transition: background-color .25s, color .25s, border-color .25s;
}
.btn--milk { background: var(--milk); color: var(--bg); }
.btn--milk:hover { background: #fff; }
.btn--line { border-color: var(--line); }
.btn--line:hover { border-color: var(--milk); }
.arrow { transition: transform .35s var(--ease); }
a:hover > .arrow { transform: translate(3px, -3px); }

/* ── Шапка. Не прилипает ──────────────────────────────── */
.header { position: relative; z-index: 2; }
.header__inner { max-width: 1840px; min-height: 88px; display: flex; align-items: center; gap: 28px; }
.mark { display: inline-flex; align-items: center; min-height: 44px; font: 900 1.65rem/1 var(--display); text-transform: uppercase; text-decoration: none; }
.nav { position: static; inset: auto; display: flex; align-items: center; gap: 4px; width: auto; height: auto; margin: 0 auto; padding: 0; overflow: visible; border: 0; background: none; color: inherit; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 14px; color: var(--muted); text-decoration: none; transition: color .2s; }
.nav a:hover { color: var(--milk); }
.nav .nav__tg, .nav__close, .menu-btn { display: none; }
.langs { display: flex; border: 1px solid var(--line); border-radius: 2px; }
.langs a { display: grid; place-items: center; min-width: 44px; min-height: 44px; font-size: .8rem; font-weight: 700; text-decoration: none; }
.langs a[aria-current] { background: var(--milk); color: var(--bg); }
.header__tg { min-height: 46px; padding-block: 8px; }
.icon-btn { width: 46px; height: 46px; place-items: center; border: 1px solid var(--line); border-radius: 2px; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ── Первый экран: сцена ──────────────────────────────── */
.hero { --light: var(--flowers); position: relative; isolation: isolate; overflow: hidden; margin-top: -88px; padding-top: 88px; }
.hero[data-active="balloons"] { --light: var(--balloons); }
.hero[data-active="salon"] { --light: var(--salon); }
.hero[data-active="cafe"] { --light: var(--cafe); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--light); opacity: .17;
  -webkit-mask: radial-gradient(ellipse 48% 62% at 72% 50%, #000, transparent);
  mask: radial-gradient(ellipse 48% 62% at 72% 50%, #000, transparent);
  transition: background-color .9s;
}
.hero__inner {
  max-width: 1840px; min-height: min(calc(100svh - 88px), 1020px);
  display: grid; grid-template-columns: minmax(0, 43%) minmax(0, 1fr); align-items: center; gap: 36px;
  padding-block: 20px 36px;
}
.hero h1 { font-size: clamp(2.25rem, min(4.2vw, 8svh), 5.25rem); text-wrap: pretty; }
.hero h1 em { display: block; color: var(--light); font-style: normal; transition: color .9s; }
.lead { max-width: 32em; margin-block: 24px 28px; color: var(--muted); font-size: 1.125rem; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.more { display: inline-flex; align-items: center; min-height: 48px; padding-inline: 12px; text-decoration: none; }
.more span { border-bottom: 1px solid var(--line); transition: border-color .2s; }
.more:hover span { border-color: currentColor; }

.stage { min-width: 0; }
.deck { position: relative; width: 100%; max-width: max(300px, calc((100svh - 250px) * 1.42)); margin-inline: auto; aspect-ratio: 16 / 11; perspective: 1400px; }
.browser { overflow: hidden; padding-top: 24px; border-radius: 10px; background: #25272a; position: relative; }
.browser::before { content: ""; position: absolute; top: 9px; left: 12px; width: 6px; height: 6px; border-radius: 50%; background: #777; box-shadow: 11px 0 #777, 22px 0 #777; }
.browser img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.card {
  position: absolute; top: 18%; left: 0; width: 84%;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .55);
  transition: transform 1s var(--ease), filter 1s, opacity .6s;
}
.card[data-offset="0"] { z-index: 4; transform: rotateY(-7deg); }
.card[data-offset="1"] { z-index: 3; transform: translate(10.7%, -14%) rotateY(-13deg) scale(.95); filter: brightness(.5); }
.card[data-offset="2"] { z-index: 2; transform: translate(19%, -25%) rotateY(-17deg) scale(.9); filter: brightness(.3); }
.card[data-offset="3"] { z-index: 1; transform: translate(24%, -32%) rotateY(-20deg) scale(.86); filter: brightness(.15); opacity: 0; }
.phone { overflow: hidden; border: 6px solid #25272a; border-radius: 22px; background: #25272a; }
.phone img { width: 100%; height: auto; aspect-ratio: 390 / 693; object-fit: cover; }
.phone .phone__old { position: absolute; inset: 0; height: 100%; }
.deck .phone { position: absolute; z-index: 5; right: 3%; bottom: 0; width: 21%; box-shadow: 0 25px 45px rgba(0, 0, 0, .6); }

.stage__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-top: 14px; }
.stage__label { color: var(--muted); font-size: .8rem; }
.stage__pause { display: grid; place-items: center; width: 32px; height: 32px; color: var(--muted); transition: color .2s; }
.stage__pause:hover { color: var(--milk); }
.stage__pause svg { width: 14px; height: 14px; fill: currentColor; }
.stage__pause[aria-pressed="true"] .is-running, .stage__pause[aria-pressed="false"] .is-paused { display: none; }
.picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.picker button { position: relative; min-height: 56px; padding-top: 10px; border-top: 2px solid var(--line); color: var(--muted); text-align: left; line-height: 1.2; transition: color .2s; }
.picker button::before { content: ""; position: absolute; top: -2px; left: 0; right: 0; height: 2px; background: var(--light); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.picker button:hover, .picker button[aria-pressed="true"] { color: var(--milk); }
.picker button[aria-pressed="true"]::before { transform: none; }
.picker small { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; }

/* ── Работы ───────────────────────────────────────────── */
.work { padding-top: clamp(72px, 10vw, 150px); }
.head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr); align-items: end; gap: 20px 60px; padding-bottom: clamp(36px, 5vw, 72px); }
.head p { color: var(--muted); }
/* clip, а не hidden: hidden стал бы своей прокруткой, и анимация работ от прокрутки замерла бы */
.case { --light: var(--flowers); background: #121a15; overflow: hidden; overflow: clip; }
.case--balloons { --light: var(--balloons); background: #10152b; }
.case--salon { --light: var(--salon); background: #21140f; }
.case--cafe { --light: var(--cafe); background: #0d1e22; }
.case__inner { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: center; gap: clamp(32px, 5vw, 96px); padding-block: clamp(48px, 7vw, 112px); }
.case:nth-child(even) .case__visual { order: -1; }
.case:nth-child(even) .case__inner { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
.case__type { color: var(--light); font-weight: 500; }
.case h3 { margin-block: 12px 20px; font-size: clamp(3rem, 6vw, 6.25rem); }
.case__text { max-width: 27em; }
.case__status { position: relative; padding-left: 17px; max-width: 30em; margin-top: 18px; color: var(--muted); font-size: .9rem; }
.case__status::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--light); }
.case__links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 28px; }
.case__links .btn { border-color: var(--light); color: var(--light); }
.case__links .btn:hover { background: var(--light); color: var(--bg); }
.note { color: var(--muted); font-size: .8rem; }

.switch { display: flex; justify-content: flex-end; gap: 4px; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.switch label { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding-inline: 14px; border-bottom: 2px solid transparent; color: var(--muted); font-size: .875rem; cursor: pointer; }
.switch label:hover, .switch label:has(:checked) { color: var(--milk); }
.switch label:has(:checked) { border-color: var(--light); }
.switch label:has(:focus-visible) { outline: 2px solid var(--milk); outline-offset: 2px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.devices { display: grid; aspect-ratio: 16 / 10; }
.devices > * { grid-area: 1 / 1; min-height: 0; align-self: center; justify-self: center; transition: opacity .45s, transform .7s var(--ease), visibility .45s; }
.devices .browser { width: 100%; }
.devices .phone { height: 100%; aspect-ratio: 390 / 693; box-sizing: content-box; max-height: calc(100% - 12px); opacity: 0; visibility: hidden; transform: translateY(24px); }
.devices .phone img { height: 100%; }
.case__visual:has([value="phone"]:checked) .browser { opacity: 0; visibility: hidden; transform: scale(.94); }
.case__visual:has([value="phone"]:checked) .phone { opacity: 1; visibility: visible; transform: none; }

/* ── Заказ в Telegram ─────────────────────────────────── */
.section { padding-block: clamp(72px, 10vw, 150px); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 48px clamp(48px, 8vw, 140px); }
.split .lead { margin-bottom: 0; }
.chat { margin: 0; padding: clamp(18px, 3vw, 40px); border-radius: 28px; background: var(--raised); }
.message { max-width: 420px; margin: 0; padding: 18px 20px; border-radius: 4px 18px 18px; background: #24282c; font-size: .95rem; line-height: 1.6; }
.message + .message { margin: 14px 0 0 auto; }
.message b { display: block; margin-bottom: 4px; }
.qty { display: inline-block; padding-inline: 6px; border-radius: 3px; background: var(--flowers); color: var(--bg); font-weight: 700; }
.keys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.keys span { flex: 1 1 auto; padding: 7px 10px; border-radius: 6px; background: rgba(255, 255, 255, .09); font-size: .8rem; text-align: center; }
.chat figcaption { margin-top: 18px; color: var(--muted); font-size: .8rem; }

/* ── Услуги и начало работы ───────────────────────────── */
.services { margin-top: clamp(32px, 5vw, 64px); border-bottom: 1px solid var(--line); }
.services li { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: baseline; gap: 10px 40px; padding-block: clamp(22px, 3vw, 38px); border-top: 1px solid var(--line); }
.services h3 { font-size: clamp(1.7rem, 3vw, 3rem); }
.services p { max-width: 32em; color: var(--muted); }

.start { background: var(--milk); color: var(--bg); }
.start :focus-visible { outline-color: var(--bg); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px clamp(24px, 4vw, 72px); margin-top: clamp(36px, 5vw, 72px); }
.steps li { padding-top: 20px; border-top: 2px solid var(--bg); }
.steps i { display: block; margin-bottom: 24px; font: 900 clamp(3rem, 6vw, 6rem)/1 var(--display); font-style: normal; }
.steps h3 { margin-bottom: 12px; font-size: clamp(1.35rem, 1.9vw, 1.85rem); }
.steps p { color: #4a4843; }

/* ── Вопросы и связь ──────────────────────────────────── */
.faq__inner { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 36px clamp(40px, 6vw, 110px); align-items: start; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; padding-block: 18px; font-weight: 500; font-size: 1.125rem; line-height: 1.35; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font: 400 1.7rem/1 var(--body); transition: transform .3s var(--ease); }
.faq details[open]:not(.is-closing) summary::after { transform: rotate(45deg); }
.faq details.is-moving { overflow: hidden; }
.faq summary, .faq details p { padding-inline: 10px; }
.faq summary:focus-visible { outline-offset: -2px; }
.faq details p { max-width: 36em; padding-bottom: 24px; color: var(--muted); }

.contact { position: relative; isolation: isolate; overflow: hidden; border-top: 1px solid var(--line); }
.contact::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 45% 75% at 82% 80%, rgba(169, 199, 155, .17), transparent); }
.contact h2 { max-width: 13em; font-size: clamp(2.6rem, 7vw, 7rem); text-wrap: pretty; }
.contact .btn--milk { min-height: 62px; padding-inline: 36px; font-size: 1.125rem; }
.handle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 18px; color: var(--muted); font-size: .9rem; }
.handle strong { color: var(--milk); font-size: 1.125rem; -webkit-user-select: all; user-select: all; }
.copy { min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }

.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-block: 26px; }

.lost { min-height: 100svh; display: grid; align-content: center; justify-items: start; gap: 28px; }

/* ── Планшет и телефон ────────────────────────────────── */
@media (max-width: 1080px) {
  .header__inner { gap: 14px; }
  .nav a { padding-inline: 8px; }
  .header__tg { padding-inline: 16px; }
}

@media (max-width: 860px) {
  .header__inner { min-height: 68px; gap: 10px; }
  .mark { margin-right: auto; font-size: 1.5rem; }
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
  .header__tg { display: none; }
  .nav:popover-open {
    position: fixed; inset: 8px 8px auto; display: grid; gap: 0; align-items: stretch;
    width: auto; max-height: calc(100dvh - 16px); margin: 0; padding: 70px 22px 22px; overflow: auto;
    border: 1px solid var(--line); border-radius: 4px; background: var(--raised);
  }
  .nav:popover-open a { min-height: 60px; padding: 0; border-bottom: 1px solid var(--line); color: var(--milk); font: 900 1.9rem/1 var(--display); text-transform: uppercase; }
  .nav:popover-open .nav__tg { display: flex; justify-content: center; margin-top: 18px; padding: 12px; border: 0; background: var(--milk); color: var(--bg); font: 700 1rem/1.2 var(--body); text-transform: none; }
  .nav:popover-open .nav__close { position: absolute; top: 12px; right: 12px; display: inline-grid; }
  .nav::backdrop { background: rgba(0, 0, 0, .6); }

  .hero { margin-top: -68px; padding-top: 68px; }
  .hero::before { -webkit-mask-image: radial-gradient(ellipse 80% 45% at 70% 75%, #000, transparent); mask-image: radial-gradient(ellipse 80% 45% at 70% 75%, #000, transparent); }
  .hero__inner { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 12px; padding-block: 18px 32px; }
  .hero h1 { font-size: clamp(1.9rem, min(9.8vw, 6.4svh), 3.5rem); }
  .lead { margin-block: 14px 16px; font-size: 1rem; line-height: 1.5; }
  .hero__actions .btn { width: 100%; }
  .hero__actions .more { width: 100%; justify-content: center; }
  .deck { max-width: min(100%, 560px); }
  .deck .phone { border-width: 4px; border-radius: 14px; }
  .picker { gap: 6px; }
  .picker button { font-size: .78rem; }
  .picker small { display: none; }

  .head, .split, .faq__inner, .case__inner, .case:nth-child(even) .case__inner { grid-template-columns: minmax(0, 1fr); }
  .case:nth-child(even) .case__visual { order: 0; }
  .case__inner { gap: 24px; }
  .devices { aspect-ratio: auto; }
  .devices .phone { height: auto; max-height: none; width: min(62%, 250px); }
  .case__visual:not(:has([value="phone"]:checked)) .phone { display: none; }
  .case__visual:has([value="phone"]:checked) .browser { display: none; }
  .services li, .steps { grid-template-columns: minmax(0, 1fr); }
  .steps i { margin-bottom: 10px; }
  .contact .btn--milk { width: 100%; padding-inline: 18px; }
}

/* Старый браузер без popover: меню просто прячется, всё есть на странице */
@supports not selector(:popover-open) { .menu-btn { display: none !important; } }
/* Без :has показываем только снимок компьютера */
@supports not selector(:has(*)) { .switch, .devices .phone { display: none; } }

/* ── Движение. Страницу не задерживает ────────────────── */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .card { animation: deal 1.2s var(--ease) both; }
  .card:nth-child(2) { animation-delay: .1s; }
  .card:nth-child(3) { animation-delay: .18s; }
  .deck .phone { animation: rise 1s .5s var(--ease) both; }
  @supports (animation-timeline: view()) {
    .case__visual, .chat {
      animation: settle linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
  }
}
/* Работы меняются сами, слова и ответы появляются. Прячем только под классами, которые ставит скрипт */
@media screen and (prefers-reduced-motion: no-preference) {
  .hero.is-auto .picker button[aria-pressed="true"]::before { animation: fill 3.2s linear both; }
  .hero.is-held .picker button[aria-pressed="true"]::before { animation-play-state: paused; }

  .words-title .word { display: inline-block; max-width: 100%; opacity: 0; }
  .words-title.is-in .word { animation: word-up .9s var(--ease) both; animation-delay: calc(var(--i) * 110ms); }
  .words-text .word { opacity: 0; }
  .words-text.is-in .word { animation: word-in .7s ease both; animation-delay: calc(.15s + var(--i) * 35ms); }
  .rise { opacity: 0; }
  .rise.is-in { animation: block-up .9s var(--ease) both; animation-delay: calc(var(--order, 0) * 100ms); }
  .rise:focus-within, .rise:focus { opacity: 1; }

  .faq details p { transition: opacity .3s, translate .4s var(--ease); }
  .faq details[open]:not(.is-closing) p { animation: answer .7s var(--ease) .08s backwards; }
  .faq details.is-closing p { opacity: 0; translate: 0 -8px; }
}
@media (prefers-reduced-motion: reduce) {
  .stage__pause { display: none; }
  *, *::before, *::after { transition: none !important; }
}
/* translate и scale, а не transform: transform у окон занят местом на сцене */
@keyframes deal { from { translate: 0 22%; scale: .88; } }
@keyframes rise { from { opacity: 0; translate: 0 28px; } }
@keyframes settle { from { translate: 0 56px; scale: .94; } }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes word-up { from { opacity: 0; translate: 0 .4em; filter: blur(6px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }
@keyframes word-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes block-up { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@keyframes answer { from { opacity: 0; translate: 0 -10px; } }
