/* ═══════════════════════════════════════════════════════════
   verba-design.ru
   Шрифт TildaSans — свободная лицензия, tilda.cc/sans
   Локальный файл, при его отсутствии подхватывается CDN.
   ═══════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'TildaSans';
  font-style: normal;
  font-weight: 250 1000;
  font-display: swap;
  src: url('../fonts/TildaSans-VF.woff2') format('woff2-variations'),
       url('https://static.tildacdn.com/fonts/tildasans/TildaSans-VF.woff2') format('woff2-variations');
}

:root {
  --white: #fff;
  --black: #000;
  --ink: #030303;
  --red: #a10000;

  --dock-h: 44px;
  --pad: clamp(16px, 3.2vw, 44px);
  --gap: clamp(24px, 4vw, 64px);

  --fs-body: clamp(14px, 1.1vw, 15px);
  --fs-small: 13px;
  --lh-body: 1.55;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  padding-bottom: var(--dock-h);
  font-family: 'TildaSans', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--white); padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

:where(a, button, input, textarea):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* ─────────────────────────────────────── первый экран */

.hero {
  position: relative;
  height: calc(100svh - var(--dock-h));
  min-height: 520px;
  display: grid;
  /* средняя строка — minmax(0,1fr): фотография занимает ровно то,
     что осталось после текста и заголовка, и не выдавливает их за экран */
  grid-template-rows: auto minmax(0, 1fr) auto;
  /* отступы поджаты, чтобы фотографии досталось больше высоты */
  gap: clamp(12px, 1.6vw, 24px);
  padding: clamp(14px, 1.8vw, 28px) var(--pad) 0;
  overflow: hidden;
}

/* на широких экранах текст и фотография стоят рядом —
   так фотографии достаётся вся высота, а не остаток после текста */
@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 32%) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      'lead  media'
      'title title';
    column-gap: clamp(24px, 3vw, 56px);
  }
  .hero__lead  { grid-area: lead; align-self: start; }
  .hero__media { grid-area: media; }
  .hero__title { grid-area: title; }
}

.hero__lead {
  margin: 0;
  /* на телефоне текст занимает всю ширину экрана, выключка по левому краю */
  max-width: 92ch;
  font-weight: 600;
  font-size: var(--fs-body);
}
@media (min-width: 900px) {
  .hero__lead { max-width: min(92ch, 74vw); }
}

.hero__media {
  position: relative;
  justify-self: end;
  align-self: end;
  /* пропорция кадра задана — фотография не превращается в узкую полоску.
     Ширина растёт от высоты и упирается в ширину строки «Людмила Верба». */
  height: 100%;
  aspect-ratio: 3 / 2;
  width: auto;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
  background: #f2f2f2;
}

.hero__slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.hero__slide.is-active { opacity: 1; }

.hero__title {
  margin: 0;
  display: grid;
  justify-items: end;
  text-align: right;
  font-weight: 600;
  /* На телефоне имя набирается крупно и переносится на несколько строк —
     иначе оно вынуждено ужиматься под длину строки «— дизайнер интерьера».
     На десктопе кегль зависит и от ширины, и от высоты экрана. */
  font-size: min(11.5vw, 17vh);
  line-height: 0.82;
  letter-spacing: -0.055em;
  /* нижний край букв почти в стык с красной полосой, но не под ней */
  margin-bottom: 0.14em;
}

/* на широком экране имя укладывается в две строки — кегль меньше,
   зато строка «— дизайнер интерьера» идёт целиком */
@media (min-width: 900px) {
  .hero__title {
    font-size: clamp(28px, min(6.2vw, 14vh), 108px);
    margin-bottom: 0.1em;
  }
}

/* ─────────────────────────────────────── опыт */

.experience {
  display: grid;
  gap: clamp(16px, 2vw, 28px) var(--gap);
  grid-template-columns: 1fr;
  padding: clamp(64px, 10vw, 160px) var(--pad) clamp(48px, 8vw, 120px);
}

.experience__title,
.section-label {
  margin: 0;
  font-weight: 600;
  font-size: var(--fs-small);
}

.experience__years {
  margin: 0;
  font-weight: 600;
  font-size: var(--fs-small);
}

.experience__text { margin: 0 0 clamp(20px, 3vw, 32px); max-width: 58ch; }
.experience__portrait { width: 100%; }

.experience__list {
  margin: 0; padding: 0; list-style: none;
  align-self: start;
}
.experience__list li {
  padding: 12px 0;
  border-bottom: 1px solid currentColor;
}
.experience__list li:first-child { border-top: 1px solid currentColor; }

@media (min-width: 900px) {
  .experience {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      'title  years'
      'left   list';
  }
  .experience__title  { grid-area: title; }
  .experience__years  { grid-area: years; justify-self: end; }
  .experience__left   { grid-area: left; }
  .experience__list   { grid-area: list; }
}

.section-label {
  padding: clamp(48px, 7vw, 96px) var(--pad) clamp(20px, 3vw, 40px);
  scroll-margin-top: 0;
}

/* ─────────────────────────────────────── карточка проекта */

.projects { display: block; }

.project {
  --fg: var(--black);
  background: var(--bg);
  color: var(--fg);
  /* один проект — ровно один экран */
  height: calc(100svh - var(--dock-h));
  min-height: 520px;
  padding: clamp(24px, 4vw, 56px) var(--pad) clamp(20px, 3vw, 40px);
  display: grid;
  /* сначала текст, под ним фотография на весь остаток */
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(20px, 3vw, 44px);
}
.project--dark { --fg: var(--white); }

.project__cover {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.project__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
}

.project__meta {
  display: grid;
  gap: 12px;
  align-items: start;
}
.project__desc { margin: 0; max-width: 62ch; }
.project__year { margin: 0; font-weight: 600; font-size: var(--fs-small); }

.project__open {
  justify-self: start;
  background: none;
  border: 0;
  padding: 4px 0;
  font-weight: 600;
  font-size: var(--fs-small);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.project__open:hover { border-bottom-color: currentColor; }

@media (min-width: 900px) {
  .project__meta {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--gap);
  }
  .project__year { justify-self: start; }
  .project__open { justify-self: end; }
}

/* Телефон: текст и год сверху, кнопка опускается вплотную к фотографии */
@media (max-width: 899px) {
  .project {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  /* desc, year и кнопка становятся прямыми детьми колонки */
  .project__meta { display: contents; }
  .project__year { margin-top: -4px; }
  .project__open {
    align-self: flex-start;
    margin-top: auto;
    margin-bottom: 4px;
  }
  .project__cover {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
  }
  .project__img { object-fit: cover; object-position: center; }
}

/* появление обложки при прокрутке */
.reveal {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
/* на телефоне сдвиг убран — остаётся только проявление.
   Сдвиг заставлял браузер пересчитывать раскладку прямо во время прокрутки */
@media (max-width: 899px) {
  .reveal { transform: none; transition: opacity 0.6s ease; }
}

/* ─────────────────────────────────────── контакты */

.contacts {
  /* блок ростом в экран — иначе на телефоне он не может встать под шапку
     и оказывается прижат к самому низу страницы */
  min-height: calc(100svh - var(--dock-h));
  padding: clamp(40px, 7vw, 160px) var(--pad) clamp(48px, 7vw, 100px);
  display: grid;
  align-content: start;
  gap: clamp(20px, 4vw, 48px);
}
.contacts__title { margin: 0; font-weight: 600; font-size: var(--fs-small); }

.contacts__lead {
  margin: 0;
  max-width: 30ch;
  font-weight: 600;
  font-size: clamp(24px, 4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.contacts__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.contacts__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px clamp(16px, 3vw, 40px);
}
.contacts__links a {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px;
  font-size: var(--fs-small); font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn--send { background: var(--ink); color: var(--white); }
.btn--send:hover { background: var(--red); border-color: var(--red); }
.btn--tg { background: transparent; color: var(--ink); }
.btn--tg:hover { background: var(--ink); color: var(--white); }

.contacts__note { margin: 0; font-size: 11px; opacity: 0.6; max-width: 70ch; }

/* ─────────────────────────────────────── нижнее меню */

.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  height: var(--dock-h);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  background: var(--ink);
  overflow-x: auto;
  scrollbar-width: none;
  /* меню выносится на отдельный слой — не перерисовывается при прокрутке */
  will-change: transform;
  transform: translateZ(0);
}
.dock::-webkit-scrollbar { display: none; }

.dock a {
  flex: 0 0 auto;
  padding: 6px 14px;
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
  color: var(--white);
  /* полоса чёрная, поэтому неактивные пункты без своей плашки */
  background: transparent;
  transition: background 0.2s, color 0.2s;
}
.dock a:hover { background: var(--white); color: var(--ink); }
.dock a.is-current { background: var(--white); color: var(--ink); }

/* ─────────────────────────────────────── просмотр проекта
   Ключевое отличие от Тильды: высота не задана.
   Сколько фотографий — столько высоты, на любом экране. */

.viewer {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--white);
  color: var(--black);
  overflow: hidden;
}
.viewer::backdrop { background: rgba(0, 0, 0, 0.6); }

.viewer__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--pad);
  background: var(--white);
  border-bottom: 1px solid #e5e5e5;
}
.viewer__year { margin: 0; font-weight: 600; font-size: var(--fs-small); }
.viewer__close {
  background: none; border: 0; padding: 6px 0;
  font-weight: 600; font-size: var(--fs-small);
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.viewer__close:hover { border-bottom-color: currentColor; }

.viewer__body {
  height: calc(100% - 49px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: clamp(20px, 4vw, 48px) var(--pad) clamp(48px, 8vw, 120px);
  display: grid;
  /* фотографии идут почти встык */
  gap: 2px;
  justify-items: center;
}

.viewer__desc {
  margin: 0 auto clamp(20px, 3vw, 40px);
  max-width: min(100ch, 1100px);
  width: 100%;
}

.shot {
  margin: 0;
  width: min(100%, 1100px);
}
.shot__img { width: 100%; }

@media (min-width: 900px) {
  .viewer { width: 100%; height: 100%; }
}
