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

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* lock scroll when mobile menu open */
.no-scroll { overflow: hidden; }

/* ======== Contact form helpers ======== */
.input-error {
  border-color: #e5484d !important;
  box-shadow: 0 0 0 3px rgba(229,72,77,0.15);
}

.error-text {
  color: #e5484d;
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.15);
  padding: 10px 14px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 1003;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ================= HEADER / HERO ================= */
.hero {
  background: linear-gradient(to right, var(--hero-left) 50%, var(--hero-right) 50%);
  display: flex;
  flex-direction: column;
  padding: 40px 20px;
  color: var(--text);
}

/* ===== Navbar ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto 40px auto;
}


.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
}

.nav-links a {
  color: var(--nav-link);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 5px;
}

.nav-links a:hover {
  background: #333;
}

/* (removed) active nav style */

.contact-btn {
  background-color: var(--accent);
  font-weight: bold;
}

.theme-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}


/* не самый важный, передвигает вправо навигатор */

.navbar {
  display: flex;
  justify-content: flex-end; /* всё меню вправо */
  align-items: center;
  width: 100%; /* растянуть на всю ширину экрана */
  padding-right: 100px; /* расстояние от правого края */
  position: relative;
}


.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
}

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

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  padding: 8px 12px;
}
/* здесь кончается выравнивание навбара */




/* ===== Hero Content ===== */
.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: auto;
  gap: 40px;
}

.text p {
  font-size: 18px;
  color: var(--muted);
}

.text h1 {
  font-size: 42px;
  color: var(--hero-name);
}

.subtitle {
  color: var(--muted);
  margin: 10px 0;
}

.socials {
  margin-top: 15px;
}

.socials .icon {
  display: inline-flex;
  /* алиг вертикально */
  align-items: center;
  /* джус горизонтально */
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: 10px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  color: var(--text);
  background: var(--card);
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}

.socials .icon:hover { transform: translateY(-2px); border-color: rgba(0,0,0,0.25); }
.dark .socials .icon { border-color: rgba(255,255,255,0.15); }
.dark .socials .icon:hover { border-color: rgba(255,255,255,0.35); }

/* Keep social images from distorting, fit inside 28x28 */
.socials .icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

/* Make social icons light in dark theme */
.dark .socials .icon img {
  filter: brightness(0) invert(1);
}

/* If a specific logo has large transparent padding (e.g., GitHub), scale it up */
.socials .icon[aria-label="GitHub"] img {
  transform: scale(1.75);
  transform-origin: center;
}



/* ===== Photo ===== */
.photo img {
  max-width: 300px;
  border-radius: 20px;
}


/* ================= ABOUT ================= */
.about {
  padding: 60px 20px;
  background: var(--section-bg);
  text-align: center;
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--text);
}

.about p { color: var(--text); }


/* ========== SKILLS SECTION ========== */
.skills {
  padding: 60px 20px;
  background-color: var(--section-bg);
  text-align: center;
}

.skills h2 {
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 40px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
}

.skill {
  background: var(--card);
  border-radius: 10px;
  padding: 20px;
  transition: transform 0.3s ease;
}

.skill:hover {
  transform: translateY(-5px);
}

.skill img {
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
  object-fit: contain;
}


/* ========== PROJECTS ========== */
.projects {
  background: var(--section-bg);
  padding: 60px 20px;
  text-align: center;
}

.projects h2 {
  font-size: 2rem;
  margin-bottom: 40px;
  color: var(--text);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.project-card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card h3 {
  margin-bottom: 10px;
  color: #2c2c74;
}

.project-card a {
  display: inline-block;
  margin-top: 8px;
  margin-right: 10px;
  color: var(--link);
  text-decoration: underline;
}



/* ========== CONTACT ========== */
.contact {
  background: var(--contact-bg);
  padding: 60px 20px;
  text-align: center;
}

.contact h2 {
  font-size: 2rem;
  margin-bottom: 30px;
  color: var(--text);
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-form input,
.contact-form textarea {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
}

.contact-form input[type="submit"] {
  background-color: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.contact-form input[type="submit"]:hover { filter: brightness(1.05); }




/* ======== Общий фон через переменные ======== */

/* ======== Заголовки секций (рамка, как на примере) ======== */
.section-title-container {
  text-align: center;
  margin-bottom: 50px;
}

.section-title {
  display: inline-block;
  border: 3px solid var(--text);
  padding: 10px 40px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
  margin-bottom: 40px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* мягкая тень */
  transition: all 0.3s ease;
}

.section-title:hover {
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2); /* тень усиливается при наведении */
  transform: translateY(-3px); /* лёгкое приподнимание */
}


/* ======== Текстовые подзаголовки (например "USING NOW") ======== */
.subheading {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 1px;
  color: var(--text);
  text-transform: uppercase;
  margin: 40px 0 20px;
  text-align: center;
}




/* ================= FOOTER ================= */
footer {
  text-align: center;
  padding: 20px;
  font-size: 14px;
  background-color: var(--footer-bg);
  color: #ffffff; /* footer text always white */
}

/* Back to Top button */
#backToTop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #111;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 1000;
}

#backToTop.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}


/* ======== Responsive tweaks ======== */
@media (max-width: 900px) {
  .hero-content { flex-direction: column; text-align: left; align-items: flex-start; }
  .navbar { padding-right: 20px; }
}

/* ======== Theme variables ======== */
:root {
  --bg: #ffffff;
  --text: #111111;
  --card: #ffffff;
  --section-bg: #f9f9f9;
  --contact-bg: #ffffff;
  --accent: #ef5c5c;
  --hero-left: #dddddd;
  --hero-right: #000000;
  --nav-link: #f5f5f5;
  --footer-bg: #000000;
  --link: #005eff;
  --muted: #444b57;
  --hero-name: #111111;
}

.dark {
  --bg: #0b0e12;
  --text: #e5e7eb;
  --card: #171923;
  --section-bg: #10141b;
  --contact-bg: #121826;
  --accent: #8b95ff;
  --hero-left: #0e1217;
  --hero-right: #06080c;
  --nav-link: #e5e7eb;
  --footer-bg: #000000; /* keep footer dark across themes */
  --link: #8b95ff;
  --muted: #a0a8b8;
  --hero-name: #e5e7eb;
}



/* ================= HAMBURGER MENU (mobile) ================= */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.18); /* светлый фон, чтобы не теряться на тёмном градиенте */
  border: 1px solid rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 6px; /* подложка вокруг линий */
  z-index: 1001;
  position: relative;
  border-radius: 8px;
  backdrop-filter: saturate(150%) blur(4px);
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background-color: #111; /* тёмные полоски в светлой теме */
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* В тёмной теме полоски светлые для контраста */
.dark .hamburger-line { background-color: #e5e7eb; }

/* Подложка в тёмной теме чуть темнее, граница мягче */
.dark .hamburger {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.28);
}

.hamburger:hover { filter: brightness(1.05); }

.hamburger.active .hamburger-line:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.hamburger.active .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger.active .hamburger-line:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  background: var(--card);
  flex-direction: column;
  justify-content: center; align-items: center;
  list-style: none; padding: 0; margin: 0;
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}
.mobile-menu.active { transform: translateX(0); }
.mobile-menu li { margin: 20px 0; }
.mobile-menu a {
  color: var(--text);
  text-decoration: none;
  font-size: 1.5rem; font-weight: 500;
  padding: 10px 20px; border-radius: 8px; display: block;
  transition: all 0.3s ease;
}
.mobile-menu a:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }
.mobile-menu .contact-btn { background-color: var(--accent); color: #fff; font-weight: bold; }
.mobile-menu .mobile-theme-toggle {
  background: transparent; border: 2px solid var(--text);
  padding: 10px 20px; border-radius: 8px; cursor: pointer;
  font-size: 1.2rem; color: var(--text); margin-top: 20px; transition: all .3s ease;
}
.mobile-menu .mobile-theme-toggle:hover { background: var(--text); color: var(--card); }

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links { display: none; }
  .mobile-menu { display: flex; }
}

@media (max-width: 480px) {
  .mobile-menu a { font-size: 1.3rem; }
  .hamburger { width: 25px; height: 25px; }
}
