@font-face { font-family: "Unbounded"; src: url("fonts/Unbounded.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --black: #000000;
  --white: #FFFFFF;
  --text: #FAFAFA;
  --muted: #A1A1AA;
  --line: #27272A;
  --display: "Unbounded", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; background: var(--black); scrollbar-width: thin; scrollbar-color: #3F3F46 var(--black); }
body {
  margin: 0; min-height: 100vh;
  background: var(--black); color: var(--text);
  font: 400 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--white); color: var(--black); }
h1, h2 { margin: 0; }
a { color: var(--text); }
:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; border-radius: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Вход: профиль и список проявляются по очереди */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.rise { animation: rise .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); }

/* Курсор-кольцо (fx.js) */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none;
  width: 24px; height: 24px; border: 1.5px solid #fff; border-radius: 50%;
  mix-blend-mode: difference; opacity: 0;
  transition: width .25s var(--ease), height .25s var(--ease), background-color .2s, opacity .2s;
}
.cursor.on { opacity: 1; }
.cursor.hot { width: 56px; height: 56px; border-width: 2px; }

/* Кнопка: белая, на чёрном */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--white); color: var(--black); text-decoration: none;
  font: 700 16px/1 Inter, system-ui, sans-serif;
  transition: box-shadow .25s, background-color .2s, color .2s, transform .2s var(--ease);
}
.btn svg { transition: transform .25s var(--ease); }
.btn:hover { box-shadow: 0 0 0 6px rgba(255,255,255,.18); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(.97); }
.btn-lg { min-height: 60px; padding: 0 36px; font-size: 20px; }

/* ───────── Главная ───────── */
.home::before {                  /* мягкий белый свет за курсором */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 170px), rgba(255,255,255,.07), transparent 70%);
}
.grid {                          /* сетка точек проступает только возле курсора */
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,.6) 1px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(300px circle at var(--mx, 50%) var(--my, 170px), #000, transparent);
  mask-image: radial-gradient(300px circle at var(--mx, 50%) var(--my, 170px), #000, transparent);
}
.home::after {                   /* зерно: глубина на чистом чёрном */
  content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background-image: var(--grain); opacity: .06;
}
.page {
  position: relative; z-index: 1; max-width: 720px; min-height: 100vh; margin: 0 auto;
  display: flex; flex-direction: column; padding: 96px 24px 32px;
}
.profile { display: flex; flex-direction: column; align-items: center; text-align: center; }
.avatar-ring {
  position: relative; isolation: isolate;
  width: 160px; height: 160px; padding: 3px; border-radius: 50%;
  background: conic-gradient(from var(--a), #fff, #000 24%, #71717A 46%, #000 72%, #fff);
  animation: spin 7s linear infinite, rise .8s var(--ease) both;
}
.avatar-ring::before {
  content: ""; position: absolute; inset: -16px; z-index: -1; border-radius: 50%;
  background: inherit; filter: blur(30px); opacity: .28;
}
@keyframes spin { to { --a: 360deg; } }
.avatar {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; background: var(--line); border: 6px solid var(--black);
}
.profile h1 {
  margin-top: 32px;
  font: 800 clamp(44px, 11vw, 84px)/1 var(--display); letter-spacing: -.04em; overflow-wrap: anywhere;
}
.socials { display: flex; gap: 24px; margin: 32px 0 0; padding: 0; list-style: none; }
.socials a { position: relative; display: block; line-height: 0; border-radius: 14px; transition: transform .25s var(--ease); }
.socials a:hover { transform: translateY(-4px); }
.socials img { display: block; width: 48px; height: 48px; object-fit: contain; }
.socials a::after {              /* подпись-подсказка */
  content: attr(data-label);
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translate(-50%, -4px);
  padding: 6px 10px; border-radius: 999px; background: var(--white); color: var(--black);
  font: 600 12px/1 Inter, sans-serif; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .2s, transform .25s var(--ease);
}
.socials a:hover::after, .socials a:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

.section-title {
  display: flex; align-items: center; gap: 16px;
  margin: 112px 0 24px;
  font-size: 14px; font-weight: 700; letter-spacing: .14em; color: var(--muted);
}
.section-title::after { content: ""; order: 1; flex: 1; height: 1px; background: var(--line); }
.count {
  order: 2; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); font-size: 12px; letter-spacing: 0; font-variant-numeric: tabular-nums;
}

.projects { margin: 0; padding: 0; list-style: none; }
.project {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 -24px; padding: 36px 24px;
  border-top: 1px solid var(--line);
  transition: background-color .25s, color .25s;
}
.project:last-child { border-bottom: 1px solid var(--line); }
.project:hover, .project:focus-within { background: var(--white); color: var(--black); }   /* строка инвертируется */
.project-name, .project .btn { position: relative; z-index: 2; }
.project-name {
  min-width: 0; font: 700 clamp(20px, 4.2vw, 30px)/1.15 var(--display); letter-spacing: -.02em;
  overflow-wrap: anywhere; transition: transform .45s var(--ease);
}
.project:hover .project-name { transform: translateX(8px); }
.shot {                          /* скриншот-«открытка» слева от кнопки */
  position: absolute; z-index: 1; right: 196px; top: 50%;
  width: 132px; height: 74px; object-fit: cover; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(-50%) rotate(-6deg) scale(.88);
  transition: opacity .3s, transform .5s var(--ease);
}
.project:hover .shot, .project:focus-within .shot { opacity: 1; transform: translateY(-50%) rotate(-3deg) scale(1); }
.project .btn { flex: none; }
.project .btn::after { content: ""; position: absolute; inset: -200px -2000px; }   /* вся строка кликабельна */
.project .btn:active { transform: none; }
.project .btn:focus-visible { outline: none; }
.project:has(.btn:focus-visible) { outline: 3px solid var(--white); outline-offset: -3px; }
.project:hover .btn, .project:focus-within .btn { background: var(--black); color: var(--white); box-shadow: none; }
.empty { color: var(--muted); }

.foot {
  margin-top: auto; padding-top: 96px;
  display: flex; justify-content: space-between; gap: 16px;
  color: var(--muted); font-size: 13px;
}
.clock time { color: var(--text); font-variant-numeric: tabular-nums; }

/* ───────── Страница проекта ───────── */
.stage { position: fixed; inset: 0; background: var(--black); overflow: hidden; }
@keyframes drift { from { transform: scale(1.04); } to { transform: scale(1.13) translate(-1.5%, -1%); } }
.backdrop {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  animation: drift 26s ease-in-out infinite alternate;
}
.frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.bar {                           /* полоска загрузки проекта */
  position: absolute; top: 0; left: 0; z-index: 3; width: 0; height: 3px; background: var(--white);
}
.bar.run { width: 85%; transition: width 8s cubic-bezier(.1, .7, .2, 1); }
.bar.done { width: 100%; opacity: 0; transition: width .3s, opacity .5s .2s; }

.intro {
  position: absolute; inset: 0; display: flex; align-items: center;
  padding: 64px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.96) 0%, rgba(0,0,0,.72) 42%, rgba(0,0,0,.38) 100%),
    radial-gradient(120% 90% at 100% 100%, transparent 45%, rgba(0,0,0,.65) 100%);
  transition: opacity .35s;
}
.intro::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: var(--grain); opacity: .07; }
.intro.is-hidden { opacity: 0; pointer-events: none; }
.intro-body {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 32px; max-width: 880px;
  transition: transform .35s var(--ease);
}
.intro.is-hidden .intro-body { transform: translateX(-28px); }
.intro h1 { font: 800 clamp(34px, 7vw, 80px)/1.02 var(--display); letter-spacing: -.04em; overflow-wrap: anywhere; }
.actions { display: flex; align-items: center; gap: 16px; }
.hint {
  display: none; padding: 6px 10px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06);
  color: var(--muted); font: 600 12px/1 Inter, sans-serif;
}
@media (pointer: fine) { .hint { display: inline-block; } }
.back {
  position: absolute; top: 24px; left: 32px; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px 10px 12px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background-color .2s;
}
.back:hover { background: rgba(255,255,255,.18); }
.meta {
  position: absolute; left: 64px; right: 64px; bottom: 28px;
  display: flex; justify-content: space-between; gap: 16px;
  color: var(--muted); font-size: 13px; font-weight: 500;
}
.meta-r { display: flex; align-items: center; gap: 20px; font-variant-numeric: tabular-nums; }
.meta a { display: inline-flex; align-items: center; gap: 4px; color: var(--text); text-decoration: none; }
.meta a:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 600px) {
  .page { padding: 64px 16px 24px; }
  .project { margin: 0 -16px; padding: 28px 16px; }
  .shot { display: none; }
  .intro { padding: 24px; }
  .back { left: 16px; top: 16px; }
  .meta { left: 24px; right: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
