:root {
  --bg: #060a12;
  --bg-alt: #0a1120;
  --panel: #0e1728;
  --panel-2: #121d33;
  --ink: #eaf1fb;
  --muted: #9fb0c9;
  --faint: #6b7d99;
  --brand: #3ba9f4;
  --brand-2: #7c5cff;
  --accent: #22d3a6;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-text { font-family: "Sora", sans-serif; letter-spacing: -0.02em; }

a { color: inherit; text-decoration: none; }

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

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6, 10, 18, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-family: "Sora"; font-weight: 800; font-size: 18px;
  box-shadow: 0 6px 18px rgba(59, 169, 244, 0.35);
}
.brand-text { font-size: 17px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--muted); font-size: 14.5px; font-weight: 500; transition: color 0.2s; position: relative; }
.nav-links a:hover { color: var(--ink); }
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--brand); transition: width 0.25s;
}
.nav-links a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
  padding: 8px 18px; border-radius: 999px; color: var(--ink) !important;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.3);
}
.nav-cta:hover { transform: translateY(-1px); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: 0.3s; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 120px 24px 80px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.orb-1 { width: 520px; height: 520px; background: var(--brand); top: -120px; left: -80px; animation: float1 16s ease-in-out infinite; }
.orb-2 { width: 480px; height: 480px; background: var(--brand-2); bottom: -140px; right: -100px; animation: float2 20s ease-in-out infinite; }
.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 40%, transparent 100%);
}
@keyframes float1 { 50% { transform: translate(60px, 40px) scale(1.1); } }
@keyframes float2 { 50% { transform: translate(-50px, -30px) scale(1.08); } }

.hero-content { position: relative; z-index: 1; max-width: 860px; }
.hero-eyebrow {
  text-transform: uppercase; letter-spacing: 0.28em; font-size: 12px; font-weight: 600;
  color: var(--brand); margin-bottom: 22px;
}
.hero-title {
  font-size: clamp(3rem, 9vw, 6rem); font-weight: 800; line-height: 1.02;
  background: linear-gradient(120deg, #fff 20%, var(--brand) 60%, var(--brand-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: var(--muted); margin: 24px auto 0; max-width: 640px; }
.hero-sub strong { color: var(--ink); }
.hero-actions { display: flex; gap: 14px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.btn {
  padding: 14px 28px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s; display: inline-block;
}
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 12px 30px rgba(59, 169, 244, 0.35); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(124, 92, 255, 0.45); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: rgba(255,255,255,0.02); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--brand); }

.hero-stats { display: flex; gap: 42px; justify-content: center; margin-top: 56px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num, .stat-suffix { font-family: "Sora"; font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; color: var(--ink); }
.stat-suffix { color: var(--brand); }
.stat > span:first-child, .stat .stat-suffix { display: inline; }
.stat { position: relative; }
.stat-label { font-size: 12.5px; color: var(--faint); letter-spacing: 0.04em; margin-top: 4px; text-transform: uppercase; }

.scroll-cue { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 1; }
.scroll-cue span {
  display: block; width: 26px; height: 42px; border: 2px solid var(--faint); border-radius: 14px; position: relative;
}
.scroll-cue span::after {
  content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 8px; background: var(--brand); border-radius: 2px; animation: cue 1.6s infinite;
}
@keyframes cue { 0% { opacity: 0; top: 8px; } 40% { opacity: 1; } 80% { opacity: 0; top: 22px; } }

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 110px 24px; }
.section-alt { max-width: none; background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-head { margin-bottom: 54px; }
.section-kicker { color: var(--brand); font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.section-title { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 700; margin-top: 12px; }
.section-desc { color: var(--muted); margin-top: 10px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
.about-lead { font-size: 1.15rem; color: var(--muted); }
.about-lead strong { color: var(--ink); }
.about-cards { display: flex; flex-direction: column; gap: 16px; }
.mini-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px;
  transition: transform 0.25s, border-color 0.25s;
}
.mini-card:hover { transform: translateY(-4px); border-color: var(--brand); }
.mini-card h3 { font-size: 1.05rem; margin-bottom: 6px; color: var(--brand); }
.mini-card p { color: var(--muted); font-size: 0.96rem; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--brand), var(--brand-2), transparent);
}
.tl-item { position: relative; margin-bottom: 26px; }
.tl-dot {
  position: absolute; left: -34px; top: 24px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--brand); display: grid; place-items: center;
}
.tl-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 12px var(--brand); }
.tl-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.tl-card:hover { transform: translateX(6px); border-color: var(--brand); box-shadow: var(--shadow); }
.tl-period { color: var(--brand); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; }
.tl-card h3 { font-size: 1.2rem; margin: 6px 0 2px; }
.tl-org { color: var(--faint); font-size: 0.9rem; font-weight: 500; }
.tl-card ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.96rem; }
.tl-card li { margin-bottom: 5px; }
.tl-card strong { color: var(--accent); }

/* ---------- Skills ---------- */
.skills-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  padding: 11px 20px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line);
  font-size: 14.5px; color: var(--muted); transition: transform 0.2s, color 0.2s, border-color 0.2s, background 0.2s;
}
.chip:hover { transform: translateY(-3px); color: var(--ink); border-color: var(--brand); background: var(--panel-2); }

/* ---------- Projects ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.project-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  transition: transform 0.28s, border-color 0.28s, box-shadow 0.28s; display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-6px); border-color: var(--brand); box-shadow: var(--shadow); }
.project-card.feature {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(59,169,244,0.12), rgba(124,92,255,0.1)), var(--panel);
  border-color: rgba(59,169,244,0.35);
}
.project-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.project-tag {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand);
  background: rgba(59,169,244,0.12); padding: 5px 12px; border-radius: 999px;
}
.project-arrow { font-size: 22px; color: var(--brand); transition: transform 0.25s; }
.project-card.feature:hover .project-arrow { transform: translate(4px, -4px); }
.project-card h3 { font-size: 1.5rem; margin-bottom: 4px; }
.project-card.feature h3 { font-size: 2rem; }
.project-domain { color: var(--brand); font-weight: 600; font-size: 0.95rem; margin-bottom: 12px; }
.project-card p { color: var(--muted); }
.project-stack { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.project-stack span { font-size: 12.5px; color: var(--faint); border: 1px solid var(--line); padding: 4px 11px; border-radius: 8px; }

/* ---------- Education ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.edu-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  transition: transform 0.25s, border-color 0.25s;
}
.edu-card:hover { transform: translateY(-4px); border-color: var(--brand); }
.edu-card h3 { font-size: 1.12rem; margin-bottom: 6px; }
.edu-card p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Contact ---------- */
.contact-wrap { text-align: center; max-width: 760px; }
.contact-lead { color: var(--muted); margin-top: 12px; font-size: 1.1rem; }
.contact-links { display: flex; gap: 18px; justify-content: center; margin-top: 38px; flex-wrap: wrap; }
.contact-link {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px 28px;
  display: flex; flex-direction: column; gap: 4px; min-width: 200px; transition: transform 0.25s, border-color 0.25s;
}
.contact-link:hover { transform: translateY(-4px); border-color: var(--brand); }
.cl-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.cl-value { font-weight: 600; color: var(--ink); }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 34px 24px; display: flex; justify-content: space-between;
  align-items: center; flex-wrap: gap; gap: 12px; color: var(--faint); font-size: 14px; flex-wrap: wrap;
}
.to-top { color: var(--muted); transition: color 0.2s; }
.to-top:hover { color: var(--brand); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links {
    position: fixed; top: 68px; right: 16px; left: 16px; flex-direction: column; align-items: flex-start;
    gap: 6px; background: rgba(10,17,32,0.97); backdrop-filter: blur(14px); border: 1px solid var(--line);
    border-radius: 16px; padding: 18px; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: 0.28s;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { width: 100%; padding: 8px 4px; }
  .nav-toggle { display: flex; }
  .about-grid { grid-template-columns: 1fr; gap: 30px; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card.feature { grid-column: span 1; }
  .edu-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 28px; }
  .section { padding: 80px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
