/* mvlikhachev.com — Bento Box Grid, по дизайн-системе ui-ux-pro-max */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/jakarta.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --fg: #09090b;
  --muted: #475569;
  --border: #e4e4e7;
  --accent: #2563eb;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(9, 9, 11, 0.04), 0 8px 24px rgba(9, 9, 11, 0.06);
  --shadow-lift: 0 2px 4px rgba(9, 9, 11, 0.06), 0 18px 40px rgba(9, 9, 11, 0.14);
  --radius: 28px;
  --radius-sm: 16px;
  --gap: 16px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #111113;
    --fg: #fafafa;
    --muted: #a1adbf;
    --border: #27272a;
    --accent: #6ea0ff;
    --on-accent: #06122b;
    --shadow: none;
    --shadow-lift: 0 0 0 1px #3f3f46;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3, p { margin: 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Навигация ---------- */
.nav {
  position: sticky;
  top: 12px;
  z-index: 10;
  margin-top: 12px;
}
.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 6px 8px 6px 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 800;
}
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--fg);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.nav-links a:hover { background: var(--border); }
.nav-links .cta { background: var(--fg); color: var(--bg); }
.nav-links .cta:hover { background: var(--accent); color: var(--on-accent); }

/* ---------- Заглавный блок главной ---------- */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 6vw, 72px); }
.hero h1 {
  max-width: 14ch;
  font-size: clamp(2.75rem, 8.6vw, 6.25rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.hero p {
  max-width: 34rem;
  margin-top: 28px;
  color: var(--muted);
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  line-height: 1.5;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--fg);
  color: var(--bg);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--accent); color: var(--on-accent); }
.btn:active { transform: translateY(0); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { background: var(--card); color: var(--fg); border-color: var(--fg); }

/* ---------- Сетка ---------- */
.section-title {
  margin: clamp(56px, 8vw, 96px) 0 24px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gap);
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Карточка проекта */
.project {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  padding: clamp(24px, 3vw, 36px);
  border: 0;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.project:hover { transform: scale(1.012); box-shadow: var(--shadow-lift); }
.project:hover .go { transform: translate(3px, -3px); }

/*
 * Цвета проекта: страница задаёт --from и --to в классе .prj-<адрес>. Текст на карточке
 * светлый; у светлых карточек (.dark-text) — тёмный оттенок цвета самой карточки.
 */
.prj {
  --on: #fff;
  --chip: rgba(255, 255, 255, 0.16);
  --chip-ring: rgba(255, 255, 255, 0.2);
  background: linear-gradient(140deg, var(--from) 0%, var(--to) 100%);
  color: var(--on);
}
.prj.dark-text {
  --on: color-mix(in srgb, var(--to) 14%, #000);
  --chip: color-mix(in srgb, var(--on) 12%, transparent);
  --chip-ring: transparent;
}
@media (prefers-color-scheme: dark) { .prj { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); } }

/* Ширина карточки в сетке из шести колонок. */
.size-narrow { grid-column: span 2; }
.size-wide { grid-column: span 4; }
.size-full { grid-column: span 6; min-height: 340px; }
/* Последняя карточка неполного ряда дотягивается до его конца (классы ставит сервер). */
@media (min-width: 1024px) {
  .fill-d-4 { grid-column: span 4; }
  .fill-d-6 { grid-column: span 6; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .fill-t-6 { grid-column: span 6; }
}

.project-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.go {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--chip);
  transition: transform 0.25s ease;
}
.go svg { width: 20px; height: 20px; }

.project h2 {
  margin-top: 20px;
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.project .desc { max-width: 26rem; margin-top: 12px; font-size: 1.0625rem; line-height: 1.5; opacity: 0.86; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--chip);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.pill-dot.soon { background: currentColor; opacity: 0.55; }

/* Иллюстрации в карточках */
.art { position: absolute; z-index: -1; pointer-events: none; }
/* Два скриншота в рамках телефонов, наклонённые навстречу друг другу. */
.art-phones { right: clamp(-10px, 2vw, 40px); bottom: -150px; display: flex; gap: 18px; }
.art-phones .phone:first-child { transform: translateY(54px) rotate(-5deg); }
.art-phones .phone:last-child { transform: rotate(4deg); }
/* Иллюстрация в правом нижнем углу; в широкой и полной карточке — крупнее. */
.art-image { right: -30px; bottom: -40px; width: 300px; }
.size-wide .art-image { right: -20px; width: min(560px, 62%); }
.size-full .art-image { right: 36px; top: 50%; bottom: auto; transform: translateY(-50%); width: min(600px, 50%); }
.art-image img { width: 100%; height: auto; }

.phone {
  width: 190px;
  flex: none;
  border-radius: 30px;
  padding: 7px;
  background: #0a0f1a;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.phone img { width: 100%; height: auto; border-radius: 24px; }

/* Значок приложения */
.tile {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 22.5%;
  background: var(--chip);
  color: inherit;
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--chip-ring);
}
.tile img { width: 100%; height: 100%; }
.tile-lg { width: 96px; height: 96px; font-size: 2.5rem; }

/* Карточки «обо мне» */
.info { grid-column: span 2; padding: clamp(24px, 3vw, 32px); min-height: 220px; display: flex; flex-direction: column; }
.info h3 { margin-top: 20px; font-size: 1.25rem; line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
.info p { margin-top: 8px; color: var(--muted); font-size: 1rem; }
.info .mail { margin-top: auto; padding-top: 20px; font-weight: 700; word-break: break-all; }
.icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tint, var(--accent)) 12%, transparent);
  color: var(--tint, var(--accent));
}
.icon svg { width: 24px; height: 24px; }

/* ---------- Страница проекта ---------- */
.app-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: center;
  min-height: 520px;
  margin-top: 28px;
  padding: clamp(28px, 5vw, 64px);
  border-radius: calc(var(--radius) + 8px);
}

.app-hero h1 {
  margin-top: 24px;
  font-size: clamp(2.75rem, 7vw, 5rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.045em;
}
.app-hero .tagline { max-width: 28rem; margin-top: 16px; font-size: clamp(1.125rem, 2vw, 1.375rem); line-height: 1.45; opacity: 0.88; }
.app-hero .hero-actions { margin-top: 32px; }
.app-hero .btn { background: #fff; color: #0b1220; }
.app-hero .btn:hover { background: #0b1220; color: #fff; }
.app-hero.dark-text .btn { background: var(--on); color: #fff; }
.app-hero.dark-text .btn:hover { background: #fff; color: var(--on); }

/* Переключатель языка страницы. */
.langs ul { display: flex; flex-wrap: wrap; gap: 4px; margin: 24px 0 0; padding: 0; list-style: none; }
.langs a, .langs span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}
.langs a { color: inherit; opacity: 0.8; }
.langs a:hover { opacity: 1; background: var(--chip, var(--border)); }
.langs span { background: var(--chip, var(--border)); }
.doc .langs ul { margin-top: 16px; }
.doc .langs a { color: var(--fg); }

.app-art { display: flex; justify-content: center; align-items: center; gap: 18px; }
.app-art .phone { width: min(220px, 44%); }
.app-art .phone:first-child { transform: translateY(28px) rotate(-5deg); }
.app-art .phone:last-child { transform: translateY(-12px) rotate(4deg); }
.app-art > svg, .app-art > img { width: min(420px, 100%); height: auto; }

.intro { max-width: 46rem; margin-top: clamp(40px, 6vw, 72px); font-size: clamp(1.125rem, 2vw, 1.3125rem); line-height: 1.6; }
.intro p + p { margin-top: 16px; }


.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.feature { padding: 28px; }
.feature h3 { margin-top: 20px; font-size: 1.1875rem; line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
.feature p { margin-top: 8px; color: var(--muted); font-size: 1rem; }
.feature.wide { grid-column: span 2; }

.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.shot { padding: 28px 28px 0; display: flex; justify-content: center; background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 10%, var(--card)), var(--card)); }
.shot .phone { width: min(240px, 100%); border-radius: 30px 30px 0 0; padding-bottom: 0; }
.shot .phone img { border-radius: 24px 24px 0 0; }

.note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: clamp(24px, 3vw, 36px);
  margin-top: var(--gap);
}
.note h3 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.note p { margin-top: 4px; color: var(--muted); }

.more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.more a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  padding: 16px 20px;
  border: 0;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.more a:hover { transform: scale(1.02); box-shadow: var(--shadow-lift); }
.more .tile { width: 52px; height: 52px; font-size: 1.25rem; }

/* ---------- Текстовые страницы ---------- */
.doc { max-width: 46rem; margin: clamp(40px, 7vw, 80px) auto 0; padding: clamp(24px, 5vw, 56px); }
.doc h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; font-weight: 800; letter-spacing: -0.035em; }
.doc h2 { margin-top: 48px; font-size: 1.625rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
.doc h3 { margin-top: 28px; font-size: 1.125rem; font-weight: 800; }
.doc p { margin-top: 12px; }
.doc .meta { color: var(--muted); font-size: 0.9375rem; }
/* Строка-курсив отдельным абзацем — дата редакции и область действия политики. */
.doc p > em:only-child { color: var(--muted); font-size: 0.9375rem; font-style: normal; }
.doc ul, .doc ol { margin: 12px 0 0; padding-left: 1.4em; }
.doc li + li { margin-top: 6px; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 16px;
  font-weight: 700;
  text-decoration: none;
}
.back svg { width: 18px; height: 18px; }
.back:hover { text-decoration: underline; }

/* ---------- Подвал ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: clamp(64px, 10vw, 120px);
  padding-top: 24px;
  padding-bottom: 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
}
.foot a { color: inherit; }

/* ---------- Появление при загрузке ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
  .rise[data-i="1"] { --i: 1; } .rise[data-i="2"] { --i: 2; } .rise[data-i="3"] { --i: 3; }
  .rise[data-i="4"] { --i: 4; } .rise[data-i="5"] { --i: 5; } .rise[data-i="6"] { --i: 6; }
  .rise[data-i="7"] { --i: 7; } .rise[data-i="8"] { --i: 8; } .rise[data-i="9"] { --i: 9; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
  }
  .wave { animation: wave 2.6s ease-out infinite; transform-origin: 150px 150px; transform-box: view-box; }
  .wave.w2 { animation-delay: 0.65s; }
  .wave.w3 { animation-delay: 1.3s; }
  @keyframes wave {
    0% { opacity: 0; transform: scale(0.55); }
    30% { opacity: 0.9; }
    100% { opacity: 0; transform: scale(1.15); }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .project, .more a, .go { transition: none; }
  .project:hover, .more a:hover, .btn:hover { transform: none; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 1023px) {
  .size-wide { grid-column: span 6; }
  .more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .size-wide:has(.art-image) { min-height: 620px; }
  .size-wide .art-image { width: 92%; right: 4%; bottom: -70px; }
  .size-full { min-height: 460px; }
  .size-full .art-image { top: auto; bottom: 28px; right: 24px; transform: none; width: min(560px, 86%); }
  .size-narrow { grid-column: span 3; }
  .info { grid-column: span 3; }
  .info.contact { grid-column: span 6; min-height: 0; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature.wide { grid-column: span 2; }
  .app-hero { grid-template-columns: 1fr; min-height: 0; }
  .app-art { margin-top: 12px; }
}

@media (max-width: 767px) {
  .wrap { padding: 0 16px; }
  .nav-links .hide-sm { display: none; }
  .size-narrow, .info { grid-column: span 6; }
  .project { min-height: 440px; }
  .project:has(.art-phones) { min-height: 560px; }
  .art-phones { right: 50%; transform: translateX(50%); bottom: -170px; }
  .size-wide .art-image { width: 116%; right: -22%; bottom: -30px; }
  .size-wide:has(.art-image) { min-height: 520px; }
  .size-full { min-height: 440px; }
  .size-full .art-image { width: 130%; right: -36%; bottom: 20px; }
  .features, .shots, .more { grid-template-columns: 1fr; }
  .feature.wide { grid-column: auto; }
  .shots { grid-template-columns: repeat(3, minmax(220px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .shots .shot { scroll-snap-align: start; }
  .app-hero { border-radius: var(--radius); }
}
