/* ─── FONTS ──────────────────────────────────────────────── */
/*
  Чтобы сменить шрифт — раскомментируй нужный @import
  и поменяй --mono / --sans в :root ниже.

  ВАРИАНТ A (текущий) — JetBrains Mono + Inter
  ВАРИАНТ B — IBM Plex Mono + IBM Plex Sans (теплее, мягче)
  ВАРИАНТ C — Fira Code + DM Sans (шире, читаемее на больших экранах)
  ВАРИАНТ D — Space Mono + Plus Jakarta Sans (quirky, выделяется)
*/

/* A — текущий */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@300;400;500;600&display=swap');

/* B — раскомментируй и замени --mono/--sans ниже
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;700&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');
*/

/* C — раскомментируй и замени --mono/--sans ниже
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;700&family=DM+Sans:wght@300;400;500;600&display=swap');
*/

/* D — раскомментируй и замени --mono/--sans ниже
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Plus+Jakarta+Sans:wght@300;400;500;600&display=swap');
*/

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:       #0d0f14;
  --bg2:      #13161e;
  --bg3:      #1a1e29;
  --border:   #252a38;
  --border2:  #2e3448;

  --text:     #e8eaf0;
  --text2:    #8b90a8;
  --text3:    #555c76;

  --accent:   #5b8def;
  --accent2:  #3d6fd4;
  --accent-glow: rgba(91,141,239,0.15);

  /* Шрифты — меняй вместе с @import выше */
  --mono: 'JetBrains Mono', monospace; /* B: 'IBM Plex Mono'  C: 'Fira Code'  D: 'Space Mono' */
  --sans: 'Inter', system-ui, sans-serif; /* B: 'IBM Plex Sans'  C: 'DM Sans'  D: 'Plus Jakarta Sans' */

  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.2s ease;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(15px, 1.2vw, 19px);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ─── NAV ────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 40px;
  height: 56px;
  background: rgba(13,15,20,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.nav-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(14px, 1.25vw, 18px);
  color: var(--accent);
  letter-spacing: 2px;
  margin-right: auto;
}
.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  font-size: clamp(13px, 1.05vw, 17px);
  color: var(--text2);
  letter-spacing: 0.3px;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  font-size: clamp(13px, 1.15vw, 17px);
  font-weight: 500;
  padding: 7px 18px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent) !important;
  transition: background var(--transition), color var(--transition);
}
.nav-cta:hover { background: var(--accent); color: #fff !important; }

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px 40px 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px; left: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(91,141,239,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}
.hero-label {
  font-family: var(--mono);
  font-size: clamp(12px, 1.05vw, 15px);
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.6s 0.1s ease forwards;
}
.hero-name {
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -2px;
  color: #fff;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.6s 0.2s ease forwards;
}
.hero-tagline {
  font-family: var(--mono);
  font-size: clamp(14px, 1.35vw, 20px);
  color: var(--text2);
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.6s 0.3s ease forwards;
}
.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.6s 0.4s ease forwards;
}
.stat {
  padding: 16px 32px;
  background: var(--bg2);
  border: 1px solid var(--border);
}
.stat:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.stat:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }
.stat-divider { width: 1px; height: 52px; background: var(--border); }
.stat-num {
  display: block;
  font-family: var(--mono);
  font-size: clamp(24px, 2.15vw, 33px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  display: block;
  font-size: clamp(11px, 1.0vw, 14px);
  color: var(--text3);
  letter-spacing: 0.5px;
}
.hero-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  opacity: 0;
  animation: fadeUp 0.6s 0.5s ease forwards;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: clamp(13px, 1.15vw, 17px);
  color: var(--text2) !important;
  transition: color var(--transition);
}
.contact-link:hover { color: var(--text) !important; }
.contact-link svg { flex-shrink: 0; }
.hero-scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: clamp(11px, 1.0vw, 14px);
  color: var(--text3);
  letter-spacing: 2px;
  animation: pulse 2s infinite;
}

/* ─── MAIN / SECTIONS ────────────────────────────────────── */
.main { max-width: 940px; margin: 0 auto; padding: 0 40px 80px; }
.section { padding: 80px 0; border-top: 1px solid var(--border); }
.section:first-child { border-top: none; }
.section-title {
  font-family: var(--mono);
  font-size: clamp(11px, 1.0vw, 14px);
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 40px;
}

/* ─── TIMELINE / JOBS ────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.job {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.job:last-child { border-bottom: none; }
.job-meta {
  padding-top: 2px;
}
.job-period {
  display: block;
  font-family: var(--mono);
  font-size: clamp(11px, 1.0vw, 14px);
  color: var(--text3);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.job-company {
  display: block;
  font-size: clamp(13px, 1.15vw, 17px);
  font-weight: 600;
  color: var(--text2);
}
.job-role {
  font-size: clamp(15px, 1.35vw, 20px);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.job-team {
  font-size: clamp(12px, 1.05vw, 15px);
  color: var(--text3);
  margin-bottom: 14px;
  font-family: var(--mono);
}
.job-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.job-items li {
  font-size: clamp(13px, 1.15vw, 17px);
  color: var(--text2);
  padding-left: 16px;
  position: relative;
}
.job-items li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text3);
}
.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

/* ─── PROJECT CARDS ──────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.project-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: default;
}
.project-card:hover {
  border-color: var(--border2);
  box-shadow: 0 0 0 1px var(--border2), 0 8px 40px rgba(0,0,0,0.3);
}
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.project-label {
  display: block;
  font-family: var(--mono);
  font-size: clamp(10px, 0.95vw, 13px);
  color: var(--accent);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.project-name {
  font-size: clamp(15px, 1.35vw, 20px);
  font-weight: 600;
  color: var(--text);
}
.project-link-icon {
  color: var(--text3) !important;
  padding: 4px;
  flex-shrink: 0;
  transition: color var(--transition);
}
.project-link-icon:hover { color: var(--text) !important; }
.project-desc {
  font-size: clamp(13px, 1.1vw, 17px);
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 16px;
}
.project-metrics {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.metric { text-align: center; }
.metric-val {
  display: block;
  font-family: var(--mono);
  font-size: clamp(16px, 1.45vw, 21px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 3px;
}
.metric-key {
  font-size: clamp(10px, 0.95vw, 13px);
  color: var(--text3);
  letter-spacing: 0.5px;
}
.project-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.project-bullets li {
  font-size: clamp(13px, 1.1vw, 17px);
  color: var(--text2);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}
.project-bullets li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ─── TAGS / CHIPS ───────────────────────────────────────── */
.project-tags, .job-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono);
  font-size: clamp(10px, 0.95vw, 13px);
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text3);
  letter-spacing: 0.3px;
}
.chip {
  font-family: var(--mono);
  font-size: clamp(11px, 1.0vw, 14px);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
}
.chip-primary {
  border-color: rgba(91,141,239,0.3);
  color: var(--accent);
  background: rgba(91,141,239,0.06);
}

/* ─── SKILLS ─────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 40px;
}
.skill-group-title {
  font-family: var(--mono);
  font-size: clamp(11px, 1.0vw, 14px);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 10px;
}
.skill-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ─── ACHIEVEMENTS ───────────────────────────────────────── */
.achievements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.achievement {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ach-icon { font-size: clamp(18px, 1.55vw, 23px); flex-shrink: 0; line-height: 1; margin-top: 2px; }
.ach-title { font-size: clamp(14px, 1.25vw, 18px); font-weight: 500; color: var(--text); margin-bottom: 2px; }
.ach-sub { font-size: clamp(12px, 1.05vw, 15px); color: var(--text3); }

/* ─── FOOTER ─────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 40px;
  text-align: center;
  font-size: clamp(12px, 1.05vw, 15px);
  color: var(--text3);
}
.footer a { color: var(--text3); }
.footer a:hover { color: var(--accent); }

/* ─── PDF LINKS ──────────────────────────────────────────── */
.pdf-links {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  font-family: var(--mono);
  font-size: clamp(11px, 1.0vw, 14px);
  letter-spacing: 0.3px;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.pdf-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ─── GALLERY THUMBS ─────────────────────────────────────── */
.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.gallery-thumb-btn {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg3);
  cursor: pointer;
  padding: 0;
  transition: border-color var(--transition), transform var(--transition);
}
.gallery-thumb-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.gallery-thumb-btn img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  display: block;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.gallery-thumb-btn:hover img { opacity: 1; }

/* ─── GALLERY MODAL ──────────────────────────────────────── */
.gallery-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
}
.gallery-overlay.active { display: block; }

.gallery-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 201;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 40px;
}
.gallery-modal.active { display: flex; }

.gallery-stage {
  position: relative;
  max-width: 900px;
  width: 100%;
}
.gallery-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  display: block;
}
.gallery-caption {
  margin-top: 12px;
  text-align: center;
  font-size: clamp(12px, 1.05vw, 15px);
  color: var(--text2);
  font-family: var(--mono);
}
.gallery-close {
  position: fixed;
  top: 20px; right: 24px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 50%;
  width: 36px; height: 36px;
  color: var(--text2);
  font-size: clamp(15px, 1.3vw, 19px);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--transition), border-color var(--transition);
  z-index: 202;
}
.gallery-close:hover { color: var(--text); border-color: var(--text2); }

.gallery-nav {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 50%;
  width: 44px; height: 44px;
  color: var(--text);
  font-size: clamp(20px, 1.65vw, 25px);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  z-index: 202;
}
.gallery-nav:hover { background: var(--bg2); border-color: var(--accent); }
.gallery-prev { left: 16px; }
.gallery-next { right: 16px; }
.gallery-nav:disabled { opacity: 0.2; cursor: default; }

.gallery-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.gallery-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border2);
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  padding: 0;
}
.gallery-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* ─── REVEAL ANIMATION ───────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── KEYFRAMES ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 0 20px; gap: 16px; }
  .nav-links { display: none; }
  .hero { padding: 90px 20px 50px; }
  .hero-stats { flex-direction: column; align-items: flex-start; }
  .stat { width: 100%; border-radius: var(--radius) !important; margin-bottom: 8px; }
  .stat-divider { display: none; }
  .main { padding: 0 20px 60px; }
  .job { grid-template-columns: 1fr; gap: 8px; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .achievements { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}