/* ============================================================
   XF Portfolio — styles
   1. Tokens      2. Reset      3. Layout      4. Header
   5. Hero        6. Sections   7. Components  8. Footer
   9. Lightbox   10. Responsive 11. Motion
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --accent: #ff3b18;
  --accent-2: #ff8a3d;
  --accent-soft: rgba(255, 59, 24, .14);

  --bg: #0a0908;
  --bg-2: #100e0c;
  --panel: rgba(255, 255, 255, .035);
  --panel-2: rgba(255, 255, 255, .06);
  --text: #f3eee8;
  --muted: #a39a91;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .85);
  --cream: #ede6da;
  --on-cream: #14100e;

  --font-display: "Inter Tight", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  --container: 1240px;
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --header-h: 68px;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f4ef;
  --bg-2: #efeae2;
  --panel: rgba(20, 16, 14, .035);
  --panel-2: rgba(20, 16, 14, .06);
  --text: #16120f;
  --muted: #61574f;
  --line: rgba(20, 16, 14, .12);
  --line-strong: rgba(20, 16, 14, .24);
  --shadow: 0 30px 70px -35px rgba(60, 40, 30, .45);
  --cream: #16120f;
  --on-cream: #f7f4ef;
  --accent-soft: rgba(255, 59, 24, .12);
  color-scheme: light;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(15px, .35vw + 14px, 17px);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; }
em { font-style: italic; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: #fff;
  transform: translateY(-160%);
  transition: transform .25s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 3. Layout ---------- */
.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.section { padding: clamp(72px, 10vw, 140px) 0; position: relative; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section--contact { padding-bottom: clamp(60px, 8vw, 110px); }

.section__head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.section__title {
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  margin-top: 14px;
}
.section__title em { color: var(--accent); }
.section__sub { color: var(--muted); margin-top: 16px; max-width: 60ch; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .78rem; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
}
.eyebrow span {
  color: var(--accent);
  font-family: var(--font-display);
  letter-spacing: .04em;
}
.eyebrow::after {
  content: ""; width: 46px; height: 1px; background: var(--line-strong);
}
.eyebrow--sm::after { display: none; }

/* ---------- 4. Header ---------- */
.scroll-progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 120;
  background: transparent; pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 110;
  transition: background-color .35s var(--ease), border-color .35s var(--ease), backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--line);
}

.header__inner {
  display: flex; align-items: center; gap: 24px;
  height: var(--header-h);
}

.logo { display: inline-flex; align-items: center; }
.logo__mark {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic; font-weight: 700;
  font-size: 1.35rem; letter-spacing: .02em;
  color: var(--accent);
  transition: transform .3s var(--ease);
}
.logo:hover .logo__mark { transform: translateY(-2px) rotate(-4deg); }

.nav { margin-inline: auto; }
.nav__list { display: flex; gap: clamp(14px, 2vw, 30px); }
.nav__link {
  position: relative; font-size: .93rem; color: var(--muted);
  padding: 6px 2px; transition: color .25s var(--ease);
}
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1.5px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .35s var(--ease);
}
.nav__link:hover { color: var(--text); }
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav__link.is-active { color: var(--text); }

.header__actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer;
  transition: border-color .25s, background-color .25s, transform .25s var(--ease);
}
.icon-btn:hover { border-color: var(--line-strong); transform: rotate(12deg); }
.icon {
  width: 17px; height: 17px; fill: none;
  stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
:root[data-theme="dark"] .icon--sun { display: none; }
:root[data-theme="light"] .icon--moon { display: none; }

.burger {
  display: none; width: 40px; height: 38px; cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 9px;
}
.burger span {
  display: block; height: 1.6px; background: var(--text); border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s;
}
.burger span + span { margin-top: 5px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); }

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 42px) 0 64px;
  overflow: hidden;
  isolation: isolate;
}

.hero__glow {
  position: absolute; z-index: -2;
  top: var(--my, 45%); left: var(--mx, 68%);
  width: min(88vw, 900px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(255, 59, 24, .30) 0%,
    rgba(255, 90, 30, .13) 34%,
    rgba(255, 120, 40, .04) 55%,
    transparent 72%);
  filter: blur(10px);
  transition: top 1.1s var(--ease), left 1.1s var(--ease);
}
:root[data-theme="light"] .hero__glow { opacity: .55; }

.hero__rings {
  position: absolute; z-index: -1;
  top: 50%; left: 72%; transform: translate(-50%, -50%);
  width: min(92vw, 820px); aspect-ratio: 1;
  display: grid; place-items: center;
}
.hero__rings span {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(255, 96, 40, .16);
  animation: ringPulse 9s ease-in-out infinite;
}
.hero__rings span:nth-child(1) { width: 38%; height: 38%; animation-delay: 0s; }
.hero__rings span:nth-child(2) { width: 60%; height: 60%; animation-delay: .8s; }
.hero__rings span:nth-child(3) { width: 82%; height: 82%; animation-delay: 1.6s; }
.hero__rings span:nth-child(4) { width: 100%; height: 100%; animation-delay: 2.4s; }
@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: .45; }
  50% { transform: scale(1.045); opacity: .9; }
}

.hero__grid-lines {
  position: absolute; inset: 0; z-index: -3; opacity: .5;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: clamp(70px, 9vw, 120px) clamp(70px, 9vw, 120px);
  mask-image: radial-gradient(ellipse 90% 70% at 40% 45%, #000 20%, transparent 78%);
}

.hero__inner { position: relative; }

.hero__badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 15px 7px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: .8rem; color: var(--muted); letter-spacing: .02em;
  margin-bottom: 20px;
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 24, .5); }
  70% { box-shadow: 0 0 0 12px rgba(255, 59, 24, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 24, 0); }
}

.hero__title {
  font-size: clamp(2.8rem, 7.4vw, 6.4rem);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.035em;
  max-width: 14ch;
}
.hero__title .line { display: block; }
.hero__title .accent em {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 60%, var(--accent) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
  padding-right: .08em;
}
@keyframes shimmer { to { background-position: 220% 0; } }

.hero__lead {
  color: var(--muted);
  max-width: 52ch;
  margin-top: 20px;
  font-size: clamp(.98rem, .5vw + .85rem, 1.12rem);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero__stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px; margin-top: clamp(30px, 4vw, 52px);
  padding-top: 22px; border-top: 1px solid var(--line);
  max-width: 900px;
}
.stat__value {
  font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 600; letter-spacing: -.03em; color: var(--text);
}
.stat__label { order: 2; font-size: .8rem; color: var(--muted); line-height: 1.4; margin-top: 6px; }
.stat { display: flex; flex-direction: column; }

.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted);
}
.scroll-hint__line {
  width: 1px; height: 44px; background: linear-gradient(var(--accent), transparent);
  animation: hintDrop 2.2s var(--ease) infinite;
}
@keyframes hintDrop {
  0% { transform: scaleY(.2); transform-origin: top; opacity: 0; }
  40% { opacity: 1; }
  100% { transform: scaleY(1); transform-origin: top; opacity: 0; }
}

/* ---------- 6. Marquee ---------- */
.marquee {
  border-block: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden; padding: 16px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex; align-items: center; gap: 28px; width: max-content;
  animation: marquee 42s linear infinite;
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  letter-spacing: -.01em;
  color: var(--muted);
}
.marquee__track i { color: var(--accent); font-style: normal; font-size: .6em; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 7. Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px;
  font-size: .82rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .28s var(--ease), background-color .28s, color .28s, border-color .28s, box-shadow .28s;
}
.btn--primary {
  background: var(--cream); color: var(--on-cream);
  box-shadow: 0 12px 30px -14px rgba(237, 230, 218, .6);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -16px rgba(255, 59, 24, .5); background: #fff; }
:root[data-theme="light"] .btn--primary { box-shadow: 0 12px 26px -16px rgba(0, 0, 0, .5); }
:root[data-theme="light"] .btn--primary:hover { background: var(--accent); color: #fff; }

.btn--outline { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--ghost {
  border-color: var(--line-strong); font-size: .74rem; padding: 10px 18px;
  text-transform: none; letter-spacing: .01em; font-weight: 500;
}
.btn--ghost:hover { background: var(--panel-2); border-color: var(--accent); }
.btn--full { width: 100%; justify-content: center; }
.btn__arrow { transition: transform .28s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

.chip {
  display: inline-block; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: .78rem; color: var(--muted);
  transition: color .25s, border-color .25s, transform .25s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

/* ---------- 8. About ---------- */
.about { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 70px); align-items: start; }

.portrait {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(255, 90, 30, .35), transparent 60%),
    linear-gradient(160deg, #241713, #0d0b0a 70%);
  display: grid; place-items: center;
}
:root[data-theme="light"] .portrait {
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(255, 90, 30, .35), transparent 60%),
    linear-gradient(160deg, #f0e5da, #ded2c5 70%);
}
.portrait__shape {
  position: absolute; inset: 12%;
  border-radius: 50% 50% 46% 54% / 48% 42% 58% 52%;
  border: 1px solid rgba(255, 120, 60, .35);
  background: radial-gradient(circle at 35% 30%, rgba(255, 59, 24, .22), transparent 65%);
  animation: morph 16s ease-in-out infinite;
}
@keyframes morph {
  0%, 100% { border-radius: 50% 50% 46% 54% / 48% 42% 58% 52%; transform: rotate(0deg); }
  50% { border-radius: 44% 56% 58% 42% / 56% 48% 52% 44%; transform: rotate(8deg); }
}
.portrait__initials {
  position: relative;
  font-family: Georgia, serif; font-style: italic; font-weight: 700;
  font-size: clamp(3rem, 8vw, 5.5rem); color: var(--accent); opacity: .9;
}
.portrait__caption { margin-top: 14px; font-size: .82rem; color: var(--muted); }

.about__text .lead { font-size: clamp(1.05rem, 1.4vw, 1.3rem); color: var(--text); }
.about__text p + p { margin-top: 16px; color: var(--muted); }
.about__list { margin-top: 26px; display: grid; gap: 10px; }
.about__list li { display: flex; gap: 12px; color: var(--muted); font-size: .95rem; }
.about__list span { color: var(--accent); }
.about__tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }

/* ---------- 9. Cards / process ---------- */
.cards {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  position: relative; padding: 26px 24px 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .4s var(--ease), border-color .35s, background-color .35s;
}
.card::before {
  content: ""; position: absolute; inset: -1px;
  background: radial-gradient(320px circle at var(--px, 50%) var(--py, 0%), var(--accent-soft), transparent 65%);
  opacity: 0; transition: opacity .35s;
  pointer-events: none;
}
.card:hover { border-color: var(--line-strong); }
.card:hover::before { opacity: 1; }
.card__icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; margin-bottom: 20px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--accent);
}
.card__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.card__title { font-size: 1.18rem; }
.card__text { margin-top: 10px; color: var(--muted); font-size: .93rem; }
.card__meta { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.card__meta li { font-size: .8rem; color: var(--muted); letter-spacing: .02em; }
.card__meta li::before { content: "— "; color: var(--accent); }

.process {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px; margin-top: 22px;
  counter-reset: step;
}
.process__step {
  padding-top: 22px; border-top: 2px solid var(--line);
  transition: border-color .35s;
}
.process__step:hover { border-top-color: var(--accent); }
.process__num { font-family: var(--font-display); color: var(--accent); font-size: .82rem; letter-spacing: .12em; }
.process__step h4 { margin: 10px 0 6px; font-size: 1.05rem; }
.process__step p { color: var(--muted); font-size: .88rem; }

/* ---------- 10. Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.project {
  grid-column: span 2;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); overflow: hidden;
  transition: transform .4s var(--ease), border-color .35s, box-shadow .4s;
}
.project:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.project--wide { grid-column: span 4; }

.project__visual {
  position: relative; aspect-ratio: 16 / 9;
  display: grid; place-items: center; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.project__visual::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(90% 70% at 70% 0%, rgba(255, 255, 255, .07), transparent 60%);
}
.project__visual--1 { background: linear-gradient(150deg, #2a1611, #120d0b 70%); }
.project__visual--2 { background: linear-gradient(150deg, #1a1a24, #0d0c0f 70%); }
.project__visual--3 { background: linear-gradient(150deg, #22190f, #100d0a 70%); }
.project__visual--4 { background: linear-gradient(150deg, #101c1c, #0a0f0f 70%); }

.project__body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project__tagline { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.project__title { font-size: clamp(1.15rem, 1.6vw, 1.5rem); }
.project__text { color: var(--muted); font-size: .93rem; }
.project__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.project__tags li {
  font-size: .74rem; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.project__result { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.project__result strong { font-family: var(--font-display); font-size: 1.35rem; color: var(--text); margin-right: 8px; }

/* широкие карточки на десктопе раскладываются горизонтально */
@media (min-width: 1081px) {
  .project--wide { flex-direction: row; }
  .project--wide .project__visual {
    flex: 1 1 56%; aspect-ratio: auto; min-height: 330px;
    border-bottom: none; border-right: 1px solid var(--line);
  }
  .project--wide .project__body { flex: 1 1 44%; padding: 30px 32px 32px; }
}

/* project mockups */
.mock { position: relative; z-index: 1; width: 78%; }
.mock--dashboard { display: flex; align-items: flex-end; gap: 10px; height: 62%; }
.mock__bar {
  flex: 1; height: var(--h); border-radius: 6px 6px 3px 3px;
  background: linear-gradient(var(--accent), rgba(255, 59, 24, .18));
  opacity: .85;
  animation: barGrow 1.2s var(--ease) both;
}
.mock__bar:nth-child(2n) { background: linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, .07)); }
@keyframes barGrow { from { transform: scaleY(.15); transform-origin: bottom; } }

.mock--phone { display: grid; gap: 9px; width: 58%; }
.mock__line { height: 9px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.mock__line.w70 { width: 70%; } .mock__line.w40 { width: 40%; }
.mock__line.w55 { width: 55%; } .mock__line.w30 { width: 30%; }
.mock__card { height: 62px; border-radius: 12px; background: linear-gradient(120deg, var(--accent), rgba(255, 138, 61, .35)); }

.mock--grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 60%; }
.mock--grid span { aspect-ratio: 1; border-radius: 8px; background: rgba(255, 255, 255, .12); }
.mock--grid span:nth-child(3n) { background: rgba(255, 59, 24, .55); }

.mock--system { display: flex; flex-wrap: wrap; gap: 9px; width: 62%; justify-content: center; }
.mock--system .swatch { width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .14); }
.mock--system .swatch:nth-child(1) { background: var(--accent); }
.mock--system .swatch:nth-child(4) { background: var(--accent-2); }
.mock__pill { width: 110px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .2); }
.mock__pill.sm { width: 62px; }

/* ---------- 11. Research ---------- */
.research { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(20px, 3vw, 34px); align-items: start; }
.research__methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.method {
  padding: 22px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel);
  transition: transform .35s var(--ease), border-color .35s;
}
.method:hover { transform: translateY(-4px); border-color: var(--accent); }
.method h3 { font-size: 1.05rem; }
.method p { color: var(--muted); font-size: .89rem; margin-top: 8px; }
.method__count { display: inline-block; margin-top: 14px; font-size: .78rem; color: var(--accent); letter-spacing: .06em; }

.research__case {
  padding: clamp(22px, 3vw, 32px); border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, var(--panel-2), transparent 65%);
}
.research__case h3 { font-size: 1.3rem; margin: 12px 0 12px; }
.research__case p { color: var(--muted); font-size: .93rem; }
.research__facts { display: flex; gap: 22px; margin: 22px 0; flex-wrap: wrap; }
.research__facts li { display: flex; flex-direction: column; }
.research__facts strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--accent); line-height: 1.1; }
.research__facts span { font-size: .78rem; color: var(--muted); }
.research__quote {
  padding-left: 16px; border-left: 2px solid var(--accent);
  font-style: italic; color: var(--text) !important;
}
.research__quote span { display: block; font-style: normal; font-size: .8rem; color: var(--muted); margin-top: 8px; }

/* ---------- 12. Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.art {
  position: relative; cursor: pointer; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); overflow: hidden;
  aspect-ratio: 4 / 3; display: grid; place-items: center;
  transition: transform .4s var(--ease), border-color .35s, background-color .35s;
}
.art:hover { transform: translateY(-5px) scale(1.01); border-color: var(--accent); }
.art svg { width: 62%; height: auto; overflow: visible; }
.art svg .a { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.art svg .b { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.art svg .c { fill: var(--accent); }
.art--2 { background: linear-gradient(150deg, rgba(255, 59, 24, .09), transparent 60%); }
.art--4 { background: linear-gradient(200deg, rgba(255, 138, 61, .1), transparent 60%); }
.art--5 { background: linear-gradient(120deg, rgba(255, 255, 255, .04), transparent 60%); }
.art__label {
  position: absolute; left: 16px; bottom: 14px;
  font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  transition: color .3s;
}
.art:hover .art__label { color: var(--accent); }

/* ---------- 13. Contact ---------- */
.cta {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(90% 120% at 100% 0%, var(--accent-soft), transparent 55%),
    var(--panel);
}
.contact-list { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px; }
.contact-list a {
  position: relative; color: var(--muted); font-size: .95rem;
  transition: color .25s;
}
.contact-list a::after {
  content: ""; position: absolute; left: 0; bottom: -3px; width: 100%; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform .3s var(--ease);
}
.contact-list a:hover { color: var(--text); }
.contact-list a:hover::after { transform: scaleX(1); transform-origin: left; }

.form { display: grid; gap: 16px; align-content: start; }
.field { display: grid; gap: 7px; }
.field label { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  padding: 13px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg);
  transition: border-color .25s, box-shadow .25s;
  resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field.has-error input, .field.has-error textarea { border-color: var(--accent); }
.field__error { font-size: .78rem; color: var(--accent); min-height: 0; }
.form__status { font-size: .88rem; color: var(--accent); min-height: 1.2em; }

/* ---------- 14. Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 30px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer__note { font-size: .82rem; color: var(--muted); }
.footer__top { font-size: .82rem; color: var(--muted); transition: color .25s; }
.footer__top:hover { color: var(--accent); }

/* ---------- 15. Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 34px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  padding: 24px;
  animation: fadeIn .28s var(--ease);
}
.lightbox[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.lightbox__figure { max-width: min(680px, 90vw); text-align: center; }
.lightbox__art {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: clamp(18px, 4vw, 44px);
  display: grid; place-items: center;
  animation: popIn .35s var(--ease);
}
@keyframes popIn { from { transform: scale(.94); opacity: 0; } }
.lightbox__art svg { width: min(400px, 60vw); height: auto; }
.lightbox__art svg .a { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lightbox__art svg .b { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.lightbox__art svg .c { fill: var(--accent); }
.lightbox__figure h3 { margin-top: 20px; font-size: 1.3rem; }
.lightbox__figure p { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.lightbox__close {
  position: absolute; top: 20px; right: 24px;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); font-size: 1.5rem; line-height: 1;
}
.lightbox__nav {
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer; flex: none;
  border: 1px solid var(--line); background: var(--panel); font-size: 1.6rem; line-height: 1;
  transition: border-color .25s, color .25s;
}
.lightbox__nav:hover, .lightbox__close:hover { border-color: var(--accent); color: var(--accent); }

body.is-locked { overflow: hidden; }

/* ---------- 16. Reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity .8s var(--ease) var(--d, 0s), transform .8s var(--ease) var(--d, 0s);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 17. Responsive ---------- */
@media (max-width: 1080px) {
  .research { grid-template-columns: 1fr; }
  .projects { grid-template-columns: repeat(4, 1fr); }
  .project, .project--wide { grid-column: span 2; }
}

@media (max-width: 940px) {
  .header__cta { display: none; }
  .burger { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    padding: 10px 20px 26px;
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform .35s var(--ease), opacity .3s var(--ease);
  }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__list { flex-direction: column; gap: 4px; }
  .nav__link { display: block; padding: 13px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav__link::after { display: none; }

  .about { grid-template-columns: 1fr; }
  .portrait { max-width: 340px; }
  .process { grid-template-columns: repeat(2, 1fr); }
  .cta { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .hero__stats { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .projects { grid-template-columns: 1fr; }
  .project, .project--wide { grid-column: span 1; }
  .research__methods { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
  .hero { min-height: auto; padding-bottom: 70px; }
  .footer__inner { justify-content: center; text-align: center; }
}

@media (max-width: 420px) {
  .gallery { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr; }
}

/* невысокие экраны: собираем первый экран плотнее */
@media (min-width: 641px) and (max-height: 900px) {
  .hero { padding-top: calc(var(--header-h) + 28px); padding-bottom: 52px; }
  .hero__title { font-size: clamp(2.6rem, 6.2vw, 5.2rem); }
  .hero__stats { margin-top: 26px; padding-top: 18px; }
  .hero__badge { margin-bottom: 16px; }
  .scroll-hint { display: none; }
}

/* ---------- 18. Motion preferences / print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .scroll-progress, .scroll-hint, .marquee, .lightbox, .form { display: none; }
  body { background: #fff; color: #000; }
}
