:root {
  --bg: #080c11;
  --bg-2: #0b1118;
  --panel: rgba(15, 22, 32, 0.4);
  --muted: #8b9bb4;
  --text: #f0f4f8;
  --accent: #7c5cff;
  --accent-2: #00e6a8;
  --glass-bg: rgba(255, 255, 255, 0.02);
  --glass-border: rgba(255, 255, 255, 0.05);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: clip; /* clip instead of hidden keeps position: sticky working */
}

/* Dynamic Glowing Background Orbs */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.25;
  animation: pulseRotate 15s infinite alternate ease-in-out;
}
body::before {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -150px;
  left: -200px;
}
body::after {
  width: 500px;
  height: 500px;
  background: var(--accent-2);
  bottom: -100px;
  right: -150px;
  animation-duration: 20s;
  animation-direction: alternate-reverse;
}

@keyframes pulseRotate {
  0% { transform: scale(1) translate(0, 0); opacity: 0.2; }
  50% { opacity: 0.35; }
  100% { transform: scale(1.1) translate(50px, 30px); opacity: 0.2; }
}

a { color: var(--accent-2); text-decoration: none; transition: 0.3s ease; }
a:hover { color: #fff; text-shadow: 0 0 8px var(--accent-2); }
img { max-width: 100%; display: block; }

/* Header & Nav */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 12, 17, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}
.container { max-width: 1150px; margin: 0 auto; padding: 24px 32px; }

nav { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 16px; }

/* Enhanced Logo to match the image beautifully */
.logo {
  flex-shrink: 0; /* Mencegah gambar lonjong/tertekan di mobile */
  width: 54px; height: 54px;
  border-radius: 50%;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid transparent;
  background-image: linear-gradient(var(--bg), var(--bg)), linear-gradient(135deg, var(--accent), var(--accent-2));
  background-origin: border-box;
  background-clip: content-box, border-box;
  box-shadow: 0 4px 15px rgba(124, 92, 255, 0.3);
  transition: transform 0.3s ease;
}
.logo:hover { transform: scale(1.05) rotate(5deg); }
.logo img { width: 100%; height: 100%; object-fit: cover; }

.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

.navlinks { display: flex; gap: 8px; align-items: center; background: rgba(0,0,0,0.2); border-radius: 20px; padding: 4px 8px; border: 1px solid var(--glass-border); }
.navlinks a { 
  padding: 8px 16px; border-radius: 16px; font-weight: 600; font-size: 14px; 
  color: var(--muted); transition: 0.3s ease;
}
.navlinks a:hover { color: #fff; background: rgba(255,255,255,0.05); text-shadow: none; }
.navlinks a.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1118;
  box-shadow: 0 4px 15px rgba(0, 230, 168, 0.3);
}

/* Layout */
main { padding: 48px 0; animation: fadeIn 0.8s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }

/* Glassmorphism Cards */
.card {
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 32px;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(124, 92, 255, 0.1);
}

/* Typography Enhancements */
.role { 
  display: inline-block;
  background: rgba(124,92,255,0.1);
  color: #fff;
  border: 1px solid rgba(124,92,255,0.3);
  padding: 6px 14px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 16px;
  box-shadow: 0 4px 10px rgba(124,92,255,0.2);
}
.hero-left h1 { 
  font-size: 42px; 
  margin: 0 0 12px; 
  line-height: 1.15;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 30%, #a4b4c4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline { color: var(--muted); margin-bottom: 24px; font-size: 16px; line-height: 1.6; }

/* Buttons */
.cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 12px 20px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.btn:hover { 
  background: rgba(255,255,255,0.08); 
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.2);
  text-shadow: none;
}
.btn.primary { 
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1118; border: none;
  box-shadow: 0 4px 15px rgba(124, 92, 255, 0.3);
}
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 230, 168, 0.4);
  color: #000;
}

/* Right Aside stats */
.hero-right { display: flex; flex-direction: column; gap: 16px; }
.stat {
  display: flex; justify-content: space-between; align-items: center; 
  padding: 16px; border-radius: 16px; background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.02);
}
.small { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* Sections */
section { margin-top: 48px; }
section h3 { font-size: 24px; margin: 0 0 20px; color: #fff; font-weight: 700; letter-spacing: -0.01em; }

/* Skills List */
.skills-list { display: flex; flex-direction: column; gap: 12px; }
.skill { 
  display: flex; align-items: center; gap: 12px; 
  padding: 16px; border-radius: 12px; 
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)); 
  border: 1px solid var(--glass-border);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.skill:hover {
  transform: translateX(5px);
  border-color: rgba(0, 230, 168, 0.4);
  background: linear-gradient(90deg, rgba(0,230,168,0.05), transparent);
}
.skill strong { font-weight: 600; color: #fff; }

/* Projects Grid */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.project {
  position: relative; overflow: hidden;
  padding: 24px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(20,28,40,0.6), rgba(15,22,32,0.4));
  border: 1px solid var(--glass-border);
  min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.project::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0; transition: opacity 0.3s ease;
}
.project:hover { transform: translateY(-8px); box-shadow: 0 15px 35px rgba(0,0,0,0.6); border-color: rgba(255,255,255,0.1); }
.project:hover::before { opacity: 1; }

.project .meta { display: flex; align-items: center; color: var(--accent-2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.project .title { font-weight: 800; font-size: 20px; color: #fff; }
.project .desc { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 8px 0 0; }
.project .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tag { 
  font-size: 11px; padding: 4px 10px; border-radius: 20px; 
  background: rgba(124, 92, 255, 0.1); color: #c4b5fd; 
  border: 1px solid rgba(124, 92, 255, 0.2); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* Writeups Page */
.writeup-year { margin-top: 48px; }
.year-title { font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 24px; position:relative; display:inline-block;}
.year-title::after { content:""; position:absolute; bottom:-4px; left:0; width:50%; height:3px; background:var(--accent); border-radius:2px; }

.writeup-list { list-style: none; padding: 0; margin: 0; }
.writeup-list li {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px;
  padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.3s ease; border-radius: 12px;
}
.writeup-list li:hover { background: rgba(255,255,255,0.02); padding-left: 32px; }
.writeup-list li a { color: #fff; font-weight: 600; font-size: 16px; }
.writeup-list .date { font-size: 14px; color: var(--accent-2); font-weight: 600; }

/* Contact */
#contact .card {
  background: linear-gradient(135deg, rgba(124,92,255,0.05), rgba(0,230,168,0.05));
  border-color: rgba(124,92,255,0.2);
}

/* Footer */
footer { margin-top: 60px; padding: 32px 0; border-top: 1px solid var(--glass-border); color: var(--muted); text-align: center; font-size: 14px; }
.links strong { color: #fff; }

/* Mobile Menu Toggle */
.nav-toggle { display: none; background: transparent; border: 0; padding: 8px; cursor: pointer; }
.hamburger { display: inline-block; width: 24px; height: 18px; position: relative; }
.hamburger span {
  position: absolute; left: 0; right: 0; height: 2px;
  background: #fff; border-radius: 2px;
  transition: all .3s ease;
}
.hamburger span:nth-child(1) { top: 0px; }
.hamburger span:nth-child(2) { top: 8px; }
.hamburger span:nth-child(3) { top: 16px; }

.nav-toggle.open .hamburger span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.nav-toggle.open .hamburger span:nth-child(2) { opacity: 0; }
.nav-toggle.open .hamburger span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

/* Responsive */
@media (max-width: 1000px) {
  .container { padding: 20px 24px; }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  main { padding: 32px 0; }
  
  .brand { gap: 12px; }
  .brand-name { font-size: 16px; }
  .brand-desc { display: none; } /* Sembunyikan deskripsi di mobile agar logo & toggle muat */
  
  .navlinks { display: none; }
  .logo { width: 42px; height: 42px; flex-shrink: 0; }
  
  .hero-right { order: 2; gap: 12px; }
  .hero-left h1 { font-size: 32px; margin-bottom: 8px; }
  .card { padding: 20px; border-radius: 16px; }
  
  .projects { grid-template-columns: 1fr; }
  .project { min-height: auto; padding: 20px; }
  
  .nav-toggle { display: flex; align-items: center; justify-content: center; z-index: 100; padding: 6px; }
  
  .navlinks {
    display: flex; flex-direction: column; position: absolute;
    top: 64px; right: 20px; left: 20px;
    background: rgba(15,22,32,0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 16px; gap: 8px; border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    opacity: 0; transform: translateY(-10px);
    pointer-events: none; transition: all .3s ease; z-index: 60;
  }
  .navlinks a { width: 100%; text-align: center; }
  .navlinks.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
}
