:root {
  --bg: #0a0a0f;
  --bg-soft: #12121b;
  --card: #15151f;
  --card-border: #24243200;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8e8f0;
  --muted: #9a9ab0;
  --accent: #7c5cff;
  --accent-2: #00e5ff;
  --accent-3: #ff4d8a;
  --glow: rgba(124, 92, 255, 0.45);
  --radius: 18px;
  --maxw: 1080px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- фоновые эффекты ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 70%);
  z-index: -2;
  opacity: 0.5;
}
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.5;
  pointer-events: none;
}
.bg-glow--1 {
  width: 520px; height: 520px;
  background: var(--accent);
  top: -160px; left: -120px;
}
.bg-glow--2 {
  width: 460px; height: 460px;
  background: var(--accent-2);
  top: 30%; right: -160px;
}

/* ---------- навигация ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
  backdrop-filter: blur(10px);
}
.nav__logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -1px;
}
.nav__logo span { color: var(--accent-2); }
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav__links a:hover { color: var(--text); }

/* ---------- общие секции ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.section { padding: 80px 0 20px; }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  margin-bottom: 36px;
}
.section__num {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-2);
  font-size: 15px;
  font-weight: 600;
}
.section__title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -1px;
}

/* ---------- герой ---------- */
.hero { padding: 70px 0 30px; text-align: center; }
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 26px;
}
.hero__badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2ee6a0;
  box-shadow: 0 0 10px #2ee6a0;
  animation: pulse 1.8s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero__title {
  font-size: clamp(40px, 8vw, 76px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -2.5px;
  margin-bottom: 16px;
}
.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__role {
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--text);
  font-weight: 600;
  margin-bottom: 18px;
}
.hero__bio {
  max-width: 600px;
  margin: 0 auto 30px;
  color: var(--muted);
  font-size: 17px;
}
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 44px; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 26px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.25s;
}
.btn--primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 30px var(--glow);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px var(--glow); }
.btn--ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
.btn--ghost:hover { border-color: var(--accent-2); color: var(--accent-2); }

.stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  list-style: none;
}
.stack li {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--muted);
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s;
}
.stack li:hover { color: var(--accent-2); border-color: var(--accent-2); }

/* ---------- обо мне ---------- */
.about {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.about p { color: var(--muted); font-size: 17px; }
.about__facts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.about__facts li {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  font-size: 15px;
  color: var(--muted);
}
.about__facts b { color: var(--text); font-weight: 800; }

/* ---------- проекты ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.card__body { text-align: left; }
.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 92, 255, 0.5);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(124, 92, 255, 0.25);
}
.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: radial-gradient(circle at 50% 0%, #1d1d2e, #0c0c14 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}
.card__media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.card__placeholder {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--muted);
}
.card__media.is-empty img { display: none; }
.card__media.is-empty .card__placeholder { display: flex; }

.card__body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__tagrow { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid var(--line);
}
.tag--accent {
  background: rgba(124, 92, 255, 0.15);
  color: #b6a6ff;
  border-color: rgba(124, 92, 255, 0.4);
}
.card__title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.card__desc { color: var(--muted); font-size: 15px; }
.card__why { color: var(--muted); font-size: 14px; }
.card__why b, .card__desc b { color: var(--text); }
.card code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent-2);
  padding: 1px 6px;
  border-radius: 5px;
}
.card__links { display: flex; gap: 18px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.link {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: opacity 0.2s;
}
.link:hover { opacity: 0.7; }

/* ---------- лендинги (галерея) ---------- */
.section__lead { text-align: center; color: var(--muted); font-size: 16px; margin: -20px 0 28px; }

.gallery { position: relative; }
.gallery__track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 6px 4px 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.gallery__track::-webkit-scrollbar { height: 8px; }
.gallery__track::-webkit-scrollbar-thumb { background: rgba(124, 92, 255, 0.5); border-radius: 10px; }
.gallery__track::-webkit-scrollbar-track { background: transparent; }

.landing {
  flex: 0 0 340px;
  max-width: 340px;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.landing:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 229, 255, 0.2);
}
.landing__media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #1a1a28, #0e0e16);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.landing__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 4s ease;
}
.landing:hover .landing__media img { transform: translateY(calc(-100% + 212px)); }
.landing__media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--muted);
}
.landing__body { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.landing__title { font-size: 19px; font-weight: 800; letter-spacing: -0.5px; }
.landing__desc { color: var(--muted); font-size: 14px; }
.landing__link { color: var(--accent-2); font-weight: 600; font-size: 14px; margin-top: 4px; }

.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(20, 20, 30, 0.85);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.gallery__nav:hover { border-color: var(--accent-2); color: var(--accent-2); }
.gallery__nav--prev { left: -8px; }
.gallery__nav--next { right: -8px; }
@media (max-width: 760px) {
  .gallery__nav { display: none; }
  .landing { flex-basis: 80vw; max-width: 80vw; }
}

/* ---------- контакты ---------- */
.contact__lead { color: var(--muted); font-size: 18px; margin-bottom: 24px; text-align: center; }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.social {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}
.social:hover {
  border-color: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.15);
}
.social__ico { font-size: 18px; }

/* ---------- футер ---------- */
.footer {
  max-width: var(--maxw);
  margin: 60px auto 0;
  padding: 30px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ---------- адаптив ---------- */
@media (max-width: 920px) {
  .projects { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .nav__links { gap: 18px; }
  .nav__links a { font-size: 14px; }
  .projects { grid-template-columns: 1fr; }
  .about__facts { grid-template-columns: 1fr; }
}

/* появление при скролле */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
