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

:root {
  --primary-color: #2563eb;
  --secondary-color: #64748b;
  --accent-color: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --white: #ffffff;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--white);
}

body.dark {
  background: #121212;
  color: #f2f2f2;
}

/* Header & Navigation */
.header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

body.dark .header {
  background: #1e1e1e;
  border-color: #2a2a2a;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.nav-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.menu a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.3s ease;
  padding: 8px 10px;
  border-radius: 8px;
}

.menu a:hover {
  color: var(--primary-color);
  background: rgba(0,0,0,.06);
}

body.dark .menu a:hover {
  background: rgba(255,255,255,.08);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.greeting-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#greeting {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Buttons */
.btn-primary {
  background: var(--primary-color);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease;
  display: inline-block;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: transparent;
  color: var(--primary-color);
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  font-size: 0.875rem;
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--white);
}

.btn {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--primary-color);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .3s, transform .1s;
}

.btn:hover {
  background: #0056b3;
}

.btn:active {
  transform: translateY(1px);
}

/* Гамбургер */
.hamburger {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #ccc;
  display: none;
  place-items: center;
  background: transparent;
  cursor: pointer;
  transition: border-color .2s ease;
}

.hamburger-bars {
  position: relative;
  width: 20px;
  height: 14px;
}

.bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.bar:nth-child(1) {
  top: 0;
}

.bar:nth-child(2) {
  top: 6px;
}

.bar:nth-child(3) {
  bottom: 0;
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 4rem 0;
  min-height: 80vh;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* About Section */
.about {
  padding: 4rem 0;
  background: var(--accent-color);
  margin: 2rem 0;
  padding: 4rem 0;
}

body.dark .about {
  background: #1a1a1a;
}

.about h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.stat {
  text-align: center;
  padding: 1.5rem;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

body.dark .stat {
  background: #2a2a2a;
}

.stat h3 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Projects Section */
.projects {
  padding: 4rem 0;
}

.projects h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  text-align: center;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark .project-card {
  background: #1e1e1e;
  border-color: #2a2a2a;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.project-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.project-type {
  background: var(--accent-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

body.dark .project-type {
  background: #2a2a2a;
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.project-tech {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.project-tech span {
  background: var(--accent-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

body.dark .project-tech span {
  background: #2a2a2a;
}

/* Contact Section */
.contact {
  padding: 4rem 0;
  background: var(--accent-color);
  margin: 2rem 0;
  padding: 4rem 0;
}

body.dark .contact {
  background: #1a1a1a;
}

.contact h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  text-align: center;
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.contact-info p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-links a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.contact-links a:hover {
  color: #1d4ed8;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  font-family: inherit;
  background: var(--white);
  color: var(--text-primary);
}

body.dark .form-group input,
body.dark .form-group textarea {
  background: #2a2a2a;
  border-color: #3a3a3a;
  color: #f2f2f2;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

body.dark .footer {
  border-color: #2a2a2a;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Тёмная тема */
body.dark .btn {
  background: #2f80ff;
}

body.dark .menu a:hover {
  background: rgba(255,255,255,.08);
}
.scroll-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #0b66ff;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s ease, visibility .25s ease, transform .25s ease;
}

.scroll-top:hover { background: #0853cc; }

.scroll-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
html { scroll-behavior: smooth; }

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .navbar {
    flex-direction: row;
    gap: 1rem;
    text-align: center;
    flex-wrap: wrap;
  }

  .menu {
    display: none;
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: 80px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    flex-direction: column;
    padding: 10px;
    gap: 0.5rem;
    z-index: 1000;
  }

  body.dark .menu {
    background: #1e1e1e;
    border-color: #2a2a2a;
  }

  .menu.open {
    display: flex;
    animation: fadeIn .25s ease forwards;
  }

  .hamburger {
    display: grid;
  }

  .header-controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  .greeting-section {
    flex-direction: column;
    gap: 0.5rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
    padding: 2rem 0;
  }

  .hero-title {
    font-size: 2rem;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-stats {
    flex-direction: row;
    justify-content: space-around;
  }

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

  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about,
  .contact {
    margin: 1rem 0;
    padding: 2rem 0;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }

  .about-stats {
    flex-direction: column;
  }

  .project-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-controls {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}