:root {
  --bg: #0b0f19;
  --bg-alt: #111726;
  --card: #151d2e;
  --text: #e7ebf3;
  --muted: #9aa5b8;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --radius: 14px;
  --max-w: 1080px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.links { display: flex; gap: 1.25rem; align-items: center; }
.links a { color: var(--muted); font-size: .95rem; }
.links a:hover { color: var(--text); text-decoration: none; }

.btn-primary, .btn-outline {
  display: inline-block;
  padding: .6rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none !important;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0b0f19; }
.btn-outline { border: 1px solid rgba(255,255,255,0.2); color: var(--text) !important; }
.btn-primary:hover, .btn-outline:hover { opacity: .85; }

/* Scroll progress bar */
.page-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 100;
  transition: width 0.1s linear;
}

/* Custom cursor */
.cursor-dot, .cursor-ring { display: none; }
body.has-custom-cursor { cursor: none; }
body.has-custom-cursor a, body.has-custom-cursor button { cursor: none; }
body.has-custom-cursor .cursor-dot {
  display: block;
  position: fixed;
  top: 0; left: 0;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  pointer-events: none;
  z-index: 999;
  transform: translate(-100px, -100px);
  margin-left: -3px; margin-top: -3px;
}
body.has-custom-cursor .cursor-ring {
  display: block;
  position: fixed;
  top: 0; left: 0;
  width: 32px; height: 32px;
  margin-left: -16px; margin-top: -16px;
  border-radius: 50%;
  border: 1px solid rgba(124, 92, 255, 0.6);
  pointer-events: none;
  z-index: 998;
  transform: translate(-100px, -100px);
  transition: width 0.2s, height 0.2s, margin 0.2s, border-color 0.2s;
}
body.has-custom-cursor .cursor-ring.cursor-hover {
  width: 52px; height: 52px;
  margin-left: -26px; margin-top: -26px;
  border-color: var(--accent-2);
  background: rgba(34, 211, 238, 0.08);
}

/* Fade-in sections (before GSAP kicks in, avoid flash of unstyled content) */
.fade-section { opacity: 1; }

/* Hero canvas background */
.hero { position: relative; overflow: hidden; }
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }

.hero { padding: 5rem 2rem 4rem; text-align: center; }
.hero-inner { max-width: var(--max-w); margin: 0 auto; }
.avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); margin-bottom: 1.5rem; }
.hero h1 { font-size: 2.6rem; }
.tagline { font-size: 1.25rem; color: var(--muted); max-width: 640px; margin: 0.5rem auto 1rem; }
.sub { max-width: 640px; margin: 0 auto 1.5rem; color: var(--muted); }
.cta-row { display: flex; gap: 1rem; justify-content: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.social-row { display: flex; gap: 1.5rem; justify-content: center; }

/* Sections */
.section { max-width: var(--max-w); margin: 0 auto; padding: 3.5rem 2rem; }
.section-sub { color: var(--muted); margin-top: -0.25rem; }

.stack-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.stack-badges span {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  padding: .35rem .8rem;
  border-radius: 999px;
  font-size: .85rem;
  color: var(--muted);
}

/* Timeline */
.timeline { border-left: 2px solid rgba(124,92,255,0.4); padding-left: 1.5rem; display: flex; flex-direction: column; gap: 1.75rem; }
.tl-item { position: relative; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -1.62rem;
  top: 0.3rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
}
.tl-year { color: var(--accent-2); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tl-item h3 { margin-top: .3rem; }
.tl-item p { color: var(--muted); margin: 0; }
.tl-role { font-style: italic; margin-bottom: .6rem !important; }
.tl-item ul { margin: .5rem 0 .75rem; padding-left: 1.15rem; color: var(--muted); }
.tl-item ul li { margin-bottom: .45rem; }
.tl-item ul li strong { color: var(--text); font-weight: 600; }
.tl-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.tl-tags span {
  background: rgba(124,92,255,0.1);
  border: 1px solid rgba(124,92,255,0.25);
  color: var(--accent-2);
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .78rem;
}

/* Skills groups */
.skills-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.skill-group {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.skill-group h4 { margin: 0 0 .75rem; font-size: .95rem; color: var(--accent-2); letter-spacing: .02em; }
.skill-tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.skill-tags span {
  background: var(--bg-alt);
  border: 1px solid rgba(255,255,255,0.08);
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .82rem;
  color: var(--muted);
}

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.project-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.project-card img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #0b0f19; }
.project-card h3 { font-size: 1.05rem; }
.project-card ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: .9rem; }
.project-card ul li { margin-bottom: .3rem; }
.project-links { display: flex; gap: .75rem; margin-top: auto; padding-top: .5rem; }
.project-links a { font-size: .85rem; font-weight: 600; }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 1rem; max-width: 480px; margin-top: 1.5rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.5rem; align-items: center; }
.contact-form input, .contact-form textarea {
  background: var(--bg-alt);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: .75rem 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); }
.contact-form button { align-self: flex-start; border: none; cursor: pointer; }

/* Footer */
.footer { text-align: center; padding: 2rem; color: var(--muted); font-size: .85rem; border-top: 1px solid rgba(255,255,255,0.06); }

@media (max-width: 640px) {
  .nav { padding: 1rem; flex-wrap: wrap; gap: .5rem; }
  .links { gap: .75rem; flex-wrap: wrap; justify-content: center; }
  .hero { padding: 3.5rem 1.25rem 2.5rem; }
  .hero h1 { font-size: 2rem; }
  .section { padding: 2.5rem 1.25rem; }
}
