:root {
  --bg: #fafafa;
  --text: #222;
  --muted: #666;
  --accent: #2563eb;
  --border: #e5e7eb;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

header {
  text-align: center;
  padding: 100px 20px 60px;
}
header h1 {
  font-size: 2.8em;
  font-weight: 700;
}
header p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1.2em;
}

nav {
  position: sticky;
  top: 0;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 100;
}
nav a {
  color: var(--text);
  padding: 14px 20px;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color 0.2s;
}
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 0%;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
nav a:hover::after,
nav a.active::after {
  width: 100%;
}
nav a.active {
  color: var(--accent);
}

a {
  color: #4f46e5;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #3730a3;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

section {
  margin-bottom: 80px;
  scroll-margin-top: 90px;
}
section h2 {
  text-align: center;
  color: var(--accent);
  font-size: 1.8em;
  margin-bottom: 25px;
}
section p {
  text-align: center;
  color: var(--muted);
  max-width: 700px;
  margin: 0 auto;
}

.skills-group {
  margin-bottom: 40px;
}

.skills-group h3 {
  text-align: center;
  color: var(--accent);
  margin-bottom: 20px;
  font-size: 1.4em;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.skill-pill {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 50px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 500;
  color: var(--text);
  transition: all 0.3s ease;
  cursor: default;
}

.skill-pill:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 25px;
  margin-bottom: 400px;
}
.socials a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  transition: all 0.2s ease;
  font-weight: 500;
}
.socials a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.socials svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

footer {
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 40px 20px;
  font-size: 0.9em;
}

#scrollTopBtn {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 20px;
  transition: transform 0.2s;
}
#scrollTopBtn:hover {
  transform: translateY(-3px);
}

@media (max-width: 600px) {
  header h1 { font-size: 2.2em; }
  .skills { grid-template-columns: 1fr 1fr; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #60a5fa;
    --border: #1e293b;
  }

  body {
    background: var(--bg);
    color: var(--text);
  }

  header p {
    color: var(--muted);
  }

  nav {
    background: #1e293b;
    border-bottom: 1px solid var(--border);
  }
  nav a {
    color: var(--text);
  }
  nav a.active {
    color: var(--accent);
  }

  a {
    color: #93c5fd; /* светло-синий для контраста */
  }

  a:hover {
    color: #3b82f6; /* более яркий синий при наведении */
  }

  .skills div {
    background: #1e293b;
    border-color: var(--border);
  }
  .skills div:hover {
    background: #334155;
    border-color: var(--accent);
  }

  .socials a {
    background: #1e293b;
    border-color: var(--border);
    color: var(--text);
  }
  .socials a:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  footer {
    background: #1e293b;
    border-top: 1px solid var(--border);
    color: var(--muted);
  }

  #scrollTopBtn {
    background: var(--accent);
    color: #fff;
  }
}