/* =========================================================
   Валерия Семенюк — лендинг-визитка
   Палитра: тёмный зелёно-графитовый фон, айвори-текст,
   терракота/охра как акцент.
   ========================================================= */

:root {
  --bg:        #1B2316;
  --bg-lift:   #222B1C;
  --ink:       #F3EDE0;
  --muted:     #A6A392;
  --accent:    #E2874A;
  --ochre:     #D1A44A;

  --line:      rgba(243, 237, 224, 0.13);
  --line-soft: rgba(243, 237, 224, 0.07);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --shell:   1180px;
  --gutter:  clamp(1.25rem, 5vw, 4.5rem);

  --ease:    cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Сброс ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* clip, а не hidden: hidden делает body скролл-контейнером и ломает
     position: sticky у верхнего меню, clip — нет */
  overflow-x: clip;
}

h1, h2, h3, p, figure, ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol { list-style: none; }

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a { color: inherit; }

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ---------- Служебное ---------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* Плёнка зерна — лёгкая editorial-текстура поверх фона */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Якоря не должны прятаться под липким меню */
main > section {
  scroll-margin-top: 5.5rem;
}

/* =========================================================
   Липкое верхнее меню
   ========================================================= */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease),
              border-color 0.3s var(--ease),
              backdrop-filter 0.3s var(--ease);
}

/* при скролле — подложка, чтобы меню не сливалось с контентом */
.nav.is-stuck {
  background: rgba(27, 35, 22, 0.88);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line-soft);
}

/* Меню во всю ширину экрана: контейнером .shell не ограничено,
   поэтому места хватает и на все пункты в один ряд */
.nav__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.6vw, 1.6rem);
  width: 100%;
  padding: 0.8rem var(--gutter);
}

.nav__brand {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.nav__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.nav__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ochre);
  flex: none;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  margin-left: auto;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 1.3vw, 1.25rem);
}

.nav__links a {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}

.nav__links a:hover {
  color: var(--ink);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 1.2vw, 1rem);
}

/* --- переключатель языка ---
   Класс именно .langswitch, а не .lang: .lang занят карточками
   языков в разделе «Образование», и правила двух блоков смешивались. */

.langswitch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  flex: none;
}

.langswitch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* line-height: 1 — иначе межстрочный интервал body раздувает
     заливку по вертикали и она перестаёт облегать текст */
  line-height: 1;
  /* верхний отступ чуть больше нижнего: у прописных букв под базовой
     линией остаётся неиспользуемое место под выносные элементы,
     из-за чего текст визуально уезжает вверх */
  padding: 0.5rem 0.62rem 0.36rem;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.langswitch__btn:hover { color: var(--ink); }

.langswitch__btn.is-active {
  background: var(--accent);
  color: var(--bg);
}

/* --- главный CTA меню --- */

.nav__cta {
  padding: 0.55rem 1rem;
  border-radius: 3px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease);
}

.nav__cta:hover { background: var(--ochre); }

/* --- гамбургер (виден только на узких экранах) --- */

.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 34px;
  margin-left: auto;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}

.nav__burger-line {
  display: block;
  width: 16px;
  height: 1px;
  margin-inline: auto;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav.is-open .nav__burger-line:first-child {
  transform: translateY(3px) rotate(45deg);
}

.nav.is-open .nav__burger-line:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* =========================================================
   Типографика общих элементов
   ========================================================= */

.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow__num {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.eyebrow__num::after {
  content: "";
  display: inline-block;
  width: clamp(1.5rem, 4vw, 3rem);
  height: 1px;
  margin-left: 0.7rem;
  vertical-align: middle;
  background: var(--line);
}

.section__title {
  margin-top: 1.1rem;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.prose {
  max-width: 58ch;
  color: var(--ink);
}

/* Акцентное слово внутри абзаца — тот же приём, что в заголовке hero.
   Fraunces крупнее Inter при равном кегле, поэтому чуть уменьшен. */
.prose em {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-style: italic;
  font-weight: 500;
  font-size: 1.06em;
  color: var(--ochre);
}

.link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(226, 135, 74, 0.35);
  padding-bottom: 2px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.link:hover {
  color: var(--ochre);
  border-bottom-color: var(--ochre);
}

.link__arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.link:hover .link__arrow { transform: translate(2px, -2px); }

.link--sm { font-size: 0.9rem; }

/* ---------- Кнопка ---------- */

.btn {
  --btn-bg: var(--accent);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 2.4rem;
  padding: 0.95rem 1.6rem;
  border-radius: 3px;
  background: var(--btn-bg);
  color: var(--bg);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.3s var(--ease),
              transform 0.3s var(--ease),
              box-shadow 0.3s var(--ease);
}

.btn:hover {
  --btn-bg: var(--ochre);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -14px rgba(226, 135, 74, 0.75);
}

.btn:active { transform: translateY(0); }

.btn__arrow {
  transition: transform 0.3s var(--ease);
}

.btn:hover .btn__arrow { transform: translateX(5px); }

.btn--lg {
  padding: 1.1rem 2rem;
  font-size: 1.05rem;
}

/* =========================================================
   1. HERO
   ========================================================= */

.hero {
  position: relative;
  padding-top: clamp(2.5rem, 6vw, 5.5rem);
  padding-bottom: clamp(4rem, 9vw, 8rem);
  overflow: hidden;
}

/* мягкое тёплое свечение в правом верхнем углу */
.hero::before {
  content: "";
  position: absolute;
  top: -22vw;
  right: -14vw;
  width: 58vw;
  height: 58vw;
  max-width: 780px;
  max-height: 780px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 135, 74, 0.16) 0%, rgba(226, 135, 74, 0) 62%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  /* minmax(0, …) — чтобы длинное неразрывное слово не распирало сетку */
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}

.hero__text {
  grid-column: 1 / 8;
}

.hero__title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(2.5rem, 1.2rem + 4.4vw, 4.15rem);
  line-height: 1.04;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--ochre);
}

.hero__lead {
  margin-top: clamp(1.5rem, 3vw, 2.2rem);
  max-width: 48ch;
  font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.22rem);
  line-height: 1.6;
  color: var(--muted);
}

/* --- Портрет --- */

.hero__portrait {
  position: relative;
  grid-column: 8 / -1;
  margin-top: clamp(1rem, 5vw, 4rem);
}

.hero__portrait :is(img, video) {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: 3px;
  filter: saturate(0.92) contrast(1.02);
}

/* охристый контур со смещением — асимметричная деталь */
.hero__ring {
  position: absolute;
  z-index: 1;
  inset: -1.4rem -1.4rem auto auto;
  width: 78%;
  aspect-ratio: 1;
  border: 1px solid rgba(209, 164, 74, 0.45);
  border-radius: 3px;
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-10px, 12px, 0); }
}

/* =========================================================
   Секции
   ========================================================= */

.section {
  position: relative;
  z-index: 2;
  padding-block: clamp(4rem, 8vw, 7.5rem);
  border-top: 1px solid var(--line-soft);
}

.section__head {
  margin-bottom: clamp(2.2rem, 4vw, 3.5rem);
}

.section__title {
  max-width: 20ch;
}

/* ---------- 2. Сейчас ---------- */

/* Зеркало hero: там портрет справа от текста, здесь — слева */
.now__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}

.now__portrait {
  position: relative;
  grid-column: 1 / 6;
  margin-top: clamp(0.5rem, 3vw, 2.5rem);
}

.now__portrait :is(img, video) {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 3px;
  filter: saturate(0.92) contrast(1.02);
}

/* контур со смещением влево — отражение hero__ring */
.now__ring {
  position: absolute;
  z-index: 1;
  inset: auto auto -1.3rem -1.3rem;
  width: 72%;
  aspect-ratio: 1;
  border: 1px solid rgba(226, 135, 74, 0.4);
  border-radius: 3px;
  animation: drift 22s ease-in-out infinite alternate;
}

.now__text {
  grid-column: 7 / -1;
}

.now__text .prose {
  margin-top: clamp(1.4rem, 3vw, 2.1rem);
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0;
  padding-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
}

.skills li {
  display: inline-flex;
  align-items: center;
}

.skills li:not(:last-child)::after {
  content: "";
  width: 4px;
  height: 4px;
  margin-inline: 0.9rem;
  border-radius: 50%;
  background: var(--accent);
}

/* --- Карточки работ (плейсхолдеры) --- */

.works {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.25rem);
  margin-top: clamp(3rem, 6vw, 5rem);
}

.work__frame {
  position: relative;
  display: grid;
  place-items: center;
  /* 16:10 — пропорция самих скриншотов (1440×899), кадр не режется */
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 3px;
  background-color: var(--bg-lift);
  background-image: repeating-linear-gradient(
    -45deg,
    var(--line-soft) 0 1px,
    transparent 1px 11px
  );
  overflow: hidden;
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}

.work__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work:hover .work__frame {
  border-color: rgba(226, 135, 74, 0.45);
  transform: translateY(-4px);
}

/* Карточка-ссылка: сама плитка кликабельна */
a.work {
  display: block;
  color: inherit;
  text-decoration: none;
}

.work__caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 0.9rem;
  font-size: 0.85rem;
}

.work__name { font-weight: 500; }
.work__meta { color: var(--muted); }

.work__arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

a.work:hover .work__meta { color: var(--accent); }
a.work:hover .work__arrow { transform: translate(2px, -2px); }

/* карточка без ссылки — ждёт данных */
.work--soon .work__meta {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Заглушка для ещё не загруженных картинок ----------
   Класс проставляет script.js, когда файл не найден: вместо
   «битой» картинки остаётся штриховка кадра и подпись. */

.is-missing :is(img, video) { display: none; }

.is-missing::after {
  content: attr(data-placeholder);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 0 1rem;
}

.now__portrait.is-missing {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: 3px;
  background-color: var(--bg-lift);
  background-image: repeating-linear-gradient(
    -45deg,
    var(--line-soft) 0 1px,
    transparent 1px 11px
  );
}

/* ---------- Бегущая строка ---------- */

.marquee {
  position: relative;
  z-index: 2;
  overflow: hidden;
  padding-block: clamp(0.9rem, 1.8vw, 1.35rem);
  border-block: 1px solid var(--line-soft);
  background: var(--bg-lift);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 42s linear infinite;
}

.marquee__group {
  display: flex;
  align-items: center;
  flex: none;
}

.marquee__group li {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.05rem, 0.9rem + 0.7vw, 1.5rem);
  letter-spacing: -0.01em;
  color: var(--ochre);
  white-space: nowrap;
}

/* косая черта-разделитель между пунктами */
.marquee__group li::after {
  content: "/";
  margin-inline: clamp(1.25rem, 3vw, 2.75rem);
  font-style: normal;
  color: var(--line);
}

/* -25% = ровно одна из четырёх копий: петля замыкается незаметно */
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-25%, 0, 0); }
}

/* ---------- 4. Портфолио ---------- */

.pf__group + .pf__group {
  margin-top: clamp(3rem, 6vw, 5rem);
}

.pf__group .works {
  margin-top: 1.6rem;
}

/* --- «Куча» визуалов CS-Cart --- */

.pile {
  position: relative;
  height: clamp(380px, 44vw, 540px);
  margin-top: 1.6rem;
}

.pile__item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: var(--z);
  width: 30%;
  margin: 0;
  cursor: grab;
  /* нужно, чтобы pointermove не перехватывался прокруткой */
  touch-action: none;
  transform: translate3d(var(--dx, 0px), var(--dy, 0px), 0) rotate(var(--rot));
  transition: box-shadow 0.25s var(--ease);
  box-shadow: 0 12px 32px -20px rgba(0, 0, 0, 0.85);
}

.pile__item.is-dragging {
  cursor: grabbing;
  box-shadow: 0 28px 64px -24px rgba(0, 0, 0, 0.95);
  transition: none;
}

.pile__frame {
  display: grid;
  place-items: center;
  /* пропорция самих скриншотов CS-Cart (1315×934) — кадр не режется */
  aspect-ratio: 1315 / 934;
  border: 1px solid var(--line);
  border-radius: 3px;
  background-color: var(--bg-lift);
  background-image: repeating-linear-gradient(
    -45deg,
    var(--line-soft) 0 1px,
    transparent 1px 11px
  );
  overflow: hidden;
}

.pile__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

/* Позиции, наклоны и порядок наложения — подобраны так,
   чтобы куча не вылезала за контейнер на любой ширине */
.pile__item:nth-child(1) { --x: 3%;  --y: 8%;  --rot: -6deg; --z: 3; }
.pile__item:nth-child(2) { --x: 24%; --y: 2%;  --rot: 5deg;  --z: 6; }
.pile__item:nth-child(3) { --x: 46%; --y: 12%; --rot: -3deg; --z: 2; }
.pile__item:nth-child(4) { --x: 65%; --y: 4%;  --rot: 7deg;  --z: 5; }
.pile__item:nth-child(5) { --x: 14%; --y: 44%; --rot: 4deg;  --z: 4; }
.pile__item:nth-child(6) { --x: 44%; --y: 50%; --rot: -8deg; --z: 1; }

.pile__note {
  max-width: 46ch;
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---------- 3. Бэкграунд ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: clamp(3rem, 6vw, 5rem);
}

.stat {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.stat__num {
  display: block;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(2.1rem, 1.2rem + 3.2vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ochre);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  display: block;
  max-width: 22ch;
  margin-top: 0.85rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

/* --- Хронология --- */

.timeline {
  margin-top: clamp(3.5rem, 7vw, 6rem);
  border-top: 1px solid var(--line-soft);
}

.tl {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(1.75rem, 3.5vw, 2.75rem);
  border-bottom: 1px solid var(--line-soft);
}

.tl__years {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 0.4rem;
}

.tl__place {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(1.3rem, 1rem + 1vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.tl__city {
  font-family: var(--font-text);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-left: 0.6rem;
  white-space: nowrap;
}

.tl__role {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.tl__desc {
  max-width: 62ch;
  margin-top: 0.9rem;
  color: var(--muted);
}

/* ---------- 4. Образование и языки ---------- */

/* Мелкий подзаголовок внутри секции — та же подача, что у .tl__role */
.subhead {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.edu__group + .edu__group {
  margin-top: clamp(2.75rem, 5vw, 4rem);
}

.edu__group .timeline {
  margin-top: 1.4rem;
}

/* записи об учёбе короче рабочих — сжимаем ритм */
.timeline--edu .tl {
  padding-block: clamp(1.25rem, 2.4vw, 1.75rem);
}

.langs {
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

.lang-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: 1.6rem;
}

.lang {
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.lang__name {
  display: block;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lang__level {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- 5. Навыки ---------- */

/* заголовок без надстрочного номера — верхний отступ не нужен */
.section__title--solo {
  margin-top: 0;
}

.skillset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.25rem, 5vw, 4rem);
  margin-top: clamp(2.25rem, 4vw, 3.25rem);
}

/* Пункты здесь длинные (до 449px при колонке 494px) — в инлайн-поток
   они ложатся по одному в строку с рваным краем. Тот же набор: та же
   типографика и та же терракотовая точка, но столбцом. */
.skillset .skills {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.skillset .skills li {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  line-height: 1.45;
}

.skillset .skills li::before {
  content: "";
  width: 4px;
  height: 4px;
  margin-top: 0.6em;
  border-radius: 50%;
  background: var(--accent);
}

.skillset .skills li:not(:last-child)::after {
  content: none;
}

/* длинные формулировки капсом читаются тяжело — тут обычный регистр */
.skills--sentence {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.95rem;
  font-weight: 400;
}

/* ---------- 6. Контакты ---------- */

.section--contact {
  padding-block: clamp(5rem, 11vw, 10rem);
}

/* Текст слева, компактный портрет справа — мельче, чем в hero */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: end;
}

.contact__portrait {
  position: relative;
}

/* тот же контур, что у hero и «Сейчас», смещён в правый верхний угол */
.contact__ring {
  position: absolute;
  z-index: 1;
  inset: -1.2rem -1.2rem auto auto;
  width: 76%;
  aspect-ratio: 1;
  border: 1px solid rgba(209, 164, 74, 0.45);
  border-radius: 3px;
  animation: drift 20s ease-in-out infinite alternate;
}

.contact__portrait :is(img, video) {
  /* position + z-index, чтобы контур остался позади кадра:
     без них абсолютный .contact__ring рисовался бы поверх */
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 28%;
  border-radius: 3px;
  filter: saturate(0.92) contrast(1.02);
}

.contact__portrait.is-missing {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 3px;
  background-color: var(--bg-lift);
  background-image: repeating-linear-gradient(
    -45deg,
    var(--line-soft) 0 1px,
    transparent 1px 11px
  );
}

.contact__title {
  margin-top: 1.4rem;
  max-width: 20ch;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(2rem, 1.1rem + 3.6vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.contact__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--ochre);
}

/* Второстепенные контакты под основной кнопкой */
.contact__more {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin-top: 1.9rem;
}

.contact__more li {
  display: inline-flex;
  align-items: center;
}

.contact__more li:not(:last-child)::after {
  content: "";
  width: 4px;
  height: 4px;
  margin-inline: 1.3rem;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Футер ---------- */

.footer {
  position: relative;
  z-index: 2;
  padding-block: 2.25rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.85rem;
  color: var(--muted);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* =========================================================
   Появление блоков при скролле
   ========================================================= */

/* Скрываем только при активном JS — иначе контент останется невидимым */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  transition-delay: var(--d, 0ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* =========================================================
   Адаптив
   ========================================================= */

/* --- Меню сворачивается в гамбургер раньше остальной вёрстки:
       шесть длинных названий разделов в строку уже не помещаются --- */
@media (max-width: 1200px) {
  .nav__burger { display: flex; }

  .nav__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: block;
    padding: 1.25rem var(--gutter) 1.6rem;
    background: var(--bg-lift);
    border-bottom: 1px solid var(--line-soft);
    box-shadow: 0 22px 40px -28px rgba(0, 0, 0, 0.9);
  }

  .nav:not(.is-open) .nav__menu { display: none; }

  .nav__links {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .nav__links a { font-size: 0.95rem; }

  .nav__actions {
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line-soft);
  }
}

@media (max-width: 620px) {
  /* бейдж уезжает первым — он декоративный, а место нужно */
  .nav__badge { display: none; }
}

@media (max-width: 900px) {
  .contact__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact__portrait {
    max-width: 260px;
    margin-top: clamp(2.5rem, 6vw, 3.5rem);
  }

  .contact__ring {
    inset: -0.9rem -0.9rem auto auto;
    width: 60%;
  }

  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__text,
  .hero__portrait {
    grid-column: 1 / -1;
  }

  .hero__portrait {
    order: -1;
    margin-top: 0;
    margin-bottom: clamp(2.5rem, 7vw, 3.5rem);
    max-width: 340px;
  }

  .hero__portrait :is(img, video) {
    aspect-ratio: 1 / 1;
  }

  .hero__ring {
    inset: -1rem -1rem auto auto;
    width: 62%;
  }

  .now__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .now__portrait,
  .now__text {
    grid-column: 1 / -1;
  }

  .now__portrait {
    margin-top: 0;
    margin-bottom: clamp(2.25rem, 6vw, 3rem);
    max-width: 320px;
  }

  .now__portrait :is(img, video) {
    aspect-ratio: 1 / 1;
  }

  .now__ring {
    inset: auto auto -1rem -1rem;
    width: 58%;
  }

  /* куча становится выше и уже — плитки крупнее, но всё влезает */
  .pile {
    height: clamp(400px, 96vw, 520px);
  }

  .pile__item { width: 52%; }

  .pile__item:nth-child(1) { --x: 2%;  --y: 4%;  }
  .pile__item:nth-child(2) { --x: 40%; --y: 1%;  }
  .pile__item:nth-child(3) { --x: 6%;  --y: 26%; }
  .pile__item:nth-child(4) { --x: 42%; --y: 31%; }
  .pile__item:nth-child(5) { --x: 1%;  --y: 53%; }
  .pile__item:nth-child(6) { --x: 38%; --y: 60%; }

  .stats {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .stat {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
    padding-block: 1.25rem;
  }

  .stat__label {
    margin-top: 0;
    max-width: none;
  }

  .tl {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  .tl__years { padding-top: 0; }

  .skillset {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .works {
    grid-template-columns: minmax(0, 1fr);
  }

  /* цифра и подпись рядом уже не помещаются — ставим друг под другом */
  .stat {
    display: block;
    padding-block: 1.4rem;
  }

  .stat__label {
    margin-top: 0.6rem;
    max-width: 30ch;
  }

  .tl__city {
    display: block;
    margin-left: 0;
    margin-top: 0.3rem;
  }

  .lang-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .lang {
    padding-block: 1.1rem;
  }

  /* контакты в столбик — точка-разделитель тут не нужна */
  .contact__more {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }

  .contact__more li:not(:last-child)::after {
    display: none;
  }
}

/* =========================================================
   Уважение к prefers-reduced-motion
   ========================================================= */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .hero__ring,
  .now__ring,
  .contact__ring { animation: none; }

  /* Общее правило выше сжимает анимацию до 0.01ms — бегущая строка
     мгновенно «домотала» бы себя до конца. Гасим её явно, чтобы
     полоса просто стояла на месте и текст читался. */
  .marquee__track {
    animation: none !important;
    transform: none !important;
  }
}


/* =========================================================
   Кастомный курсор

   Два слоя: точка следует за мышью мгновенно, кольцо —
   с небольшим отставанием (сглаживание считается в script.js).
   Включается только там, где есть настоящая мышь: на тач-экранах
   слои вообще не создаются, системное поведение остаётся как было.
   ========================================================= */

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;   /* курсор не должен перехватывать клики */
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  will-change: transform;
}

/* появляются только после первого движения мыши,
   иначе на загрузке висели бы в углу экрана */
.cursor-dot.is-ready,
.cursor-ring.is-ready { opacity: 1; }

.cursor-dot__shape {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

.cursor-ring__shape {
  display: block;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background-color: transparent;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 0.28s var(--ease),
              background-color 0.28s var(--ease);
}

/* над ссылкой, кнопкой или карточкой кольцо растёт и наливается */
.cursor-ring.is-hover .cursor-ring__shape {
  transform: translate(-50%, -50%) scale(1.7);
  background-color: rgba(226, 135, 74, 0.16);
}

@media (hover: hover) and (pointer: fine) {
  html,
  body { cursor: none; }

  /* элементы со своим курсором тоже гасим, иначе системный
     возвращается поверх кастомного */
  a,
  button,
  [role="button"],
  .pile__item,
  .pile__item.is-dragging { cursor: none; }
}

/* Подстраховка: если по какой-то причине слои окажутся в разметке
   на тач-устройстве, они останутся невидимыми */
@media not all and (hover: hover) and (pointer: fine) {
  .cursor-dot,
  .cursor-ring { display: none; }
}
