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

:root {
  scroll-padding-top: 100px;
  scroll-behavior: smooth;
  --ink: #21060c;
  --pink: #e2cde0;
  --paper: #fafbf5;
  --font: Montserrat, Arial, sans-serif;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
}

a { color: inherit; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }

/* Menu links land slightly deeper in each member's section. */
#zhenya {
  scroll-margin-top: calc(-1 * clamp(120px, 14vw, 210px));
}

#about { scroll-margin-top: -104px; }
#liza { scroll-margin-top: -50px; }
#zahar { scroll-margin-top: 0; }

/* Header */
.site-header {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
  min-height: 77px;
  background: linear-gradient(180deg, #e2cde0, #dbbef600);
}

.navigation {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  max-width: 1512px;
  margin-inline: auto;
  padding: 21px clamp(20px, 2.7vw, 41px) 0;
  font-size: 14px;
}

.navigation__group {
  display: flex;
  gap: clamp(20px, 3.53vw, 54px);
  font-weight: 300;
}

.navigation__group--people {
  gap: clamp(16px, 2.24vw, 34px);
  font-weight: 200;
}
.navigation a {
  text-decoration: none;
  transition: opacity 180ms ease;
}

.navigation a:hover { opacity: 0.65; }

@media (prefers-reduced-motion: reduce) {
  .navigation a { transition: none; }
}

/* Main */
.hero {
  position: relative;
  width: 100%;
  height: min(59.127vw, 894px);
  background: var(--pink) url("assets/hero/background.svg") center / 100% 100% no-repeat;
}

.hero-title {
  position: absolute;
  inset: min(13.823vw, 209px) auto auto 50%;
  width: min(41.27vw, 624px);
  aspect-ratio: 624 / 509;
  margin: 0;
  translate: -50% 0;
}

.hero-title__letter {
  position: absolute;
  display: block;
  left: var(--x);
  top: var(--y);
  width: var(--width);
  height: auto;
}

/* Координаты внутри группы букв из Figma. Порядок HTML задаёт наложение. */
.hero-title__letter--m { --x: 16.1859%; --y: 0.0000%; --width: 25.9615%; }
.hero-title__letter--m2 { --x: 34.1346%; --y: 62.8684%; --width: 21.9551%; }
.hero-title__letter--a1 { --x: 28.6859%; --y: 7.6621%; --width: 26.9231%; }
.hero-title__letter--d { --x: 50.0000%; --y: 7.6621%; --width: 17.4679%; }
.hero-title__letter--e { --x: 64.4231%; --y: 8.8409%; --width: 16.6667%; }
.hero-title__letter--b { --x: 31.0897%; --y: 35.3635%; --width: 17.1474%; }
.hero-title__letter--y { --x: 43.4295%; --y: 35.3635%; --width: 15.2244%; }
.hero-title__letter--h { --x: 0.0000%; --y: 53.2417%; --width: 29.9679%; }
.hero-title__letter--u { --x: 22.5962%; --y: 59.1356%; --width: 18.2692%; }
.hero-title__letter--a2 { --x: 52.8846%; --y: 53.4381%; --width: 21.1538%; }
.hero-title__letter--n { --x: 56.0897%; --y: 46.1690%; --width: 43.9103%; }

.hero-about {
  position: absolute;
  inset: auto auto min(4.43vw, 67px) max(3.175vw, calc((100% - 1512px) / 2 + 48px));
  display: flex;
  align-items: flex-start;
  gap: clamp(6px, .56vw, 9px);
  font-size: clamp(14px, 1.323vw, 20px);
  line-height: 1.2;
}

.hero-about__symbol { flex: 0 0 15px; margin-top: 2px; }
.hero-about p { margin: 0; }

.hero-letter {
  position: absolute;
  inset: auto max(7.86vw, calc((100% - 1512px) / 2 + 119px)) min(3.44vw, 52px) auto;
  width: min(19.46vw, 294px);
  aspect-ratio: 294 / 251;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.hero-letter:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}

.hero-letter img { position: absolute; display: block; height: auto; }
.hero-letter__envelope { right: 0; top: 0; width: 85.37%; }
.hero-letter__arrow { left: 0; top: 66.7%; width: 17%; }
.hero-letter__label { left: 9.5%; top: 81.6%; width: 24.83%; }

/* Появление первого экрана. */
.hero-title__letter--m { --appear-delay: .08s; }
.hero-title__letter--a1 { --appear-delay: .19s; }
.hero-title__letter--d { --appear-delay: .30s; }
.hero-title__letter--e { --appear-delay: .41s; }
.hero-title__letter--b { --appear-delay: .52s; }
.hero-title__letter--y { --appear-delay: .63s; }
.hero-title__letter--h { --appear-delay: .74s; }
.hero-title__letter--u { --appear-delay: .85s; }
.hero-title__letter--m2 { --appear-delay: .96s; }
.hero-title__letter--a2 { --appear-delay: 1.07s; }
.hero-title__letter--n { --appear-delay: 1.18s; }

@media (prefers-reduced-motion: no-preference) {
  .hero-title__letter {
    animation: hero-letter-appear .65s cubic-bezier(.2,.75,.25,1) var(--appear-delay) both,
      brand-letter-bounce 1s steps(1, end) calc(2s + var(--bounce-delay, 0s)) infinite;
    --bounce-height: clamp(5px, .75vw, 11px);
    will-change: translate;
  }
  .navigation { animation: hero-fade-in .8s ease .55s both; }
  .hero-about { animation: hero-fade-in .85s ease .95s both; }
  .hero-letter { animation: hero-fade-in .9s ease 1.05s both; }
  .hero-letter__envelope {
    transform-origin: 50% 68%;
    animation: envelope-sway 3.6s ease-in-out 1.95s infinite;
  }
  .hero-letter:hover .hero-letter__envelope,
  .hero-letter:focus-visible .hero-letter__envelope { animation-play-state: paused; }
}

@keyframes hero-letter-appear {
  from { opacity: 0; transform: translateY(16px) rotate(-7deg) scale(.9); }
  to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

@keyframes hero-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes envelope-sway {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

/* Временное оформление письма до получения макета. */
.motivation-letter {
  position: fixed;
  width: min(90vw, 560px);
  max-height: 85dvh;
  padding: clamp(24px, 5vw, 48px);
  border: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
}

.motivation-letter::backdrop { background: rgb(33 6 12 / 45%); }
.motivation-letter h2 { font-size: 24px; font-weight: 400; margin: 0 25px 20px 0; }
.motivation-letter p:last-child { margin-bottom: 0; }
.motivation-letter__close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 30px;
  cursor: pointer;
  line-height: 1;
}
.motivation-letter__close:focus-visible { outline: 2px solid currentColor; }

/* Motivation letter — letterv2 Figma reference. */
.manifest-dialog {
  --letter-cream: #f3f2ea;
  width: min(92vw, 779px);
  max-width: none;
  max-height: calc(100dvh - 28px);
  padding: 0;
  background: transparent;
  overflow: auto;
  scrollbar-width: none;
  border-radius: 0 0 3px 3px;
}
.manifest-dialog::backdrop { background: rgb(33 6 12 / 43%); }
.manifest-dialog::-webkit-scrollbar { display: none; }
body:has(.manifest-dialog[open]) { overflow: hidden; }
.manifest-envelope {
  position: relative;
  padding-top: 34.85%;
  perspective: 1000px;
  isolation: isolate;
}
.manifest-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 779 / 274;
  background: url("assets/letter/envelope.svg") no-repeat center top / 100% auto;
  transform-origin: 50% 99%;
  backface-visibility: hidden;
  z-index: 1;
}
.manifest-dialog #motivation-title {
  position: absolute;
  top: clamp(44px, 15vw, 128px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 62%;
  font-family: 'Denistina', 'Segoe Script', Georgia, cursive;
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.03;
  margin: 0;
  text-align: center;
  font-weight: 400;
  color: #514d40;
}
.manifest-paper {
  position: relative;
  min-height: 382px;
  padding: 90px 65px 35px;
  color: #514d40;
  background: var(--letter-cream);
  border-radius: 0 0 3px 3px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}
.manifest-paper p { max-width: 555px; margin: 0 0 32px; }
.manifest-paper .manifest-signature {
  max-width: none;
  margin: auto 0 0;
  padding-top: 8px;
  text-align: right;
  font-family: 'Denistina', 'Segoe Script', Georgia, cursive;
  font-size: 18px;
  line-height: 1.35;
}
.manifest-dialog .motivation-letter__close {
  z-index: 3;
  top: 12px;
  right: 28px;
  font-size: 28px;
  font-weight: 200;
  color: #8a8679;
}
@media (prefers-reduced-motion: no-preference) {
  .manifest-dialog[open] { animation: manifest-arrive .35s ease-out both; }
  .manifest-dialog[open]::backdrop { animation: manifest-backdrop .3s ease-out both; }
  .manifest-dialog[open] .manifest-flap { animation: manifest-unfold .65s cubic-bezier(.3,.1,.2,1) .12s both; }
  .manifest-dialog[open] #motivation-title { animation: manifest-title-reveal .45s ease-out .58s both; }
  .manifest-dialog[open] .manifest-paper > :not(form) { animation: manifest-letter-reveal .48s ease-out .58s both; }
}
@keyframes manifest-arrive {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes manifest-backdrop { from { opacity: 0; } to { opacity: 1; } }
@keyframes manifest-unfold {
  from { transform: rotateX(180deg); }
  to { transform: rotateX(0deg); }
}
@keyframes manifest-title-reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes manifest-letter-reveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 600px) {
  .manifest-dialog #motivation-title { top: 13vw; font-size: clamp(19px, 5vw, 27px); }
  .manifest-paper { min-height: 0; padding: 44px 23px 28px; font-size: 13px; line-height: 1.5; }
  .manifest-paper p { max-width: none; margin-bottom: 20px; }
  .manifest-dialog .motivation-letter__close { top: 8px; right: 12px; }
}

/* About */
.about-section {
  background: var(--paper);
}

.about-section__layout {
  position: relative;
  width: 100%;
  max-width: 1512px;
  margin-inline: auto;
  aspect-ratio: 1230 / 816;
  container-type: inline-size;
}

.about-section__title {
  position: absolute;
  top: 16.05%;
  right: 2.85%;
  width: 3.175%;
  margin: 0;
}

.about-section__title img {
  display: block;
  width: 100%;
  height: auto;
}

.about-section__intro {
  position: absolute;
  top: 15.93%;
  left: 2.85%;
  display: flex;
  align-items: flex-start;
  gap: 1.55cqw;
  font-size: 1.71cqw;
  font-weight: 400;
  line-height: 1.14;
}

.about-section__intro p { margin: 0; }
.about-section__symbol {
  width: 1.55cqw;
  height: auto;
  flex-shrink: 0;
  margin-top: 2px;
}

.about-section__circle {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  fill: currentColor;
  font-size: 12px;
  font-weight: 400;
}

.about-section__portrait { position: absolute; top: 25.858%; left: 32.033%; width: 34.228%; }
.about-section__snapshot {
  position: absolute;
  top: 27%;
  left: 33%;
  width: 41%;
  margin: 0;
}
.about-section__snapshot img {
  display: block;
  width: 100%;
  height: auto;
}
.about-section__callout {
  position: absolute;
  right: 34%;
  bottom: calc(100% + 6px);
  width: 54%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.about-section__callout .about-section__callout-arrow {
  width: 19%;
}
.about-section__intro { max-width: 83%; }
.profile-link {
  border: 0; padding: 3px 0; background: none; color: inherit; font: inherit;
  font-size: .82em; text-decoration: none; cursor: pointer;
  transition: opacity 180ms ease;
}
.profile-link:hover { opacity: 0.65; }
@media (prefers-reduced-motion: reduce) {
  .profile-link { transition: none; }
}
.profile-link:focus-visible, .letter-project:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.about-section__note {
  position: absolute;
  top: 75%;
  left: 63.98%;
  width: 29.8%;
  margin: 0;
  font-size: 1.22cqw;
  font-weight: 400;
  line-height: 1.2;
}

/* Liza */
.liza-section {
  background: var(--paper) url("assets/team/liza/background.svg") center / 100% 100% no-repeat;
}

.liza-section__layout {
  position: relative;
  width: 100%;
  max-width: 1512px;
  margin-inline: auto;
  aspect-ratio: 1512 / 804;
  container-type: inline-size;
  overflow: hidden;
}

.liza-section__paper-left,
.liza-section__paper-right {
  position: absolute;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  transition: transform 450ms cubic-bezier(.22,.68,.25,1);
}

@media (min-width: 1101px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .liza-section__layout:has(.liza-card:hover) .liza-section__paper-left {
    transform: translateX(-19%) rotate(-3deg);
  }

  .liza-section__layout:has(.liza-card:hover) .liza-section__paper-right {
    transform: translateX(19%) rotate(3deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .liza-section__paper-left,
  .liza-section__paper-right { transition: none; }
}

.liza-section__paper-left {
  left: 17%;
  top: 9.33%;
  width: 34.52%;
  aspect-ratio: 522 / 556;
  background-image: url("assets/team/liza/paper-left.svg");
}

.liza-section__paper-left p {
  position: absolute;
  left: 8%;
  top: 14%;
  width: 42%;
  margin: 0;
  font-size: 1.12cqw;
  line-height: 1.6;
  transform: rotate(-6.58487deg);
  transform-origin: left top;
}

.liza-section__paper-right {
  left: 48.68%;
  top: 7.09%;
  width: 35.25%;
  aspect-ratio: 533 / 614;
  background-image: url("assets/team/liza/paper-right.svg");
}

.liza-section__paper-right p {
  position: absolute;
  top: 8%;
  left: 23%;
  width: 65%;
  margin: 0;
  font-size: .9cqw;
  line-height: 1.35;
  text-align: center;
  color: #5f5550;
  transform: rotate(8.58587deg);
}

.member-photo {
  --photo-tilt: -5deg;
  position: absolute;
  z-index: 1;
  width: 13.5%;
  margin: 0;
  padding: clamp(6px, .65cqw, 10px);
  background: #fffdf6;
  text-align: center;
  transform: rotate(var(--photo-tilt));
  transform-origin: center 15%;
  transition: opacity .65s ease, transform .65s cubic-bezier(.2,.75,.3,1);
}
.member-photo[hidden] { display: none; }
.member-photo img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.member-photo figcaption {
  margin-top: 7px;
  padding-bottom: 4px;
  font: 400 clamp(12px, 1.3cqw, 20px)/1.2 'Denistina', Georgia, serif;
  color: #5c494b;
}
.liza-section__photo {
  position: absolute;
  z-index: 1;
  left: .5%;
  top: 45%;
  width: 22.5%;
  aspect-ratio: 355 / 437;
  margin: 0;
  --photo-hover-rotation: 15deg;
  transform-origin: center 15%;
}
.liza-section__photo img { display: block; height: auto; }
.liza-section__portrait {
  width: 76%;
  position: absolute;
  top: 50%;
  left: 50%;
  box-sizing: border-box;
  padding: 2% 2% 8%;
  background: #fff;
  transform: translate(-50%, -50%) rotate(-15deg);
}
.liza-section__photo-clip { position: absolute; left: 4%; top: -38%; width: 86%; pointer-events: none; }

@media (max-width: 1100px), (max-width: 1366px) and (pointer: coarse) {
  .liza-section__photo {
    position: relative;
    inset: auto;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    width: min(48%, 205px);
    margin: 35px 0 8px;
  }
}
.zhenya-section__photo { --photo-tilt: 15deg; left: 73%; top: 12%; width: 20%; padding-bottom: 2.6%; }
.member-photo.is-photo-pending { opacity: 0; transform: translateY(18px) rotate(calc(var(--photo-tilt) - 5deg)) scale(.94); }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .liza-section__photo { transition: transform .65s cubic-bezier(.2,.75,.3,1); }
  .member-photo:not(.is-photo-pending):hover,
  .liza-section__photo:hover {
    transform: translateY(-4px) rotate(var(--photo-hover-rotation, 0deg)) scale(1.03);
  }
}
@media (prefers-reduced-motion: reduce) {
  .member-photo { transition: none; }
  .member-photo.is-photo-pending { opacity: 1; transform: rotate(var(--photo-tilt)); }
}

.liza-card {
  position: absolute;
  left: 26.06%;
  top: 21.14%;
  width: 47.82%;
  aspect-ratio: 723 / 482;
  background: url("assets/team/liza/card.svg") center / 100% 100% no-repeat;
  container-type: inline-size;
}

.liza-card__title {
  position: absolute;
  inset: 14.94% auto auto 26.42%;
  width: 47.44%;
  aspect-ratio: 343 / 151;
  margin: 0;
}

.liza-card__letter {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--width);
  height: auto;
}

/* Геометрия отдельных букв внутри заголовка Liza. */
.liza-card__letter--l { --x: 0%; --y: 0%; --width: 34.111%; }
.liza-card__letter--i { --x: 29.155%; --y: 9.934%; --width: 17.201%; }
.liza-card__letter--z { --x: 44.023%; --y: 9.934%; --width: 25.364%; }
.liza-card__letter--a { --x: 51.02%; --y: 18.543%; --width: 48.98%; }

.liza-card__description {
  position: absolute;
  top: 61%;
  left: 10%;
  width: 80%;
  margin: 0;
  font-size: 2.3cqw;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}

.liza-card__description > span {
  display: block;
  max-width: 25em;
  margin: .85em auto 0;
}

.liza-card .liza-card__details {
  display: block;
  width: clamp(112px, 28%, 201px);
  margin: .9em auto 0;
}

.liza-card__details img { display: block; width: 100%; height: auto; }

.member-group { font-size: .84em; font-weight: 400; white-space: nowrap; }
.member-email {
  display: block;
  margin: .25em 0 .35em;
  font-size: .78em;
  line-height: 1.3;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: opacity .2s ease;
}
.member-email:hover { opacity: .65; }
.member-email:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
.member-email[hidden] { display: none; }
@media (min-width: 1101px) {
  .liza-card__description { top: 57%; }
  .liza-card__description > span { margin-top: .55em; }
  .liza-card .liza-card__details { margin-top: .65em; }
}

/* Zhenya */
.zhenya-section {
  background: #e2cde0;
  overflow-x: clip;
}

.zhenya-section__layout {
  position: relative;
  width: 100%;
  max-width: 1512px;
  margin-inline: auto;
  aspect-ratio: 962 / 646;
  container-type: inline-size;
}

.zhenya-section__paper {
  position: absolute;
  width: 37%; left: 5%; top: calc(43% + 6px); z-index: 1; translate: var(--paper-offset, 0px) 0;
  height: auto;
}

.zhenya-section__paper > img { display: block; width: 100%; height: auto; }
.zhenya-paper-copy {
  position: absolute; left: 23%; top: 21%; width: 60%; font-size: 1.1cqw;
  line-height: 1.15; transform: rotate(-14deg);
}


.zhenya-card {
  position: absolute;
  left: 50%;
  top: 11.43%;
  width: 70.5%;
  aspect-ratio: 1066 / 760;
  translate: -50% 0;
  background: #b6c6d5d4 url("assets/team/zhenya/card.svg") center / 100% 100% no-repeat;
  container-type: inline-size;
}

.zhenya-card__title {
  position: absolute;
  inset: 0;
  margin: 0;
}

.zhenya-card__letter {
  position: absolute;
  display: block;
  left: var(--x);
  top: var(--y);
  width: var(--width);
  height: auto;
}

.zhenya-card__letter--z { --x: 29.4%; --y: 18%; --width: 10.413%; }
.zhenya-card__letter--h { --x: 34%; --y: 15%; --width: 16.886%; }
.zhenya-card__letter--e { --x: 40.85%; --y: 21.9%; --width: 13.884%; }
.zhenya-card__letter--n { --x: 45.9%; --y: 12.57%; --width: 18.386%; }
.zhenya-card__letter--y { --x: 53.9%; --y: 12%; --width: 19.7%; }
.zhenya-card__letter--a { --x: 67.7%; --y: 15%; --width: 10.6%; }

.zhenya-card__description {
  position: absolute;
  top: 47%; left: 24%; width: 52%;
  margin: 0;
  font-size: 1.7cqw;
  line-height: 1.35;
  font-weight: 400;
  text-align: center;
}

/* Zahar */
.zahar-section {
  background: var(--pink);
}

.zahar-section__layout {
  position: relative;
  width: 100%;
  max-width: 1512px;
  margin-inline: auto;
  aspect-ratio: 1512 / 966;
  overflow: hidden;
  container-type: inline-size;
}

.zahar-notebook {
  position: absolute;
  top: 0;
  left: 0;
  width: 63.3%;
  aspect-ratio: 957 / 966;
  background: url("assets/team/zahar/notebook.svg") center / 100% 100% no-repeat;
  clip-path: inset(0 0 5px);
  container-type: inline-size;
}

.zahar-notebook__title {
  position: absolute;
  left: 39.081%;
  top: 3.623%;
  width: 47.858%;
  aspect-ratio: 458 / 205;
  margin: 0;
}

.zahar-notebook__letter {
  position: absolute;
  display: block;
  left: var(--x);
  top: var(--y);
  width: var(--width);
  height: auto;
}

.zahar-notebook__letter--z  { --x: 0%; --y: 10.244%; --width: 24.236%; }
.zahar-notebook__letter--a1 { --x: 8.734%; --y: 21.951%; --width: 36.681%; }
.zahar-notebook__letter--h  { --x: 32.533%; --y: 0%; --width: 39.301%; }
.zahar-notebook__letter--a2 { --x: 52.183%; --y: 21.951%; --width: 24.672%; }
.zahar-notebook__letter--r  { --x: 68.341%; --y: 0%; --width: 31.659%; }

@media (prefers-reduced-motion: no-preference) {
  .liza-card__letter--i {
    transform-origin: 50% 85%;
    animation: liza-letter-wiggle 2.4s ease-in-out infinite;
  }

  .zhenya-card__letter--e {
    transform-origin: 50% 80%;
    transform: translateY(-30%) rotate(29.0852deg);
  }

  .zhenya-card__letter--e.is-falling {
    animation: zhenya-letter-fall .95s cubic-bezier(.4,0,.65,1) .35s both;
  }

  .zahar-notebook__letter--r {
    transform-origin: 50% 70%;
    animation: zahar-letter-rattle 3.2s ease-in-out infinite;
  }
}

@keyframes liza-letter-wiggle {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

@keyframes zhenya-letter-fall {
  0% { transform: translateY(-30%) rotate(29.0852deg); }
  65% { transform: translateY(3%) rotate(-3deg); }
  82% { transform: translateY(-4%) rotate(2deg); }
  100% { transform: translateY(0) rotate(0); }
}

@keyframes zahar-letter-rattle {
  0%, 74%, 100% { transform: translateX(0) rotate(0); }
  78% { transform: translateX(-2%) rotate(-2deg); }
  82% { transform: translateX(2%) rotate(2deg); }
  86% { transform: translateX(-1.5%) rotate(-1.5deg); }
  90% { transform: translateX(1%) rotate(1deg); }
  94% { transform: translateX(0) rotate(0); }
}

.zahar-notebook__description,
.zahar-notebook__note {
  position: absolute;
  margin: 0;
  font-weight: 400;
  line-height: 1.35;
}

.zahar-notebook__description {
  top: 30.9%;
  left: 39.08%;
  width: 48%;
  text-align: left;
  font-size: 1.985cqw;
  line-height: 1.15;
}

.zahar-notebook__note {
  top: 76.1%;
  left: 39.08%;
  width: 48%;
  font-size: 1.985cqw;
  line-height: 1.15;
}

.zahar-section__paper {
  position: absolute;
  right: 0;
  top: -6.73%;
  width: 59.25%;
  aspect-ratio: 896 / 991;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translateX(72%);
  transform-origin: top right;
  z-index: 1; transition: transform .65s cubic-bezier(.22,.8,.25,1), top .65s cubic-bezier(.22,.8,.25,1);
}

.zahar-section__paper[aria-expanded="true"] {
  top: 0;
  transform: translateX(25%) scale(.97); transition-duration: .85s;
}

.zahar-section__paper:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
  .zahar-section__paper { transition: none; }
}

.zahar-section__paper-image {
  display: block;
  width: 100%;
  height: 100%;
}

.zahar-paper-copy {
  position: absolute;
  inset: 0;
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.zahar-section__paper[aria-expanded="true"] .zahar-paper-copy {
  opacity: 1;
  visibility: visible;
}
.zahar-paper-body {
  position: absolute;
  left: 22%;
  top: 40%;
  width: 36%;
  font: 400 1.1cqw/1.18 var(--font);
  text-align: left;
  transform: rotate(-26deg);
  transform-origin: left top;
}
.zahar-paper-body strong, .zahar-paper-skills, .zahar-paper-project { display: block; }
.zahar-paper-body strong, .zahar-paper-skills { font-size: 1.14em; }
.zahar-paper-body strong { font-weight: 500; }
.zahar-paper-skills { margin: 1em 0 1.1em; }
.zahar-paper-project + .zahar-paper-project { margin-top: .65em; }
.zahar-paper-aside {
  position: absolute;
  top: 31%;
  left: 50%;
  width: 20%;
  font: 400 1.15cqw/1.2 'Denistina', 'Segoe Script', Georgia, cursive;
  text-align: left;
}
.zahar-paper-aside svg {
  display: block;
  width: 67%;
  height: auto;
  margin: -.15em 0 0 22%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zahar-section__hint {
  position: absolute;
  top: 74.7%;
  right: 11.5%;
  width: 6.6%;
  aspect-ratio: 120 / 90;
  pointer-events: none;
}

.zahar-section__arrow,
.zahar-section__label {
  position: absolute;
  height: auto;
}

.zahar-section__hint {
  opacity: 1;
  transition: opacity .2s ease .45s;
}
.zahar-section__paper[aria-expanded="true"] + .zahar-section__hint {
  opacity: 0;
  transition-delay: 0s;
}
.zahar-notebook .zahar-notebook__details {
  display: inline-block;
  max-width: 100%;
  width: clamp(115px, 20cqw, 201px);
  margin-top: .45em;
}
.zahar-notebook__details img { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) {
  .zahar-section__hint { transition: none; }
}

.zahar-section__arrow { top: 0; left: 0; width: 41.67%; }
.zahar-section__label { top: 55%; right: 0; width: 58.33%; }

/* Letter collage */
.letter-section {
  background: var(--pink);
}

.letter-section__layout {
  position: relative;
  width: 100%;
  max-width: 1512px;
  margin-inline: auto;
  aspect-ratio: 1512 / 1640;
  container-type: inline-size;
}

.letter-section__layout img {
  position: absolute;
  display: block;
  height: auto;
}

.letter-section__photo,
.letter-section__note {
  transform-origin: top left;
}

.letter-project {
  position: absolute;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.letter-section__layout .letter-project:not(.letter-section__photo--left) img { position: static; width: 100%; height: auto; }

.letter-section__prompt {
  position: absolute;
  top: 6.35%;
  left: 9%;
  width: 22.49%;
}
.letter-section__prompt img:first-child { position: static; width: 100%; }
.letter-section__prompt-arrow { left: 32%; top: 150%; width: 32.94%; }
.details-dialog {
  width: min(92vw, 650px);
  scrollbar-width: thin;
  scrollbar-color: #bba9b9 transparent;
}
.details-dialog::-webkit-scrollbar { width: 5px; }
.details-dialog::-webkit-scrollbar-track { background: transparent; }
.details-dialog::-webkit-scrollbar-thumb { background: #bba9b9; border-radius: 10px; }
.details-dialog::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

/* Smooth entrance for the participant and project detail dialogs. */
@media (prefers-reduced-motion: no-preference) {
  .details-dialog[open] { animation: details-enter .45s cubic-bezier(.22,.8,.25,1) both; }
  .details-dialog[open]::backdrop { animation: manifest-backdrop .35s ease-out both; }
}
@keyframes details-enter {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.details-dialog h3 { font-size: 17px; margin: 22px 0 4px; }
.details-dialog p { margin: 0 0 12px; }
.details-dialog li { margin-bottom: 8px; }
.member-portfolio a { color: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.member-portfolio a:hover { opacity: .65; }
.member-portfolio li p { margin-top: 4px; }

/* The front of the envelope stays above the moving cards. */
.letter-section__front { pointer-events: none; }

.letter-section__flap {
  left: 27.381%;
  top: 54.57%;
  width: 43.651%;
}

.letter-section__back {
  left: 27.37%;
  top: 64.2%;
  width: 45.635%;
}

.letter-section__photo--top {
  left: 43.1045%;
  top: 3%;
  width: 43.3201%;
}

.letter-section__note {
  left: 46.2963%;
  top: 22.93%;
  width: 21.0317%;
  aspect-ratio: 318 / 411;
}
.letter-section__note::before {
  content: "";
  position: absolute;
  top: 0;
  left: 17.6%;
  width: 83.16%;
  height: 91.24%;
  background: #e1b5b580;
  transform: rotate(8.58587deg);
  transform-origin: top left;
}
.letter-section__note span {
  position: absolute;
  top: 35%;
  left: 29%;
  font: 400 clamp(10px, 1.35cqw, 21px)/1.17 var(--font);
  text-align: left;
  transform: rotate(8.58587deg);
}

.letter-section__photo--center {
  left: 31.9378%;
  top: 41.46%;
  width: 38.4259%;
}

.letter-section__photo--left {
  position: absolute;
  left: 20.37%;
  top: 25%;
  width: 23.0159%;
  aspect-ratio: 348 / 430;
  margin: 0;
}
.letter-section__photo--left img {
  left: 0;
  top: 13.84%;
  width: 77.63%;
  height: 87.39%;
  object-fit: cover;
  border: solid clamp(2px, .4cqw, 6px) #fbfbfbcc;
  transform: rotate(-11.62deg);
  transform-origin: top left;
}

.letter-section__front {
  left: 26.9367%;
  top: 64.45%;
  width: 45.9656%;
}
.next-block { min-height: 24px; }
#skills { display: block; height: 0; }

/* Footer */
.site-footer {
  background: var(--paper);
}

.site-footer__layout {
  position: relative;
  width: 100%;
  max-width: 1512px;
  margin-inline: auto;
  aspect-ratio: 1512 / 415;
  container-type: inline-size;
}

.site-footer__contacts {
  position: absolute;
  left: 6%;
  top: 34%;
}

.site-footer__contacts h2 {
  margin: 0 0 2.8cqw;
  font-size: 4.23cqw;
  line-height: 1.1;
  font-weight: 300;
}

.site-footer__contacts address,
.site-footer__repository {
  font-size: 1.06cqw;
  line-height: 1.25;
  font-style: normal;
  font-weight: 300;
}

.site-footer a {
  text-decoration: none;
  transition: opacity 180ms ease;
}

.site-footer a:hover { opacity: .65; }

.site-footer__symbol {
  position: absolute;
  left: 45.7%;
  top: 28.9%;
  width: 10.185%;
  height: auto;
}

.site-footer__navigation {
  position: absolute;
  left: 85.3%;
  top: 36%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .24cqw;
  color: #555;
  font-size: 1.06cqw;
  line-height: 1.15;
  font-weight: 300;
}

.site-footer__navigation img {
  width: .72cqw;
  height: auto;
}

.footer-brand { background: var(--pink); }

.footer-brand__layout {
  position: relative;
  width: 100%;
  max-width: 1512px;
  aspect-ratio: 1512 / 130;
  margin-inline: auto;
}

.footer-brand__letter {
  position: absolute;
  display: block;
  left: var(--x);
  top: var(--y);
  width: var(--width);
  height: auto;
}

.footer-brand__letter--m { --x: 7.4735%; --y: 0.0000%; --width: 6.0185%; }
.footer-brand__letter--a1 { --x: 10.3836%; --y: 16.9231%; --width: 6.2169%; }
.footer-brand__letter--d { --x: 15.3439%; --y: 16.9231%; --width: 4.0344%; }
.footer-brand__letter--e { --x: 18.6508%; --y: 20.0000%; --width: 3.9021%; }
.footer-brand__letter--b { --x: 47.0238%; --y: 17.6923%; --width: 3.9021%; }
.footer-brand__letter--y { --x: 49.9339%; --y: 17.6923%; --width: 3.4392%; }
.footer-brand__letter--m2 { --x: 83.7963%; --y: 28.4615%; --width: 3.3069%; }
.footer-brand__letter--h { --x: 78.6376%; --y: 14.6154%; --width: 4.4974%; }
.footer-brand__letter--u { --x: 82.0767%; --y: 23.0769%; --width: 2.7116%; }
.footer-brand__letter--a2 { --x: 86.6402%; --y: 15.3846%; --width: 3.1746%; }
.footer-brand__letter--n { --x: 87.1032%; --y: 4.6154%; --width: 6.6138%; }

@media (prefers-reduced-motion: no-preference) {
  .footer-brand__letter {
    --bounce-height: clamp(3px, .55vw, 8px);
    animation: brand-letter-bounce 1s steps(1, end) var(--bounce-delay, 0s) infinite;
    will-change: translate;
  }
  .is-motion-offscreen .hero-title__letter,
  .is-motion-offscreen .footer-brand__letter {
    animation-play-state: paused;
    will-change: auto;
  }
  .footer-brand__letter--m, .hero-title__letter--m { --bounce-delay: .8s; --bounce-duration: 2.3s; }
  .footer-brand__letter--a1, .hero-title__letter--a1 { --bounce-delay: .2s; --bounce-duration: 3.1s; }
  .footer-brand__letter--d, .hero-title__letter--d { --bounce-delay: 1.4s; --bounce-duration: 2.7s; }
  .footer-brand__letter--e, .hero-title__letter--e { --bounce-delay: .5s; --bounce-duration: 3.6s; }
  .footer-brand__letter--b, .hero-title__letter--b { --bounce-delay: 1.1s; --bounce-duration: 2.1s; }
  .footer-brand__letter--y, .hero-title__letter--y { --bounce-delay: 0s; --bounce-duration: 2.9s; }
  .footer-brand__letter--h, .hero-title__letter--h { --bounce-delay: .4s; --bounce-duration: 3.3s; }
  .footer-brand__letter--u, .hero-title__letter--u { --bounce-delay: 1.6s; --bounce-duration: 2.4s; }
  .footer-brand__letter--m2, .hero-title__letter--m2 { --bounce-delay: .7s; --bounce-duration: 3.8s; }
  .footer-brand__letter--a2, .hero-title__letter--a2 { --bounce-delay: 1.2s; --bounce-duration: 2.6s; }
  .footer-brand__letter--n, .hero-title__letter--n { --bounce-delay: .3s; --bounce-duration: 3.0s; }
}

@keyframes brand-letter-bounce {
  0%, 100% { translate: 0 0 0; }
  50% { translate: 0 calc(-1 * var(--bounce-height)) 0; }
}

/* Tablet and mobile: retain the paper artwork, but place readable content in flow. */
@media (max-width: 1100px), (max-width: 1366px) and (pointer: coarse) {
  :root { --compact-gutter: clamp(20px, 5vw, 48px); }
  #liza, #zhenya, #zahar { scroll-margin-top: 0; }
  #about { scroll-margin-top: -58px; }
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    height: auto;
    gap: 28px;
    padding: 120px var(--compact-gutter) 36px;
    background-size: cover;
  }
  .hero-title { position: relative; inset: auto; grid-column: 1 / -1; justify-self: center; width: min(100%, 500px); translate: none; }
  .hero-about { position: static; max-width: none; font-size: 16px; }
  .hero-about__break { display: none; }
  .hero-letter { position: relative; inset: auto; width: clamp(156px, 22vw, 185px); justify-self: end; }

  .about-section__layout {
    display: flex;
    flex-direction: column;
    gap: 28px;
    aspect-ratio: auto;
    padding: 38px var(--compact-gutter);
    overflow: hidden;
  }
  .about-section__title { position: static; width: 48px; align-self: flex-end; }
  .about-section__intro { position: static; gap: 10px; font-size: clamp(16px, 2.5vw, 20px); max-width: none; line-height: 1.4; }
  .about-section__symbol { width: 18px; }
  .about-section__break { display: none; }
  .about-section__portrait { position: relative; inset: auto; width: min(100%, 421px); align-self: center; }
  .about-section__circle { width: 100%; }
  .about-section__note { position: static; width: auto; max-width: 550px; align-self: flex-end; font-size: 16px; line-height: 1.45; }
  .profile-link { min-height: 44px; font-size: 14px; padding: 8px 0; }

  .liza-section { background-size: cover; }
  .liza-section__layout, .zhenya-section__layout, .letter-section__layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
    aspect-ratio: auto;
    padding: 32px var(--compact-gutter);
  }
  .liza-section__paper-left, .liza-section__paper-right {
    position: relative; inset: auto; width: min(100%, 360px); justify-self: center;
    padding: 42px 18% 34px; transform: none;
    display: flex; align-items: center;
  }
  .liza-section__paper-left { background-image: url("assets/team/liza/paper-left-responsive.svg"); }
  .liza-section__paper-right { background-image: url("assets/team/liza/paper-right-responsive.svg"); }
  .liza-section__paper-right { padding-inline: 22% 12%; }
  .liza-section__paper-left p, .liza-section__paper-right p {
    position: static; width: 100%; margin: 0; transform: none;
    font-size: clamp(14px, 2vw, 16px); line-height: 1.5; overflow-wrap: anywhere;
  }
  .member-photo {
    position: relative; inset: auto; grid-column: 1 / -1; grid-row: 2;
    justify-self: center; width: min(48%, 190px); margin: 4px auto 8px;
    padding: 8px;
  }
  .liza-card, .zhenya-card {
    position: relative; inset: auto; grid-column: 1 / -1; grid-row: 1;
    width: min(100%, 700px); margin-inline: auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; padding: clamp(34px, 5.5vw, 52px); aspect-ratio: auto;
    min-height: clamp(300px, 46vw, 420px);
    overflow-wrap: anywhere;
  }
  .liza-card { background-image: url("assets/team/liza/card-responsive.svg"); }
  .zhenya-card { background-image: url("assets/team/zhenya/card-responsive.svg"); }
  .liza-card__title { position: relative; inset: auto; width: min(75%, 343px); }
  .liza-card__description, .zhenya-card__description {
    position: static; width: 100%; font-size: clamp(15px, 2.1vw, 18px); line-height: 1.45;
  }
  .liza-card__break { display: none; }

  .zhenya-card { translate: none; }
  .zhenya-card__title { position: relative; inset: auto; width: min(100%, 520px); aspect-ratio: 1066 / 440; }
  .zhenya-card__letter { left: calc((var(--x) - 23%) * 1.6); top: calc((var(--y) - 9%) * 2.75); width: calc(var(--width) * 1.6); }
  .zhenya-section__paper {
    position: relative; inset: auto; width: min(100%, 340px); margin-inline: auto; height: auto;
    display: grid; place-items: center; min-height: 155px;
  }
  .zhenya-section__paper {
    aspect-ratio: 662 / 676; padding: 20% 10%;
    background: url("assets/team/zhenya/paper-responsive.svg") center / 100% 100% no-repeat;
  }
  .zhenya-section__paper > img { display: none; }
  .zhenya-paper-copy {
    position: relative; inset: auto; width: 100%; z-index: 1;
    font-size: clamp(14px, 2vw, 16px); line-height: 1.5; transform: rotate(-5deg);
  }

  .zahar-section__layout { display: flex; flex-direction: column; gap: 24px; aspect-ratio: auto; padding: 32px var(--compact-gutter); }
  .zahar-notebook {
    position: relative; inset: auto; width: min(100%, 700px); margin-inline: auto; aspect-ratio: auto;
    display: flex; flex-direction: column; align-items: center; gap: 20px;
    padding: 32px clamp(24px, 6vw, 56px) 40px clamp(42px, 12vw, 110px);
    background-image: url("assets/team/zahar/notebook-responsive.svg");
    background-size: 100% 100%; background-position: center;
  }
  .zahar-notebook__title { position: relative; inset: auto; width: min(100%, 458px); }
  .zahar-notebook__description, .zahar-notebook__note {
    position: static; width: 100%; font-size: clamp(15px, 2.1vw, 18px); line-height: 1.45; overflow-wrap: anywhere;
  }
  .zahar-section__paper {
    position: relative; inset: auto; width: min(95%, 360px); margin-inline: auto;
    transform: none; transform-origin: center; transition: transform .3s ease;
  }
  .zahar-section__paper[aria-expanded="true"] { top: auto; transform: scale(1.02); }
  .zahar-section__paper[aria-expanded="true"] { aspect-ratio: 5 / 7; }
  .zahar-section__paper[aria-expanded="true"] .zahar-section__paper-image {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 178%;
    height: auto;
    transform: translate(-50%, -50%) rotate(26deg);
  }
  .zahar-section__paper[aria-expanded="true"] .zahar-paper-copy {
    position: relative;
    inset: auto;
    display: block;
    padding: 9% 15%;
  }
  .zahar-paper-body {
    position: static;
    width: auto;
    font-size: clamp(13px, 2vw, 16px);
    transform: none;
  }
  .zahar-paper-skills { margin: .5em 0 .8em; }
  .zahar-paper-break { display: none; }
  .zahar-paper-aside {
    position: static;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .5em;
    width: auto;
    margin-top: .55em;
    font-size: 14px;
  }
  .zahar-paper-aside svg { width: 2.6em; margin: 0; }
  .zahar-section__paper[aria-expanded="false"]::after {
    content: 'Прочитать записку'; position: absolute; top: 43%; left: 25%; width: 54%;
    font: 400 15px/1.4 var(--font); color: var(--ink); transform: rotate(-16deg);
  }
  .zahar-section__hint { display: none; }

  .letter-section__layout {
    --compact-envelope-width: min(65vw, 360px);
    padding-bottom: calc(24px + var(--compact-envelope-width) * .5);
    overflow: hidden;
  }
  .letter-section__prompt {
    position: relative;
    inset: auto;
    grid-column: 1 / -1;
    grid-row: 1;
    width: min(65%, 250px);
    margin-inline: auto;
    padding-bottom: 20px;
  }
  .letter-section__prompt-arrow { top: 55%; width: 17%; }
  .letter-project {
    position: relative;
    inset: auto;
    width: 100%;
    min-width: 0;
  }
  .letter-section__photo--left {
    grid-column: 1;
    grid-row: 2 / span 2;
    align-self: center;
  }
  .letter-section__photo--top { grid-column: 2; grid-row: 2; }
  .letter-section__note { grid-column: 2; grid-row: 3; }
  .letter-section__note span { font-size: clamp(11px, 2.1vw, 17px); }
  .letter-section__photo--center {
    grid-column: 1 / -1;
    grid-row: 4;
    justify-self: center;
    width: min(100%, var(--compact-envelope-width));
  }
  .letter-section__back, .letter-section__front { top: auto; left: 50%; bottom: 24px; width: var(--compact-envelope-width); translate: -50% 0; }
  .letter-section__flap { top: auto; left: 50%; bottom: calc(24px + var(--compact-envelope-width) * .56); width: calc(var(--compact-envelope-width) * .95); translate: -50% 0; }

  .site-footer__layout {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 28px; align-items: start; aspect-ratio: auto; padding: 40px var(--compact-gutter);
  }
  .site-footer__contacts { position: static; min-width: 0; }
  .site-footer__contacts h2 { font-size: 34px; margin-bottom: 20px; }
  .site-footer__contacts address,
.site-footer__repository { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
  .site-footer__symbol { position: static; width: 68px; align-self: center; }
  .site-footer__navigation { position: static; font-size: 15px; gap: 6px; justify-self: end; }
  .site-footer__navigation img { width: 9px; }
}

@media (max-width: 600px) {
  :root { --compact-gutter: 16px; }
  .site-header { position: sticky; min-height: 0; background: var(--pink); }
  #about { scroll-margin-top: -35px; }
  .navigation { display: grid; grid-template-columns: 1fr; gap: 0; padding: 5px 16px; }
  .navigation__group { justify-content: center; gap: clamp(14px, 5vw, 24px); }
  .navigation a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; }
  .hero {
    grid-template-columns: minmax(0, 1fr) auto; gap: 22px 12px;
    min-height: min(680px, calc(100svh - 90px));
    padding: 38px var(--compact-gutter) 30px;
    align-content: space-between;
  }
  .hero-title { width: min(100%, 415px); }
  .hero-letter { width: clamp(112px, 32vw, 150px); }
  .hero-about { font-size: 15px; line-height: 1.45; }

  .about-section__layout { gap: 22px; padding-block: 30px; }
  .about-section__portrait { width: min(100%, 350px); }

  .liza-section__layout, .zhenya-section__layout, .letter-section__layout {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
    padding-inline: var(--compact-gutter);
  }
  .liza-card, .zhenya-card {
    min-height: 350px; padding: 40px 30px; gap: 20px;
    max-width: 440px;
  }
  .liza-card { background-image: url("assets/team/liza/card-portrait.jpeg"); }
  .liza-card__title { width: min(86%, 270px); }
  .liza-card__description, .zhenya-card__description { font-size: 16px; line-height: 1.45; }
  .liza-card .profile-link, .zhenya-card .profile-link { font-size: 13px; }
  .liza-section__paper-left, .liza-section__paper-right {
    width: 100%; min-height: 208px; aspect-ratio: auto;
    padding: 24px 10px 20px 15px;
  }
  .liza-section__paper-right { padding: 24px 9px 20px 24px; }
  .liza-section__paper-left p, .liza-section__paper-right p { font-size: 14px; line-height: 1.45; }
  .zhenya-section__paper {
    width: 100%; min-height: 208px; aspect-ratio: auto;
    padding: 22px 14px;
  }
  .zhenya-paper-copy { transform: none; }
  .zhenya-paper-copy .profile-link { font-size: 12px; }
  .zhenya-paper-copy { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }

  .zahar-section__layout { padding: 30px var(--compact-gutter); gap: 18px; }
  .zahar-notebook { padding: 34px 24px 34px 42px; gap: 17px; max-width: 440px; }
  .zahar-notebook__description, .zahar-notebook__note { font-size: 16px; }
  .zahar-section__paper { width: min(82%, 300px); }
  .zahar-section__paper[aria-expanded="true"] { width: min(98%, 300px); }



  .site-footer__layout { grid-template-columns: minmax(0, 1fr) auto; gap: 22px; }
  .site-footer__symbol { width: 56px; }
  .site-footer__navigation { grid-column: 1 / -1; justify-self: start; }
  .site-footer__navigation a { display: flex; min-height: 32px; align-items: center; }
  .footer-brand__layout { aspect-ratio: 360 / 70; }
  .footer-brand__letter { width: calc(var(--width) * 2.1); top: calc(var(--y) * .8 + 8%); }
  .footer-brand__letter--m, .footer-brand__letter--a1, .footer-brand__letter--d, .footer-brand__letter--e { left: calc((var(--x) - 7.4735%) * 2.1 + 4%); }
  .footer-brand__letter--b, .footer-brand__letter--y { left: calc((var(--x) - 47.0238%) * 2.1 + 43%); }
  .footer-brand__letter--h, .footer-brand__letter--u, .footer-brand__letter--m2, .footer-brand__letter--a2, .footer-brand__letter--n { left: calc((var(--x) - 78.6376%) * 2.1 + 62%); }


}

@media (max-width: 1100px) and (prefers-reduced-motion: reduce), (max-width: 1366px) and (pointer: coarse) and (prefers-reduced-motion: reduce) {
  .zahar-section__paper { transition: none; }
}

.zhenya-paper-copy > div { margin-top: .65em; }
.zhenya-card .zhenya-card__details {
  display: block; width: clamp(110px, 39%, 201px); margin: 1.4em auto 0;
}
.zhenya-card__details img { display: block; width: 100%; height: auto; }
.zhenya-section { position: relative; }
.zhenya-section__pin, .zahar-section__layout { position: relative; z-index: 2; }
.zhenya-section__klaksa {
  position: absolute; z-index: 1; right: max(0px, calc((100% - 1512px) / 2));
  bottom: 0; width: min(40%, 595px); height: auto; transform: translateY(38%);
  pointer-events: none;
}
.member-photo .zhenya-section__clip {
  position: absolute; top: -24%; left: -14%; width: 86%; aspect-ratio: 1;
  object-fit: contain; transform: rotate(-15deg); pointer-events: none;
}
@media (max-width: 1100px), (max-width: 1366px) and (pointer: coarse) {
  .member-photo.zhenya-section__photo {
    width: min(48%, 190px); justify-self: end; margin-inline: 0 12%;
    padding-bottom: 16px;
  }
  .zhenya-section__klaksa { width: min(55%, 300px); }
}
.zahar-section__photo {
  position: absolute;
  top: 54%;
  left: 2%;
  z-index: 2;
  width: 19%;
  margin: 0;
  pointer-events: none;
}
.zahar-section__photo img { display: block; height: auto; }
.zahar-section__photo-back {
  position: absolute;
  top: 1%;
  left: -14%;
  width: 122.5%;
}
.zahar-section__portrait { position: relative; width: 100%; }
.zahar-section__pin {
  position: absolute;
  top: -16%;
  left: 21%;
  width: 56%;
}
@media (max-width: 1100px), (max-width: 1366px) and (pointer: coarse) {
  .zahar-section__photo {
    position: relative;
    inset: auto;
    align-self: center;
    width: min(48%, 225px);
    margin-top: 20px;
  }
}
.site-footer__repository { margin-top: 0; }


/* Mobile paper and envelope: readable content and touch controls. */
.zhenya-paper-skills > span,
.zhenya-paper-projects > span { display: block; }
.zhenya-paper-experience { display: none; }

@media (max-width: 1100px), (max-width: 1366px) and (pointer: coarse) {
  .zhenya-section__paper {
    grid-column: 1 / -1;
    grid-row: 3;
    width: min(100%, 520px);
    min-height: 0;
    height: auto;
    aspect-ratio: auto;
    padding: 28px clamp(20px, 5vw, 36px);
    translate: none;
    background: #efd7d3 url("assets/team/zhenya/paper-responsive.svg") center / 100% 100% no-repeat;
    border-radius: 3px;
  }
  .zhenya-paper-copy {
    width: 100%;
    position: relative;
    inset: auto;
    transform: none;
    text-align: left;
    font-size: clamp(14px, 2.1vw, 16px);
    line-height: 1.5;
    overflow-wrap: normal;
  }
  .zhenya-paper-skills {
    display: flex;
    flex-wrap: wrap;
    gap: .35em 1em;
  }
  .zhenya-paper-skills > span { white-space: nowrap; }
  .zhenya-paper-experience { display: block; margin-top: 1em; }
  .zhenya-paper-projects > span + span { margin-top: .6em; }
  .member-photo .zhenya-section__clip {
    top: -13%;
    left: -9%;
    width: 43%;
    transform: rotate(-15deg);
  }
  .zahar-section__paper {
    z-index: 4;
    touch-action: manipulation;
  }
  .zahar-section__paper-image,
  .zahar-paper-copy,
  .zahar-section__paper::after { pointer-events: none; }

  .letter-section__layout {
    --compact-envelope-width: min(76vw, 420px);
    padding-bottom: calc(56px + var(--compact-envelope-width) * .94);
  }
  .letter-project { touch-action: manipulation; }
}
@media (max-width: 600px) {
  .zhenya-section__paper { padding: 24px 21px; }
  .zhenya-paper-copy { font-size: 14px; line-height: 1.5; }
}
/* Tablet: keep touch controls accessible in both orientations. */
@media (min-width: 601px) and (max-width: 1100px),
       (min-width: 601px) and (max-width: 1366px) and (pointer: coarse) {
  :root { scroll-padding-top: 74px; }
  #about { scroll-margin-top: 0; }
  .site-header {
    min-height: 0;
    background: var(--pink);
  }
  .navigation {
    align-items: center;
    padding: 6px var(--compact-gutter);
    font-size: 16px;
  }
  .navigation__group { gap: clamp(18px, 3vw, 32px); }
  .navigation a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
  }
  .hero { padding-top: 94px; }
  .hero-title { width: min(100%, 500px, 56vh); }
  .hero-about { font-size: 17px; line-height: 1.5; }
  .about-section__title { width: 64px; }
  .liza-section__layout, .zhenya-section__layout,
  .zahar-section__layout, .letter-section__layout { gap: 28px; }
  .liza-card__description, .zhenya-card__description,
  .zahar-notebook__description, .zahar-notebook__note {
    font-size: 18px;
    line-height: 1.5;
  }
  .liza-section__photo {
    justify-self: center;
    width: min(100%, 205px);
    margin: 22px 0 0;
  }
  .liza-section__paper-left, .liza-section__paper-right {
    padding: 46px 12% 36px;
  }
  .liza-section__paper-right { padding-inline: 19% 10%; }
  .liza-section__paper-left p, .liza-section__paper-right p {
    font-size: 16px;
  }
  .zhenya-section__layout {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: center;
  }
  .zhenya-section__paper {
    grid-column: 1;
    grid-row: 2;
    width: min(100%, 520px);
    padding: 28px 26px;
    justify-self: end;
    margin: 0;
  }
  .member-photo.zhenya-section__photo {
    grid-column: 2;
    grid-row: 2;
    width: min(82%, 210px);
    justify-self: center;
    margin: 22px 0;
    transform-origin: center;
  }
  .zahar-section__layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
  }
  .zahar-notebook { grid-column: 1 / -1; }
  .zahar-section__photo {
    grid-column: 1;
    grid-row: 2;
    width: min(75%, 245px);
    justify-self: center;
    margin: 24px 0;
  }
  .zahar-section__paper {
    grid-column: 2;
    grid-row: 2;
    width: min(100%, 360px);
    justify-self: center;
  }
  .zahar-section__paper[aria-expanded="true"] .zahar-paper-copy {
    padding: 8% 13%;
  }
  .zahar-paper-body { font-size: 15px; line-height: 1.3; }
  .manifest-paper { font-size: 15px; line-height: 1.5; }
  .motivation-letter__close {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (min-width: 980px) and (max-width: 1100px),
       (min-width: 980px) and (max-width: 1366px) and (pointer: coarse) {
  .liza-section__layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, .75fr) minmax(0, 1fr);
    align-items: center;
  }
  .liza-section__paper-left { grid-column: 1; grid-row: 2; }
  .liza-section__photo { grid-column: 2; grid-row: 2; }
  .liza-section__paper-right { grid-column: 3; grid-row: 2; }
}
