/* ===== Base styles ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #050816;
  --bg-alt: #0f172a;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.1);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --card-bg: #020617;
  --border: rgba(148, 163, 184, 0.3);
  --radius-lg: 18px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.9);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #0b1120, #020617 55%, #000 90%);
  color: var(--text);
  line-height: 1.6;
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.2rem;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: radial-gradient(circle at top, #020617, #020617 40%, #000 90%);
}

.section-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.section-text {
  color: var(--muted);
  max-width: 700px;
  margin-bottom: 1rem;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.7),
    transparent
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0.4rem;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 1rem;
}

.logo span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav a:hover {
  color: var(--text);
}

.nav a:hover::after {
  width: 100%;
}

/* Mobile menu button */
.menu-btn {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text);
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  padding-top: 6rem;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr);
  gap: 2.5rem;
  align-items: center;
}

.hero-subtitle {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  margin-bottom: 0.7rem;
}

.hero-title {
  font-size: clamp(2.3rem, 4vw, 3.1rem);
  font-weight: 800;
  margin-bottom: 0.7rem;
}

.hero-text {
  color: var(--muted);
  max-width: 480px;
  margin-bottom: 1.4rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background-color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}

.btn.primary {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #0b1120;
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.4);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 60px rgba(56, 189, 248, 0.45);
}

.btn.secondary {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.5);
}

.btn.secondary:hover {
  background: rgba(15, 23, 42, 0.9);
}

/* Hero card */
.hero-card {
  background: radial-gradient(circle at top left, #1e293b, #020617);
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 1.4rem 1.6rem;
  box-shadow: var(--shadow-soft);
  font-size: 0.92rem;
}

.hero-card p + p {
  margin-top: 0.5rem;
}

/* ===== Grid & cards ===== */
.grid {
  display: grid;
  gap: 1.5rem;
}

.skills-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.contact-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card {
  background: radial-gradient(circle at top left, #0b1120, #020617);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.3rem 1.4rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.8);
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.card ul {
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.card ul li + li {
  margin-top: 0.25rem;
}

.tag {
  margin-top: 0.8rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* ===== Contact ===== */
#contact a {
  color: var(--accent);
  text-decoration: none;
}

#contact a:hover {
  text-decoration: underline;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  padding: 1.4rem 0 1.6rem;
  background: radial-gradient(circle at top, #020617, #000 90%);
}

.footer-content {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
  }

  .hero-card {
    order: -1;
  }

  .nav {
    position: absolute;
    right: 1rem;
    top: 3.1rem;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(15, 23, 42, 0.98);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    display: none;
  }

  .nav.show {
    display: flex;
  }

  .menu-btn {
    display: block;
  }

  .header-content {
    padding-inline: 0;
  }
}

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: center;
}

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

.ci-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.9rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(56, 189, 248, 0.5);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.ci-badge span {
  color: var(--accent);
  font-weight: 600;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2.2rem;
  align-items: center;
}

.profile-photo {
  width: 260px;
  height: 260px;
  max-width: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .about-grid > div:last-child {
    display: flex;
    justify-content: center;
  }
}

.nav a.active {
  color: var(--accent);
  font-weight: 600;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 2.4rem;
  align-items: center;
}

/* Контейнер, чтобы картинка не растягивалась */
.about-photo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-photo {
  width: 260px;          /* Фиксированная ширина */
  height: 260px;         /* Фиксированная высота */
  object-fit: cover;     /* Картинка не растягивается */
  border-radius: 50%;    /* Делаем круглую */
  border: 3px solid var(--accent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
  max-width: 100%;       /* Чтобы не выходила за рамки */
}

/* Мобильная версия */
@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .about-photo-wrapper {
    margin-top: 1.5rem;
    justify-content: center;
  }
}

.logo {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 1rem;
  text-decoration: none;  /* чтобы убрать подчеркивание */
}

.logo span {
  color: var(--accent);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.cert-card {
  text-align: center;
}

.cert-card img {
  width: 120px;
  height: auto;
}

.cert-card p {
  margin-top: 10px;
  font-weight: bold;
}