/* Базовые стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

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

/* =========================
   HEADER + NAV
========================= */

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

header nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap; /* чтобы на узком экране не ломалось */
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2563eb;
  text-decoration: none;
}

nav a {
  margin-left: 2rem;
  text-decoration: none;
  color: #555;
  transition: color 0.3s;
}

nav a:hover,
nav a.active {
  color: #2563eb;
}

/* =========================
   LANGUAGE SWITCH (RU/EN)
========================= */

header nav .lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
}

header nav .lang-switch .lang {
  text-decoration: none;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, .35);
  color: inherit;
  opacity: .75;
}

header nav .lang-switch .lang:hover {
  opacity: 1;
}

header nav .lang-switch .active-lang {
  opacity: 1;
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

@media (max-width: 768px) {
  header nav {
    justify-content: center;
  }
  header nav .lang-switch {
    margin-left: 0;
  }
}

/* =========================
   HERO
========================= */

.hero {
  padding: 4rem 0;
  text-align: center;
}

.avatar {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  margin: 0 auto 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  font-weight: bold;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.tagline {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 3rem;
}

/* =========================
   TERMINAL
========================= */

.terminal {
  max-width: 600px;
  margin: 2rem auto;
  background: #1a1a1a;
  color: #00ff00;
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
}

.terminal-header {
  background: #333;
  padding: 10px 15px;
  display: flex;
  align-items: center;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.terminal .title {
  margin-left: 15px;
  color: #aaa;
  font-size: 0.9rem;
}

.terminal-body {
  padding: 20px;
  font-family: 'Courier New', monospace;
}

.prompt {
  color: #00ff00;
  margin-right: 10px;
}

/* =========================
   SECTIONS
========================= */

section {
  padding: 3rem 0;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #222;
}

.about {
  background: white;
}

/* =========================
   CONTACTS
========================= */

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
}

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

.social-links a {
  display: inline-block;
  padding: 12px 20px;
  background: #fff;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  border: 2px solid #ddd;
  transition: all 0.3s;
}

.social-links a:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.github:hover { border-color: #333; }
.telegram:hover { border-color: #0088cc; }
.email:hover { border-color: #ea4335; }

/* =========================
   FORM
========================= */

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input, textarea {
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
}

button {
  padding: 12px 30px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background: #1d4ed8;
}

/* =========================
   FOOTER
========================= */

footer {
  background: #222;
  color: #fff;
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
}

footer a {
  color: #60a5fa;
  text-decoration: none;
}

.heart {
  color: #ff0000;
  animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* =========================
   THEME TOGGLE (beautiful)
========================= */

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 20px;
  transition: all 0.3s;
  flex: 0 0 auto; /* чтобы кнопка темы не ломала nav */
}

.theme-toggle:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
}

.theme-toggle-inner {
  position: relative;
  width: 60px;
  height: 30px;
  background: #e0e0e0;
  border-radius: 30px;
  transition: background 0.3s;
}

.theme-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.theme-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  transition: opacity 0.3s;
}

.theme-icon.sun {
  left: 8px;
  opacity: 0;
}

.theme-icon.moon {
  right: 8px;
  opacity: 1;
}

.theme-text {
  font-size: 14px;
  color: #666;
}

/* =========================
   DARK THEME
========================= */

body.dark-theme {
  background: #1a1a1a;
  color: #f0f0f0;
}

.dark-theme header {
  background: #222;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.dark-theme nav a {
  color: #ccc;
}

.dark-theme nav a:hover,
.dark-theme nav a.active {
  color: #60a5fa;
}

.dark-theme .about,
.dark-theme .contacts {
  background: #222;
}

.dark-theme .terminal {
  background: #0a0a0a;
  border: 1px solid #333;
}

.dark-theme .terminal-header {
  background: #222;
}

.dark-theme .terminal .title {
  color: #888;
}

.dark-theme form input,
.dark-theme form textarea {
  background: #2a2a2a;
  border-color: #444;
  color: #f0f0f0;
}

.dark-theme form input::placeholder,
.dark-theme form textarea::placeholder {
  color: #888;
}

.dark-theme .social-links a {
  background: #2a2a2a;
  border-color: #444;
  color: #f0f0f0;
}

.dark-theme .social-links a:hover {
  background: #333;
}

.dark-theme footer {
  background: #111;
  color: #aaa;
}

.dark-theme footer a {
  color: #7bb4ff;
}

/* theme toggle in dark mode */
.dark-theme .theme-toggle:hover {
  background: #444;
}

.dark-theme .theme-toggle-inner {
  background: #333;
}

.dark-theme .theme-slider {
  transform: translateX(30px);
  background: #4a4a4a;
}

.dark-theme .theme-icon.sun {
  opacity: 1;
}

.dark-theme .theme-icon.moon {
  opacity: 0;
}

.dark-theme .theme-text {
  color: #aaa;
}

/* language switch in dark mode */
.dark-theme header nav .lang-switch .lang {
  border-color: rgba(255,255,255,.18);
}

.dark-theme header nav .lang-switch .active-lang {
  background: #60a5fa;
  border-color: #60a5fa;
  color: #0a0a0a;
}

.avatar-logo {
  background: none;
}

.avatar-logo img {
  width: 140px;
  height: auto;
  filter: drop-shadow(0 10px 25px rgba(0,0,0,0.15));
}

.avatar.avatar-logo {
  background: #ffffff;      /* фон под логотип */
  width: 180px;             /* увеличим контейнер */
  height: 180px;
  border-radius: 20px;      /* мягкие углы */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.avatar.avatar-logo img {
  width: 160px;
  height: auto;
  display: block;
}

