/* ============ tokens ============ */
:root {
  --bg:        #0a0a0f;
  --surface:   #121219;
  --surface-2: #181822;
  --border:    rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.16);
  --text:      #e9e9f1;
  --muted:     #9a9ab0;
  --faint:     #6c6c82;
  --accent-a:  #6366f1;
  --accent-b:  #22d3ee;
  --grad:      linear-gradient(120deg, var(--accent-a), var(--accent-b));
  --maxw:      980px;
  --radius:    18px;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, .logo-mark, .stat-num, .lang-toggle {
  font-family: "Space Grotesk", "Inter", sans-serif;
}

a { color: inherit; text-decoration: none; }

/* ============ language visibility ============ */
.i18n-en, .i18n-ru { display: none; }
html.lang-en .i18n-en { display: inline; }
html.lang-ru .i18n-ru { display: inline; }

/* ============ ambient orbs ============ */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: float 22s var(--ease) infinite alternate;
}
.orb-1 { width: 480px; height: 480px; top: -160px; left: -120px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.55), transparent 70%); }
.orb-2 { width: 420px; height: 420px; top: 30%; right: -160px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.4), transparent 70%); animation-delay: -7s; }
.orb-3 { width: 360px; height: 360px; bottom: -140px; left: 30%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%); animation-delay: -14s; }
@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 60px) scale(1.15); }
}

/* ============ nav ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 16px 24px;
  border-radius: 0 0 16px 16px;
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav.scrolled { box-shadow: 0 10px 40px -20px rgba(0, 0, 0, 0.9); background: rgba(10, 10, 15, 0.8); }

.nav-logo { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.logo-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad); color: #05060a; font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 20px -8px var(--accent-a);
}
.logo-text { font-size: 15px; letter-spacing: 0.2px; }

.nav-links { display: flex; gap: 26px; }
.nav-links a {
  font-size: 14px; color: var(--muted); position: relative;
  transition: color 0.2s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px;
  width: 0; height: 2px; background: var(--grad); border-radius: 2px;
  transition: width 0.25s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.lang-toggle {
  display: flex; align-items: center; gap: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--faint); padding: 7px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; letter-spacing: 0.5px;
  transition: border-color 0.2s var(--ease);
}
.lang-toggle:hover { border-color: var(--border-hi); }
.lang-sep { opacity: 0.4; }
.lang-opt { transition: color 0.2s var(--ease); }
html.lang-en .lang-opt[data-lang="en"],
html.lang-ru .lang-opt[data-lang="ru"] {
  color: var(--text);
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============ layout ============ */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 70px 0; }

.section-title {
  display: flex; align-items: baseline; gap: 14px;
  font-size: clamp(22px, 4vw, 30px); font-weight: 600; margin-bottom: 38px;
}
.section-num {
  font-size: 15px; font-weight: 600;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; font-family: "Space Grotesk", sans-serif;
}

/* ============ hero ============ */
.hero { padding: 90px 0 60px; }
.hero-eyebrow {
  font-size: 14px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 18px;
}
.hero-name {
  font-size: clamp(40px, 9vw, 76px); font-weight: 700; line-height: 1.02;
  letter-spacing: -1.5px; margin-bottom: 10px;
}
.hero-role { font-size: clamp(20px, 4vw, 30px); font-weight: 600; margin-bottom: 22px; }
.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-tagline { font-size: clamp(16px, 2.4vw, 19px); color: var(--muted); max-width: 620px; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 32px; }
.meta-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; color: var(--muted);
}
.meta-pill .ic { width: 15px; height: 15px; fill: var(--accent-b); }
.dot-live {
  width: 9px; height: 9px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 12px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-primary { background: var(--grad); color: #05060a; box-shadow: 0 12px 30px -12px var(--accent-a); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px var(--accent-a); }
.btn-ghost { background: var(--surface); border: 1px solid var(--border-hi); color: var(--text); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent-b); }

/* ============ about ============ */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.about-text p { color: var(--muted); margin-bottom: 16px; }
.about-text p:first-child { color: var(--text); font-size: 17px; }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 18px; text-align: center;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.stat:hover { border-color: var(--border-hi); transform: translateY(-3px); }
.stat-num {
  display: block; font-size: 26px; font-weight: 700; margin-bottom: 4px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 12.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.6px; }

/* ============ timeline ============ */
.timeline { list-style: none; position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--accent-a), var(--accent-b), transparent);
}
.tl-item { position: relative; padding-bottom: 38px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent-a);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.tl-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.tl-card:hover { border-color: var(--border-hi); transform: translateY(-3px); box-shadow: 0 20px 50px -30px #000; }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 4px; }
.tl-company { font-size: 18px; font-weight: 600; }
.tl-period {
  margin-left: auto; font-size: 12.5px; color: var(--faint);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.tl-role { font-size: 14px; color: var(--accent-b); margin-bottom: 12px; font-weight: 500; }
.tl-role .tl-loc { color: var(--faint); }
.tl-bullets { list-style: none; display: grid; gap: 8px; }
.tl-bullets li { position: relative; padding-left: 20px; color: var(--muted); font-size: 14.5px; }
.tl-bullets li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 6px; height: 6px; border-radius: 2px; background: var(--grad);
}

/* ============ skills ============ */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.skill-cat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.skill-cat:hover { border-color: var(--border-hi); transform: translateY(-3px); }
.skill-cat h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--faint); margin-bottom: 14px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tags span {
  font-size: 13.5px; padding: 6px 12px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.skill-tags span:hover { border-color: var(--accent-b); color: var(--accent-b); }

/* ============ education ============ */
.edu-card {
  display: flex; gap: 20px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}
.edu-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--surface-2); flex-shrink: 0; }
.edu-icon svg { width: 28px; height: 28px; fill: var(--accent-b); }
.edu-degree { font-size: 17px; font-weight: 600; }
.edu-school { color: var(--muted); font-size: 14.5px; }
.edu-year { color: var(--faint); font-size: 13px; margin-top: 2px; }

/* ============ contact ============ */
.contact-lead { color: var(--muted); max-width: 560px; margin-bottom: 28px; font-size: 17px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.contact-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.contact-card:hover { border-color: var(--accent-b); transform: translateY(-4px); box-shadow: 0 20px 50px -30px var(--accent-a); }
.contact-card .ic { width: 22px; height: 22px; fill: var(--accent-b); margin-bottom: 10px; }
.contact-k { font-size: 12.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.6px; }
.contact-v { font-size: 15.5px; font-weight: 500; word-break: break-all; }

/* ============ footer ============ */
.footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 36px 24px 50px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  color: var(--faint); font-size: 13.5px; border-top: 1px solid var(--border);
}
.footer-sep { opacity: 0.5; }

/* ============ reveal animation ============ */
.reveal, .tl-item, .skill-cat {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.visible, .tl-item.visible, .skill-cat.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .tl-item, .skill-cat { opacity: 1; transform: none; transition: none; }
  .orb { animation: none; }
  html { scroll-behavior: auto; }
}

/* ============ responsive ============ */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 54px 0; }
  .tl-period { margin-left: 0; }
}
