:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #17181c;
  --muted: #5b5f66;
  --border: #e5e4e0;
  --accent: #1d4ed8;
  --accent-text: #ffffff;
  --tag-personal-bg: #eef2ff;
  --tag-personal-text: #1d4ed8;
  --tag-kantor-bg: #f1f1ee;
  --tag-kantor-text: #45484e;
  --tag-freelance-bg: #f1f1ee;
  --tag-freelance-text: #45484e;
  --shadow: 0 1px 2px rgba(20, 20, 20, .04);
}

html[data-theme="dark"] {
  --bg: #101114;
  --surface: #17181c;
  --text: #eef0f4;
  --muted: #9aa0ab;
  --border: #2a2c32;
  --accent: #6d94ff;
  --accent-text: #0c1020;
  --tag-personal-bg: #1b2340;
  --tag-personal-text: #a8bcff;
  --tag-kantor-bg: #1f2025;
  --tag-kantor-text: #c3c6ce;
  --tag-freelance-bg: #1f2025;
  --tag-freelance-text: #c3c6ce;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
  transition: background-color .15s, color .15s;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }

.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  background: var(--text); color: var(--bg);
  font: 700 16px "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}
.brand-cursor { width: 3px; height: 14px; border-radius: 1px; background: var(--accent); display: inline-block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 700; font-size: 14px; color: var(--text); }
.brand-handle { font-size: 11px; color: var(--muted); letter-spacing: .04em; }

.nav { display: flex; gap: 28px; }
.nav a {
  text-decoration: none; font-size: 14px; font-weight: 500; color: var(--muted);
}
.nav a:hover { color: var(--text); }

.top-actions { display: flex; align-items: center; gap: 12px; }

.language-switch {
  display: flex; padding: 3px; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
}
.lang-btn {
  border: 0; background: transparent; padding: 5px 11px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11px; font-weight: 700;
  color: var(--muted); text-decoration: none; border-radius: 14px; letter-spacing: .02em;
}
.lang-btn.active { background: var(--accent); color: var(--accent-text); }

.theme-toggle {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; display: grid; place-items: center; font-size: 14px;
}
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: inline; }

.nav-toggle {
  display: none; width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span { width: 16px; height: 2px; background: var(--text); display: block; }

/* Sections */
section { padding: 88px 0; border-bottom: 1px solid var(--border); }
main > section:last-child { border-bottom: none; }

.eyebrow, .section-eyebrow {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}

/* Hero */
.hero { padding-top: 110px; padding-bottom: 96px; }
.hero h1 { font-size: 44px; font-weight: 800; margin-bottom: 18px; }
.hero-handle { color: var(--muted); font-weight: 600; }
.hero-lede { max-width: 640px; font-size: 17px; color: var(--muted); margin: 0 0 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { opacity: .92; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--text); }

/* About */
h2 { font-size: 28px; font-weight: 700; margin-bottom: 28px; max-width: 640px; }
.about-grid { display: grid; grid-template-columns: 1fr 220px; gap: 48px; align-items: start; }
.about-text { color: var(--muted); font-size: 15.5px; max-width: 620px; }
.stat-row { display: flex; gap: 28px; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 34px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Skills */
.skills-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.skill-group { background: var(--surface); padding: 22px; }
.skill-group h3 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.skill-group p { font-size: 13.5px; color: var(--muted); margin: 0; }

/* Projects */
.featured-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 36px; box-shadow: var(--shadow); margin-bottom: 56px;
}
.featured-body h3 { font-size: 22px; margin: 10px 0 12px; }
.featured-body > p { color: var(--muted); font-size: 15px; max-width: 680px; }

.tag {
  display: inline-block; font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  padding: 4px 10px; border-radius: 999px;
}
.tag-personal { background: var(--tag-personal-bg); color: var(--tag-personal-text); }
.tag-kantor { background: var(--tag-kantor-bg); color: var(--tag-kantor-text); }
.tag-freelance { background: var(--tag-freelance-bg); color: var(--tag-freelance-text); }

.highlights { margin: 16px 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.highlights li { margin-bottom: 6px; }

.tech-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
.tech-tag {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 9px;
}

.featured-links { display: flex; gap: 12px; flex-wrap: wrap; }

.case-studies-heading { margin-bottom: 10px; }
.case-studies-note { color: var(--muted); font-size: 14px; max-width: 620px; margin: 0 0 28px; }

.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.case-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px; box-shadow: var(--shadow);
}
.case-card h3 { font-size: 16px; margin: 10px 0 8px; }
.case-card p { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }
.case-card .tech-tags { margin: 0; }
.case-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 14px; }
.case-links a { font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.case-links a:hover { text-decoration: underline; }

/* Contact */
.contact-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* Footer */
.site-footer { padding: 32px 0; }
.footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .case-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 16px 24px; gap: 16px;
  }
  .nav.nav-open { display: flex; }
  .nav-toggle { display: flex; }
  .hero h1 { font-size: 32px; }
  .skills-grid { grid-template-columns: 1fr; }
  .case-grid { grid-template-columns: 1fr; }
  section { padding: 56px 0; }
}

@media (max-width: 420px) {
  .topbar { padding: 0 16px; }
  .top-actions { gap: 6px; }
  .brand-handle { display: none; }
  .lang-btn { padding: 5px 8px; }
}

@media print {
  .topbar, .top-actions, .hero-actions, .featured-links, .case-links,
  .contact-links, .site-footer { display: none; }
  body { background: #fff; color: #000; }
  section { padding: 16px 0; border-bottom: 0; }
  .featured-card, .case-card, .skill-group { box-shadow: none; border: 1px solid #ccc; }
  a { text-decoration: none; color: #000; }
}
