/* VV Lab — vladislav-lab.ru
   Токены: тёмно-индиговые чернила, один акцент «литиевого пламени», белый текст.
   Шрифты: Unbounded для заголовков и имён, Golos Text для текста (fonts/fonts.css). */

:root {
  --ink: #0F152B;
  --ink-deep: #090D1C;
  --ink-lift: #171F3D;
  --line: rgba(237, 240, 250, 0.12);
  --text: #EDF0FA;
  --muted: #9AA3C0;
  --accent: #FF5C7A;
  --accent-soft: rgba(255, 92, 122, 0.16);

  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-text: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --wrap: min(1120px, 100% - 2 * var(--gutter));

  --t-sm: 0.9375rem;
  --t-base: 1.0625rem;
  --t-lg: 1.2rem;
  --t-h2: clamp(1.55rem, 1.1rem + 2vw, 2.3rem);
  --t-name: clamp(1.2rem, 1rem + 0.8vw, 1.5rem);
  --t-h1: clamp(2.05rem, 1rem + 5.6vw, 5rem);

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--t-base);
  line-height: 1.6;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--ink-deep);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}
.skip:focus { top: 14px; }

/* ---------- шапка ---------- */

.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}
.top--solid {
  background: rgba(15, 21, 43, 0.74);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.brand__mark { width: 30px; height: 30px; object-fit: contain; }

.menu {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
}
.menu a {
  position: relative;
  text-decoration: none;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--muted);
  padding: 6px 0;
  transition: color 0.2s ease;
}
.menu a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.menu a:hover { color: var(--text); }
.menu a:hover::after { transform: scaleX(1); }

/* ---------- стенд (hero) ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 120px var(--gutter) 72px;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(70% 55% at 50% 0%, rgba(255, 255, 255, 0.07), transparent 70%),
    var(--ink);
}

.hero__field {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.hero__inner {
  display: grid;
  justify-items: center;
  gap: 0;
  will-change: transform, opacity;
}

.hero__stage {
  width: clamp(170px, 30vw, 300px);
  aspect-ratio: 1;
  margin-bottom: clamp(24px, 4vh, 44px);
  position: relative;
}

.hero__mark {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 1.1s ease;
  filter: drop-shadow(0 24px 70px rgba(255, 92, 122, 0.22));
}
.hero__mark.is-on { opacity: 1; }

.hero__title {
  font-size: var(--t-h1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
  max-width: 14ch;
}

/* Стрелка «можно листать»: проявляется через полсекунды после загрузки,
   не дожидаясь сборки знака, и дальше тихо покачивается вниз. */
.hero__scroll {
  display: inline-grid;
  place-items: center;
  width: 96px;
  height: 72px;
  margin-top: clamp(28px, 5vh, 56px);
  border-radius: 12px;
  color: var(--muted);
  opacity: 0;
  animation: appear 0.6s ease 0.5s forwards;
  transition: color 0.25s ease;
}
@keyframes appear { to { opacity: 1; } }
.hero__scroll svg {
  width: 56px;
  height: 28px;
  animation: nudge 2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.hero__scroll:hover { color: var(--text); }

@keyframes nudge {
  0%, 100% { transform: translateY(-5px); }
  50% { transform: translateY(9px); }
}

/* ---------- секции ---------- */

.section {
  padding: clamp(72px, 12vh, 140px) 0;
}

.section__head {
  margin-bottom: clamp(32px, 5vh, 56px);
}

h2 { font-size: var(--t-h2); letter-spacing: -0.015em; }

/* ---------- карточки проектов ----------
   Каждая карточка — «стенд»: подложка с коллекцией проекта и передний слой с главным
   предметом. За курсором передний слой чуть идёт следом, подложка — в обратную сторону
   (переменные --px/--py ставит app.js, от -1 до 1). Цвет свечения у каждого проекта свой. */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(40px, 6vh, 64px) clamp(20px, 3vw, 32px);
}

.card {
  --glow: 255 92 122;
  --px: 0;
  --py: 0;
}
.card--palpedia { --glow: 139 92 246; }
.card--tristocard { --glow: 224 36 94; }
.card--mutationlab { --glow: 46 230 255; }

.card__link {
  display: grid;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}
.card__link:focus-visible { outline-offset: 10px; }

.card__plate {
  position: relative;
  display: block;
  aspect-ratio: 10 / 7;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--ink-lift);
  isolation: isolate;
  transform: translateZ(0);
  box-shadow:
    inset 0 0 0 1px var(--line),
    0 30px 70px -30px rgb(var(--glow) / 0);
  transition: box-shadow 0.5s ease;
}

.card__base,
.card__hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease-out;
  will-change: transform;
}
.card__base {
  transform: translate3d(calc(var(--px) * -6px), calc(var(--py) * -4px), 0) scale(1.04);
}
.card__hero {
  transform: translate3d(calc(var(--px) * 18px), calc(var(--py) * 12px), 0);
}

.card__link:hover .card__plate,
.card__link:focus-visible .card__plate {
  box-shadow:
    inset 0 0 0 1px rgb(var(--glow) / 0.55),
    0 30px 70px -30px rgb(var(--glow) / 0.6);
}

.card__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-name);
  letter-spacing: -0.01em;
  line-height: 1.2;
  transition: color 0.25s ease;
}
.card__link:hover .card__name,
.card__link:focus-visible .card__name { color: var(--accent); }

.card__text {
  color: var(--muted);
  max-width: 44ch;
  font-size: var(--t-base);
  line-height: 1.5;
  text-wrap: pretty;
}

.card__where {
  margin-top: 4px;
  color: var(--accent);
  font-size: var(--t-sm);
  font-weight: 500;
}

/* ---------- кнопка связи ----------
   Капсула в цвете акцента. На наведении вокруг неё разгорается ореол, а по
   поверхности проходит один блик слева направо. */

.contact {
  display: flex;
  justify-content: center;
  margin-top: clamp(56px, 9vh, 96px);
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 0 clamp(28px, 4vw, 44px);
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.9rem, 0.8rem + 0.5vw, 1.05rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    0 0 0 0 var(--accent-soft),
    0 18px 50px -18px rgba(255, 92, 122, 0.55);
  transition: box-shadow 0.45s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.32) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.8s ease;
}
.button:hover,
.button:focus-visible {
  box-shadow:
    0 0 0 10px var(--accent-soft),
    0 26px 60px -16px rgba(255, 92, 122, 0.8);
}
.button:hover::after,
.button:focus-visible::after { transform: translateX(120%); }
.button:active { transform: scale(0.97); }
.button:focus-visible {
  outline-color: var(--text);
  outline-offset: 14px;
  border-radius: 999px;
}

/* ---------- подвал ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: var(--t-sm);
  background: var(--ink-deep);
}
.foot__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

/* ---------- адаптив ---------- */

@media (max-width: 720px) {
  .top { padding: 12px var(--gutter); }
  .brand__name { font-size: 0.95rem; }
  .menu a { font-size: 0.875rem; }
  .hero { padding-top: 104px; }
  .cards { gap: 44px; }
  .card__plate { border-radius: 16px; }
}

@media (max-width: 420px) {
  .menu { gap: 14px; }
  .menu a { font-size: 0.8125rem; }
}

/* ---------- меньше движения ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__field { display: none; }
  .hero__mark { opacity: 1; transition: none; }
  .hero__scroll { opacity: 1; animation: none; transition: none; }
  .hero__scroll svg { animation: none; }
  .hero__inner { will-change: auto; }
  .card__base,
  .card__hero { transition: none; will-change: auto; }
  .menu a::after,
  .card__plate,
  .card__name,
  .button,
  .top { transition: none; }
  .button::after { display: none; }
}
