* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #08080f;
  --bg-secondary: #0f0f1a;
  --bg-card: #151527;
  --text-primary: #ffffff;
  --text-secondary: #dfdfdf;
  --accent-orange: #f97316;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  cursor: default;
}

a, button, .btn-connect, .scroll-top-btn, .burger {
  cursor: pointer;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

/* ========== HEADER & NAV ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #08080f;
  border-bottom: 1px solid #ffffff1a;
  z-index: 1000;
}

.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1px;
  width: 0%;
  background: #ffffff;
  z-index: 1;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s, letter-spacing 0.3s;
}

@media (hover: hover) {
  .logo:hover {
    color: #9d72ff;
    letter-spacing: 2px;
  }
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  position: relative; 
  text-decoration: none;
  font-weight: 500;
  color: #ffffff;
  opacity: 0.8;
  font-size: 0.95rem;
}

.nav-links a:hover {
  opacity: 1;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #ffffff;
  transition: width 0.2s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Бургер */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.5rem;
  z-index: 100;
}

.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
}

.burger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ========== HERO ========== */
.hero {
  padding: 8rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-image-wrapper {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 1700 / 2560;
  max-width: 380px;
  width: 100%;
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-text-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.5rem 1.5rem;
  background: linear-gradient(to top, #08080f, transparent);
  color: white;
  z-index: 1;
}

.hero-text-overlay .greeting {
  font-size: 1.1rem;
  opacity: 0.95;
  margin-bottom: 0.2rem;
}

.hero-text-overlay .name {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero-text-overlay .role {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.25rem 0 0.75rem;
  color: var(--accent-orange);
}

/* ========== КНОПКИ ========== */
.btn-connect {
  display: inline-block;
  background: #ffffff;
  color: #08080f;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 100px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}

.btn-connect:hover {
  background: #8b5cf6;
  color: #ffffff;
}

.resume-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--accent-orange);
  text-decoration: none;
  border-bottom: 2px solid var(--accent-orange);
  padding-bottom: 4px;
  width: fit-content;
  transition: all 0.2s;
}

.resume-link:hover {
  color: #fb923c;
  border-color: #fb923c;
  gap: 0.8rem;
}

/* ========== HERO CONTENT ========== */
.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.2;
}

.hero-content .subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 500px;
  line-height: 1.6;
}

/* ========== SECTIONS ========== */
section {
  padding: 2rem 0 3.5rem;
}

section:nth-child(even) {
  background: var(--bg-secondary);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.about-text {
  font-size: 1.15rem;
  max-width: 700px;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.projects-stats {
  display: flex;
  gap: 4rem;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--accent-orange);
  line-height: 1;
}

.stat-label {
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-size: 1.15rem;
}

/* ========== КАРТОЧКИ ПОРТФОЛИО ========== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.project-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid #ffffff14;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #9d72ff 0%, #87b4ff 100%);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: 20px 20px 0 0;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: #8b5cf666;
}

.project-card:hover::before {
  opacity: 1;
}

.project-card h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-card:hover h3 {
  background: linear-gradient(135deg, #9d72ff 0%, #87b4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.project-tag {
  display: block;
  width: fit-content;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-orange);
  background: #f9731526;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  border: 1px solid #f973164d;
  transition: background 0.3s, border-color 0.3s;
}

.project-card:hover .project-tag {
  background: #f9731540;
  border-color: #f9731580;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ========== КАРТОЧКИ УСЛУГ ========== */
.services-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.service-item {
  position: relative;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid #ffffff14;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.service-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: linear-gradient(180deg, #9d72ff 0%, #87b4ff 100%);
  transition: height 0.3s ease;
}

.service-item:hover {
  border-color: #8b5cf666;
  transform: translateY(-3px);
}

.service-item:hover::before {
  height: 100%;
}

.service-item h4 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.service-item:hover h4 {
  background: linear-gradient(135deg, #9d72ff 0%, #87b4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.service-item p {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========== CONTACTS ========== */
.contact-block {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #ffffff1a;
}

.contact-info p {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  color: var(--text-secondary);
}

.contact-info strong {
  color: #ffffff;
  font-size: 1.3rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}

.contact-links a {
  color: #a1a1a1;
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
  display: flex;
}

.contact-links a svg {
  width: 44px;
  height: 44px;
}

.contact-links a:hover {
  color: #ffffff;
  transform: translateY(-2px);
}

/* ========== FOOTER ========== */
.footer {
  border-top: 1px solid #ffffff1a;
  padding: 2rem 6rem;
  text-align: center;
  color: #808090;
  font-size: 0.9rem;
  background: var(--bg-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ========== SCROLL TO TOP ========== */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: #434343;
  border: none;
  border-radius: 35%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background 0.2s;
  z-index: 40;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top-btn:hover {
  background: #6d67e6;
}

.scroll-top-btn svg path {
  fill: #ffffff;
}

/* ========== MOBILE ========== */
@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }

  .nav-bar {
    padding: 0.7rem;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: 280px;
    max-width: 100vw;
    background: #08080f;
    flex-direction: column;
    padding: 3rem 2rem 2rem;
    box-shadow: -5px 0 30px #00000080;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    gap: 2rem;
    border-left: 1px solid #ffffff1a;
    z-index: 99;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .burger {
    display: flex;
  }

  .hero {
    padding: 6rem 0 3rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-image-wrapper {
    max-width: 280px;
    margin: 0 auto;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .contact-block {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    gap: 1.5rem;
  }

  .contact-links {
    gap: unset;
  }

  .contact-links a {
    padding: 0.5rem 0.8rem;
  }

  .contact-links a svg {
    width: 40px;
    height: 40px;
  }

  .contact-info p {
    font-size: 1rem;
    word-break: break-all;
  }

  .projects-stats {
    gap: 2rem;
    flex-direction: column;
  }

  .footer {
    flex-direction: column;
    gap: 20px;
  }
}