/* ============ Tokens ============ */
:root {
  --bg:        #08080d;
  --bg-2:      #0e0e16;
  --surface:   #14141f;
  --surface-2: #1b1b29;
  --border:    rgba(255,255,255,.08);
  --border-hi: rgba(255,255,255,.16);
  --text:      #f3f3f8;
  --muted:     #a2a2b8;
  --faint:     #6d6d82;
  --accent:    #7c6cff;   /* indigo  */
  --accent-2:  #22d3ee;   /* cyan    */
  --grad: linear-gradient(105deg, var(--accent), var(--accent-2));
  --maxw: 1120px;
  --ease: cubic-bezier(.22,1,.36,1);
}

* { 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;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .nav__brand, .hero__tagline, .stat__num {
  font-family: "Space Grotesk", system-ui, sans-serif;
  line-height: 1.05;
  letter-spacing: -.02em;
}

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

/* ============ Animated background ============ */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background:
    linear-gradient(var(--bg-2) 1px, transparent 1px) 0 0 / 100% 64px,
    linear-gradient(90deg, var(--bg-2) 1px, transparent 1px) 0 0 / 64px 100%;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  opacity: .5;
}
.bg-glow {
  position: fixed; z-index: -3; border-radius: 50%;
  filter: blur(120px); opacity: .35; pointer-events: none;
}
.bg-glow--1 { width: 520px; height: 520px; background: var(--accent);
  top: -160px; left: -120px; animation: float1 18s var(--ease) infinite alternate; }
.bg-glow--2 { width: 460px; height: 460px; background: var(--accent-2);
  top: 30%; right: -140px; animation: float2 22s var(--ease) infinite alternate; }
@keyframes float1 { to { transform: translate(120px, 80px) scale(1.15); } }
@keyframes float2 { to { transform: translate(-100px, 120px) scale(1.1); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============ Nav ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 48px);
  transition: background .3s, backdrop-filter .3s, padding .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8,8,13,.72);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
  padding-top: 12px; padding-bottom: 12px;
}
.nav__brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 1.05rem; }
.nav__mark { display: inline-flex; filter: drop-shadow(0 0 9px rgba(124,108,255,.55)); }
.nav__mark svg { display: block; }
.nav__links { display: flex; align-items: center; gap: clamp(14px, 3vw, 34px); }
.nav__links a { color: var(--muted); font-size: .95rem; font-weight: 500; transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__cta {
  padding: 8px 18px; border: 1px solid var(--border-hi); border-radius: 999px;
  color: var(--text) !important;
}
.nav__cta:hover { background: var(--surface); border-color: var(--accent); }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }

/* ============ Layout ============ */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(80px, 12vw, 140px) clamp(20px, 5vw, 48px); }
.section__head { max-width: 640px; margin-bottom: 56px; }
.section__head h2 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; margin: 14px 0; }
.section__lead { color: var(--muted); font-size: 1.1rem; }
.tag {
  display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-2);
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface);
}

/* ============ Hero ============ */
.hero {
  min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 120px clamp(20px, 5vw, 48px) 60px; position: relative;
}
.hero__inner { max-width: 860px; }
.hero__avatar {
  width: 108px; height: 108px; margin: 0 auto 26px; border-radius: 50%;
  padding: 3px; background: var(--grad);
  box-shadow: 0 0 44px -8px rgba(124,108,255,.65);
  animation: avatarGlow 5s ease-in-out infinite;
}
.hero__avatar img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  display: block; background: #ececf2;
}
@keyframes avatarGlow {
  50% { box-shadow: 0 0 60px -6px rgba(34,211,238,.6); }
}
.hero__eyebrow { font-weight: 600; letter-spacing: .35em; color: var(--muted); font-size: .95rem; margin-bottom: 22px; }
.hero__title { font-size: clamp(3.2rem, 13vw, 8rem); font-weight: 700; }
.hero__title span { display: inline-block; }
.hero__tagline {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px;
  margin: 26px 0 8px; font-size: clamp(1rem, 2.5vw, 1.4rem); font-weight: 500;
  letter-spacing: .1em; color: var(--faint);
}
.hero__tagline span { position: relative; }
.hero__tagline span:not(:last-child)::after {
  content: "·"; position: absolute; right: -18px; color: var(--accent);
}
.hero__sub { max-width: 560px; margin: 22px auto 36px; color: var(--muted); font-size: 1.12rem; }
.hero__sub strong { color: var(--text); }
.hero__cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--border-hi); border-radius: 20px;
  display: flex; justify-content: center; padding-top: 7px;
  transition: opacity .4s var(--ease);
}
.hero__scroll span { width: 4px; height: 8px; background: var(--accent-2); border-radius: 2px; animation: scroll 1.6s infinite; }
@keyframes scroll { 0%{opacity:0;transform:translateY(-4px)} 40%{opacity:1} 80%,100%{opacity:0;transform:translateY(10px)} }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: .98rem;
  transition: transform .2s var(--ease), box-shadow .3s, background .3s, border-color .3s;
}
.btn--primary { background: var(--grad); color: #08080d; box-shadow: 0 8px 30px -8px rgba(124,108,255,.6); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px rgba(124,108,255,.8); }
.btn--ghost { border: 1px solid var(--border-hi); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); background: var(--surface); transform: translateY(-2px); }

/* ============ Stats ============ */
.stats {
  max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  transform: translateY(-30px);
}
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 26px 22px; text-align: center;
}
.stat__num { display: block; font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 700; }
.stat__label { color: var(--muted); font-size: .9rem; }

/* ============ AI section ============ */
.ai { position: relative; }
.ai-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.ai-card {
  background: linear-gradient(160deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: 20px; padding: 28px 24px;
  position: relative; overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s;
}
.ai-card::before {
  content: ""; position: absolute; inset: 0; border-radius: 20px; padding: 1px;
  background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s;
}
.ai-card:hover { transform: translateY(-6px); }
.ai-card:hover::before { opacity: 1; }
.ai-card__icon { font-size: 1.9rem; margin-bottom: 16px; }
.ai-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.ai-card p { color: var(--muted); font-size: .95rem; }

/* ============ Proficiencies ============ */
.prof-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.prof {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px 22px; transition: transform .3s var(--ease), background .3s, border-color .3s;
}
.prof:hover { transform: translateY(-4px); background: var(--surface-2); border-color: var(--border-hi); }
.prof h3 { font-size: 1.05rem; margin-bottom: 8px; }
.prof p { color: var(--muted); font-size: .9rem; }

/* ============ Projects ============ */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.project {
  background: linear-gradient(160deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: 22px; padding: 32px 30px;
  transition: transform .3s var(--ease), border-color .3s;
}
.project:hover { transform: translateY(-5px); border-color: var(--border-hi); }
.project__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.project__top h3 { font-size: 1.5rem; }
.project__year { color: var(--accent-2); font-size: .85rem; font-weight: 500; white-space: nowrap; }
.project__role { color: var(--faint); font-size: .85rem; margin: 6px 0 16px; text-transform: uppercase; letter-spacing: .06em; }
.project p { color: var(--muted); }
.project strong { color: var(--text); }
.project__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.project__tags span {
  font-size: .78rem; color: var(--muted); padding: 5px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
}
.project__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.project__links a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .85rem; font-weight: 600; color: var(--text);
  padding: 8px 15px; border: 1px solid var(--border-hi); border-radius: 999px;
  transition: color .2s, background .2s, border-color .2s, transform .2s var(--ease);
}
.project__links a span { transition: transform .2s var(--ease); }
.project__links a:hover { color: var(--accent-2); border-color: var(--accent); background: var(--surface-2); transform: translateY(-2px); }
.project__links a:hover span { transform: translate(2px, -2px); }

/* ============ Contact ============ */
.contact__inner { text-align: center; max-width: 660px; margin: 0 auto; }
.contact__inner h2 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 14px 0; }
.contact__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 32px 0 28px; }
.socials { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; align-items: center; color: var(--muted); }
.socials a { position: relative; font-weight: 500; transition: color .2s; }
.socials a:hover { color: var(--text); }
.socials a::after {
  content: ""; position: absolute; left: 0; bottom: -3px; width: 0; height: 1px;
  background: var(--grad); transition: width .3s;
}
.socials a:hover::after { width: 100%; }
.socials__web3 { font-size: .85rem; color: var(--faint); }

/* ============ Footer ============ */
.footer {
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  max-width: var(--maxw); margin: 0 auto; padding: 30px clamp(20px, 5vw, 48px);
  color: var(--faint); font-size: .88rem;
}
.footer__brand { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.footer__brand svg { display: block; }

/* ============ Reveal animation ============ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease) var(--d, 0s), transform .7s var(--ease) var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .ai-grid, .prof-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav__links { display: none; }
  .nav__links.open {
    display: flex; flex-direction: column; position: absolute; top: 100%; right: 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 18px 22px; gap: 16px;
  }
  .nav__toggle { display: flex; }
  .ai-grid, .prof-grid { grid-template-columns: 1fr; }
  .hero__tagline span:not(:last-child)::after { display: none; }
}
