/* NOSYMPATHY — Zakhar Bazarov portfolio */

/* ---------- Переменные тем ---------- */
:root,
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-2: #121212;
  --fg: #ffffff;
  --fg-2: #d4d4d4;
  --muted: #a0a0a0;
  --line: #1e1e1e;
  --accent: #ffffff;
  --card-bg: #151515;
  --card-hover: #111111;
  --selection-bg: #fff;
  --selection-fg: #000;
  --ease: cubic-bezier(.2,.7,.2,1);
}

:root[data-theme="light"] {
  --bg: #f5f5f5;
  --bg-2: #ffffff;
  --fg: #0a0a0a;
  --fg-2: #333333;
  --muted: #555555;
  --line: #d4d4d4;
  --accent: #0a0a0a;
  --card-bg: #e8e8e8;
  --card-hover: #eaeaea;
  --selection-bg: #0a0a0a;
  --selection-fg: #fff;
}

/* Плавный переход между темами */
html {
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
body, .site-footer, .archive-row, .credits, .project-hero {
  transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html, body {
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block }
a { color: inherit; text-decoration: none }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer }

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

/* ---------- Типографика ---------- */
.display {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: .95;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Лейаут ---------- */
.container { max-width: 1600px; margin: 0 auto; padding: 0 32px }
@media (max-width: 640px) { .container { padding: 0 20px } }

/* ---------- Хедер / Навигация ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 22px 32px;
  display: flex; align-items: center; justify-content: space-between;
  mix-blend-mode: difference;
  color: #fff;
}
.site-header .brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: .12em;
  font-size: 14px;
}
.site-nav ul { display: flex; gap: 28px; list-style: none; align-items: center }

/* --- Переключатели языка и темы --- */
.site-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: 24px;
}
.site-controls button {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 0;
  opacity: .7;
  transition: opacity .3s var(--ease);
}
.site-controls button:hover { opacity: 1 }
.site-nav a {
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  position: relative; padding: 4px 0;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.site-nav a:hover::after, .site-nav a.is-active::after {
  transform: scaleX(1); transform-origin: left;
}

@media (max-width: 640px) {
  .site-header { padding: 18px 20px }
  .site-nav ul { gap: 12px }
  .site-nav a { font-size: 11px }
  .site-controls { margin-left: 10px; gap: 10px }
  .site-controls button { font-size: 10px; padding: 3px 6px }
}

/* ---------- Splash ---------- */
.splash {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 24px;
  position: relative;
}
.splash .logo {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: clamp(48px, 10vw, 140px);
  letter-spacing: -.04em;
  line-height: .9;
  opacity: 0; transform: translateY(12px);
  animation: rise .9s var(--ease) .15s forwards;
}
.splash .tagline {
  margin-top: 18px; color: var(--muted);
  font-size: 12px; letter-spacing: .3em; text-transform: uppercase;
  opacity: 0; animation: fade 1s var(--ease) .6s forwards;
}
.splash .enter {
  margin-top: 56px;
  padding: 14px 28px;
  border: 1px solid #fff;
  font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
  transition: background .4s var(--ease), color .4s var(--ease), transform .4s var(--ease);
  opacity: 0; animation: fade 1s var(--ease) .9s forwards;
}
.splash .enter { border-color: var(--fg) }
.splash .enter:hover { background: var(--fg); color: var(--bg) }
.splash .foot {
  position: absolute; bottom: 24px; left: 0; right: 0;
  display: flex; justify-content: space-between;
  padding: 0 32px; font-size: 11px; color: var(--muted);
  letter-spacing: .18em; text-transform: uppercase;
  opacity: 0; animation: fade 1s var(--ease) 1.1s forwards;
}
@media (max-width: 640px) { .splash .foot { padding: 0 20px; font-size: 10px } }

@keyframes rise { to { opacity: 1; transform: none } }
@keyframes fade { to { opacity: 1 } }

/* ---------- Оболочка страницы ---------- */
.page { padding: 140px 0 120px }
.page-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(44px, 8vw, 120px);
  font-weight: 600; letter-spacing: -.03em; line-height: .9;
  margin-bottom: 60px;
}
.page-intro { color: var(--muted); max-width: 620px; font-size: 16px; margin-bottom: 60px }

/* ---------- Лоадер ---------- */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 0;
}
.loader-pulse {
  width: 40px;
  height: 40px;
  border: 2px solid var(--line);
  border-top-color: var(--fg);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- Сетка работ ---------- */
.work-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px 32px;
}
@media (max-width: 820px) { .work-grid { grid-template-columns: 1fr; gap: 40px } }

.project-card { display: block; position: relative; overflow: hidden }
.project-card .thumb {
  position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--card-bg);
}
.project-card .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.65));
  opacity: .55; transition: opacity .6s var(--ease);
}
.project-card .thumb img, .project-card .thumb .ph {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.02);
  transition: transform 1s var(--ease), filter 1s var(--ease);
  filter: grayscale(20%);
}
.project-card:hover .thumb img, .project-card:hover .thumb .ph {
  transform: scale(1.08); filter: none;
}
.project-card:hover .thumb::after { opacity: .3 }

.project-card .ph {
  display: flex; align-items: center; justify-content: center;
  font-family: "Space Grotesk", sans-serif; font-size: 72px; letter-spacing: -.04em;
  color: var(--line);
  background: radial-gradient(circle at 30% 30%, var(--bg-2), var(--bg) 70%);
}

.project-card .meta {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 18px; gap: 16px;
}
.project-card .meta h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px; font-weight: 500; letter-spacing: -.01em;
}
.project-card .meta .cat {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}

/* --- Reveal on scroll --- */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in { opacity: 1; transform: none }

/* ---------- Страница проекта ---------- */
.project-hero {
  width: 100%; aspect-ratio: 16/9; background: #000;
  margin-bottom: 48px; position: relative; overflow: hidden;
}
.project-hero iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.project-meta {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 60px; margin-top: 40px;
}
@media (max-width: 820px) { .project-meta { grid-template-columns: 1fr; gap: 32px } }
.project-meta h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(36px, 5vw, 72px); font-weight: 600; letter-spacing: -.02em; line-height: 1;
}
.project-meta .desc { color: var(--fg-2); font-size: 17px; margin-top: 18px; max-width: 60ch }
.credits { border-top: 1px solid var(--line); padding-top: 22px }
.credits dt {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-top: 14px;
}
.credits dd { font-size: 15px; margin-top: 4px }
.back-link {
  display: inline-block; margin-top: 60px;
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  border-bottom: 1px solid #444; padding-bottom: 4px;
}
.back-link:hover { border-color: var(--fg) }

/* ---------- Архив ---------- */
.archive-list { border-top: 1px solid var(--line); margin-top: 20px }
.archive-row {
  display: grid; grid-template-columns: 60px 1fr 160px 120px;
  gap: 20px; align-items: center;
  padding: 22px 4px; border-bottom: 1px solid var(--line);
  transition: background .4s var(--ease), padding .4s var(--ease);
}
.archive-row:hover { background: var(--card-hover); padding-left: 18px }
.archive-row .num { color: var(--muted); font-size: 12px; letter-spacing: .2em }
.archive-row .title {
  font-family: "Space Grotesk", sans-serif; font-size: 22px; font-weight: 500;
}
.archive-row .cat {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.archive-row .year { font-size: 14px; color: var(--muted); text-align: right }
@media (max-width: 820px) {
  .archive-row { grid-template-columns: 40px 1fr 70px; gap: 12px }
  .archive-row .cat { display: none }
  .archive-row .title { font-size: 17px }
}

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: .9fr 1.2fr; gap: 80px; align-items: start }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; gap: 40px } }
.about .portrait {
  aspect-ratio: 4/5; background: var(--card-bg); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: #222;
  font-family: "Space Grotesk", sans-serif; font-size: 80px; letter-spacing: -.04em;
}
.about .bio p { color: var(--fg-2); font-size: 17px; margin-bottom: 18px; max-width: 58ch }
.about h3 {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); margin: 40px 0 14px;
}
.about ul { list-style: none; columns: 2; column-gap: 32px }
.about ul li { padding: 6px 0; font-size: 15px }
.about .contact a {
  display: block; font-size: 18px; margin: 6px 0;
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.about .contact a:hover { border-color: var(--fg) }

/* ---------- Футер ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 32px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
@media (max-width: 640px) {
  .site-footer { padding: 22px 20px; flex-direction: column; gap: 10px; text-align: center }
}

/* ---------- Кастомный курсор ---------- */
@media (hover: hover) and (pointer: fine) {
  body.has-cursor { cursor: none }
  body.has-cursor a, body.has-cursor button { cursor: none }
  .cursor-dot {
    position: fixed; top: 0; left: 0; width: 8px; height: 8px; border-radius: 50%;
    background: #fff; pointer-events: none; z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform .2s var(--ease), width .3s var(--ease), height .3s var(--ease), background .3s var(--ease);
    mix-blend-mode: difference;
  }
  .cursor-dot.hover { width: 36px; height: 36px; background: #fff }
}
