/* ===== Variables & Theme ===== */
:root {
  --container: 1120px;
  --bg: #0b0f17;
  --bg-alt: #111824;
  --surface: #161f2e;
  --border: #243043;
  --text: #e6edf6;
  --muted: #9fb0c6;
  --primary: #6c8cff;
  --primary-2: #8b5cf6;
  --grad: linear-gradient(120deg, #6c8cff, #8b5cf6 55%, #22d3ee);
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
  --radius: 16px;
  --speed: .25s;
}
[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-alt: #eef2f9;
  --surface: #ffffff;
  --border: #e2e8f2;
  --text: #0f1729;
  --muted: #51607a;
  --shadow: 0 12px 40px rgba(20, 30, 60, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background var(--speed), color var(--speed);
}
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--speed), background var(--speed);
}
.nav.scrolled { border-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav__logo { font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 1.1rem; color: var(--primary); }
.nav__links { display: flex; align-items: center; gap: 22px; }
.nav__links a { color: var(--muted); font-weight: 500; font-size: .95rem; transition: color var(--speed); }
.nav__links a:hover { color: var(--text); }
.nav__cta {
  padding: 8px 18px; border-radius: 999px; color: #fff !important;
  background: var(--grad); font-weight: 600;
}
.nav__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; cursor: pointer; font-size: 1.1rem; transition: var(--speed);
}
.icon-btn:hover { border-color: var(--primary); }
.lang-toggle { font-family: "JetBrains Mono", monospace; font-size: .82rem; font-weight: 600; width: auto; padding: 0 12px; }
.menu-toggle { display: none; }

/* Honeypot anti-spam (hidden from users) */
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 12px; font-weight: 600; font-size: .98rem;
  cursor: pointer; border: 1px solid transparent; transition: transform var(--speed), box-shadow var(--speed), background var(--speed);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(108, 140, 255, .35); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--primary); }

/* ===== Hero ===== */
.hero { position: relative; padding: 96px 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% 30% auto -10%; height: 500px;
  background: radial-gradient(circle at 30% 30%, rgba(108,140,255,.25), transparent 60%);
  filter: blur(20px); z-index: 0;
}
.hero__inner { position: relative; z-index: 1; text-align: center; max-width: 820px; margin: 0 auto; }
.hero__eyebrow {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: .85rem; margin-bottom: 22px;
}
.hero__title { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { color: var(--muted); font-size: 1.12rem; max-width: 600px; margin: 22px auto 0; }
.hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.hero__stats { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; margin-top: 56px; }
.stat { display: flex; flex-direction: column; }
.stat__num { font-size: 2.2rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { color: var(--muted); font-size: .9rem; }

/* ===== Sections ===== */
.section { padding: 84px 0; }
.section--alt { background: var(--bg-alt); }
.section__title { font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 36px; text-align: center; }
.section__title::after { content: ""; display: block; width: 64px; height: 4px; border-radius: 4px; background: var(--grad); margin: 14px auto 0; }

.about { max-width: 760px; margin: 0 auto; text-align: center; }
.about p { color: var(--muted); margin-bottom: 16px; font-size: 1.05rem; }
.about strong { color: var(--text); }

/* ===== GitHub contribution graph (subtle) ===== */
.gh-contrib { max-width: 760px; margin: 32px auto 0; text-align: center; }
.gh-contrib__cap { color: var(--muted); font-size: .82rem; margin-bottom: 12px; letter-spacing: .02em; }
.gh-contrib__frame {
  background: #ffffff; border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; opacity: .9; transition: opacity var(--speed); overflow-x: auto;
}
.gh-contrib__frame:hover { opacity: 1; }
.gh-contrib__frame img { width: 100%; min-width: 560px; height: auto; display: block; }

/* ===== Skills ===== */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.skill-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: transform var(--speed), border-color var(--speed);
}
.skill-card:hover { transform: translateY(-6px); border-color: var(--primary); }
.skill-card h3 { margin-bottom: 16px; font-size: 1.2rem; }
.skill-card ul { list-style: none; }
.skill-card li { color: var(--muted); padding: 7px 0 7px 22px; position: relative; }
.skill-card li::before { content: ""; position: absolute; left: 0; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

/* ===== Timeline ===== */
.timeline { max-width: 720px; margin: 0 auto; position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 34px 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -28px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px var(--bg); }
.tl-date { font-family: "JetBrains Mono", monospace; font-size: .82rem; color: var(--primary); }
.tl-item h3 { margin: 4px 0 6px; font-size: 1.15rem; }
.tl-item p { color: var(--muted); }

/* ===== Projects ===== */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform var(--speed), border-color var(--speed), box-shadow var(--speed);
  display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-6px); border-color: var(--primary); box-shadow: var(--shadow); }
.project-card__media { height: 188px; background: var(--grad); position: relative; overflow: hidden; }
.project-card__media span { position: absolute; inset: 0; display: grid; place-items: center; font-family: "JetBrains Mono", monospace; color: rgba(255,255,255,.9); font-size: 1.4rem; }
.project-card__img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform var(--speed); }
.project-card:hover .project-card__img { transform: scale(1.05); }
.project-card__body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.project-card__body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.project-card__body p { color: var(--muted); font-size: .95rem; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--border); color: var(--muted); }

/* ===== Services ===== */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.service-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: transform var(--speed), border-color var(--speed); }
.service-card:hover { transform: translateY(-6px); border-color: var(--primary); }
.service-card h3 { font-size: 1.08rem; margin-bottom: 10px; }
.service-card p { color: var(--muted); font-size: .94rem; }

/* ===== Contact ===== */
.contact__lead { text-align: center; color: var(--muted); max-width: 560px; margin: 0 auto 32px; }
.contact-form { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: .9rem; font-weight: 500; }
.field input, .field textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 16px; color: var(--text); font: inherit; font-size: .96rem; transition: border-color var(--speed);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); }
.contact-form .btn { grid-column: 1 / -1; }
.form-status { grid-column: 1 / -1; text-align: center; font-size: .92rem; color: var(--primary); min-height: 1.2em; }
.socials { display: flex; gap: 26px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.socials a { color: var(--muted); font-weight: 500; transition: color var(--speed); }
.socials a:hover { color: var(--primary); }

/* ===== Footer ===== */
.footer { padding: 32px 0; border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: .9rem; }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; transition-delay: calc(var(--i, 0) * 60ms); }
.reveal.visible { opacity: 1; transform: none; }

/* ===== Skip link ===== */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--primary); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-weight: 600; transition: top var(--speed);
}
.skip-link:focus { top: 12px; }

/* ===== Focus visible ===== */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

/* ===== Scroll progress ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--grad); z-index: 60; transition: width .1s linear;
}

/* ===== Back to top ===== */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 55;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--grad); color: #fff; font-size: 1.3rem; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: var(--speed);
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-3px); }

/* ===== Typed caret ===== */
.typed.typing { border-right: 2px solid var(--primary); padding-right: 2px; }

/* ===== Project filters & links ===== */
.filters { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.filter-btn {
  padding: 8px 18px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: var(--speed);
}
.filter-btn:hover { border-color: var(--primary); color: var(--text); }
.filter-btn.active {
  position: relative;
  background: var(--grad); color: #fff; border-color: transparent;
  isolation: isolate;
}
.filter-btn.active::before {
  content: ""; position: absolute; z-index: -1; inset: -2px; border-radius: 999px;
  padding: 2px;
  background: conic-gradient(from var(--spin, 0deg), #6c8cff, #8b5cf6, #22d3ee, #6c8cff);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  animation: spin-border 3s linear infinite;
}
@property --spin {
  syntax: "<angle>"; inherits: false; initial-value: 0deg;
}
@keyframes spin-border { to { --spin: 360deg; } }
/* Fallback bila @property tidak didukung: putar elemennya */
@supports not (background: conic-gradient(from var(--spin), red, red)) {
  .filter-btn.active::before { animation: spin-rotate 3s linear infinite; }
  @keyframes spin-rotate { to { transform: rotate(360deg); } }
}
.proj-actions { display: flex; gap: 16px; margin-top: 16px; }
.proj-link { font-size: .88rem; font-weight: 600; color: var(--primary); }
.proj-link:hover { text-decoration: underline; }

/* ===== Process ===== */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.process-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform var(--speed), border-color var(--speed);
}
.process-card:hover { transform: translateY(-6px); border-color: var(--primary); }
.process-num { font-family: "JetBrains Mono", monospace; font-size: 1.6rem; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.process-card h3 { margin: 10px 0 8px; font-size: 1.12rem; }
.process-card p { color: var(--muted); font-size: .94rem; }

/* ===== Testimonials ===== */
.testimonials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.testi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 18px;
}
.testi-card blockquote { color: var(--text); font-size: 1rem; line-height: 1.7; margin: 0; flex: 1; }
.testi-meta { display: flex; align-items: center; gap: 14px; font-size: .9rem; }
.testi-avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--grad); color: #fff; font-weight: 700; font-family: "JetBrains Mono", monospace;
}
.testi-role { color: var(--muted); font-size: .85rem; }

/* ===== FAQ ===== */
.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 4px 20px; transition: border-color var(--speed);
}
.faq-item[open] { border-color: var(--primary); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; position: relative; padding-right: 30px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; color: var(--primary); transition: transform var(--speed);
}
.faq-item[open] summary::after { content: "-"; }
.faq-item p { color: var(--muted); padding: 0 0 18px; margin: 0; }

/* ===== 404 ===== */
.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.notfound__code { font-size: clamp(4rem, 18vw, 9rem); font-weight: 800; line-height: 1; }
.notfound__title { font-size: clamp(1.4rem, 4vw, 2rem); margin: 8px 0 12px; }
.notfound__lead { color: var(--muted); max-width: 420px; margin: 0 auto 28px; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .nav__links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 12px 24px 24px; transform: translateY(-120%); transition: transform var(--speed); align-items: stretch;
    max-height: calc(100vh - 68px); overflow-y: auto;
  }
  .nav__links.open { transform: none; }
  .nav__links a { padding: 12px 0; }
  .nav__cta { text-align: center; margin-top: 8px; }
  .menu-toggle { display: grid; }
}
@media (max-width: 900px) {
  .skills, .projects, .services, .process, .testimonials { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .skills, .projects, .services, .process, .testimonials { grid-template-columns: 1fr; }
  .contact-form { grid-template-columns: 1fr; }
  .hero__stats { gap: 28px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn:hover, .skill-card:hover, .project-card:hover, .service-card:hover,
  .process-card:hover, .to-top:hover { transform: none !important; }
  .project-card:hover .project-card__img { transform: none !important; }
  .typed.typing { border-right: none; }
  .filter-btn.active::before { animation: none !important; }
}
