/* ─────────────── base ─────────────── */
:root {
  --bg: #0a0e1a;
  --bg-alt: #0d1120;
  --surface: #111629;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e6ebf4;
  --muted: #94a3b8;
  --accent-a: #8b5cf6;
  --accent-b: #38bdf8;
  --grad: linear-gradient(120deg, #8b5cf6, #38bdf8);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(139, 92, 246, 0.35); }

.wrap {
  width: min(1100px, 100% - 48px);
  margin: 0 auto;
}

/* ─────────────── nav ─────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(10, 14, 26, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
}

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

.menu { display: flex; gap: 26px; }

.menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.25s;
}

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

.hamburger {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 26px;
  height: 26px;
  position: relative;
}

.hamburger span {
  position: absolute;
  left: 0;
  height: 2px;
  width: 22px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger span:nth-child(1) { top: 4px; }
.hamburger span:nth-child(2) { top: 12px; }
.hamburger span:nth-child(3) { top: 20px; }

.hamburger.open span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }

/* ─────────────── hero ─────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 60px;
  overflow: hidden;
}

.glow {
  position: absolute;
  top: -20%;
  left: -10%;
  width: 130%;
  height: 70%;
  background: radial-gradient(ellipse 45% 60% at 60% 40%, rgba(139, 92, 246, 0.22), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent-b);
  margin-bottom: 18px;
}

h1 {
  font-size: clamp(2.4rem, 5vw + 1rem, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.typewriter {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--muted);
  margin-top: 14px;
  min-height: 1.4em;
}

.lead {
  max-width: 46ch;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 22px;
  font-size: 1rem;
}

.hero-cta {
  display: flex;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.btn {
  padding: 13px 26px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  background: var(--grad);
  color: #0b0e1a;
  box-shadow: 0 10px 24px -8px rgba(139, 92, 246, 0.5);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -10px rgba(56, 189, 248, 0.45); }

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-2px); }

.stats {
  display: flex;
  gap: 28px;
  margin-top: 38px;
  list-style: none;
  flex-wrap: wrap;
}

.stats li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-lbl {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.hero-photo {
  position: relative;
  width: 300px;
  height: 340px;
  flex-shrink: 0;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.photo-ring {
  position: absolute;
  inset: -14px;
  border-radius: 28px;
  background: var(--grad);
  opacity: 0.18;
  filter: blur(18px);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.14; transform: scale(1); }
  50% { opacity: 0.28; transform: scale(1.03); }
}

/* ─────────────── sections ─────────────── */
.sec { padding: 96px 0; }
.sec-alt { background: var(--bg-alt); }

.sec-head { margin-bottom: 44px; }

.sec-head h2 {
  font-size: clamp(1.7rem, 3vw + 0.5rem, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sec-sub {
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.6;
}

.link {
  color: var(--accent-b);
  text-decoration: none;
  font-weight: 600;
}

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

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ─────────────── about ─────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
  align-items: start;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px;
}

.lead-about {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 16px;
}

.about-card p:not(.lead-about) {
  color: var(--muted);
  line-height: 1.7;
}

.about-card b { color: var(--text); }

.about-facts {
  list-style: none;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about-facts li {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-fact {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
}

.fact-k {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-b);
  display: block;
  margin-bottom: 6px;
}

.card-fact strong { font-weight: 600; display: block; margin-bottom: 4px; }

.fact-v { color: var(--muted); font-size: 0.85rem; }

.fact-link {
  font-weight: 600;
  color: var(--accent-b);
  text-decoration: none;
  display: block;
}

/* ─────────────── skills ─────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
}

.skill-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips li {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.chips li:hover {
  background: rgba(139, 92, 246, 0.12);
  color: var(--text);
  border-color: rgba(139, 92, 246, 0.4);
}

/* ─────────────── experience ─────────────── */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--accent-a), var(--accent-b), transparent);
  opacity: 0.4;
}

.tl-item {
  position: relative;
  margin-bottom: 28px;
  padding-left: 32px;
}

.tl-dot {
  position: absolute;
  left: -7px;
  top: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}

.tl-dates {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-b);
  display: block;
  margin-bottom: 6px;
}

.tl-body h3 { font-size: 1.1rem; font-weight: 600; }

.tl-org {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 4px 0 10px;
}

.tl-desc {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

/* ─────────────── projects ─────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 24px 40px -16px rgba(0, 0, 0, 0.5);
}

.p-tag {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-b);
  padding: 4px 10px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  margin-bottom: 16px;
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-card p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.93rem;
  flex: 1;
}

.p-tech {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ─────────────── education ─────────────── */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}

.edu-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
}

.edu-card h3 { font-size: 1.1rem; font-weight: 600; }

.edu-card p {
  color: var(--muted);
  font-size: 0.93rem;
  margin-top: 6px;
  line-height: 1.6;
}

.edu-year {
  font-family: var(--mono);
  color: var(--accent-b);
  font-size: 0.8rem;
  display: block;
  margin-top: 14px;
}

.certs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cert {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

/* ─────────────── contact ─────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.25s, border-color 0.25s;
}

.contact-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.4);
}

.c-icon {
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--accent-b);
  margin-bottom: 14px;
}

.contact-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }

.contact-card p {
  color: var(--muted);
  font-size: 0.9rem;
  word-break: break-word;
}

/* ─────────────── footer ─────────────── */
.foot {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  background: var(--bg-alt);
}

.foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.foot a {
  color: var(--accent-b);
  text-decoration: none;
}

.to-top { margin-left: auto; }

/* ─────────────── responsive ─────────────── */
@media (max-width: 900px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 18px;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(14px);
    padding: 24px;
    border-bottom: 1px solid var(--line);
    display: none;
  }

  .menu.open { display: flex; }
  .hamburger { display: block; }

  .hero { padding: 110px 0 40px; }
  .hero-inner { flex-direction: column; text-align: center; }
  .lead { margin: 22px auto 0; }
  .hero-cta { justify-content: center; }
  .stats { justify-content: center; gap: 20px; }
  .hero-photo { width: 240px; height: 280px; }

  .skills-grid, .project-grid, .contact-grid, .edu-grid { grid-template-columns: 1fr; }
  .sec { padding: 72px 0; }
}
