/* RESET & BASE */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

:root {
  --bg: #f8fafc;
  --bg2: #ffffff;
  --card: #ffffff;
  --text: #334155;
  --text2: #475569;
  --muted: #64748b;
  --light: #94a3b8;
  --heading: #0f172a;
  --border: #e2e8f0;
  --border2: #f1f5f9;
  --shadow: 0 10px 30px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.06);
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --gradient: linear-gradient(135deg, #3b82f6, #8b5cf6, #3b82f6);
  --nav-bg: rgba(255, 255, 255, 0.75);
  --hero-grad: linear-gradient(145deg, #dbeafe, #ede9fe);
  --card-grad: linear-gradient(125deg, #eff6ff, #e0e7ff);
  --canvas-node: rgba(59, 130, 246, 0.2);
  --canvas-line: rgba(59, 130, 246, 0.1);
}

body.dark-mode {
  --bg: #090e17;
  --bg2: #0f172a;
  --card: #141e33;
  --text: #cbd5e1;
  --text2: #94a3b8;
  --muted: #64748b;
  --light: #475569;
  --heading: #f8fafc;
  --border: #1e293b;
  --border2: #0f172a;
  --shadow: 0 10px 30px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.6);
  --nav-bg: rgba(9, 14, 23, 0.75);
  --hero-grad: linear-gradient(145deg, #1e3a8a, #4c1d95);
  --card-grad: linear-gradient(125deg, #1e293b, #172554);
  --canvas-node: rgba(139, 92, 246, 0.3);
  --canvas-line: rgba(139, 92, 246, 0.15);
}

/* Utilities */
.container { max-width: 1100px; margin: 0 auto; padding: 0 28px; }
.relative-z { position: relative; z-index: 10; }
a { text-decoration: none; color: inherit; }
strong { color: var(--heading); }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-48 { margin-top: 48px; }

/* Scroll Progress */
.scroll-progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--gradient); width: 0%; z-index: 10000; border-radius: 0 2px 2px 0; }

/* Gradient Text */
.gradient-text { background: var(--gradient); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: shine 4s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }

/* Buttons */
.btn-primary { background: var(--gradient); background-size: 200% auto; color: #fff; padding: 11px 26px; border-radius: 40px; font-weight: 600; font-size: 0.9rem; border: none; display: inline-flex; align-items: center; gap: 8px; transition: all 0.4s ease; box-shadow: 0 4px 15px rgba(59,130,246,0.3); cursor: pointer; }
.btn-primary:hover { background-position: right center; transform: translateY(-3px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); }
.btn-secondary { background: var(--bg2); color: var(--text); padding: 11px 26px; border-radius: 40px; font-weight: 600; font-size: 0.9rem; border: 2px solid var(--border); display: inline-flex; align-items: center; gap: 8px; transition: all 0.3s ease; cursor: pointer; }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: rgba(59, 130, 246, 0.05); transform: translateY(-3px); }

/* Nav */
nav { width: 100%; background: var(--nav-bg); -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(255, 255, 255, 0.05); transition: all 0.3s ease; }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 14px 28px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.5px; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text2); font-weight: 500; font-size: 0.9rem; position: relative; transition: color 0.3s; }
.nav-links a::after { content: ''; position: absolute; bottom: -6px; left: 0; width: 0; height: 2px; background: var(--accent); transition: width 0.3s ease; border-radius: 2px; }
.nav-links a:hover { color: var(--heading); }
.nav-links a:hover::after { width: 100%; }
.dark-mode-toggle { background: var(--card); border: 1px solid var(--border); width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text); transition: all 0.4s ease; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.dark-mode-toggle:hover { color: var(--accent); transform: rotate(30deg) scale(1.1); box-shadow: 0 5px 15px rgba(59, 130, 246, 0.2); }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.4rem; color: var(--text); transition: color 0.3s; cursor: pointer; }

/* Hero */
.hero-section { padding: 90px 0; position: relative; overflow: hidden; }
#networkCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.hero { display: flex; align-items: center; gap: 60px; flex-wrap: wrap; }
.hero-content { flex: 1 1 450px; }
.hero-greeting { font-weight: 700; color: var(--accent); text-transform: uppercase; font-size: 0.85rem; margin-bottom: 12px; letter-spacing: 1.5px; }
.hero-content h1 { font-size: 3.8rem; font-weight: 800; line-height: 1.1; color: var(--heading); margin-bottom: 12px; letter-spacing: -1px; }

/* Typing Effect */
.hero-description { font-size: 1.25rem; font-weight: 500; color: var(--text2); margin-bottom: 35px; line-height: 1.6; min-height: 60px; }
.typed-cursor { font-weight: bold; color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.hero-image { flex: 1 1 350px; display: flex; justify-content: center; position: relative; }
.profile-img-wrapper { width: 320px; height: 320px; border-radius: 50%; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--hero-grad); border: 5px solid var(--bg2); animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0px); box-shadow: 0 20px 50px rgba(0,0,0,0.1); } 50% { transform: translateY(-15px); box-shadow: 0 30px 60px rgba(0,0,0,0.15); } }
.profile-photo { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.profile-img-wrapper:hover .profile-photo { transform: scale(1.08) rotate(-2deg); }

/* Sections */
section { padding: 80px 0; }
#pendidikan { background: var(--bg2); border-top: 1px solid var(--border2); border-bottom: 1px solid var(--border2); }
.section-title { font-size: 2.5rem; font-weight: 800; color: var(--heading); margin-bottom: 10px; letter-spacing: -0.5px; }
.section-subtitle { color: var(--muted); font-size: 1.1rem; margin-bottom: 50px; }
.cert-section-heading { font-size: 1.25rem; font-weight: 700; color: var(--heading); margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px dashed var(--border); display: inline-block; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 50px; align-items: start; }
.about-text p { margin-bottom: 20px; color: var(--text2); font-size: 1.05rem; }
.skills { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.skill-tag { background: var(--bg2); border: 1px solid var(--border); padding: 8px 18px; border-radius: 30px; font-size: 0.85rem; font-weight: 600; color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,0.02); transition: all 0.3s ease; }
.skill-tag:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(59, 130, 246, 0.15); }
.about-card { background: var(--card); padding: 32px; border-radius: 24px; border: 1px solid var(--border2); box-shadow: var(--shadow); transition: transform 0.4s ease, box-shadow 0.4s ease; }
.about-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.about-card-title { font-weight: 700; color: var(--heading); margin-bottom: 8px; font-size: 1.1rem; }
.about-card-highlight { font-weight: 700; color: var(--accent); font-size: 1.05rem; }
.about-card-sub { color: var(--muted); font-size: 0.95rem; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 35px; border-left: 2px solid var(--border); padding-left: 35px; margin-left: 10px; }
.timeline-item { position: relative; opacity: 0; transform: translateX(-20px); transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.timeline-item.visible { opacity: 1; transform: translateX(0); }
.timeline-item::before { content: ''; position: absolute; left: -42px; top: 5px; width: 14px; height: 14px; background: var(--accent); border-radius: 50%; border: 4px solid var(--bg2); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); transition: all 0.3s ease; }
.timeline-item:hover::before { background: var(--bg2); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4); transform: scale(1.2); }
.timeline-year { font-weight: 700; background: var(--accent); color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; display: inline-block; margin-bottom: 10px; }
.timeline-role { font-weight: 800; font-size: 1.25rem; color: var(--heading); margin-bottom: 4px; }
.timeline-company { color: var(--muted); font-weight: 600; margin-bottom: 10px; font-size: 0.95rem; }

/* Cards */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.cert-card { background: var(--card); border: 1px solid var(--border2); border-radius: 20px; padding: 28px; display: flex; gap: 20px; opacity: 0; transform: translateY(20px); transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: var(--shadow); cursor: pointer; }
.cert-card.visible { opacity: 1; transform: translateY(0); }
.cert-card:hover { transform: translateY(-8px); box-shadow: 0 15px 35px -10px rgba(59, 130, 246, 0.3); border-color: var(--accent); }
.cert-icon { width: 55px; height: 55px; min-width: 55px; background: rgba(59, 130, 246, 0.1); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--accent); transition: all 0.4s ease; }
.cert-card:hover .cert-icon { background: var(--gradient); color: #fff; transform: rotate(10deg); }
.cert-info h3 { font-weight: 700; font-size: 1.1rem; color: var(--heading); margin-bottom: 4px; }
.cert-org { font-weight: 600; font-size: 0.85rem; color: var(--accent); margin-bottom: 8px; }
.cert-info p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.cert-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.cert-tag { background: var(--bg2); border: 1px solid var(--border); padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }

.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.portfolio-card { background: var(--card); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border2); opacity: 0; transform: translateY(20px); transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); cursor: pointer; }
.portfolio-card.visible { opacity: 1; transform: translateY(0); }
.portfolio-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px -10px rgba(59, 130, 246, 0.3); border-color: var(--accent); }
.card-img { height: 200px; background: var(--card-grad); display: flex; align-items: center; justify-content: center; font-size: 3.5rem; color: var(--accent); transition: all 0.4s ease; position: relative; overflow: hidden; }
.card-img::after { content: ''; position: absolute; width: 100%; height: 100%; background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.05)); top: 0; left: 0; }
.portfolio-card:hover .card-img { font-size: 4rem; color: var(--accent-hover); }
.card-content { padding: 26px; }
.card-content h3 { font-weight: 800; font-size: 1.25rem; color: var(--heading); margin-bottom: 10px; }
.card-content p { color: var(--muted); font-size: 0.95rem; }

/* Contact */
.contact-box { background: var(--card-grad); border-radius: 28px; padding: 50px; box-shadow: var(--shadow-lg); display: flex; flex-wrap: wrap; gap: 40px; align-items: center; justify-content: space-between; border: 1px solid var(--border); }
.contact-info h3 { font-size: 2.2rem; font-weight: 800; color: var(--heading); margin-bottom: 12px; letter-spacing: -0.5px; }
.contact-detail { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; color: var(--heading); font-weight: 600; font-size: 1.05rem; transition: transform 0.3s; }
.contact-detail:hover { transform: translateX(5px); color: var(--accent); }
.contact-detail i { color: var(--accent); width: 20px; font-size: 1.2rem; }
.social-links { display: flex; gap: 16px; margin-top: 26px; }
.social-links a { color: var(--text); background: var(--bg2); width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); font-size: 1.1rem; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.social-links a:hover { background: var(--accent); color: #fff; transform: translateY(-5px) scale(1.1); box-shadow: 0 10px 20px rgba(59,130,246,0.3); border-color: var(--accent); }
.glow-emoji { font-size: 5.5rem; opacity: 0.9; animation: float 4s ease-in-out infinite; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1)); }

/* Footer */
footer { text-align: center; padding: 40px 0; color: var(--muted); font-size: 0.95rem; border-top: 1px solid var(--border2); font-weight: 500; }

/* Responsive */
@media (max-width: 850px) {
  .hero { flex-direction: column-reverse; text-align: center; gap: 40px; }
  .hero-content h1 { font-size: 2.8rem; }
  .hero-description { min-height: 80px; }
  .hero-cta { justify-content: center; }
  .profile-img-wrapper { width: 260px; height: 260px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; position: absolute; top: 70px; left: 0; right: 0; background: var(--nav-bg); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); flex-direction: column; padding: 24px 28px; gap: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); border-bottom: 1px solid var(--border); }
  .nav-links.active { display: flex; animation: slideDown 0.3s ease forwards; }
  @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
  .mobile-menu-btn { display: block; }
  .contact-box { padding: 40px 28px; text-align: center; justify-content: center; flex-direction: column; }
  .contact-detail { justify-content: center; }
  .social-links { justify-content: center; }
}
@media (max-width: 480px) {
  .hero-content h1 { font-size: 2.2rem; }
  .hero-description { font-size: 1.1rem; min-height: 90px; }
  .section-title { font-size: 2rem; }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn-primary, .hero-cta .btn-secondary { width: 100%; justify-content: center; }
}