/* ============================================================
   LapaLab · редизайн 2.11.2026
   «Ночь + лайм»: ночной синий фон, слоновая кость в тексте,
   лайм — только там, где нужно действие. Сериф в заголовках.
   ============================================================ */

:root {
  --night: #0e1424;
  --deep:  #080c16;
  --panel: #161e33;
  --panel-2: #1c2540;
  --line:  rgba(242, 238, 227, 0.12);
  --line-strong: rgba(242, 238, 227, 0.26);

  --ivory: #f2eee3;
  --dust:  #9aa3b8;
  --lime:  #c6f432;
  --lime-ink: #101a06;
  --ember: #ff7a59;

  --font-display: "Piazzolla", "Georgia", "Times New Roman", serif;
  --font-body: "Onest", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 5rem);
  --max: 1440px;
  --section: clamp(5rem, 11vw, 10rem);

  --h1: clamp(2.75rem, 7.2vw, 6.75rem);
  --h2: clamp(2rem, 4.2vw, 3.75rem);
  --h3: clamp(1.35rem, 2vw, 1.75rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --z-preview: 5;
  --z-header: 20;
  --z-menu: 30;
}

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

html { scroll-behavior: smooth; background: var(--night); }
html.no-smooth { scroll-behavior: auto; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--night);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Зерно поверх всего — чтобы тёмный фон не был плоским */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.045;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
  font-variation-settings: "opsz" 30;
}
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); line-height: 1.15; }
em { font-style: italic; font-weight: 400; }

p { margin: 0; max-width: 64ch; text-wrap: pretty; }
p + p { margin-top: 1em; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
img, svg, video { max-width: 100%; display: block; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
::selection { background: var(--lime); color: var(--lime-ink); }

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

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.muted { color: var(--dust); }
.lime { color: var(--lime); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ivory);
  text-decoration: none;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.4s var(--ease);
}
.btn:hover { border-color: var(--ivory); }
.btn--primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.btn--primary:hover { background: #d8ff4a; border-color: #d8ff4a; }
.btn--big { padding: 1.15rem 2rem; font-size: 1.05rem; }

/* ---------- Шапка ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
  transition: background 0.4s, backdrop-filter 0.4s, box-shadow 0.4s;
  view-transition-name: site-header;
}
.header.is-scrolled {
  background: rgba(14, 20, 36, 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  width: fit-content;
}
.logo__dot {
  width: 0.7rem; height: 0.7rem;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(198, 244, 50, 0.5);
}
.logo:hover .logo__dot { animation: pulse 1.2s var(--ease) infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(198, 244, 50, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(198, 244, 50, 0); }
}

.nav { display: flex; gap: clamp(1.2rem, 2.5vw, 2.4rem); justify-self: center; }
.nav a {
  text-decoration: none;
  color: var(--dust);
  padding: 0.3rem 0;
  position: relative;
  transition: color 0.25s;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1px;
  background: var(--lime);
  transition: right 0.35s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ivory); }
.nav a[aria-current="page"]::after, .nav a:hover::after { right: 0; }

.header__cta { justify-self: end; }
.nav-toggle {
  display: none;
  justify-self: end;
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  position: relative;
}
.nav-toggle i, .nav-toggle i::before, .nav-toggle i::after {
  content: ""; position: absolute; left: 50%; width: 1.1rem; height: 1.5px; background: var(--ivory);
  transform: translateX(-50%); transition: transform 0.35s var(--ease), opacity 0.25s;
}
.nav-toggle i { top: calc(50% - 4px); }
.nav-toggle i::before { top: 8px; }
.nav-toggle i::after { top: 8px; opacity: 0; }
.menu-open .nav-toggle i { transform: translateX(-50%) translateY(4px) rotate(45deg); }
.menu-open .nav-toggle i::before { transform: translateX(-50%) translateY(-8px) rotate(-90deg); }

/* Мобильное меню */
.menu {
  position: fixed; inset: 0;
  z-index: var(--z-menu);
  background: var(--deep);
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.6s var(--ease);
  visibility: hidden;
}
.menu-open .menu { clip-path: inset(0 0 0 0); visibility: visible; }
.menu-open .header { z-index: calc(var(--z-menu) + 1); background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.menu a {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 4rem);
  line-height: 1.1;
  text-decoration: none;
  padding: 0.25rem 0;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}
.menu-open .menu a { opacity: 1; transform: none; }
.menu-open .menu a:nth-child(2) { transition-delay: 0.05s; }
.menu-open .menu a:nth-child(3) { transition-delay: 0.1s; }
.menu-open .menu a:nth-child(4) { transition-delay: 0.15s; }
.menu__meta { margin-top: 2.5rem; color: var(--dust); display: grid; gap: 0.4rem; }
.menu__meta a { font: inherit; opacity: 1; transform: none; padding: 0; }

/* ---------- Герой ---------- */
.hero {
  padding: calc(6.5rem + 4vw) 0 0;
  position: relative;
  overflow-x: clip;
  overflow-y: visible;
}
.hero__title {
  max-width: 14ch;
  font-size: var(--h1);
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: block; transform: translateY(110%); animation: rise 1s var(--ease) forwards; }
.hero__title .line:nth-child(2) > span { animation-delay: 0.08s; }
.hero__title .line:nth-child(3) > span { animation-delay: 0.16s; }
@keyframes rise { to { transform: none; } }

.hero__lead {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 36rem) auto;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  opacity: 0; animation: fade 0.9s var(--ease) 0.35s forwards;
}
@keyframes fade { to { opacity: 1; } }
.hero__sub { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem); color: var(--dust); }
.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Лента работ — настоящие проекты плывут по диагонали */
/* Наклон небольшой, а сверху и снизу оставлен запас: лента не режется по прямой */
.strip {
  margin-top: clamp(2rem, 4vw, 4rem);
  padding-block: clamp(3rem, 6vw, 7rem) clamp(1rem, 3vw, 3rem);
  overflow-x: clip;
  overflow-y: visible;
  opacity: 0; animation: fade 1.2s var(--ease) 0.5s forwards;
}
.strip__track {
  display: flex;
  gap: clamp(1rem, 2vw, 1.75rem);
  width: max-content;
  transform: rotate(-2.5deg) translateX(-2%);
  transform-origin: left center;
  animation: drift 70s linear infinite;
  will-change: transform;
}
@keyframes drift {
  from { translate: 0 0; }
  to { translate: -50% 0; }
}
.strip:hover .strip__track { animation-play-state: paused; }
.strip__item {
  flex: none;
  height: clamp(180px, 24vw, 320px);
  border-radius: 10px;
  overflow: clip;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  text-decoration: none;
  position: relative;
}
.strip__item img { height: 100%; width: auto; object-fit: cover; }
.strip__item--phone {
  border-radius: 22px;
  padding: 6px;
  background: #1a2238;
  border-color: rgba(242, 238, 227, 0.2);
}
.strip__item--phone img { border-radius: 16px; }
.strip__item span {
  position: absolute; left: 0.9rem; bottom: 0.7rem;
  font-size: 0.85rem; color: var(--ivory);
  background: rgba(8, 12, 22, 0.75);
  padding: 0.25rem 0.6rem; border-radius: 999px;
  backdrop-filter: blur(6px);
}

/* ---------- Манифест ---------- */
.statement {
  padding-block: var(--section);
}
.statement__text {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.6vw, 3.25rem);
  line-height: 1.18;
  max-width: 24ch;
  font-weight: 400;
  text-wrap: balance;
}
.statement__text em { color: var(--lime); font-style: italic; }
.statement__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}
.statement__note { color: var(--dust); max-width: 36ch; font-size: 1.05rem; }

/* ---------- Заголовки секций ---------- */
.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }
.section__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 3rem;
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
.section__head p { color: var(--dust); max-width: 42ch; justify-self: end; }
.section__link { display: inline-block; margin-top: 2.5rem; color: var(--lime); font-weight: 500; }

/* ---------- Услуги: издательский список ---------- */
.services { border-top: 1px solid var(--line); }
.service {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1rem 3rem;
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  position: relative;
  transition: padding-left 0.45s var(--ease);
}
a.service:hover { padding-left: 1rem; }
a.service::before {
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 0.45rem; height: 0.45rem; border-radius: 50%;
  background: var(--lime);
  transform: translateY(-50%) scale(0);
  transition: transform 0.4s var(--ease);
}
a.service:hover::before { transform: translateY(-50%) scale(1); }
.service h3 { font-size: clamp(1.5rem, 2.6vw, 2.25rem); }
.service__tag { display: block; color: var(--dust); font-family: var(--font-body); font-size: 0.95rem; margin-top: 0.5rem; }
.service__text { color: var(--dust); align-self: center; }
.service__text p { max-width: 52ch; }
.service__list { list-style: none; padding: 0; margin: 1.1rem 0 0; display: grid; gap: 0.45rem; color: var(--ivory); }
.service__list li { padding-left: 1.1rem; position: relative; }
.service__list li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 0.35rem; height: 0.35rem; border-radius: 50%; background: var(--lime); }

/* ---------- Указатель работ ---------- */
.works { border-top: 1px solid var(--line); }
.work {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  gap: 1rem 2rem;
  align-items: baseline;
  padding: clamp(1.3rem, 2.4vw, 2rem) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ivory);
  position: relative;
  transition: color 0.3s;
}
.work__name {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-weight: 500;
  transition: transform 0.5s var(--ease);
}
.work__kind { color: var(--dust); }
.work__site { color: var(--dust); font-size: 0.95rem; white-space: nowrap; }
.work__thumb { display: none; }
@media (hover: hover) {
  .works:hover .work { color: var(--dust); }
  .works:hover .work:hover { color: var(--ivory); }
  .work:hover .work__name { transform: translateX(0.6rem); }
}

/* Превью, которое едет за курсором */
.work-preview {
  position: fixed;
  left: 0; top: 0;
  width: clamp(280px, 26vw, 420px);
  aspect-ratio: 16 / 11;
  border-radius: 10px;
  overflow: clip;
  pointer-events: none;
  z-index: var(--z-preview);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85) rotate(-3deg);
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.85);
  background: var(--panel);
}
.work-preview.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
.work-preview img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top;
  opacity: 0; transition: opacity 0.3s;
}
.work-preview img.is-active { opacity: 1; }
@media (hover: none), (pointer: coarse) { .work-preview { display: none; } }

/* ---------- Процесс ---------- */
.process { counter-reset: step; }
.process__list {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.process__list li { counter-increment: step; }
.process__list li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--lime);
  line-height: 1;
  margin-bottom: 1.2rem;
}
.process__list h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.process__list p { color: var(--dust); font-size: 0.98rem; }

/* ---------- Призыв ---------- */
.cta {
  background: var(--deep);
  padding-block: var(--section);
  border-top: 1px solid var(--line);
}
.cta__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}
.cta h2 { font-size: clamp(2.2rem, 5vw, 4.5rem); max-width: 14ch; }
.cta__side { display: grid; gap: 1.25rem; justify-items: start; }
.cta__side p { color: var(--dust); }

/* ---------- Подвал ---------- */
.footer {
  background: var(--deep);
  border-top: 1px solid var(--line);
  padding: 3rem 0 2rem;
  color: var(--dust);
  font-size: 0.95rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer h4 { margin: 0 0 0.8rem; font-weight: 500; color: var(--ivory); font-size: 1rem; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ivory); }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.footer__bottom {
  margin-top: 3rem; padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

/* ---------- Внутренние страницы ---------- */
.page-head {
  padding: calc(7rem + 3vw) 0 clamp(2.5rem, 5vw, 4rem);
}
.page-head h1 { max-width: 16ch; }
.page-head p { margin-top: 1.5rem; color: var(--dust); font-size: 1.15rem; max-width: 50ch; }

/* ---------- Кейс ---------- */
.case-head { padding: calc(7rem + 3vw) 0 2.5rem; }
.case-head__top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 2rem 4rem;
  align-items: end;
}
.case-head__kind { color: var(--dust); margin-bottom: 1rem; }
.case-head__lead { color: var(--dust); font-size: 1.15rem; max-width: 42ch; }
.case-cover {
  border-radius: 14px;
  overflow: clip;
  background: var(--panel);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
}
.case-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.case-cover--app {
  aspect-ratio: auto;
  background: radial-gradient(60% 80% at 50% 100%, rgba(198, 244, 50, 0.18), transparent 70%), var(--deep);
  display: flex; justify-content: center; align-items: flex-end; gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(2rem, 5vw, 4rem) var(--gutter) 0;
  min-height: 420px;
}
.phone {
  width: clamp(150px, 20vw, 260px);
  aspect-ratio: 9 / 18.5;
  border-radius: clamp(18px, 2.4vw, 30px);
  padding: 7px;
  background: #1a2238;
  border: 1px solid rgba(242, 238, 227, 0.22);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  overflow: clip;
  flex: none;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: calc(clamp(18px, 2.4vw, 30px) - 7px); }
.case-cover--app .phone:nth-child(2) { translate: 0 -2rem; }

/* Постеры приложения (промо-картинки из RuStore) */
.poster { border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8); }
.case-cover--posters {
  aspect-ratio: auto; background: transparent; border: 0; overflow: visible;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(0.75rem, 2vw, 1.5rem);
}
.case-cover--posters .poster:nth-child(2) { translate: 0 -1.5rem; }
.case-gallery--posters { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); max-width: 560px; }
.strip__item--poster { border-radius: 12px; }

.case-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  padding: 2rem 0;
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.case-facts dt { color: var(--dust); font-size: 0.9rem; margin-bottom: 0.4rem; }
.case-facts dd { margin: 0; font-weight: 500; }
.case-facts a { color: var(--lime); }

.case-body {
  padding-block: clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 2rem 4rem;
}
.case-body h2 { font-size: clamp(1.6rem, 2.4vw, 2.25rem); position: sticky; top: 6rem; }
.case-body .prose { display: grid; gap: 2.5rem; }
.prose h3 { font-size: 1.35rem; margin-bottom: 0.6rem; }
.prose p { color: var(--dust); max-width: 58ch; }
.prose ul { margin: 0.8rem 0 0; padding-left: 1.1rem; color: var(--dust); display: grid; gap: 0.35rem; }
.case-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.case-gallery figure { margin: 0; }
.case-gallery img { border-radius: 10px; border: 1px solid var(--line); }
.case-gallery figcaption { color: var(--dust); font-size: 0.9rem; margin-top: 0.6rem; }
.case-gallery--phones { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); justify-items: center; }
.case-gallery--phones .phone { width: 100%; max-width: 220px; }

.case-next {
  border-top: 1px solid var(--line);
  padding-block: clamp(3rem, 7vw, 6rem);
}
.case-next a {
  text-decoration: none;
  display: grid; gap: 0.6rem;
}
.case-next small { color: var(--dust); font-size: 1rem; }
.case-next .work__name { font-size: clamp(2rem, 5vw, 4.5rem); display: inline-block; }
.case-next a:hover .work__name { transform: translateX(0.6rem); }

/* ---------- Контакты ---------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 3rem 5rem;
  padding-bottom: var(--section);
}
.lead { display: grid; gap: 1.6rem; }
.lead__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.field { display: grid; gap: 0.45rem; }
.field span { color: var(--dust); font-size: 0.92rem; }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--ivory);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  padding: 0.6rem 0;
  border-radius: 0;
  transition: border-color 0.3s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--lime); }
.field input.is-invalid { border-color: var(--ember); }
.field textarea { resize: vertical; min-height: 4rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.6rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--dust);
  transition: all 0.25s var(--ease);
}
.chip input:checked + span { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.chip input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 2px; }
.lead__error { color: var(--ember); font-size: 0.95rem; }
.lead__done { display: grid; gap: 1rem; padding: 2rem; border: 1px solid var(--line-strong); border-radius: 14px; }
.lead__done h3 { font-size: 1.8rem; }
.lead__done p { color: var(--dust); }

.contact__side { display: grid; gap: 2rem; align-content: start; }
.contact__row { display: grid; gap: 0.3rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.contact__row span:first-child { color: var(--dust); font-size: 0.9rem; }
.contact__big { font-family: var(--font-display); font-size: clamp(1.4rem, 2.2vw, 1.9rem); text-decoration: none; }
.contact__big:hover { color: var(--lime); }
.contact__addr { display: flex; gap: 0.6rem; align-items: baseline; margin-top: 0.3rem; }
.contact__addr::before { content: ""; flex: none; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--lime); translate: 0 -0.15em; }

/* Пингвин — награда после заявки (идея заказчика) */
.pengu { display: grid; gap: 1rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.pengu__title { color: var(--dust); font-size: 0.95rem; }
.pengu__scene { position: relative; width: 180px; margin-inline: auto; }
.pengu__bubble {
  position: absolute; left: 50%; top: 0;
  transform: translate(-50%, 0);
  width: max-content; max-width: 260px;
  background: var(--ivory); color: var(--night);
  padding: 0.55rem 0.9rem; border-radius: 12px;
  font-size: 0.92rem; text-align: center;
}
.pengu__bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: var(--ivory); transform: translateX(-50%) rotate(45deg); }
.pengu__svg { width: 100%; height: auto; margin-top: 4.75rem; transform-origin: 50% 90%; }
.pengu__eyes-happy, .pengu__blush { opacity: 0; transition: opacity 0.3s; }
.pengu__tear { transform-origin: 63px 95px; animation: tear 2.2s ease-in-out infinite; }
@keyframes tear { 0%, 60% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(26px); opacity: 0; } }
.is-happy .pengu__eyes-open, .is-full .pengu__eyes-open { opacity: 0; }
.is-happy .pengu__eyes-happy, .is-happy .pengu__blush, .is-full .pengu__eyes-happy, .is-full .pengu__blush { opacity: 1; }
.is-happy .pengu__tear, .is-full .pengu__tear { display: none; }
.is-eating .pengu__beak { animation: chew 0.24s ease-in-out 3; transform-origin: 100px 96px; }
@keyframes chew { 50% { transform: scaleY(1.6); } }
.is-eating .pengu__flipper--l { animation: flapL 0.3s ease-in-out 2; transform-origin: 37px 85px; }
.is-eating .pengu__flipper--r { animation: flapR 0.3s ease-in-out 2; transform-origin: 163px 85px; }
@keyframes flapL { 50% { transform: rotate(25deg); } }
@keyframes flapR { 50% { transform: rotate(-25deg); } }
.is-happy .pengu__svg { animation: bounce 0.6s var(--ease); }
@keyframes bounce { 30% { transform: translateY(-10px) scale(1.04); } 60% { transform: translateY(0) scale(0.98); } }
.pengu__food { display: flex; justify-content: center; gap: 0.6rem; }
.pengu__snack {
  width: 3rem; height: 3rem; border-radius: 50%;
  border: 1px solid var(--line-strong); background: transparent;
  cursor: pointer; display: grid; place-items: center;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.pengu__snack:hover { transform: translateY(-3px); border-color: var(--lime); }
.pengu__snack svg { width: 1.4rem; height: 1.4rem; }
.is-full .pengu__food { opacity: 0.3; pointer-events: none; }
.pengu__bite { position: absolute; left: 50%; top: 40%; translate: -50% -50%; animation: bite 0.72s ease-in forwards; }
.pengu__bite svg { width: 1.6rem; height: 1.6rem; }
@keyframes bite { to { top: 56%; scale: 0.2; opacity: 0; } }
.pengu__heart { position: absolute; top: 45%; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--lime); animation: heart 1.5s ease-out forwards; }
@keyframes heart { to { translate: 0 -70px; opacity: 0; } }

/* ---------- Переходы страниц ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 0.35s var(--ease) both leave; }
::view-transition-new(root) { animation: 0.6s var(--ease) both enter; }
::view-transition-old(site-header), ::view-transition-new(site-header) { animation: none; mix-blend-mode: normal; }
@keyframes leave { to { opacity: 0; transform: translateY(-2%) scale(0.985); } }
@keyframes enter { from { opacity: 0; clip-path: inset(100% 0 0 0); transform: translateY(3%); } to { opacity: 1; clip-path: inset(0 0 0 0); transform: none; } }
/* Картинка кейса перетекает из превью */
::view-transition-group(*) { animation-timing-function: var(--ease); animation-duration: 0.65s; }
::view-transition-old(*):only-child { animation-duration: 0.35s; }

/* Запасной вариант без View Transitions: роутер вешает классы */
main { min-height: 60svh; }
.page-leaving main { opacity: 0; transform: translateY(-1.5%) scale(0.99); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
.page-entering main { animation: enter-main 0.6s var(--ease) both; }
@keyframes enter-main { from { opacity: 0; transform: translateY(2.5%); } }
.page-fade { position: fixed; inset: 0; z-index: 15; background: var(--night); pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.page-loading .page-fade { opacity: 1; }

/* ---------- 404 ---------- */
.notfound { min-height: 80svh; display: grid; align-content: center; gap: 1.5rem; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .process__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .case-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .header { grid-template-columns: 1fr auto; }
  .nav, .header__cta { display: none; }
  .nav-toggle { display: block; }
  .hero__lead, .statement__grid, .section__head, .service, .cta__grid, .case-head__top, .case-body, .contact { grid-template-columns: minmax(0, 1fr); }
  .section__head p { justify-self: start; }
  .case-body h2 { position: static; }
  .work { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
  .work__thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 0.8rem; }
  .work__site { display: none; }
}
@media (max-width: 640px) {
  .process__list { grid-template-columns: minmax(0, 1fr); }
  .lead__row { grid-template-columns: minmax(0, 1fr); }
  .footer__grid { grid-template-columns: minmax(0, 1fr); }
  .case-cover--app { min-height: 300px; gap: 0.75rem; }
  .case-cover--posters { gap: 0.5rem; }
  .case-cover--posters .poster { border-radius: 8px; }
  .case-cover--posters .poster:nth-child(2) { translate: 0 -0.5rem; }
  .case-cover--app .phone { width: 28vw; }
  .hero__title { max-width: none; }
  .strip__item { height: 160px; }
}

/* ---------- Без лишнего движения ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
  .strip__track { animation: none; transform: rotate(-2.5deg); }
  .hero__title .line > span { transform: none; }
  .hero__lead, .strip { opacity: 1; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
