/* ===== VARIABLES & BASE ===== */
:root {
  --bg: #0a0a1e;
  --bg-secondary: rgba(0,0,0,0.2);
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(0, 240, 255, 0.05);
  --nav-bg: rgba(10, 10, 30, 0.95);
  --text: #fff;
  --text-secondary: rgba(255,255,255,0.8);
  --text-muted: rgba(255,255,255,0.6);
  --accent: #00f0ff;
  --accent-secondary: #7b2ff7;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(0, 240, 255, 0.3);
  --input-bg: rgba(255,255,255,0.05);
  --shadow: rgba(0, 240, 255, 0.3);
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  --main-bg: linear-gradient(180deg, #0a0a1e 0%, #0d0b2a 25%, #1a0a2e 50%, #0d0b2a 75%, #0a0a1e 100%);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-secondary: rgba(0,0,0,0.03);
  --bg-card: rgba(255,255,255,0.9);
  --bg-card-hover: rgba(0, 140, 200, 0.05);
  --nav-bg: rgba(255, 255, 255, 0.95);
  --text: #1a1a2e;
  --text-secondary: #2d3748;
  --text-muted: #64748b;
  --accent: #0891b2;
  --accent-secondary: #7c3aed;
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(8, 145, 178, 0.3);
  --input-bg: rgba(0,0,0,0.03);
  --shadow: rgba(8, 145, 178, 0.2);
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  --main-bg: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 25%, #e8eef5 50%, #f1f5f9 75%, #f8fafc 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--main-bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gradient); border-radius: 4px; }

/* ===== ANIMATIONS ===== */
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-20px); } }
@keyframes pulse { 0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.05); } }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); } 40% { transform: translateX(-50%) translateY(-10px); } 60% { transform: translateX(-50%) translateY(-5px); } }
@keyframes scrollDot { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(8px); } }
@keyframes travelDown { 0% { top: -80px; } 100% { top: 100%; } }
@keyframes travelRight { 0% { left: -120px; } 100% { left: 100%; } }
@keyframes nodePulse { 0%, 100% { opacity: 0.3; transform: scale(1); } 50% { opacity: 0.8; transform: scale(1.8); } }
@keyframes typing { from { width: 0; } to { width: 100%; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ===== SECTION REVEAL ===== */
.section-reveal { opacity: 0; transform: translateY(60px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.section-reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== UTILITIES ===== */
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent; }
.accent { color: var(--accent); }
.purple { color: var(--accent-secondary); }
.section-container { max-width: 1100px; width: 100%; margin: 0 auto; }
.section-container.narrow { max-width: 800px; }
.section-title { font-size: clamp(2rem, 4vw, 3rem); text-align: center; margin-bottom: 1rem; font-weight: 700; }
.title-bar { width: 60px; height: 4px; background: var(--gradient); border-radius: 2px; margin: 0 auto 3rem; }
.section-divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(0,240,255,0.2), transparent); margin: 0 10%; }
.section-divider.purple { background: linear-gradient(90deg, transparent, rgba(123,47,247,0.2), transparent); }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 1.2rem 2rem; background: transparent;
  display: flex; justify-content: space-between; align-items: center;
  transition: all 0.3s ease;
}
.navbar.scrolled { padding: 0.8rem 2rem; background: var(--nav-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav-logo { font-size: 1.5rem; font-weight: 700; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; cursor: pointer; letter-spacing: 2px; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-link { color: var(--text-muted); cursor: pointer; font-size: 0.9rem; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; transition: color 0.3s; border-bottom: 2px solid transparent; padding-bottom: 4px; }
.nav-link.active, .nav-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.theme-toggle { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg-card); cursor: pointer; font-size: 1.1rem; transition: all 0.3s; display: flex; align-items: center; justify-content: center; }
.theme-toggle:hover { border-color: var(--accent); transform: rotate(180deg); }

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed; bottom: 2rem; right: 2rem; width: 48px; height: 48px;
  border-radius: 50%; background: var(--gradient); border: none; color: #fff;
  font-size: 1.3rem; cursor: pointer; display: flex; align-items: center;
  justify-content: center; z-index: 999; opacity: 0;
  transform: translateY(20px) scale(0.8); transition: all 0.3s ease;
  pointer-events: none; box-shadow: 0 4px 20px var(--shadow);
}
.back-to-top.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.back-to-top:hover { transform: translateY(-3px) scale(1.1); box-shadow: 0 8px 30px var(--shadow); }

/* ===== HERO ===== */
.hero-section { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 2rem; }
.hero-orb { position: absolute; width: 500px; height: 500px; border-radius: 50%; background: radial-gradient(circle, rgba(123,47,247,0.15), transparent 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); animation: pulse 4s ease-in-out infinite; }
.hero-content { position: relative; z-index: 1; text-align: center; }
.hero-subtitle { color: var(--accent); font-size: 1rem; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 1rem; font-weight: 500; }
.hero-title { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; margin: 0 0 1.5rem; line-height: 1.1; }
.typed-text { font-size: clamp(1rem, 2.5vw, 1.3rem); color: var(--text-muted); min-height: 2rem; font-family: monospace; }
.typed-cursor { animation: blink 1s infinite; color: var(--accent); }
.hero-buttons { margin-top: 2.5rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-primary { padding: 0.9rem 2.5rem; background: var(--gradient); border: none; border-radius: 50px; color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s; box-shadow: 0 0 30px var(--shadow); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 50px var(--shadow); }
.btn-outline { padding: 0.9rem 2.5rem; background: transparent; border: 2px solid var(--accent); border-radius: 50px; color: var(--accent); font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-outline:hover { background: rgba(0,240,255,0.1); }
.scroll-indicator { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); animation: bounce 2s infinite; }
.scroll-mouse { width: 24px; height: 40px; border: 2px solid var(--accent); border-radius: 12px; display: flex; justify-content: center; padding-top: 8px; opacity: 0.6; }
.scroll-dot { width: 4px; height: 8px; background: var(--accent); border-radius: 2px; animation: scrollDot 2s infinite; }

/* ===== ABOUT ===== */
.about-section { min-height: 100vh; padding: 8rem 2rem; display: flex; align-items: center; justify-content: center; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 3rem; align-items: center; }
.about-left { display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.avatar-container { position: relative; width: 240px; height: 240px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.avatar-ring { position: absolute; inset: -3px; border-radius: 50%; background: conic-gradient(var(--accent), var(--accent-secondary), var(--accent)); opacity: 0.3; animation: float 6s linear infinite; }
.avatar-bg { position: absolute; inset: 3px; border-radius: 50%; background: var(--bg); }
.avatar-emoji { position: relative; z-index: 1; font-size: 7rem; }
.avatar-badge { position: absolute; bottom: 10px; right: 10px; padding: 0.4rem 0.8rem; background: var(--gradient); border-radius: 20px; font-size: 0.7rem; color: #fff; font-weight: 600; box-shadow: 0 4px 15px var(--shadow); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; width: 100%; max-width: 280px; }
.stat-card { text-align: center; padding: 1.2rem 0.5rem; background: var(--bg-card); border-radius: 14px; border: 1px solid var(--accent); border-color: rgba(0,240,255,0.3); transition: all 0.3s; cursor: default; box-shadow: 0 2px 10px rgba(0,240,255,0.06); }
.stat-card:hover { transform: scale(1.06); border-color: var(--accent); box-shadow: 0 8px 30px rgba(0,240,255,0.2); }
.stat-icon { font-size: 1.2rem; display: block; margin-bottom: 0.25rem; }
.stat-value { font-size: 1.3rem; font-weight: 800; display: block; }
.stat-label { color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; }
.about-right { }
.role-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; background: rgba(0,240,255,0.1); border: 1px solid rgba(0,240,255,0.4); border-radius: 20px; margin-bottom: 1.5rem; box-shadow: 0 2px 12px rgba(0,240,255,0.15); }
.role-badge span { color: var(--accent); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.about-text { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.8; margin-bottom: 1.5rem; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.info-card { padding: 1.1rem; background: var(--bg-card); border-radius: 14px; border: 1px solid rgba(0,240,255,0.2); display: flex; align-items: center; gap: 0.75rem; transition: all 0.3s; cursor: default; box-shadow: 0 2px 10px rgba(0,240,255,0.05); }
.info-card:hover { transform: scale(1.04); border-color: var(--accent); box-shadow: 0 8px 25px rgba(0,240,255,0.15); background: var(--bg-card-hover); }
.info-icon { width: 36px; height: 36px; background: rgba(0,240,255,0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.info-label { color: var(--text-muted); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 0.15rem; }
.info-value { color: var(--text); font-size: 0.85rem; font-weight: 600; display: block; }
.about-cta { margin-top: 1.5rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ===== SKILLS ===== */
.skills-section { min-height: 100vh; padding: 8rem 2rem; display: flex; align-items: center; justify-content: center; background: var(--bg-secondary); }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.skill-card { padding: 2rem; background: var(--bg-card); border-radius: 20px; border: 1px solid var(--border); }
.skill-category { font-size: 1.1rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; }
.skill-bar-wrap { margin-bottom: 1.5rem; }
.skill-bar-wrap > span:first-child { color: var(--text-secondary); font-size: 0.95rem; }
.skill-bar-wrap > span:last-of-type { float: right; font-size: 0.85rem; font-weight: 600; }
.skill-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 0.5rem; clear: both; }
.skill-fill { height: 100%; width: 0%; background: var(--gradient); border-radius: 3px; transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1); }
.skill-fill.animated { box-shadow: 0 0 8px rgba(0,240,255,0.4); }
.tags-section { margin-top: 3rem; text-align: center; }
.tags-section h3 { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 1.5rem; }
.tags-wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.tag { padding: 0.5rem 1.2rem; background: rgba(0,240,255,0.08); border: 1px solid rgba(0,240,255,0.2); border-radius: 20px; color: var(--text-secondary); font-size: 0.85rem; transition: all 0.3s; cursor: default; }
.tag:hover { background: rgba(0,240,255,0.15); border-color: var(--accent); color: var(--accent); }
.tag.purple { background: rgba(123,47,247,0.08); border-color: rgba(123,47,247,0.2); }
.tag.purple:hover { background: rgba(123,47,247,0.15); border-color: var(--accent-secondary); color: var(--accent-secondary); }

/* ===== RESUME ===== */
.resume-section { min-height: 100vh; padding: 8rem 2rem; display: flex; flex-direction: column; align-items: center; }
.resume-heading { font-size: 1.3rem; margin-bottom: 2rem; display: flex; align-items: center; gap: 0.75rem; }
.timeline { position: relative; padding-left: 2rem; margin-bottom: 4rem; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--gradient); border-radius: 1px; }
.timeline-item { margin-bottom: 2.5rem; position: relative; }
.timeline-dot { position: absolute; left: -2rem; top: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); margin-left: -1px; }
.timeline-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem 2rem; transition: all 0.3s; }
.timeline-card:hover { border-color: rgba(0,240,255,0.3); box-shadow: 0 10px 30px rgba(0,240,255,0.08); }
.timeline-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.timeline-header h4 { color: var(--text); font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.period-badge { padding: 0.3rem 0.8rem; border-radius: 8px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; border: 1px solid; }
.period-badge.purple { color: var(--accent-secondary); border-color: rgba(123,47,247,0.3); background: rgba(123,47,247,0.1); }
.timeline-card ul, .edu-card ul { list-style: none; padding: 0; }
.timeline-card li, .edu-card li { color: var(--text-muted); font-size: 0.88rem; line-height: 1.7; padding-left: 1.2rem; position: relative; margin-bottom: 0.4rem; }
.timeline-card li::before { content: '▸'; position: absolute; left: 0; color: var(--accent); }
.edu-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem 2rem; margin-bottom: 1.5rem; }
.edu-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.edu-header h4 { color: var(--text); font-size: 1.05rem; font-weight: 600; margin-bottom: 0.25rem; }
.edu-header p { color: var(--accent-secondary); font-size: 0.9rem; font-weight: 500; }
.edu-card li::before { content: '▸'; position: absolute; left: 0; color: var(--accent-secondary); }
.cert-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2rem; }
.cert-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; transition: all 0.3s; }
.cert-item:hover { border-color: rgba(123,47,247,0.4); }
.cert-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--shadow); flex-shrink: 0; }
.cert-item span:nth-child(2) { flex: 1; color: var(--text); font-size: 0.9rem; font-weight: 500; }
.cert-issuer { padding: 0.2rem 0.7rem; background: rgba(123,47,247,0.1); border: 1px solid rgba(123,47,247,0.25); border-radius: 8px; color: var(--accent-secondary); font-size: 0.72rem; font-weight: 600; }

/* ===== CONTACT ===== */
.contact-section { min-height: 100vh; padding: 8rem 2rem; display: flex; align-items: center; justify-content: center; background: var(--bg-secondary); }
.section-subtitle { text-align: center; color: var(--text-muted); max-width: 500px; margin: 0 auto 3rem; line-height: 1.7; }
.contact-form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px; padding: 2.5rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem; margin-bottom: 1.2rem; }
.form-group { margin-bottom: 0; }
.form-group input, .form-group textarea { width: 100%; padding: 1rem 1.2rem; background: var(--input-bg); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 0.95rem; outline: none; transition: border-color 0.3s; box-sizing: border-box; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group input.valid, .form-group textarea.valid { border-color: #22c55e; }
.form-group input.error, .form-group textarea.error { border-color: #ef4444; }
.form-meta { display: flex; justify-content: space-between; align-items: center; }
.field-status { font-size: 0.75rem; margin-top: 0.3rem; }
.field-status.error { color: #ef4444; }
.field-status.valid { color: #22c55e; }
.char-count { color: var(--text-muted); font-size: 0.7rem; margin-top: 0.3rem; }
.btn-submit { width: 100%; padding: 1rem 2rem; background: var(--border); border: none; border-radius: 12px; color: var(--text-muted); font-size: 1rem; font-weight: 600; cursor: not-allowed; transition: all 0.3s; margin-top: 1.2rem; }
.btn-submit.active { background: var(--gradient); color: #fff; cursor: pointer; box-shadow: 0 0 20px var(--shadow); }
.btn-submit.active:hover { transform: translateY(-2px); box-shadow: 0 0 40px var(--shadow); }
.success-msg { text-align: center; padding: 2rem; }
.success-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.success-msg h3 { color: var(--accent); margin-bottom: 0.5rem; }
.success-msg p { color: var(--text-muted); }
.social-links { display: flex; justify-content: center; gap: 1rem; margin-top: 2.5rem; }
.social-links a { width: 50px; height: 50px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; text-decoration: none; transition: all 0.3s; }
.social-links a:hover { background: rgba(0,240,255,0.1); border-color: var(--accent); transform: translateY(-3px); }
.footer { margin-top: 4rem; text-align: center; padding-top: 2rem; border-top: 1px solid var(--border); }
.footer p { color: var(--text-muted); font-size: 0.85rem; }

/* ===== BACKGROUND LINES ===== */
.background-lines { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
[data-theme="light"] .background-lines { opacity: 0.6; }
.main-content { position: relative; z-index: 1; }

/* ===== PARTICLES ===== */
.particle { position: absolute; border-radius: 50%; animation: float 5s ease-in-out infinite; }