html { scroll-behavior: smooth; }

:root {
  --bg-light: #f7f5ff;
  --bg-dark: #121212;
  --text-light: #111;
  --text-dark: #f5f5f5;
  --accent: #b29add;
}

body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  background: var(--bg-light);
  color: var(--text-light);
  transition: background 0.3s, color 0.3s;
}

/* Тёмная тема */
body.dark {
  background: var(--bg-dark);
  color: var(--text-dark);
}

/* === HEADER === */
header {
  background-image: url("https://kazan.art-fresco.ru/upload/webp/iblock/054/gx19ga0ga9o2uj4mc27c10fueyf2sndw.webp");
  background-size: cover;
  padding: 20px;
  position: sticky;
  top: 0;
  z-index: 999;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 25px;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.3s;
}

.nav-menu a:hover {
  opacity: 0.7;
}

#theme-toggle {
  border-radius: 5px;
}

/* === HAMBURGER === */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.bar {
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 5px;
}

/* === GREETING SECTION === */
.greeting-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 20vh; 
  text-align: center;
  background: linear-gradient(135deg, #efe9ff, #e5d5fd, #ddcbfd);
  color: #333;
  transition: background 0.3s;
}

body.dark .greeting-section {
  background: linear-gradient(135deg, #1a1a1a, #2d2246, #3c2f58);
  color: var(--text-dark);
}

.greeting-text {
  font-size: 2rem;
  margin-bottom: 25px;
  font-weight: 600;
}

#askName {
  background: var(--accent);
  color: white;
  font-size: 1.1rem;
  padding: 12px 28px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 6px 15px rgba(178, 154, 221, 0.4);
  transition: all 0.3s ease;
}

#askName:hover {
  background: #946bdf;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(148, 107, 223, 0.4);
}

#askName:active {
  transform: scale(0.97);
}

/* === INTRO === */
#intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: 60px auto;
  gap: 30px;
  flex-wrap: wrap;
}

#intro-text {
  flex: 1;
  min-width: 280px;
}
#intro-image img {
  max-width: 350px;
  border-radius: 15px;
}

#intro a {
  display: inline-block;
  padding: 10px 20px;
  margin-top: 15px;
  background: black;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
}

/* === ABOUT === */
#about {
  padding: 80px 10%;
}

.about-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.about-image img {
  width: 300px;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.about-text {
  flex: 1;
  min-width: 280px;
}

.about-text h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.about-text p {
  line-height: 1.6;
  font-size: 1.1rem;
}

/* 📱 Мобильная адаптация */
@media (max-width: 768px) {
  .about-container {
    flex-direction: column;
    text-align: center;
  }

  .about-image img {
    width: 200px;
  }
} 

/* === SKILLS === */
.skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  margin: 20px auto;
}
 
#skills h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
}

.skill-card {
  background: rgb(218, 213, 221);
  border-radius: 10px;
  padding: 20px;
  width: 250px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, background 0.3s, color 0.3s;
  color: var(--text-light);
}

body.dark .skill-card {
  background: #1e1e1e;
  color: var(--text-dark);
}

.skill-card:hover {
  transform: translateY(-5px);
}

.skill-bar {
  background: #eee;
  border-radius: 10px;
  overflow: hidden;
  height: 10px;
  margin-bottom: 8px;
}

body.dark .skill-bar {
  background: #333;
}

.skill-level {
  background: var(--accent);
  height:100%;
}

#projects {
  max-width: 1000px;
  margin: 60px auto;
  padding: 20px;
  border-radius: 12px;
}

#projects h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 28px;
}

#projects .gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  grid-auto-rows: 300px; 
  gap: 20px; 
}

#projects img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.3s;
}

#projects img:hover {
  transform: scale(1.05);
}

#projects figure {
  display: inline-block;
  margin: 10px;
  text-align: center;
}

#projects figcaption {
  display: block;
  margin-top: 5px;
  font-style: italic;
}

footer p {
  text-align: center;
  font-weight: bold;
  font-size: large;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.icon-circle {
  background: var(--accent);
  color: white;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: 0.3s;
  text-decoration: none;
}

.icon-circle:hover {
  transform: scale(1.1);
  background: #946bdf;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  .nav-menu {
    display: none;
    position: absolute;
    right: 20px;
    top: 70px;
    background: rgba(255, 255, 255, 0.95);
    flex-direction: column;
    border-radius: 8px;
    padding: 10px 20px;
  }
  .nav-menu.open {
    display: flex;
  }
  .nav-menu a {
    color: #333;
  }
}

.scroll-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #b29add;
  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-color: #946bdf; }

.scroll-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}