/* Mobile version: Figma frames "Дизайн сайта Мобильная верс" and "Меню-бургер", 390px, scaled via --zm. */

.v-mobile,
.m-modal,
.m-viewer {
  --m-ink: #190b09;
  --m-rose: #c9827d;
  --m-rose-hover: #b9716c;
  --m-accent: #9f6b6b;
  --m-line: #d8b7b3;
}

.v-mobile {
  position: relative;
  width: 390px;
  margin: 0 auto;
  zoom: var(--zm);
  color: var(--m-ink);
  overflow: hidden;
  overflow: clip;
}

.v-mobile section,
.v-mobile footer { position: relative; }

/* Shared text styles */
.m-eyebrow {
  --fs: 10px;
  --lh: 14px;
  font-weight: 500;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: .3em;
  color: var(--m-accent);
  white-space: nowrap;
}
.m-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 27px;
  background: var(--m-rose);
  color: #fff8f5;
  white-space: nowrap;
  transition: background-color .2s;
}
.m-btn:active { background: var(--m-rose-hover); }
/* Figma separates the star with two en spaces (0.525em each in its fallback font) */
.m-btn__star { margin-left: 1.05em; }

/* Hero */
.m-hero { height: 1060px; }
.m-hero > * { position: absolute; }
.m-hero__img {
  left: 16px;
  top: 0;
  width: 358px;
  height: 636px;
  border-radius: 0 0 24px 24px;
  object-fit: cover;
}
.m-logo {
  left: 16px;
  top: 9px;
}
.m-burger {
  left: 338px;
  top: 17px;
  width: 36px;
  height: 16px;
  border-radius: 24px;
  background: rgba(185, 138, 110, .41);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.m-burger::before {
  content: '';
  position: absolute;
  inset: -14px -10px;
}
.m-burger span {
  position: absolute;
  left: 9px;
  width: 18px;
  height: 2px;
  background: #2f2422;
}
.m-burger span:nth-child(1) { top: 3px; }
.m-burger span:nth-child(2) { top: 8px; }
.m-burger span:nth-child(3) { top: 13px; }
.m-hero__hello {
  left: 14px;
  top: 660px;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .2em;
  color: var(--m-accent);
  white-space: nowrap;
}
.m-hero__title {
  left: 14px;
  top: 688px;
  font-size: 40px;
  line-height: 45px;
  color: #2a2221;
  white-space: nowrap;
}
.m-hero__script {
  left: 38.85px;
  top: 780.64px;
  font-size: 24px;
  line-height: 28px;
  letter-spacing: .035em;
  color: #c88f8a;
  white-space: nowrap;
  transform-origin: 0 0;
  transform: rotate(-3.08deg);
}
.m-hero__text {
  left: 16px;
  top: 821px;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .035em;
  color: #6f5e5b;
  white-space: nowrap;
}
.m-hero__btn {
  left: 95px;
  top: 877px;
  width: 200px;
  height: 47px;
  font-size: 16px;
  line-height: 22px;
}
.m-hero__link {
  left: 106px;
  top: 940px;
  font-size: 16px;
  line-height: 22px;
  color: #000;
  white-space: nowrap;
}
.m-hero__link::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 26.5px;
  width: 161px;
  height: 1px;
  background: #1d1716;
}
.m-hero__scroll {
  left: 144px;
  top: 999px;
  width: 101px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 10px;
  line-height: 14px;
  letter-spacing: .2em;
  color: var(--m-accent);
  white-space: nowrap;
}
.m-hero__scroll span:first-child { margin-right: -.2em; }
.m-hero__arrow {
  font-size: 12px;
  letter-spacing: 0;
}

/* Projects */
.m-projects { height: 1520px; }
.m-projects > * { position: absolute; }
.m-projects__eyebrow {
  left: 15px;
  top: 23px;
}
.m-projects__title {
  --fs: 36px;
  --lh: 62px;
  left: 11px;
  top: 38px;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.m-cards {
  left: 16px;
  top: 90px;
  width: 358px;
  display: flex;
  flex-direction: column;
  gap: 32.6px;
}
.m-card:nth-child(2) { transform: translateX(.5px); }
.m-card:nth-child(3) { transform: translateX(-.5px); }
.m-card { position: relative; }
.m-card__btn {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 28px;
  -webkit-tap-highlight-color: transparent;
}
.m-card__media {
  width: 358px;
  height: 400px;
  border-radius: 28px;
  background: #fff;
  overflow: hidden;
  isolation: isolate;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.m-card__btn:active ~ .m-card__media { transform: scale(.98); }
.m-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.m-card__caption {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  text-align: center;
}
.m-card__title {
  --fs: 22px;
  --lh: 28px;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.m-card__tags {
  --fs: 14px;
  --lh: 20px;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: -.01em;
  color: #7d6461;
}

/* About */
.m-about { height: 870px; }
.m-about > * { position: absolute; }
.m-about__eyebrow {
  left: 16px;
  top: 22px;
}
.m-about__title {
  --fs: 36px;
  --lh: 62px;
  left: 14px;
  top: 37px;
  font-size: var(--fs);
  line-height: var(--lh);
  white-space: nowrap;
}
.m-about__photo {
  left: 16px;
  top: 86px;
  width: 358px;
  height: 447px;
  border-radius: 24px;
  object-fit: cover;
}
.m-about__lead {
  --fs: 24px;
  --lh: 30px;
  left: 15px;
  top: 557px;
  font-size: var(--fs);
  line-height: var(--lh);
  white-space: nowrap;
}
.m-about__text {
  --fs: 14px;
  --lh: 20px;
  left: 15px;
  top: 652px;
  font-size: var(--fs);
  line-height: var(--lh);
  color: #6f5b59;
  white-space: nowrap;
}
.m-about__handwriting {
  left: 61.82px;
  top: 746.37px;
  width: 325.28px;
  height: 108.43px;
  transform-origin: 0 0;
  transform: rotate(-9.16deg);
}

/* Process */
.m-process { height: 450px; }
.m-process > * { position: absolute; }
.m-process__eyebrow {
  left: 15px;
  top: 26px;
}
.m-process__title {
  --fs: 34px;
  --lh: 40px;
  left: 14px;
  top: 41px;
  font-size: var(--fs);
  line-height: var(--lh);
  white-space: nowrap;
}
.m-steps {
  left: 16px;
  top: 97px;
}
.m-step {
  position: relative;
  height: 86px;
  padding-left: 60px;
}
.m-step:last-child { height: auto; }
.m-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 21.5px;
  top: 44px;
  width: 1px;
  height: 42px;
  background: var(--m-line);
}
.m-step__num {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--m-line);
  border-radius: 50%;
  background: rgba(216, 183, 179, .1);
  font-size: 14px;
  line-height: 62px;
  color: var(--m-line);
}
/* Digit positions from Figma, minus the 1px border */
.m-step__num span {
  position: absolute;
  left: 18px;
  top: -10px;
}
.m-step:nth-child(4) .m-step__num span { left: 17px; }
.m-step__title {
  --fs: 20px;
  --lh: 26px;
  font-size: var(--fs);
  line-height: var(--lh);
  white-space: nowrap;
}
.m-step__text {
  --fs: 13px;
  --lh: 20px;
  margin-top: 8px;
  font-size: var(--fs);
  line-height: var(--lh);
  color: #6f5b59;
  white-space: nowrap;
}

/* Contacts */
.m-contacts { height: 500px; }
.m-contacts > * { position: absolute; }
.m-contacts__base {
  left: 16px;
  top: 22px;
  width: 358px;
  height: 420px;
  border-radius: 28px;
  background: #e2ccc7;
}
.m-contacts__photo {
  left: 16px;
  top: 22px;
  width: 358px;
  height: 443px;
  border-radius: 28px;
  overflow: hidden;
}
.m-contacts__photo img {
  position: absolute;
  left: -95.3px;
  top: 55.9px;
  width: 496.5px;
  height: 621.3px;
}
.m-contacts__fade {
  left: 16px;
  top: 77px;
  width: 358px;
  height: 388px;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(180deg, #e2ccc7 0%, rgba(226, 204, 199, 0) 60%, rgba(226, 204, 199, .3) 85%);
}
.m-contacts__eyebrow {
  --fs: 12px;
  --lh: 14px;
  left: 40px;
  top: 50px;
  font-weight: 500;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: .2em;
  color: #a67d77;
}
.m-contacts__text {
  --fs: 14px;
  --lh: 21px;
  left: 39px;
  top: 190px;
  font-size: var(--fs);
  line-height: var(--lh);
  color: #6f5b59;
  white-space: nowrap;
}
.m-contacts__title {
  --fs: 30px;
  --lh: 40px;
  left: 39px;
  top: 66px;
  font-size: var(--fs);
  line-height: var(--lh);
  color: #2a2221;
  white-space: nowrap;
}
.m-contacts__tg,
.m-contacts__mail,
.m-menu__tg,
.m-menu__mail {
  display: block;
  font-size: 10px;
  line-height: 14px;
  color: #5f4e4b;
  white-space: nowrap;
}
.m-contacts__tg img,
.m-contacts__mail img,
.m-menu__tg img,
.m-menu__mail img {
  position: absolute;
  left: 0;
  pointer-events: none;
}
.m-contacts__tg img,
.m-menu__tg img {
  top: -4px;
  width: 21px;
  height: 21px;
}
.m-contacts__mail img,
.m-menu__mail img {
  top: -6px;
  width: 26px;
  height: 26px;
}
.m-contacts__tg {
  left: 36px;
  top: 254px;
  padding-left: 21px;
}
.m-contacts__mail {
  left: 34px;
  top: 271px;
  padding-left: 23px;
}
.m-contacts__btn {
  left: 40px;
  top: 292px;
  width: 124px;
  height: 24px;
  font-size: 8px;
  line-height: 22px;
}

/* Footer */
.m-footer { height: 127px; }
.m-footer > * { position: absolute; }
.m-footer::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 12.5px;
  width: 358px;
  height: 1px;
  background: var(--m-line);
  opacity: .7;
}
.m-footer__logo {
  left: 16px;
  top: 33px;
}
.m-footer__up {
  left: 319px;
  top: 31px;
  width: 61px;
  height: 25px;
  font-weight: 500;
  line-height: 14px;
  color: #6f5b59;
}
.m-footer__arrow {
  position: absolute;
  left: 0;
  top: 0;
  width: 59px;
  text-align: center;
  font-size: 12px;
}
.m-footer__label {
  position: absolute;
  left: 2px;
  top: 11px;
  font-size: 10px;
  letter-spacing: .2em;
  white-space: nowrap;
}
.m-footer__name {
  left: 0;
  right: 0;
  top: 81px;
  padding-left: .2em;
  text-align: center;
  font-weight: 500;
  font-size: 7px;
  line-height: 14px;
  letter-spacing: .2em;
  color: #6f5b59;
}

/* Burger menu */
.m-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition: opacity .25s, visibility 0s .25s;
}
.m-menu.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity .25s;
}
.m-menu__panel {
  position: relative;
  width: 390px;
  height: 524px;
  margin: 0 auto;
  border-radius: 24px;
  background: #f2e2de;
  overflow: hidden;
  overflow: clip;
  transform: translateY(-12px);
  transition: transform .25s;
}
.m-menu.is-open .m-menu__panel { transform: none; }
.m-menu__panel > * { position: absolute; }
.m-menu__bg {
  left: 0;
  top: 111px;
  width: 390px;
  height: 486px;
  overflow: hidden;
}
.m-menu__bg img {
  position: absolute;
  left: -61.8px;
  top: -18px;
  width: 468.2px;
  height: 582px;
}
.m-menu__fade {
  left: 0;
  top: 88px;
  width: 392px;
  height: 280px;
  background: linear-gradient(180deg, #f2e2de 0%, rgba(242, 226, 222, .85) 55%, rgba(242, 226, 222, 0) 100%);
}
.m-menu__logo {
  left: 16px;
  top: 9px;
}
.m-menu__close {
  left: 333px;
  top: -6px;
  width: 61px;
  height: 61px;
}
.m-menu__close img {
  width: 61px;
  height: 61px;
}
.m-menu__nav {
  left: 4px;
  top: 84px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  font-size: 26px;
  line-height: 36px;
  color: #2a2221;
}
.m-menu__nav a {
  padding: 10px;
  white-space: nowrap;
}
.m-menu__tg {
  left: 132px;
  top: 399px;
  padding-left: 21px;
}
.m-menu__mail {
  left: 130px;
  top: 416px;
  padding-left: 23px;
}
.m-menu__btn {
  left: 120px;
  top: 437px;
  width: 150px;
  height: 35px;
  font-size: 10px;
  line-height: 22px;
}

/* Project modals: bottom sheet (outside .v-mobile, so not affected by --zm) */
.m-modal {
  width: min(100vw, 600px);
  max-width: none;
  max-height: none;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--m-ink);
  overflow: visible;
}
.m-modal::backdrop {
  background: rgba(42, 30, 28, .22);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.m-modal[open] { animation: m-sheet-in .45s cubic-bezier(.2, .8, .2, 1); }
.m-modal[open]::backdrop { animation: m-backdrop-in .45s ease; }
.m-modal.is-closing { animation: m-sheet-out .3s cubic-bezier(.4, 0, 1, 1) forwards; }
.m-modal.is-closing::backdrop { animation: m-backdrop-out .3s ease forwards; }
@keyframes m-sheet-in { from { transform: translateY(100%); } }
@keyframes m-sheet-out { to { transform: translateY(100%); } }
@keyframes m-backdrop-in { from { opacity: 0; } }
@keyframes m-backdrop-out { to { opacity: 0; } }

.m-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  max-height: 88dvh;
  border-radius: 24px 24px 0 0;
  background: #fcf7f4;
  box-shadow: 0 -20px 60px rgba(73, 44, 40, .16);
  overflow: hidden;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.m-modal__panel::before {
  content: '';
  position: absolute;
  top: 9px;
  left: 50%;
  z-index: 2;
  width: 36px;
  height: 4px;
  margin-left: -18px;
  border-radius: 2px;
  background: var(--m-line);
}
.m-modal__body {
  display: flex;
  flex-direction: column;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.m-modal__body::-webkit-scrollbar { display: none; }
.m-modal__cover {
  width: 100%;
  height: auto;
  max-height: 300px;
  aspect-ratio: 358 / 260;
  border-radius: 20px;
  background: #f3e4e1;
  object-fit: cover;
}
.m-modal__close {
  position: absolute;
  top: 36px;
  right: 28px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(252, 247, 244, .8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
}
.m-modal__close::before,
.m-modal__close::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 1.5px;
  border-radius: 1px;
  background: #2a2221;
  transform: translate(-50%, -50%) rotate(45deg);
}
.m-modal__close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.m-modal__eyebrow {
  --fs: 10px;
  --lh: 14px;
  margin-top: 24px;
  font-weight: 500;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: .3em;
  color: var(--m-accent);
}
.m-modal__title {
  --fs: 30px;
  --lh: 36px;
  margin-top: 8px;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: -.01em;
}
.m-modal__tags {
  --fs: 14px;
  --lh: 20px;
  margin-top: 10px;
  font-size: var(--fs);
  line-height: var(--lh);
  color: #7d6461;
}
.m-modal__lead {
  --fs: 20px;
  --lh: 26px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--m-line);
  font-size: var(--fs);
  line-height: var(--lh);
}
.m-modal__text {
  --fs: 14px;
  --lh: 20px;
  margin-top: 12px;
  font-size: var(--fs);
  line-height: var(--lh);
  color: #6f5b59;
}
.m-modal__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 20px;
}
.m-modal__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  aspect-ratio: 1;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1);
  padding-left: .3em;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 16px;
  background: linear-gradient(160deg, #f3e4e1 0%, #ead7d3 100%);
  font-weight: 500;
  font-size: 10px;
  line-height: 14px;
  letter-spacing: .3em;
  color: var(--m-accent);
}
.m-modal__tile::before {
  content: '✦';
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--m-rose);
}
.m-modal__tile:active { transform: scale(.96); }
.m-modal__tile--work {
  position: relative;
  padding: 0;
  overflow: hidden;
}
.m-modal__tile--work::before { content: none; }
.m-modal__tile--work img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
}
.m-modal__btn {
  flex-shrink: 0;
  height: 47px;
  margin-top: 24px;
  font-size: 16px;
  line-height: 22px;
}

/* Work viewer, opened from a project sheet tile */
.m-viewer {
  width: min(calc(100vw - 32px), 568px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--m-ink);
  overflow: visible;
}
.m-viewer::backdrop {
  background: rgba(42, 30, 28, .3);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.m-viewer[open] { animation: m-viewer-in .4s cubic-bezier(.2, .8, .2, 1); }
.m-viewer[open]::backdrop { animation: m-backdrop-in .4s ease; }
.m-viewer.is-closing { animation: m-viewer-out .25s ease forwards; }
.m-viewer.is-closing::backdrop { animation: m-backdrop-out .25s ease forwards; }
@keyframes m-viewer-in { from { opacity: 0; transform: scale(.96); } }
@keyframes m-viewer-out { to { opacity: 0; transform: scale(.97); } }
.m-viewer__panel {
  position: relative;
  padding: 12px;
  border-radius: 28px;
  background: #fcf7f4;
  box-shadow: 0 30px 80px rgba(73, 44, 40, .22);
}
.m-viewer__frame {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 180px);
  max-height: calc(100dvh - 180px);
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  background: linear-gradient(160deg, #f3e4e1 0%, #ead7d3 100%);
  overflow: hidden;
  touch-action: pan-y;
}
.m-viewer__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.m-viewer__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
}
.m-viewer__placeholder[hidden] { display: none; }
.m-viewer__placeholder::before {
  content: '✦';
  font-size: 30px;
  line-height: 1;
  color: var(--m-rose);
}
.m-viewer__soon {
  padding-left: .3em;
  font-weight: 500;
  font-size: 11px;
  line-height: 14px;
  letter-spacing: .3em;
  color: var(--m-accent);
}
.m-viewer__note {
  font-size: 13px;
  line-height: 18px;
  color: #7d6461;
}
.m-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4px 2px;
}
.m-viewer__title {
  --fs: 18px;
  --lh: 24px;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: -.01em;
}
.m-viewer__count {
  --fs: 10px;
  --lh: 14px;
  margin-top: 6px;
  font-weight: 500;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: .3em;
  color: var(--m-accent);
}
.m-viewer__nav {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}
.m-viewer__prev,
.m-viewer__next {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f3e4e1;
  -webkit-tap-highlight-color: transparent;
}
.m-viewer__prev:active,
.m-viewer__next:active { background: #ecd6d1; }
.m-viewer__prev::before,
.m-viewer__next::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 1.5px solid #2a2221;
  border-left: 1.5px solid #2a2221;
}
.m-viewer__prev::before { transform: translate(-25%, -50%) rotate(-45deg); }
.m-viewer__next::before { transform: translate(-75%, -50%) rotate(135deg); }
/* Above the panel so it never covers the work itself */
.m-viewer__close {
  position: absolute;
  top: -48px;
  right: 0;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(252, 247, 244, .8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
}
.m-viewer__close::before,
.m-viewer__close::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 1.5px;
  border-radius: 1px;
  background: #2a2221;
  transform: translate(-50%, -50%) rotate(45deg);
}
.m-viewer__close::after { transform: translate(-50%, -50%) rotate(-45deg); }

@media (prefers-reduced-motion: reduce) {
  .m-modal[open],
  .m-modal[open]::backdrop,
  .m-modal.is-closing,
  .m-modal.is-closing::backdrop,
  .m-viewer[open],
  .m-viewer[open]::backdrop,
  .m-viewer.is-closing,
  .m-viewer.is-closing::backdrop { animation: none; }
}
