:root {
  --bg: #0a0a0b;
  --fg: #eceae5;
  --muted: #87847e;
  --line: #1f1f21;
  --pad: clamp(20px, 4vw, 56px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { user-select: none; }

/* ============================================================
   ЛЕНДИНГ
   ============================================================ */

.landing-page { overflow: hidden; }

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
}

/* слои параллакса */

.hero-layer {
  position: absolute;
  inset: -5%;
  will-change: transform;
  pointer-events: none;
}

.hero-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* центр: имя + кнопки */

.hero-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  will-change: transform;
  pointer-events: none;
}

.hero-center a { pointer-events: auto; }

.hero-name {
  font-size: clamp(56px, 12vw, 190px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.hero-tag {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-actions {
  margin-top: 44px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 13px 30px;
  border: 1px solid rgba(236, 234, 229, 0.35);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
  background: rgba(10, 10, 11, 0.25);
  backdrop-filter: blur(2px);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.btn:hover {
  background: var(--fg);
  border-color: var(--fg);
  color: #0a0a0b;
}

/* углы и соцсети */

.hero-corner {
  position: absolute;
  z-index: 50;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

.corner-tl { top: 24px; left: var(--pad); color: var(--fg); }
.corner-tr { top: 24px; right: var(--pad); }
.corner-br { bottom: 24px; right: var(--pad); }

.hero-socials {
  position: absolute;
  z-index: 50;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.hero-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--muted);
  transition: color 0.25s;
}

.hero-socials a:hover { color: var(--fg); }

.hero-socials svg { width: 19px; height: 19px; display: block; }

/* ============================================================
   ВНУТРЕННИЕ СТРАНИЦЫ: шапка
   ============================================================ */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--pad);
  mix-blend-mode: difference;
}

.nav-logo {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.22em;
}

.nav-links a {
  margin-left: 28px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0.55;
  transition: opacity 0.2s;
}

.nav-links a:hover,
.nav-links a.active { opacity: 1; }

.nav-links a.active { border-bottom: 1px solid var(--fg); padding-bottom: 3px; }

/* ============================================================
   ПОРТФОЛИО: сетка во весь экран
   ============================================================ */

.portfolio {
  padding-top: 64px;
  min-height: 100vh;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

@media (max-width: 1100px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid { grid-template-columns: 1fr; } }

.work {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #101012;
  border: none;
  padding: 0;
  cursor: pointer;
}

.work img,
.work video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1), opacity 0.4s;
}

.work:hover img,
.work:hover video { transform: scale(1.04); }

/* ячейки 3D-моделей */

.model-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #36363e;
  transition: color 0.4s;
}

.model-placeholder svg { width: 72px; height: 72px; }

.work:hover .model-placeholder { color: #55555e; }

.model-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 9px;
  border: 1px solid rgba(236, 234, 229, 0.3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted);
  pointer-events: none;
  background: rgba(10, 10, 11, 0.4);
}

.work:hover .model-badge { color: var(--fg); }

/* ============================================================
   ЛАЙТБОКС
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(7, 7, 8, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 48px);
}

.lightbox[hidden] { display: none; }

.lightbox-content {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: calc(100vh - 2 * clamp(16px, 3vw, 48px));
  display: block;
}

.lightbox-content model-viewer {
  width: min(92vw, 1400px);
  height: calc(100vh - 2 * clamp(16px, 3vw, 48px));
  --poster-color: transparent;
  /* студийная подложка: тёмные модели не сливаются с фоном */
  background: radial-gradient(ellipse at 50% 38%, #303034 0%, #1a1a1d 55%, #101012 100%);
}

/* переключатель вариантов материалов (KHR_materials_variants) */

.variant-bar {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 102;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90vw;
}

.variant-btn {
  padding: 9px 18px;
  border: 1px solid rgba(236, 234, 229, 0.3);
  background: rgba(10, 10, 11, 0.55);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.variant-btn:hover { color: var(--fg); border-color: rgba(236, 234, 229, 0.6); }

.variant-btn.active {
  background: var(--fg);
  border-color: var(--fg);
  color: #0a0a0b;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 22px;
  z-index: 101;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-close:hover { opacity: 1; }

/* стрелки листания */

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 102;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 11, 0.5);
  border: 1px solid rgba(236, 234, 229, 0.25);
  color: var(--fg);
  font-size: 18px;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s, border-color 0.2s;
}

.lightbox-nav:hover { opacity: 1; border-color: rgba(236, 234, 229, 0.6); }

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

/* полоска прогресса загрузки модели */

.load-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 103;
  background: rgba(236, 234, 229, 0.08);
  transition: opacity 0.5s;
}

.load-bar-fill {
  height: 100%;
  width: 0;
  background: var(--fg);
  transition: width 0.25s ease-out;
}

.load-bar.done { opacity: 0; }

/* ============================================================
   ABOUT / CONTACT
   ============================================================ */

.page-body {
  min-height: calc(100vh - 80px);
  padding: clamp(120px, 18vh, 200px) var(--pad) clamp(64px, 10vw, 120px);
  max-width: 1200px;
}

.about-statement {
  font-size: clamp(26px, 3.6vw, 48px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  max-width: 18em;
}

.about-columns {
  margin-top: clamp(64px, 10vw, 120px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 360px));
  gap: clamp(32px, 6vw, 96px);
}

@media (max-width: 640px) { .about-columns { grid-template-columns: 1fr; } }

.col-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.col-list { list-style: none; }

.col-list li {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  color: var(--fg);
}

.col-list li:first-child { border-top: 1px solid var(--line); }

/* contact */

.contact-lead {
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 500;
  line-height: 1.3;
  max-width: 20em;
  margin-bottom: clamp(48px, 8vw, 96px);
}

.contact-list { border-top: 1px solid var(--line); }

.contact-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.3s;
}

.contact-row:hover { padding-left: 14px; }

.contact-name {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-value { font-size: clamp(17px, 2vw, 24px); font-weight: 500; }

.contact-arrow { font-size: 20px; color: var(--muted); }

.contact-row:hover .contact-arrow { color: var(--fg); }

@media (max-width: 560px) {
  .contact-row { grid-template-columns: 1fr auto; }
  .contact-name { grid-column: 1 / -1; }
}

/* ============================================================
   ФУТЕР
   ============================================================ */

.footer {
  display: flex;
  justify-content: space-between;
  padding: 26px var(--pad);
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer a:hover { color: var(--fg); }

/* ============================================================
   МОБИЛЬНЫЕ ПРАВКИ
   ============================================================ */

@media (max-width: 600px) {
  .nav { padding: 16px 20px; }
  .nav-links a { margin-left: 13px; font-size: 11px; letter-spacing: 0.06em; }

  .corner-tr, .corner-br { display: none; }

  .hero-tag { letter-spacing: 0.22em; }
  .hero-actions { margin-top: 36px; gap: 10px; }
  .btn { padding: 12px 22px; letter-spacing: 0.14em; }

  .lightbox-nav { width: 42px; height: 42px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }

  .variant-bar { bottom: 18px; gap: 6px; }
  .variant-btn { padding: 8px 13px; font-size: 10px; }
}

/* ============================================================
   ДВИЖЕНИЕ: отключение по предпочтению системы
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .hero-layer, .hero-center { transform: none !important; }
}
