/* ================= THEME ================= */
:root {
  --bg: #0a0c11;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e9ecf2;
  --muted: #9aa3b4;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --grad: linear-gradient(120deg, #a78bfa 0%, #8b5cf6 35%, #22d3ee 100%);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --radius: 18px;
  --nav-bg: rgba(10, 12, 17, 0.65);
  --blob-op: 0.45;
  --grid-line: rgba(255, 255, 255, 0.035);
  --card-solid: rgba(22, 24, 33, 0.92);
}
[data-theme="light"] {
  --bg: #f7f8fc;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #546072;
  --accent: #7c3aed;
  --accent-2: #0891b2;
  --grad: linear-gradient(120deg, #7c3aed 0%, #6d28d9 35%, #0891b2 100%);
  --shadow: 0 20px 50px -24px rgba(30, 41, 59, 0.25);
  --nav-bg: rgba(247, 248, 252, 0.75);
  --blob-op: 0.25;
  --grid-line: rgba(15, 23, 42, 0.04);
  --card-solid: rgba(255, 255, 255, 0.95);
}

/* ================= BASE ================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s, color 0.4s;
}
h1, h2, h3 { font-family: "Space Grotesk", sans-serif; line-height: 1.15; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.fill { fill: currentColor; stroke: none; }
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
::selection { background: var(--accent); color: #fff; }

/* ================= BACKGROUND ================= */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--blob-op); animation: drift 22s ease-in-out infinite alternate; }
.b1 { width: 520px; height: 520px; background: #7c3aed; top: -160px; left: -120px; }
.b2 { width: 460px; height: 460px; background: #06b6d4; top: 30%; right: -160px; animation-delay: -7s; }
.b3 { width: 380px; height: 380px; background: #db2777; bottom: -160px; left: 30%; opacity: calc(var(--blob-op) * 0.6); animation-delay: -14s; }
.grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}
@keyframes drift { to { transform: translate(60px, 40px) scale(1.1); } }

/* ================= NAV ================= */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; transition: background 0.3s, border-color 0.3s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: var(--nav-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.4rem; }
.logo span { color: var(--accent-2); }
.nav-links { display: flex; gap: 6px; }
.nav-links a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-size: 0.95rem; font-weight: 500; transition: color 0.2s, background 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-actions { display: flex; gap: 8px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: transform 0.2s, border-color 0.2s; }
.icon-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
[data-theme="dark"] .icon-btn .moon, [data-theme="light"] .icon-btn .sun { display: none; }
.menu-btn { display: none; }

/* ================= BUTTONS ================= */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 0.98rem; transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s; }
.btn svg { width: 18px; height: 18px; transition: transform 0.2s; }
.btn:hover svg { transform: translateX(3px); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.7); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(139, 92, 246, 0.85); }
.btn.ghost { border: 1px solid var(--border); background: var(--surface); }
.btn.ghost:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn.small { padding: 10px 20px; font-size: 0.92rem; margin-top: 8px; }

/* ================= HERO ================= */
.hero { min-height: 100vh; display: flex; align-items: center; position: relative; padding: 110px 0 80px; }
.hero-inner { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 0.85rem; color: var(--muted); }
.dot { 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 { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); margin: 22px 0 12px; }
.role { font-size: clamp(1.2rem, 2.6vw, 1.6rem); color: var(--muted); font-family: "Space Grotesk", sans-serif; font-weight: 500; }
.typed { color: var(--text); }
.caret { color: var(--accent-2); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.lead { max-width: 540px; margin: 20px 0 32px; color: var(--muted); font-size: 1.08rem; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; }
.cta.center { justify-content: center; }
.socials { display: flex; gap: 12px; margin-top: 36px; }
.socials a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); transition: all 0.2s; }
.socials a:hover { color: var(--text); border-color: var(--accent); transform: translateY(-3px); }

.hero-visual { position: relative; display: grid; place-items: center; aspect-ratio: 1; max-width: 420px; justify-self: center; width: 100%; }
.avatar-ring { width: 78%; aspect-ratio: 1; border-radius: 50%; padding: 4px; background: conic-gradient(from 0deg, #8b5cf6, #22d3ee, #db2777, #8b5cf6); animation: spin 10s linear infinite; }
.avatar { width: 100%; height: 100%; border-radius: 50%; background: var(--bg); display: grid; place-items: center; overflow: hidden; animation: spin 10s linear infinite reverse; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar span { font-family: "Space Grotesk", sans-serif; font-size: clamp(3rem, 9vw, 5.5rem); font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.float-card { position: absolute; padding: 10px 16px; border-radius: 14px; background: var(--card-solid); border: 1px solid var(--border); backdrop-filter: blur(10px); box-shadow: var(--shadow); font-size: 0.9rem; font-weight: 600; white-space: nowrap; animation: float 5s ease-in-out infinite; }
.float-card span { margin-right: 6px; }
.fc1 { top: 8%; left: -4%; }
.fc2 { top: 46%; right: -8%; animation-delay: -1.6s; }
.fc3 { bottom: 6%; left: 6%; animation-delay: -3.2s; }
@keyframes float { 50% { transform: translateY(-12px); } }

.scroll-hint { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--border); border-radius: 20px; }
.scroll-hint span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent-2); animation: scroll 1.8s infinite; }
@keyframes scroll { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }

/* ================= SECTIONS ================= */
.section { padding: 110px 0; }
.section-head { margin-bottom: 52px; }
.eyebrow { display: inline-block; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 12px; }
.section-head h2, .contact-card h2 { font-size: clamp(2rem, 4.2vw, 3rem); }

/* About */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: start; }
.about-text p { color: var(--muted); margin-bottom: 16px; font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat { padding: 26px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: transform 0.25s, border-color 0.25s; }
.stat:hover { transform: translateY(-4px); border-color: var(--accent); }
.stat strong { display: block; font-family: "Space Grotesk", sans-serif; font-size: 2.4rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: 0.92rem; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.skill-card, .tl-card, .edu-card, .project { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s; }
.skill-card { padding: 28px; position: relative; overflow: hidden; }
.skill-card::before, .project::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 246, 0.14), transparent 45%); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.skill-card:hover::before, .project:hover::before { opacity: 1; }
.skill-card:hover, .tl-card:hover, .edu-card:hover, .project:hover { transform: translateY(-5px); border-color: rgba(139, 92, 246, 0.5); box-shadow: var(--shadow); }
.skill-icon { font-size: 1.8rem; margin-bottom: 12px; }
.skill-card h3 { font-size: 1.25rem; margin-bottom: 16px; }
.chips, .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span, .tags span { padding: 6px 13px; border-radius: 999px; font-size: 0.85rem; font-weight: 500; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }

/* Timeline */
.timeline { list-style: none; position: relative; padding-left: 32px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), var(--accent-2), transparent); }
.timeline > li { position: relative; margin-bottom: 28px; }
.tl-dot { position: absolute; left: -32px; top: 28px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.15); }
.tl-card { padding: 26px 28px; }
.tl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tl-top h3 { font-size: 1.25rem; }
.tl-date { font-size: 0.85rem; font-weight: 600; color: var(--accent-2); font-family: "Space Grotesk", sans-serif; }
.tl-company { color: var(--muted); margin: 4px 0 14px; font-weight: 500; }
.tl-card ul { padding-left: 18px; color: var(--muted); }
.tl-card li { margin-bottom: 6px; }
.tl-card li::marker { color: var(--accent); }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.project-thumb { height: 170px; display: grid; place-items: center; position: relative; overflow: hidden; }
.project-thumb span { font-family: "Space Grotesk", sans-serif; font-size: 4rem; font-weight: 700; color: rgba(255, 255, 255, 0.9); transition: transform 0.4s; }
.project:hover .project-thumb span { transform: scale(1.12) rotate(-4deg); }
.t1 { background: linear-gradient(135deg, #7c3aed, #22d3ee); }
.t2 { background: linear-gradient(135deg, #db2777, #f59e0b); }
.t3 { background: linear-gradient(135deg, #0ea5e9, #10b981); }
.project-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.project-body h3 { font-size: 1.25rem; }
.project-body p { color: var(--muted); font-size: 0.96rem; flex: 1; }
.project-links { display: flex; gap: 18px; font-weight: 600; font-size: 0.92rem; }
.project-links a { color: var(--accent-2); transition: opacity 0.2s; }
.project-links a:hover { opacity: 0.7; }

/* Achievements */
.awards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.award { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 18px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s; }
.award::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 246, 0.14), transparent 45%); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.award:hover::before { opacity: 1; }
.award:hover { transform: translateY(-5px); border-color: rgba(139, 92, 246, 0.5); box-shadow: var(--shadow); }
.award-mark { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 3rem; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.award-mark.small { font-size: 2.2rem; }
.award-body { display: flex; flex-direction: column; gap: 10px; }
.award-tag { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-2); }
.award h3 { font-size: 1.15rem; }
.award p { color: var(--muted); font-size: 0.96rem; }
.award-link { color: var(--accent-2); font-weight: 600; font-size: 0.92rem; margin-top: 4px; }
.award-link:hover { opacity: 0.7; }
.award.featured { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 32px; padding: 36px; background: radial-gradient(ellipse at 0% 0%, rgba(139, 92, 246, 0.2), transparent 55%), radial-gradient(ellipse at 100% 100%, rgba(34, 211, 238, 0.12), transparent 55%), var(--surface); }
.award.featured .award-mark { font-size: 5.5rem; flex-shrink: 0; width: 160px; height: 160px; display: grid; place-items: center; border-radius: 28px; border: 1px solid var(--border); background-color: var(--surface-2); }
.award.featured h3 { font-size: 1.5rem; }
.tl-dot.edu { border-color: var(--accent-2); box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.15); }
.about-text strong { color: var(--text); font-weight: 600; }

/* Education */
.edu-grid { display: grid; gap: 18px; }
.edu-card { display: flex; gap: 20px; align-items: center; padding: 26px 28px; }
.edu-icon { font-size: 2rem; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); flex-shrink: 0; }
.edu-card h3 { font-size: 1.2rem; }
.edu-card p { color: var(--muted); }

/* Contact */
.contact-card { text-align: center; padding: 72px 32px; border-radius: 28px; border: 1px solid var(--border); background: radial-gradient(ellipse at top, rgba(139, 92, 246, 0.18), transparent 60%), var(--surface); position: relative; overflow: hidden; }
.contact-card p { color: var(--muted); max-width: 520px; margin: 16px auto 32px; font-size: 1.08rem; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 0.92rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer a:hover { color: var(--text); }

/* ================= REVEAL ================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s cubic-bezier(.2, .7, .2, 1), transform 0.8s cubic-bezier(.2, .7, .2, 1); }
.reveal.visible { opacity: 1; transform: none; }

/* ================= RESPONSIVE ================= */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-text { order: 2; }
  .hero-visual { order: 1; max-width: 300px; }
  .lead { margin-inline: auto; }
  .cta, .socials { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .projects-grid, .awards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .menu-btn { display: grid; }
  .nav-links { position: fixed; top: 68px; left: 16px; right: 16px; flex-direction: column; padding: 12px; border-radius: 18px; background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border); box-shadow: var(--shadow); opacity: 0; transform: translateY(-10px); pointer-events: none; transition: opacity 0.25s, transform 0.25s; }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 12px 16px; }
  .section { padding: 80px 0; }
  .skills-grid, .projects-grid, .awards-grid { grid-template-columns: 1fr; }
  .award.featured { flex-direction: column; align-items: flex-start; padding: 28px; gap: 18px; }
  .award.featured .award-mark { width: 110px; height: 110px; font-size: 3.6rem; border-radius: 22px; }
  .award.featured h3 { font-size: 1.25rem; }
  .float-card { font-size: 0.78rem; padding: 8px 12px; }
  .fc2 { right: -2%; }
  .contact-card { padding: 52px 20px; }
  .scroll-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
