/* =========================================================
   Портфолио — Даша Курилова
   Токены и вёрстка перенесены из Figma (файл x2Z2B2sZdF95oaz9CsvNVW)
   ========================================================= */

/* ---------- Шрифты ----------
   Файлы лежат в assets/fonts/ (woff2, собраны из присланных ttf).
------------------------------ */
@font-face {
  font-family: 'NauryzRedKeds';
  src: url('assets/fonts/NauryzRedKeds-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TT Commons';
  src: url('assets/fonts/TTCommons-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'TT Commons';
  src: url('assets/fonts/TTCommons-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'TT Commons';
  src: url('assets/fonts/TTCommons-DemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ---------- Токены ---------- */
:root {
  --black:        #121212;
  --dark-el:      #242424;
  --white:        #ffffff;
  --bg:           #f5f5f5;
  --element:      #e9e9e9;
  --green-black:  #b1fd06;  /* акцент на чёрном */
  --green-white:  #b1e932;  /* акцент на светлом */
  --green-text:   #98c436;
  --muted:        #565656;

  --font-display: 'NauryzRedKeds', 'Arial Black', 'Helvetica Neue', sans-serif;
  --font-body:    'TT Commons', 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;

  --shell: 1280px;
  --hs: 1;              /* масштаб первого экрана */
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* якоря не должны заезжать под фиксированное меню */
#about, #cases, #concepts, #contacts { scroll-margin-top: 110px; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--green-white);
  outline-offset: 4px;
  border-radius: 6px;
}

/* =========================================================
   МЕНЮ (63:372)
   ========================================================= */
.nav {
  position: fixed;
  inset: 30px 0 auto 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.nav__pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 5px;
  background: var(--dark-el);
  border-radius: 100px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}

.nav__name {
  padding: 10px 20px;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1;
  background: linear-gradient(90deg, var(--green-black), var(--white));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.nav__tabs { display: flex; align-items: center; gap: 20px; }

.nav__tab {
  display: block;
  padding: 9px 20px 5px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
  color: var(--white);
  white-space: nowrap;
  transition: background-color .25s ease, color .25s ease;
}
.nav__tab:hover { background: rgba(255, 255, 255, .1); }

.nav__tab--accent { background: var(--green-white); color: var(--black); }
.nav__tab--accent:hover { background: var(--green-black); }

/* =========================================================
   ГЛАВНАЯ (63:306)
   ========================================================= */
.hero {
  position: relative;
  height: calc(1227px * var(--hs));
  background: var(--black);
  overflow: hidden;
}

.hero__stage {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2373.41px;
  height: 1227px;
  margin-left: -1186.705px;
  transform: scale(var(--hs));
  transform-origin: top center;
}

/* --- звёзды с параллаксом (63:307) --- */
.stars { position: absolute; inset: 0; }

.star {
  position: absolute;
  display: block;
  color: var(--green-black);
  will-change: transform;
}
.star svg { width: 100%; height: 100%; display: block; }
.star--solid { color: var(--green-black); }
.star--outline { color: var(--green-black); }

/* --- тайтл (63:311) --- */
.hero__title {
  position: absolute;
  top: 491px;
  left: 50%;
  width: 1029px;
  margin-left: -514.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  will-change: transform;
}

.hero__title h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 85px;
  line-height: 1.1;
  letter-spacing: .01em;
  color: var(--white);
}

.hero__name {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 42px;
  line-height: 1.15;
  color: var(--white);
}

/* --- макеты (63:314) --- */
.mockups { position: absolute; inset: 0; }

.mockup {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mockup__rot { transform: rotate(var(--rot)); flex: none; }

/* у присланных скринов рамка устройства уже вшита в PNG,
   поэтому своей рамки не рисуем, а тень вешаем через filter —
   он идёт по альфа-каналу, а не по прямоугольнику */
.screen {
  position: relative;
  filter: drop-shadow(0 26px 42px rgba(0, 0, 0, .55));
}
.screen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* =========================================================
   СВЕТЛОЕ ПОЛОТНО (Фон 63:321)
   ========================================================= */
.sheet {
  position: relative;
  z-index: 2;
  background: var(--bg);
  color: var(--black);
  border-radius: 50px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .25);
  overflow: hidden;
  padding-bottom: 120px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 70px;
  line-height: 1.1;
  color: var(--black);
}

/* =========================================================
   ОБО МНЕ (63:322)
   ========================================================= */
.about {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 100px 20px 0;
}

.about__heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 70px;
  line-height: 1.1;
  text-align: center;
}
.about__heading-1 { color: var(--black); transform: translateX(-100px); }
.about__heading-2 { color: var(--green-text); transform: translateX(343px); }

.about__body {
  display: grid;
  grid-template-columns: 605px 1fr;
  gap: 58px;
  align-items: start;
  margin-top: 40px;
}

/* фото-кластер (63:336) */
.about__photo { position: relative; width: 605px; height: 686px; }

/* скругление углов уже вшито в png-альфу — своего радиуса не добавляем,
   иначе углы срезаются дважды */
.about__portrait {
  position: absolute;
  left: 160px;
  top: 18px;
  width: 365px;
  height: 511px;
  object-fit: cover;
}
.about__star {
  position: absolute;
  left: 479px;
  top: 0;
  width: 126px;
  height: 126px;
}
.about__flower {
  position: absolute;
  left: 0;
  top: 398px;
  width: 288px;
  height: 288px;
  mix-blend-mode: multiply;   /* белый фон png гасится о светлое полотно */
}

/* текст + опыт */
.about__text { display: flex; flex-direction: column; gap: 24px; padding-top: 92px; }

.about__lead {
  font-family: var(--font-body);
  font-size: 28px;
  line-height: 1.25;
  color: var(--black);
}
.about__lead b { font-weight: 600; }

.exp { display: flex; flex-direction: column; gap: 38px; margin-top: 86px; }

.exp__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
}

.exp__row { display: flex; gap: 60px; align-items: flex-start; }

.exp__years {
  flex: none;
  width: 155px;
  font-weight: 500;
  font-size: 25px;
  line-height: 1.15;
}

.exp__job { display: flex; flex-direction: column; gap: 4px; }
.exp__job b { font-weight: 500; font-size: 28px; line-height: 1.15; }
.exp__job em { font-style: normal; font-weight: 400; font-size: 24px; line-height: 1.15; }

/* =========================================================
   ЛЕНТЫ (63:402)
   ========================================================= */
.ribbons {
  position: relative;
  height: 200px;
  margin: 90px 0 40px;
  overflow: hidden;
}

.ribbon {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 46.24px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.ribbon--dark {
  top: 50%;
  background: var(--black);
  transform: translateY(calc(-50% + 6px)) rotate(-2.69deg);
}
.ribbon--light {
  top: 50%;
  background: var(--element);
  transform: translateY(calc(-50% - 6px)) rotate(2.66deg);
}

.ribbon__track {
  display: flex;
  flex: none;
  white-space: nowrap;
  animation: marquee 38s linear infinite;
}
.ribbon__track--rev { animation-direction: reverse; }

.ribbon__track span {
  flex: none;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 32px;
  line-height: 46px;
}
.ribbon--dark .ribbon__track span { color: var(--green-white); }
.ribbon--light .ribbon__track span { color: var(--black); }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* =========================================================
   КЕЙСЫ (63:343)
   ========================================================= */
.cases {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 60px 20px 0;
}

.cases__list { display: flex; flex-direction: column; gap: 30px; margin-top: 64px; }

.case {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1280 / 684;
  perspective: 2200px;
  container-type: inline-size;
  --px: 0.078125cqw;          /* 1px макета при ширине 1280 */
  cursor: pointer;
}

.case__inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .85s cubic-bezier(.65, .05, .36, 1);
}
.case:hover .case__inner,
.case:focus-visible .case__inner,
.case.is-flipped .case__inner { transform: rotateY(180deg); }

.case__face {
  position: absolute;
  inset: 0;
  background: var(--element);
  border-radius: 50px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* грань плоская: её содержимое не должно жить в 3D-контексте .case__inner */
  transform-style: flat;
  -webkit-transform-style: flat;
  /* задержка = половина переворота (.85s): грань гаснет, когда карточка стоит ребром */
  transition: visibility 0s linear .425s;
}

/* WebKit поднимает мокапы (свои трансформы, тени, картинки) в отдельные слои,
   и они переживают backface-visibility родителя — просвечивают сквозь оборот зеркально */
.case__face > *,
.case__face > * > * {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.case__face--back { transform: rotateY(180deg); visibility: hidden; }

/* подстраховка, не зависящая от backface-visibility: отвёрнутая грань просто скрыта */
.case:hover .case__face--front,
.case.is-flipped .case__face--front { visibility: hidden; }
.case:focus-visible .case__face--front { visibility: hidden; }

.case:hover .case__face--back,
.case.is-flipped .case__face--back { visibility: visible; }
.case:focus-visible .case__face--back { visibility: visible; }

/* --- лицевая сторона --- */
.case__logo--wb {
  position: absolute;
  left: calc(606 * var(--px));
  top: calc(60 * var(--px));
  width: calc(91 * var(--px));
  height: calc(91 * var(--px));
  border-radius: calc(26 * var(--px));
  object-fit: cover;
}
.case__logo--nodin {
  position: absolute;
  left: 50%;
  top: calc(86 * var(--px));
  width: calc(225 * var(--px));
  height: auto;
  transform: translateX(-50%);
}

.case__name {
  position: absolute;
  left: 50%;
  top: calc(177 * var(--px));
  transform: translateX(-50%);
  font-family: 'Inter', var(--font-body);
  font-weight: 600;
  font-size: calc(48 * var(--px));
  line-height: 1.2;
  color: var(--black);
  white-space: nowrap;
}

.case__desc {
  position: absolute;
  left: calc(651.5 * var(--px));
  top: calc(251 * var(--px));
  width: calc(385 * var(--px));
  transform: translateX(-50%);
  text-align: center;
  font-size: calc(24 * var(--px));
  line-height: 1.17;
  color: var(--black);
}

/* три телефона (Wildberries) */
.case__shot { position: absolute; width: calc(360 * var(--px)); height: calc(725 * var(--px)); }
.case__shot img { width: 100%; height: 100%; object-fit: contain; }
.case__shot--wb-r { left: calc(754 * var(--px)); top: calc(457 * var(--px)); z-index: 1; }
.case__shot--wb-l { left: calc(165 * var(--px)); top: calc(457 * var(--px)); z-index: 2; }
.case__shot--wb-c { left: calc(463 * var(--px)); top: calc(352 * var(--px)); z-index: 3; }

/* три планшета («Не один») */
/* корпус планшета рисуем сами, скрин обрезается по рамке */
.case__pad {
  position: absolute;
  width: calc(736.87 * var(--px));
  height: calc(564.93 * var(--px));
  padding: calc(29 * var(--px)) calc(30 * var(--px));
  border-radius: calc(34 * var(--px));
  background: var(--black);
  box-shadow: 0 calc(16 * var(--px)) calc(34 * var(--px)) rgba(0, 0, 0, .22);
}
.case__pad-shot {
  width: 100%;
  height: 100%;
  border-radius: calc(6 * var(--px));
  overflow: hidden;
  background: var(--bg);
}
.case__pad-shot img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: top center;
}

.case__pad--r { left: calc(419 * var(--px)); top: calc(457 * var(--px)); z-index: 1; }
.case__pad--l { left: calc(125 * var(--px)); top: calc(451 * var(--px)); z-index: 2; }
.case__pad--c { left: calc(278 * var(--px)); top: calc(352 * var(--px)); z-index: 3; }

/* --- обратная сторона (57:68 / 57:75) --- */
.back-row {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
}
.back-row--phones { gap: calc(55 * var(--px)); }
.back-row--pads   { gap: calc(24 * var(--px)); }

.back-phone { flex: none; width: calc(278 * var(--px)); height: calc(560 * var(--px)); }
.back-phone img { width: 100%; height: 100%; object-fit: contain; }

.back-pad {
  position: relative;
  flex: none;
  width: calc(400 * var(--px));
  height: calc(307 * var(--px));
  padding: calc(20.5 * var(--px)) calc(16 * var(--px));
  border-radius: calc(24 * var(--px));
  background: var(--black);
}
.back-pad__shot {
  width: 100%;
  height: 100%;
  border-radius: calc(5 * var(--px));
  overflow: hidden;
  background: var(--bg);
}
.back-pad__shot img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: top center;
}

/* подсказка — только на тач-устройствах, где нет ховера */
.case::after {
  content: 'нажми →';
  display: none;
  position: absolute;
  right: calc(48 * var(--px));
  bottom: calc(36 * var(--px));
  z-index: 5;
  padding: calc(9 * var(--px)) calc(22 * var(--px)) calc(6 * var(--px));
  border-radius: 100px;
  background: var(--black);
  color: var(--green-black);
  font-size: calc(20 * var(--px));
  line-height: 1.2;
  opacity: .9;
  transition: opacity .3s ease;
  pointer-events: none;
}
.case.is-flipped::after { opacity: 0; }
@media (hover: none) {
  .case::after { display: block; }
  .case--link.is-flipped::after { content: 'ещё раз — открыть кейс'; display: block; opacity: .9; }
}

/* =========================================================
   КОНЦЕПТЫ (63:567)
   ========================================================= */
.concepts {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 120px 20px 0;
}

.concepts__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 19px;
  margin-top: 61px;
}

.concept {
  display: block;
  position: relative;
  aspect-ratio: 416 / 536;
  background: var(--element);
  border-radius: 50px;
  overflow: hidden;
  container-type: inline-size;
  --px: 0.2403846cqw;         /* 1px макета при ширине 416 */
  transition: transform .4s cubic-bezier(.22, .61, .36, 1);
}
.concept:hover { transform: translateY(-8px); }
.concept--link { cursor: pointer; }

.concept__name {
  position: absolute;
  left: 50%;
  top: calc(64 * var(--px));
  transform: translateX(-50%);
  font-family: 'Inter', var(--font-body);
  font-weight: 600;
  font-size: calc(48 * var(--px));
  line-height: 1.2;
  color: var(--black);
  white-space: nowrap;
}

.concept__desc--narrow { width: calc(339 * var(--px)); }
.concept__desc {
  position: absolute;
  left: 50%;
  top: calc(138 * var(--px));
  width: calc(360 * var(--px));
  transform: translateX(-50%);
  text-align: center;
  font-size: calc(24 * var(--px));
  line-height: 1.17;
  color: var(--black);
}

.concept__shot { position: absolute; }
.concept__shot img { width: 100%; height: 100%; object-fit: cover; }

/* «Концепт в разработке» — скелетон-мокап, низ обрезается карточкой */
.concept__shot--skeleton {
  left: calc(36 * var(--px));
  top: calc(225 * var(--px));
  width: calc(344 * var(--px));
  height: auto;
}
.concept__shot--skeleton img { height: auto; }
.concept__shot--wide {
  left: calc(48 * var(--px));
  top: calc(238 * var(--px));
  width: calc(500 * var(--px));
  height: calc(362 * var(--px));
}
.concept__shot--wide img { object-fit: contain; }

/* =========================================================
   ПОДВАЛ (63:565)
   ========================================================= */
.footer {
  position: relative;
  z-index: 1;
  background: var(--black);
  color: var(--white);
  padding: 130px 20px 28px;
}

.footer__top { max-width: var(--shell); margin: 0 auto; }

.footer__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 70px;
  line-height: 1.1;
}

.footer__text {
  margin-top: 50px;
  max-width: 1131px;
  font-size: 28px;
  line-height: 40px;
}
.footer__text .accent { color: var(--green-white); }

.footer__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 29px;
  margin: 117px auto 0;
  max-width: var(--shell);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 25px 11px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 28px;
  line-height: 1.15;
  transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-3px); }

.btn--solid { background: var(--green-white); color: var(--black); }
.btn--solid:hover { background: var(--green-black); }

.btn--ghost { border: 2px solid var(--green-white); color: var(--green-white); }
.btn--ghost:hover { background: var(--green-white); color: var(--black); }

.footer__line {
  width: calc(100% + 40px);
  margin: 138px -20px 0;
  border: 0;
  border-top: 1px solid #2e2e2e;
}

.footer__bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: var(--shell);
  margin: 0 auto;
  padding-top: 28px;
  color: var(--muted);
  font-size: 20px;
  line-height: 40px;
}
.footer__bottom > :last-child { text-align: right; }
.footer__up { transition: color .2s ease; }
.footer__up:hover { color: var(--green-white); }

/* =========================================================
   АДАПТИВ
   ========================================================= */
@media (max-width: 1600px) { :root { --hs: .82; } }
@media (max-width: 1340px) {
  :root { --hs: .68; }
  .about__body { grid-template-columns: 1fr; gap: 40px; }
  .about__text { padding-top: 0; }
  .about__photo { margin: 0 auto; }
  .about__heading-1, .about__heading-2 { transform: none; }
}
@media (max-width: 1000px) {
  :root { --hs: .5; }
  .nav__pill { gap: 8px; padding: 4px; }
  .nav__tab, .nav__name { font-size: 15px; padding: 8px 14px 5px; }
  .section-title, .about__heading, .footer__title { font-size: 48px; }
  .concepts__list { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
}
@media (max-width: 720px) {
  :root { --hs: .34; }
  .sheet { border-radius: 32px; }
  .about { padding-top: 64px; }
  .about__photo { width: 100%; max-width: 420px; height: auto; aspect-ratio: 605 / 686; }
  .about__portrait { left: 26%; width: 60%; height: auto; aspect-ratio: 365 / 511; }
  .about__star { left: 79%; width: 21%; height: auto; }
  .about__flower { top: 58%; width: 48%; height: auto; }
  .about__lead { font-size: 20px; }
  .exp__row { flex-direction: column; gap: 6px; }
  .exp__years { width: auto; font-size: 18px; }
  .exp__job b { font-size: 20px; }
  .exp__job em { font-size: 17px; }
  .section-title, .about__heading, .footer__title { font-size: 34px; }
  .ribbon__track span { font-size: 22px; }
  .footer { padding-top: 80px; }
  .footer__text { font-size: 18px; line-height: 28px; margin-top: 28px; }
  .footer__actions { margin-top: 48px; gap: 14px; }
  .btn { font-size: 18px; padding: 12px 20px 9px; }
  .footer__line { margin-top: 60px; }
  .footer__bottom { grid-template-columns: 1fr; text-align: center; gap: 4px; font-size: 16px; line-height: 26px; }
  .footer__bottom > :last-child { text-align: center; }
  .nav { inset: 12px 0 auto 0; }
  .nav__pill { max-width: calc(100vw - 24px); overflow-x: auto; }
}

/* =========================================================
   ДОСТУПНОСТЬ
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ribbon__track { animation: none; }
  .star, .hero__title, .case__inner, .concept, .btn { transition: none !important; }
  /* переворот мгновенный — грани должны переключаться без задержки в полперехода */
  .case__face { transition: none !important; }
  .case:hover .case__inner { transform: rotateY(180deg); }
}
