:root {
  --bg: #0b0913;
  --bg-alt: #120f1f;
  --card: #161327;
  --text: #edecf8;
  --text-soft: #a9a4c7;
  --text-faint: #6e6890;
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --accent-3: #60a5fa;
  --accent-soft: #1c1938;
  --border: #272244;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --glow: 0 10px 34px rgba(124, 58, 237, 0.28);
  --gradient: linear-gradient(110deg, #60a5fa, #818cf8, #a78bfa, #c084fc, #818cf8, #60a5fa);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-2);
  color: #0b0913;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px;
}

code, .code-block {
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
}

/* ---------- Shimmer gradient text ---------- */
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-text {
  background: var(--gradient);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .gradient-text { animation: none; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 9, 19, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  letter-spacing: 0.04em;
  background: var(--gradient);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}

.logo-cursor {
  color: var(--accent-2);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav a:hover { color: var(--accent-2); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 88px;
}

/* Переливающееся «северное сияние» на фоне hero */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.hero::before {
  width: 540px;
  height: 540px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  top: -170px;
  right: -120px;
  animation: drift-a 14s ease-in-out infinite alternate;
}

.hero::after {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #2563eb 0%, transparent 70%);
  bottom: -190px;
  left: -130px;
  animation: drift-b 18s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-70px, 50px) scale(1.15); }
}

@keyframes drift-b {
  from { transform: translate(0, 0) scale(1.1); }
  to   { transform: translate(80px, -40px) scale(0.95); }
}

.hero .container { position: relative; z-index: 1; }

.hero-kicker {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid #353063;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero-hello {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.accent {
  background: var(--gradient);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}

.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero-sub {
  max-width: 640px;
  font-size: 1.1rem;
  color: var(--text-soft);
  margin-bottom: 36px;
}

.hero-sub strong { color: var(--text); }

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--gradient);
  background-size: 250% 100%;
  color: #0b0913;
  font-weight: 700;
  animation: shimmer 6s linear infinite;
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(124, 58, 237, 0.6);
}

.btn-ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent-2);
  box-shadow: var(--glow);
}

.hero-stats {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.stat { display: flex; flex-direction: column; }

.stat-num {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* ---------- Sections ---------- */
.section { padding: 88px 0; }

.section-muted {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}

.section-title::before {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.55);
  margin-bottom: 18px;
}

.contacts-inner .section-title::before { margin-left: auto; margin-right: auto; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: start;
}

.about-text p { margin-bottom: 18px; color: var(--text-soft); }
.about-text strong { color: var(--text); }

.about-skills {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.about-skills:hover {
  border-color: transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(120deg, var(--accent-3), var(--accent-2), #c084fc, var(--accent-3)) border-box;
  background-size: 100% 100%, 300% 100%;
  animation: shimmer 5s linear infinite;
  box-shadow: var(--glow);
}

.about-skills h3 {
  font-size: 1rem;
  margin-bottom: 16px;
}

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

.skills-list li {
  position: relative;
  padding: 8px 0 8px 22px;
  font-size: 0.92rem;
  color: var(--text-soft);
  border-bottom: 1px dashed var(--border);
}

.skills-list li:last-child { border-bottom: none; }

.skills-list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent-2);
}

/* ---------- Projects ---------- */
.project {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project:last-child { margin-bottom: 0; }

.project:hover {
  border-color: transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(120deg, var(--accent-3), var(--accent-2), #c084fc, var(--accent-3)) border-box;
  background-size: 100% 100%, 300% 100%;
  animation: shimmer 5s linear infinite;
  box-shadow: var(--glow);
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.project-tag {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  margin-bottom: 10px;
}

.project-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.project-tagline { color: var(--text-soft); max-width: 560px; }

.project-status {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6ee7b7;
  background: #0f2a22;
  border: 1px solid #145243;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.project-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.project-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.project-col h4:not(:first-child) { margin-top: 22px; }

.project-col p { font-size: 0.95rem; color: var(--text-soft); }

.project-col code {
  font-size: 0.85em;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--accent-3);
}

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

.feature-list li {
  position: relative;
  padding: 6px 0 6px 22px;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-2);
  font-weight: 700;
}

.feature-list strong { color: var(--text); }

.code-block {
  margin-top: 14px;
  background: #08060f;
  color: #d8ccff;
  padding: 18px 20px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  border: 1px solid #322b52;
  box-shadow: inset 0 0 44px rgba(124, 58, 237, 0.18);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.chip {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-soft);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.chip:hover {
  color: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
}

/* ---------- Install ---------- */
.install-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.install-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.install-card:hover {
  transform: translateY(-3px);
  border-color: transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(120deg, var(--accent-3), var(--accent-2), #c084fc, var(--accent-3)) border-box;
  background-size: 100% 100%, 300% 100%;
  animation: shimmer 5s linear infinite;
  box-shadow: var(--glow);
}

.install-step {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--gradient);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}

.install-card h3 {
  font-size: 1.15rem;
  margin: 10px 0 12px;
}

.install-card p { font-size: 0.92rem; color: var(--text-soft); }

.install-card code {
  font-size: 0.85em;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--accent-3);
}

/* ---------- Contacts ---------- */
.contacts-inner { text-align: center; }
.contacts-inner .section-title { margin-bottom: 16px; }

.contacts-sub {
  color: var(--text-soft);
  max-width: 520px;
  margin: 0 auto 44px;
}

.contacts-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 210px;
  padding: 26px 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-3px);
  border-color: transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(120deg, var(--accent-3), var(--accent-2), #c084fc, var(--accent-3)) border-box;
  background-size: 100% 100%, 300% 100%;
  animation: shimmer 5s linear infinite;
  box-shadow: var(--glow);
}

.contact-icon { font-size: 1.6rem; margin-bottom: 6px; }
.contact-name { font-weight: 600; }
.contact-handle { font-size: 0.82rem; color: var(--text-soft); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .logo-cursor { animation: none; }
  .hero::before, .hero::after { animation: none; }
  .btn-primary, .project:hover, .install-card:hover, .contact-card:hover, .about-skills:hover {
    animation: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid,
  .project-body { grid-template-columns: 1fr; }

  .install-grid { grid-template-columns: 1fr; }

  .nav { display: none; }

  .hero { padding: 64px 0 56px; }
  .section { padding: 64px 0; }

  .project { padding: 26px; }

  .project-head { flex-direction: column; }

  .hero-stats { gap: 32px; }
}
