/* ============================================================
   Портфолио v3 (тест): серая сетка блоков, мини-шоурилы в iPhone.
   Самодостаточный файл, от styles/uikit.css не зависит.
   ============================================================ */

@font-face { font-family: "Suisse Intl"; src: url("/fonts/SuisseIntl-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Suisse Intl"; src: url("/fonts/SuisseIntl-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Suisse Intl"; src: url("/fonts/SuisseIntl-SemiBold.otf") format("opentype"); font-weight: 600; font-display: swap; }

:root {
  --bg: #f3f4f6;
  --block: #e7e8eb;
  --text: #111214;
  --text-2: #6b6e75;
  --pill: #ffffff;
  --hairline: rgba(0, 0, 0, 0.07);
  --font: "Suisse Intl", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --gap: 8px;
  --pad: clamp(10px, 1.4vw, 20px);
  --radius: 0;
  --max: 1600px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 20px; letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 8px; }

/* ── Hero ── */
.hero {
  min-height: min(92svh, 760px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 120px var(--pad) 72px;
}
.hero h1 {
  font-size: 80px; line-height: 80px; font-weight: 500; letter-spacing: -0.04em;
  background: radial-gradient(ellipse 75% 140% at 50% 62%, var(--text) 0%, var(--text) 22%, color-mix(in srgb, var(--text) 42%, var(--bg)) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-wrap: balance; padding: 0 0.08em 0.12em;
}
.hero .sub { margin-block-start: 28px; font-size: 16px; line-height: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); margin-block-start: 32px; }
.hero-actions .pill { margin-block-start: 0; }
.pill {
  display: inline-flex; align-items: center; height: 46px; padding: 0 26px; margin-block-start: 36px;
  border-radius: 999px; background: var(--pill); font-size: 14px; font-weight: 500;
  box-shadow: 0 0 0 1px var(--hairline), 0 6px 20px -10px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease;
}
.pill:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--hairline), 0 12px 28px -12px rgba(0, 0, 0, 0.28); }

/* ── Кейс-сетка: серые прямоугольники без скруглений, текст внутри ── */
.case { max-width: var(--max); margin-inline: auto; padding: 0 var(--pad); margin-block-end: clamp(80px, 12vw, 160px); }
.panel {
  position: relative; background: var(--block); height: 660px;
  display: grid; grid-template-columns: 1fr 1fr; overflow: hidden;
}
.panel + .duo, .duo + .panel { margin-block-start: var(--gap); }
.copy { padding: clamp(18px, 3.4vw, 52px); align-self: start; }
.copy h2 { font-size: 40px; line-height: 40px; font-weight: 500; letter-spacing: -0.04em; text-wrap: balance; max-width: 15ch; }
.copy .lead { margin-block-start: 14px; font-size: 16px; line-height: 20px; max-width: 46ch; }
.phone-slot { display: grid; place-items: center; padding: clamp(12px, 1.6vw, 24px) 0; min-height: 0; grid-column: 1 / -1; grid-row: 1; }
.panel > .copy { grid-column: 1; grid-row: 1; position: relative; z-index: 2; }
.phone-slot .iphone-wrap { height: 100%; max-height: 100%; }

/* ── Ряд: видео + картинка одной высоты (flex-grow = пропорция кадра) ── */
.duo { display: flex; gap: var(--gap); margin-block-start: var(--gap); }
.duo { height: 579px; }
.tile { --fg: var(--ar); flex: var(--fg) 1 0%; height: 100%; min-width: 0; border-radius: var(--radius); overflow: hidden; background: var(--block); }
.tile video, .tile img { width: 100%; height: 100%; object-fit: cover; }

/* ── iPhone ── ширина = контейнер, всё в cqw, чтобы рамка масштабировалась пропорционально */
.iphone-wrap { height: 100%; aspect-ratio: 100 / 210.8; container-type: inline-size; position: relative; }
.iphone {
  position: relative; width: 100%; height: 100%;
  padding: 2.4cqw; border-radius: 14.4cqw;
  background: linear-gradient(150deg, #34353a 0%, #121214 40%, #26272b 100%);
  box-shadow:
    0 0 0 0.45cqw #55575e inset,
    0 0 0 0.9cqw #0b0b0c inset,
    0 7cqw 12cqw -4cqw rgba(0, 0, 0, 0.42),
    0 3cqw 6cqw -3cqw rgba(0, 0, 0, 0.3);
}
/* боковые кнопки */
.iphone::before, .iphone::after { content: ""; position: absolute; width: 0.9cqw; background: #2c2d31; border-radius: 0.6cqw; }
.iphone::before { left: -0.7cqw; top: 22cqw; height: 6cqw; box-shadow: 0 10cqw 0 #2c2d31, 0 18.5cqw 0 #2c2d31; }
.iphone::after { right: -0.7cqw; top: 31cqw; height: 15cqw; }
.screen {
  position: relative; width: 100%; height: 100%; overflow: hidden; background: #fff;
  border-radius: 12cqw;
}
.screen video, .screen img { width: 100%; height: 100%; object-fit: cover; }
.island {
  position: absolute; z-index: 3; left: 50%; top: 2.6cqw; transform: translateX(-50%);
  width: 27cqw; height: 7.8cqw; border-radius: 4cqw; background: #000;
}
.glare {
  position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 32%);
}

/* ── Появление ── */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .panel.reveal .iphone-wrap { transform: translateY(46px) scale(0.97); transition: transform 1.2s var(--ease); }
.js .panel.reveal.in .iphone-wrap { transform: none; }

/* ── Футер ── */
.foot { max-width: var(--max); margin-inline: auto; padding: 40px var(--pad) 56px; color: var(--text-2); font-size: 14px; display: flex; gap: 8px 28px; flex-wrap: wrap; }
.foot a { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 0.25em; }

@media (max-width: 820px) {
  .panel { height: auto; grid-template-columns: 1fr; }
  .duo { height: auto; }
  .tile { height: auto; aspect-ratio: var(--ar); }
  .hero h1 { font-size: clamp(44px, 11vw, 64px); line-height: 1; }
  .copy h2 { font-size: 32px; line-height: 32px; }
  .panel > .copy { grid-row: auto; }
  .phone-slot { grid-row: auto; height: min(78svh, 560px); padding: 0 0 clamp(18px, 4vw, 28px); }
}
@media (max-width: 600px) {
  .duo { flex-direction: column; }
  .tile { flex: none; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .panel.reveal .iphone-wrap { opacity: 1; transform: none; transition: none; }
}

/* ── MacBook фронтально (панель ВТБ): экран 16:10 ── */
.panel-iso { display: block; }
.panel-iso .copy { position: relative; z-index: 3; }
.panel-iso .copy h2 { max-width: 20ch; }
.iso { position: absolute; inset: 0; container-type: inline-size; pointer-events: none; }
.iso-scene { position: absolute; inset: 0; }
.laptop { position: absolute; right: 4.5%; top: 50%; width: 56cqw; transform: translateY(-50%); filter: drop-shadow(0 2.4cqw 3cqw rgba(0, 0, 0, 0.18)); }
.lid {
  position: relative; width: 100%; padding: 0.9cqw; background: #0c0c0e; border-radius: 1.5cqw 1.5cqw 0.15cqw 0.15cqw;
  box-shadow: 0 0 0 0.2cqw #b9bbc1 inset, 0 0 0 0.42cqw #d6d7dc;
}
.lid-screen { position: relative; width: 100%; aspect-ratio: 16 / 10; background: #fff; overflow: hidden; border-radius: 0.5cqw; }
.lid-screen video { width: 100%; height: 100%; object-fit: cover; }
.lid-screen .cam { position: absolute; z-index: 2; left: 50%; top: 0; transform: translateX(-50%); width: 6.4cqw; height: 1.15cqw; background: #0c0c0e; border-radius: 0 0 0.7cqw 0.7cqw; }
.base {
  position: relative; width: calc(100% + 5cqw); margin-left: -2.5cqw; height: 1.5cqw;
  background: linear-gradient(180deg, #e9eaed 0%, #c9cbd0 70%, #b2b4ba 100%); border-radius: 0 0 2.4cqw 2.4cqw / 0 0 1.4cqw 1.4cqw;
  box-shadow: 0 -0.15cqw 0 #f4f4f6 inset;
}
.base .thumb { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 11cqw; height: 0.65cqw; background: linear-gradient(180deg, #b8babf, #d3d5d9); border-radius: 0 0 1cqw 1cqw; }
@media (max-width: 820px) {
  .panel-iso { aspect-ratio: auto; min-height: 0; }
  .panel-iso .copy { padding-bottom: 0; }
  .panel-iso .iso { position: relative; inset: auto; width: 100%; aspect-ratio: 100 / 70; margin-block-start: 12px; }
  .laptop { width: 90cqw; right: auto; left: 50%; top: auto; bottom: 7%; transform: translateX(-50%); }
}

/* ── Рука с телефоном (Galaxy): видео в перспективе под слоем руки ── */
.hand-slot { position: relative; padding: 0; place-items: stretch; align-self: stretch; overflow: hidden; }
.hand-wrap { position: absolute; left: 55.2%; top: 1.4%; height: 111.8%; aspect-ratio: 1200 / 1576; transform: translateX(-59.2%); }
.hand-stage { position: absolute; left: 0; top: 0; width: 1200px; height: 1576px; transform-origin: 0 0; transform: scale(var(--s, 0.5)); }
.hand-stage video { position: absolute; left: 0; top: 0; width: 780px; height: 1688px; max-width: none; object-fit: cover; transform-origin: 0 0; border-radius: 67px / 60px; background: #fff; transform: matrix3d(0.61887551,-0.021379067,0,-2.8694132e-05,-0.058359272,0.71485728,0,-6.1145671e-06,0,0,1,0,500.40982,14.914001,0,1); }
.hand-stage img { position: absolute; left: 0; top: 0; width: 1200px; height: 1576px; max-width: none; pointer-events: none; }
@media (max-width: 820px) {
  .hand-slot { padding: 0; }
  .hand-wrap { left: 50%; top: 5.9%; }
}

/* ── Experience ── */
#coral { margin-block-end: 0; }
.exp { max-width: var(--max); margin-inline: auto; padding: clamp(64px, 8vw, 120px) calc(var(--pad) + clamp(18px, 3.4vw, 52px)) clamp(72px, 9vw, 130px); display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.exp-label { font-size: 24px; line-height: 24px; font-weight: 500; letter-spacing: -0.04em; }
.exp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 64px; }
.exp-role { font-size: 16px; line-height: 20px; }
.exp-co { font-size: 24px; line-height: 28px; font-weight: 500; letter-spacing: -0.04em; margin-block-start: 6px; text-wrap: balance; }
.exp-desc { font-size: 16px; line-height: 22px; max-width: 560px; margin-block-start: 16px; }
.exp-p { display: block; text-wrap: pretty; }
.exp-p + .exp-p { margin-block-start: 12px; }
.nw { white-space: nowrap; }
.copy .lead { text-wrap: pretty; }
@media (max-width: 820px) {
  .exp { grid-template-columns: 1fr; gap: 28px; }
}

/* ВТБ: ряд 579px — карточка в натуральную ширину, промо занимает остальное (cover) */
@media (min-width: 821px) {
  .duo.duo-natural .tile:first-child { flex: none; width: calc(579px * var(--ar) * 0.94); }
  .duo.duo-natural .tile:last-child { flex: 1 1 0; }
}
.tile.tile-inset { padding: 1.5%; }
.tile.tile-inset img { object-fit: contain; }

/* Coral: ряд без фиксированной высоты — пропорции картинок */
.duo.duo-free { height: auto; }
.duo.duo-free .tile { height: auto; aspect-ratio: var(--ar); }

/* ── ВТБ: пять экранов приложения лесенкой (вниз за край фрейма) ── */
.duo + .shots { margin-block-start: var(--gap); }
.shots { container-type: inline-size; position: relative; background: var(--block); height: 660px; overflow: hidden; display: flex; justify-content: center; align-items: flex-start; }
.shots img { --u: min(1cqw, 14px); flex: none; width: calc(17.5 * var(--u)); height: auto; margin-inline: calc(0.39 * var(--u)); margin-top: calc(1.2 * var(--u) + var(--i) * 4.41 * var(--u)); }
@media (max-width: 820px) {
  .shots { height: 560px; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x proximity; padding-inline: 16px; scrollbar-width: none; }
  .shots::-webkit-scrollbar { display: none; }
  .shots img { --u: 14px; scroll-snap-align: center; }
}

/* ── Переключатель языка: liquid glass ── */
.lang, .dock a {
  position: fixed; top: 16px; z-index: 100; padding: 4px; border-radius: 999px; isolation: isolate;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.18));
  -webkit-backdrop-filter: blur(16px) saturate(1.9) brightness(1.04); backdrop-filter: blur(16px) saturate(1.9) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(0, 0, 0, 0.06), inset 0 0 14px rgba(255, 255, 255, 0.35), 0 10px 28px -10px rgba(10, 20, 40, 0.35), 0 0 0 0.5px rgba(0, 0, 0, 0.07);
}
.lang { right: 16px; display: grid; grid-template-columns: 1fr 1fr; }
.lang::before, .dock a::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; background: radial-gradient(120% 90% at 20% -20%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 55%); }
.lang-thumb {
  position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.62));
  box-shadow: inset 0 1px 0 #fff, 0 3px 10px -3px rgba(10, 20, 40, 0.32), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.5, 1);
}
.lang[data-active="ru"] .lang-thumb { transform: translateX(100%); }
.lang button {
  appearance: none; border: 0; background: none; cursor: pointer; font: inherit; font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: -0.01em;
  color: rgba(17, 18, 20, 0.5); padding: 6px 16px; border-radius: 999px; transition: color 0.25s ease;
}
.lang button[aria-pressed="true"] { color: var(--text); }
.lang button:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
@media (max-width: 600px) { .lang, .dock { top: 10px; } .lang { right: 10px; } }

/* ── Закреплённые кнопки: появляются после первого экрана ── */
.dock {
  position: fixed; top: 16px; left: 16px; z-index: 100; display: flex; gap: var(--gap);
  opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.34, 1.4, 0.5, 1), visibility 0s 0.45s;
}
.dock.show { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
/* каждая кнопка — отдельное стекло */
.dock a {
  position: relative; top: auto; z-index: 0; display: inline-flex; align-items: center; height: 42px; padding: 0 20px;
  font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; transition: transform 0.25s var(--ease);
}
.dock a:hover { transform: translateY(-2px); }
.dock a:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.dock-short { display: none; }
@media (max-width: 600px) { .dock { left: 10px; } .dock-long { display: none; } .dock-short { display: inline; } }
@media (prefers-reduced-motion: reduce) { .dock { transition: none; transform: none; } }
.panel-iso .copy .lead { max-width: 30ch; }

/* ── Landa / Grow Food / Alfa: заголовок слева сверху, картинка по центру снизу ── */
#vtb { margin-block-end: var(--gap); }
.case.more .panel + .panel { margin-block-start: var(--gap); }
.panel-shot { display: block; }
.panel-shot .shot-copy { position: absolute; z-index: 2; left: 0; top: 0; }
.panel-shot .shot-copy h2 { max-width: none; }
.panel-shot .shot-copy .lead { max-width: 76ch; }
.panel-shot img { position: absolute; left: 50%; bottom: 0; width: min(74%, 1040px); height: auto; max-width: none; transform: translateX(-50%); }
.panel-shot:not(.panel-shot-top) img { width: min(70%, 930px); }
.panel-shot-top img { bottom: auto; top: 284px; }
@media (max-width: 820px) {
  .panel-shot { padding: clamp(18px, 3.4vw, 52px) 0 0; }
  .panel-shot .shot-copy { position: static; padding-block: 0 20px; }
  .panel-shot img, .panel-shot-top img, .panel-shot:not(.panel-shot-top) img { position: static; display: block; width: 92%; margin: 0 auto; transform: none; }
}

/* Landa: широкий интерфейс прижат к низу, панель по высоте содержимого (картинка 3207×1620) */
@media (min-width: 821px) {
  .panel.panel-shot.panel-shot-top { display: flex; flex-direction: column; align-items: center; height: auto; }
  .panel-shot.panel-shot-top .shot-copy { position: static; align-self: flex-start; padding-bottom: 0; }
  .panel-shot.panel-shot-top img { position: static; transform: none; margin-top: 28px; width: min(74%, 1040px); }
}

/* ── Кнопка перехода к проекту ── */
.go {
  position: relative; z-index: 3; display: inline-flex; align-items: center; height: 36px; padding: 0 18px; margin-block-start: 20px;
  border-radius: 999px; background: var(--pill); font-size: 14px; line-height: 20px; font-weight: 500;
  box-shadow: 0 0 0 1px var(--hairline), 0 6px 16px -10px rgba(0, 0, 0, 0.25); transition: transform 0.25s var(--ease), box-shadow 0.25s ease;
}
.go:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--hairline), 0 12px 24px -12px rgba(0, 0, 0, 0.3); }
.panel .go:focus-visible { border-radius: 999px; }

/* Текст в панелях с телефоном не заезжает на мокап */
@media (min-width: 821px) {
  .panel:has(.phone-slot) > .copy { padding-right: 0; max-width: calc(100% - 180px); }
}

/* Grow Food и Альфа: текст слева, крупная картинка справа
   (по бокам картинки ~10% прозрачного поля, поэтому right отрицательный) */
@media (min-width: 821px) {
  .panel-shot.panel-shot-side .shot-copy { width: 32%; padding-right: 0; }
  .panel-shot.panel-shot-side .shot-copy .lead { max-width: 30ch; }
  .panel-shot.panel-shot-side img { left: auto; right: -5.4%; bottom: auto; top: 50%; width: 83%; max-width: none; transform: translateY(-50%); }
}
@media (min-width: 821px) {
  .panel-shot.panel-shot-side img { width: 80%; right: -5.1%; }
}
@media (min-width: 821px) and (max-width: 1279px) {
  .panel-shot.panel-shot-side img { width: 74%; right: -4.8%; }
}
