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

:root {
  --bg: #0d1117;
  --bg-soft: #111827;
  --violet: #7c3aed;
  --indigo: #4f46e5;
  --cyan: #06b6d4;
  --cyan-bright: #22d3ee;
  --text: #e6edf3;
  --text-dim: #9aa6b2;
  --stroke: rgba(255, 255, 255, 0.08);
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Background decor ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  z-index: 0;
}
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}
.glow-1 { width: 480px; height: 480px; background: var(--violet); top: -160px; left: -120px; }
.glow-2 { width: 420px; height: 420px; background: var(--cyan); top: 220px; right: -140px; opacity: 0.35; }

/* ===== Layout ===== */
#container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 22px 48px;
}

/* ===== Hero ===== */
.hero { text-align: center; }

.avatar-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 20px;
}
.avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
  border: 3px solid transparent;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(135deg, var(--violet), var(--cyan)) border-box;
  box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.08), 0 18px 40px rgba(0, 0, 0, 0.5);
}
.status-dot {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid var(--bg);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.7);
}

.hero h1 {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.role {
  margin-top: 6px;
  font-weight: 600;
  font-size: 1.02rem;
  background: linear-gradient(90deg, var(--cyan-bright), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.role span { -webkit-text-fill-color: var(--text-dim); margin: 0 4px; }

.tagline {
  margin: 14px auto 0;
  max-width: 440px;
  color: var(--text-dim);
  font-size: 0.96rem;
  line-height: 1.55;
}
.tagline strong { color: var(--text); font-weight: 600; }

.meta {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
.chip-loc, .chip-open {
  font-size: 0.8rem;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text-dim);
}
.chip-open { display: inline-flex; align-items: center; gap: 7px; color: #7ee7a6; }
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ===== Stack ===== */
.stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 32px 0 8px;
}
.stack span {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 8px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--stroke);
  transition: 0.2s;
}
.stack span:hover { color: var(--cyan-bright); border-color: rgba(34, 211, 238, 0.4); }

/* ===== Projects ===== */
.projects { margin-top: 38px; }
.projects h2,
.links + .social, .social { }
.projects h2 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 16px;
  text-align: center;
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 20px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(var(--violet), var(--cyan));
  opacity: 0;
  transition: 0.25s;
}
.card:hover {
  transform: translateY(-3px);
  background: var(--surface-hover);
  border-color: rgba(124, 58, 237, 0.35);
}
.card:hover::before { opacity: 1; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.card-icon { font-size: 1.4rem; }
.card-tag {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--cyan-bright);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
}
.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.card p {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.card-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan-bright);
}

/* ===== Links ===== */
.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
}
.links a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--stroke);
  transition: 0.2s;
}
.links a:hover {
  background: var(--surface-hover);
  border-color: rgba(124, 58, 237, 0.45);
  transform: translateY(-2px);
}
.links .ic {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--cyan-bright);
  min-width: 22px;
  text-align: center;
}

/* ===== Social ===== */
.social {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}
.social a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--stroke);
  transition: 0.2s;
}
.social a:hover {
  color: #fff;
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.45);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(6, 182, 212, 0.18));
}

/* ===== Footer ===== */
footer {
  margin-top: 36px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-dim);
}
footer a { color: var(--text-dim); text-decoration: none; transition: 0.2s; }
footer a:hover { color: var(--cyan-bright); }
footer .dot { margin: 0 8px; opacity: 0.5; }

/* ===== Responsive ===== */
@media (max-width: 480px) {
  #container { padding: 40px 18px 40px; }
  .hero h1 { font-size: 1.6rem; }
  .glow-1, .glow-2 { width: 300px; height: 300px; }
}

/* ===== Entrance animation ===== */
.hero, .stack, .projects, .links, .social, footer {
  animation: rise 0.6s ease both;
}
.stack { animation-delay: 0.05s; }
.projects { animation-delay: 0.1s; }
.links { animation-delay: 0.15s; }
.social { animation-delay: 0.2s; }
footer { animation-delay: 0.25s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
