@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:          #090b10;
  --bg2:         #0d1117;
  --surface:     rgba(255,255,255,0.04);
  --surface-h:   rgba(255,255,255,0.08);
  --border:      rgba(255,255,255,0.08);
  --border-h:    rgba(255,255,255,0.18);
  --accent:      #58a6ff;
  --accent2:     #79c0ff;
  --tg:          #2aabee;
  --gh:          #f0f6fc;
  --muted:       #8b949e;
  --text:        #e6edf3;
  --text2:       #c9d1d9;
  --green:       #3fb950;
  --red:         #f85149;
  --radius:      16px;
  --radius-sm:   8px;
  --glow:        0 0 40px rgba(88,166,255,0.12);
  --transition:  0.3s cubic-bezier(.4,0,.2,1);
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Background mesh ────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(88,166,255,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(121,192,255,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Grid noise overlay ─────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ─── Layout ─────────────────────────────────────────────── */
main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 24px 120px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ─── Header / Hero ──────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeUp .6s ease both;
}

.hero-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--border-h);
  background: linear-gradient(135deg, var(--accent) 0%, #1f6feb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  box-shadow: var(--glow), 0 0 0 6px rgba(88,166,255,0.06);
  position: relative;
  transition: transform var(--transition);
}
.hero-avatar:hover { transform: scale(1.05) rotate(-3deg); }

.hero-avatar .status-dot {
  position: absolute;
  bottom: 4px; right: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
  animation: pulse-dot 2s infinite;
}

.hero-name {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-role::before {
  content: '>';
  color: var(--muted);
}
.hero-role .cursor {
  display: inline-block;
  width: 2px; height: 1em;
  background: var(--accent);
  animation: blink 1.1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

.hero-bio {
  color: var(--text2);
  font-size: 1.05rem;
  max-width: 540px;
  line-height: 1.7;
}

/* ─── Tags ───────────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--transition);
  cursor: default;
}
.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88,166,255,0.08);
}

/* ─── Info Card ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  backdrop-filter: blur(12px);
  transition: border-color var(--transition), box-shadow var(--transition);
  animation: fadeUp .6s ease both;
}
.card:hover {
  border-color: var(--border-h);
  box-shadow: var(--glow);
}
.card-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Info Grid ──────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.info-item { display: flex; flex-direction: column; gap: 4px; }
.info-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.info-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}
.info-value.highlight { color: var(--accent); }

/* ─── Progress bars (skills) ─────────────────────────────── */
.skills { display: flex; flex-direction: column; gap: 14px; }
.skill { display: flex; flex-direction: column; gap: 6px; }
.skill-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}
.skill-name { color: var(--text2); font-weight: 500; }
.skill-pct { color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.skill-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(.4,0,.2,1);
}

/* ─── Social Links ───────────────────────────────────────── */
.socials {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.social-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.social-btn:active { transform: translateY(0); }

.social-btn.github { border-color: rgba(240,246,252,.15); }
.social-btn.github::before { background: rgba(240,246,252,.05); }
.social-btn.github:hover { border-color: var(--gh); color: var(--gh); }
.social-btn.github:hover::before { opacity: 1; }

.social-btn.telegram { border-color: rgba(42,171,238,.25); }
.social-btn.telegram::before { background: rgba(42,171,238,.07); }
.social-btn.telegram:hover { border-color: var(--tg); color: var(--tg); box-shadow: 0 8px 24px rgba(42,171,238,.15); }
.social-btn.telegram:hover::before { opacity: 1; }

.social-btn svg { flex-shrink: 0; }

/* ─── Visitor Badge ──────────────────────────────────────── */
.visitor-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(63,185,80,.07);
  border: 1px solid rgba(63,185,80,.25);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--green);
  font-weight: 500;
  opacity: 0;
  transition: opacity .5s;
}
.visitor-badge.visible { opacity: 1; }
.visitor-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s infinite;
}
.visitor-badge .count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

/* ─── Alert toast ────────────────────────────────────────── */
#alert-toast {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(13,17,23,.95);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(248,81,73,.2);
  transform: translateY(120%);
  transition: transform .4s cubic-bezier(.4,0,.2,1);
  max-width: 320px;
}
#alert-toast.visible { transform: translateY(0); }
#alert-toast svg { flex-shrink: 0; }

/* ─── Footer ─────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  50% { opacity: 0; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(0.85); }
}

/* card animation delay helpers */
.card:nth-child(2) { animation-delay: .08s; }
.card:nth-child(3) { animation-delay: .16s; }
.card:nth-child(4) { animation-delay: .24s; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  main { padding: 48px 16px 80px; }
  .card { padding: 20px 18px; }
  .socials { flex-direction: column; }
  .social-btn { justify-content: center; }
  #alert-toast { left: 16px; right: 16px; bottom: 16px; }
}
