/* ============ VARIABLES & THEMES ============ */
:root {
  --bg: #000000;
  --bg2: #0a0a0a;
  --card: #111111;
  --accent: #ffffff;
  --accent2: #a3a3a3;
  --text: #ffffff;
  --muted: #a3a3a3;
  --radius: 20px;
  --line: rgba(255, 255, 255, .12);
  --nav-bg: rgba(0, 0, 0, .85);
  --nav-menu: rgba(0, 0, 0, .97);
  --shadow: rgba(0, 0, 0, .6);

  /* Spacing Variables */
  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-2xl: 48px;
  --sp-3xl: 64px;
  --sp-4xl: 80px;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg2: #fafafa;
  --card: #ffffff;
  --text: #000000;
  --muted: #525252;
  --accent: #000000;
  --accent2: #525252;
  --line: rgba(0, 0, 0, .12);
  --nav-bg: rgba(255, 255, 255, .88);
  --nav-menu: rgba(255, 255, 255, .98);
  --shadow: rgba(0, 0, 0, .15);
}

/* ============ RESETS & BASE ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background .4s, color .4s;
}

h1, h2, h3, .logo {
  font-family: 'Playfair Display', serif;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ============ UTILITIES ============ */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform-origin: left;
  transform: scaleX(0);
}

/* ============ CUSTOM CURSOR ============ */
.cursor {
  position: fixed;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .2s, height .2s, background .2s;
  mix-blend-mode: difference;
  display: none;
}

.cursor.big {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, .15);
}

@media (hover: hover) {
  .cursor {
    display: block;
  }
}

/* ============ NAVIGATION ============ */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 6%;
  transition: .35s;
}

nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 12px 6%;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
}

.logo span {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-size: .9rem;
  color: var(--muted);
  font-weight: 500;
  position: relative;
  transition: .25s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: .3s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 50px;
  text-decoration: none;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: .9rem;
  transition: .3s;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.btn:hover {
  opacity: .85;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px var(--shadow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
  box-shadow: none;
}

.burger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ============ THEME TOGGLE ============ */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  transition: .3s;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(15deg);
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: inline;
}

/* ============ HERO SECTION ============ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 80px;
  padding: 120px 10% 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .07), transparent 65%);
  pointer-events: none;
}

/* ============ BACKGROUND RIPPLE EFFECT ============ */
/* Meniru Aceternity: sel solid gelap + inset shadow + animasi opacity */
.ripple-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  overflow: hidden;
  /* grid memudar dari atas (mask radial seperti demo) */
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
}

.ripple-cell {
  background: rgba(255, 255, 255, .03);
  border: .5px solid rgba(255, 255, 255, .10);
  box-shadow: inset 0 0 40px 1px rgba(255, 255, 255, .04);
  opacity: .4;
  will-change: opacity;
  animation: cellRipple 1.7s ease-out;
  animation-play-state: paused; /* diam sampai dipicu JS */
}

.ripple-cell.play {
  animation-play-state: running;
}

@keyframes cellRipple {
  0% { opacity: .4; }
  50% { opacity: .95; }
  100% { opacity: .4; }
}

[data-theme="light"] .ripple-cell {
  background: rgba(0, 0, 0, .04);
  border-color: rgba(0, 0, 0, .12);
  box-shadow: inset 0 0 40px 1px rgba(0, 0, 0, .05);
}

/* konten hero tetap di atas grid */
.hero-text, .hero-visual {
  position: relative;
  z-index: 2;
}

.hero-text {
  max-width: 580px;
  position: relative;
  z-index: 2;
  flex: 1;
}

.hero-intro {
  margin-bottom: 44px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent2);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  margin-bottom: 20px;
  width: fit-content;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.grad {
  background: linear-gradient(90deg, #fff, #737373);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.typed-wrap {
  min-height: 1.8em;
  color: var(--accent2);
  font-weight: 600;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  margin-bottom: 20px;
  display: block;
  line-height: 1.3;
}

.typed-caret {
  display: inline-block;
  width: 2px;
  background: var(--accent2);
  animation: blink 1s steps(1) infinite;
  margin-left: 4px;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  letter-spacing: .3px;
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-cta-section {
  margin-bottom: 44px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-note {
  font-size: .85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .5px;
  font-weight: 500;
}

.hero-stats-wrap {
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, .05);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.stat {
  text-align: left;
}

.stat b {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: var(--accent2);
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  line-height: 1;
}

.stat small {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.5;
  font-weight: 500;
}

.hero-visual {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.blob {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  z-index: -1;
  top: -40px;
  left: -40px;
  background: linear-gradient(135deg, #fff, #525252);
  opacity: .12;
  filter: blur(90px);
  animation: float 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

/* ============ SECTIONS GENERAL ============ */
section {
  padding: 80px 10%;
  margin: 0;
}

section:not(#software) {
  border-bottom: 1px solid var(--line);
}

.sec-head {
  margin-bottom: 48px;
  max-width: 640px;
}

.sec-head .num {
  color: var(--accent);
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: .85rem;
  margin-bottom: 8px;
  display: block;
}

.sec-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
}

/* ============ REVEAL ON SCROLL (beragam arah + stagger) ============ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1);
  transition-delay: var(--rd, 0ms);
  will-change: opacity, transform;
}

/* Variasi arah masuk */
.reveal.rv-left  { transform: translateX(-56px); }
.reveal.rv-right { transform: translateX(56px); }
.reveal.rv-zoom  { transform: scale(.86) translateY(24px); }
.reveal.rv-flip  { transform: perspective(900px) rotateX(-14deg) translateY(40px); transform-origin: top; }
.reveal.rv-blur  { filter: blur(10px); }

.reveal.visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Stagger otomatis untuk grup (anak .rv-item di dalam .rv-stagger) */
.rv-stagger .rv-item {
  opacity: 0;
  transform: translateY(28px) scale(.96);
  transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.rv-stagger.visible .rv-item { opacity: 1; transform: none; }

/* ============ SPLIT HEADING (huruf masuk satu per satu) ============ */
.split-heading .sh-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(.9em) rotate(6deg);
  transition: opacity .6s ease, transform .7s cubic-bezier(.22,1,.36,1);
  transition-delay: calc(var(--i, 0) * 32ms);
}

.split-heading.visible .sh-char { opacity: 1; transform: none; }
.split-heading .sh-space { display: inline-block; width: .28em; }

/* ============ FLOATING / IDLE MOTION ============ */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

.float-slow { animation: floatY 6s ease-in-out infinite; }
.float-slower { animation: floatY 9s ease-in-out infinite; }

/* ============ PARALLAX DEKORASI ============ */
.parallax-layer { will-change: transform; transition: transform .18s linear; }

/* Marquee item muncul bergelombang saat halaman dibuka */
.marquee-track .marquee-item { animation: marqueeItemIn .7s cubic-bezier(.22,1,.36,1) backwards; }
.marquee-track .marquee-item:nth-child(1) { animation-delay: .1s; }
.marquee-track .marquee-item:nth-child(2) { animation-delay: .2s; }
.marquee-track .marquee-item:nth-child(3) { animation-delay: .3s; }
.marquee-track .marquee-item:nth-child(4) { animation-delay: .4s; }

@keyframes marqueeItemIn {
  from { opacity: 0; transform: translateY(26px) scale(.8); }
  to { opacity: 1; transform: none; }
}

/* Hormati prefers-reduced-motion untuk semua animasi scroll */
html[data-motion="off"] {
  .reveal, .rv-stagger .rv-item, .split-heading .sh-char {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .marquee-track .marquee-item { animation: none !important; }
  .float-slow, .float-slower { animation: none !important; }
  .parallax-layer { transition: none !important; transform: none !important; }
}

/* ============ TOOLS / SOFTWARE MARQUEE ============ */
#software {
  padding: 32px 0;
  background: var(--bg2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.site-footer-marquee {
  display: flex;
  overflow: hidden;
  user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 100%;
  justify-content: space-around;
  animation: marquee 18s linear infinite;
}

.site-footer-marquee:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.marquee-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 32px;
  transition: transform .3s;
  cursor: default;
}

.marquee-item:hover {
  transform: translateY(-4px);
}

.marquee-item b {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
}

.app-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 14px;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.app-icon.dark {
  background: transparent;
  border: none;
}

/* ============ SELECTED WORKS ============ */
#portofolio {
  background: var(--bg2);
}

.sw-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.sw-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: .95;
}

.sw-sub {
  max-width: 380px;
  color: var(--muted);
  font-size: .95rem;
  text-align: right;
}

.sw-list {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

/* --- Satu baris proyek --- */
.sw-project {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 56px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 48px;
}

.sw-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sw-cat {
  display: inline-block;
  align-self: flex-start;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50px;
  padding: 6px 14px;
}

.sw-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: -0.02em;
  transition: color .4s;
}

.sw-project:hover .sw-name {
  color: var(--accent);
}

.sw-desc {
  color: var(--muted);
  font-size: .92rem;
  max-width: 46ch;
}

/* Statistik 3 kolom */
.sw-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  border-left: 2px solid var(--line);
  padding-left: 20px;
}

.sw-stats b {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 800;
}

.sw-stats span {
  font-size: .62rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}

/* Tech tags */
.sw-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sw-tags span {
  font-size: .68rem;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
}

/* Tombol aksi */
.sw-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: auto;
}

.sw-link {
  position: relative;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 4px;
}

.sw-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width .3s;
}

.sw-link:hover::after {
  width: 100%;
}

.sw-visit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 8px;
  transition: .25s;
}

.sw-visit:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

/* --- Gambar dengan 3D tilt --- */
.sw-media {
  perspective: 1000px;
  cursor: pointer;
}

.sw-card {
  position: relative;
  aspect-ratio: 16/9; /* 1920x1080 */
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform .15s ease-out, border-color .4s;
  box-shadow: 0 24px 60px var(--shadow);
}

.sw-project:hover .sw-card {
  border-color: rgba(255, 255, 255, .3);
}

.sw-card .thumb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  font-weight: 800;
  color: rgba(255, 255, 255, .14);
}

.sw-card .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sw-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  transition: background .5s;
}

.sw-project:hover .sw-overlay {
  background: rgba(0, 0, 0, .1);
}

.sw-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateZ(50px);
  pointer-events: none;
}

.sw-view span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .92);
  color: #000;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 14px 26px;
  border-radius: 50px;
  opacity: 0;
  transform: scale(.9);
  transition: .4s;
  backdrop-filter: blur(4px);
}

.sw-project:hover .sw-view span {
  opacity: 1;
  transform: scale(1);
}

/* Gradient Backgrounds for Works (monokrom) */
.g1 { background: linear-gradient(135deg, #404040, #0a0a0a); }
.g2 { background: linear-gradient(135deg, #525252, #171717); }
.g3 { background: linear-gradient(135deg, #262626, #000000); }
.g4 { background: linear-gradient(135deg, #3f3f46, #18181b); }
.g5 { background: linear-gradient(135deg, #57534e, #292524); }
.g6 { background: linear-gradient(135deg, #334155, #0f172a); }

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10, 10, 14, .92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5%;
  opacity: 0;
  pointer-events: none;
  transition: .35s;
  isolation: isolate;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lb-card {
  max-width: 860px;
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transform: translateY(30px) scale(.97);
  transition: transform .45s cubic-bezier(.16, 1, .3, 1);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .55);
}

.lightbox.open .lb-card {
  transform: none;
}

/* ---- Galeri / Slider ---- */
.lb-gallery {
  position: relative;
  aspect-ratio: 16/9; /* 1920x1080 */
  background: #0d0d12;
  overflow: hidden;
  flex-shrink: 0;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Playfair Display', serif;
  color: rgba(255, 255, 255, .16);
}

.lb-track {
  display: flex;
  height: 100%;
  transition: transform .45s cubic-bezier(.16, 1, .3, 1);
  will-change: transform;
}

.lb-track.dragging { transition: none; }

.lb-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  place-items: center;
  font-size: 4rem;
  font-weight: 800;
}

.lb-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}

/* Navigasi foto (di dalam galeri) */
.lb-gnav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .3s, background .3s, color .3s, border-color .3s;
  z-index: 3;
}

.lb-gallery:hover .lb-gnav,
.lb-gnav:focus-visible { opacity: 1; }

.lb-gnav:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.lb-gprev { left: 14px; }
.lb-gnext { right: 14px; }

.lb-gnav[hidden] { display: none; }

/* Progress bar */
.lb-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, .12);
  z-index: 3;
}

.lb-progress b {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .45s cubic-bezier(.16, 1, .3, 1);
}

.lb-progress[hidden] { display: none; }

/* Counter "1 / 3" */
.lb-count {
  position: absolute;
  bottom: 12px;
  right: 14px;
  z-index: 3;
  font-size: .72rem;
  letter-spacing: 2px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 255, 255, .15);
  backdrop-filter: blur(4px);
  font-variant-numeric: tabular-nums;
  font-family: 'Inter', sans-serif;
}

.lb-count:empty { display: none; }

.lb-body {
  padding: 28px 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lb-body small {
  color: var(--accent2);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: .72rem;
  display: block;
  margin-bottom: 8px;
}

.lb-body h3 {
  font-size: 1.5rem;
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.lb-body p {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
}

.lb-dim {
  margin-top: 14px;
  display: inline-block;
  font-size: .75rem;
  color: var(--accent2);
  border: 1px dashed var(--line);
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: .5px;
}

/* Dots */
.lb-dots {
  display: none;
  gap: 8px;
  justify-content: center;
  padding-top: 16px;
}

.lb-dots.has-multi { display: flex; }

.lb-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, .22);
  cursor: pointer;
  padding: 0;
  transition: width .3s, background .3s;
}

.lb-dot.active { width: 22px; background: var(--accent); }

.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  z-index: 5;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: .25s;
}

.lb-close:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: .25s;
  z-index: 3;
}

.lb-nav:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.lb-prev { left: 2%; }
.lb-next { right: 2%; }

/* ============ EXPERIENCE ============ */
.timeline {
  position: relative;
  max-width: 760px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}

.t-item {
  position: relative;
  padding: 0 0 40px 46px;
  margin-bottom: 8px;
}

.t-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}

.t-item .year {
  color: var(--accent2);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 6px;
}

.t-item h3 {
  font-size: 1.2rem;
  margin: 0 0 4px 0;
  font-weight: 700;
}

.t-item em {
  color: var(--muted);
  font-style: normal;
  font-size: .9rem;
  display: block;
  margin-bottom: 8px;
}

.t-item p {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
}

/* ============ CONTACT ============ */
#kontak {
  background: var(--bg2);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Glow mengikuti kursor di section kontak */
.contact-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.06), transparent 60%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .5s;
  z-index: 0;
}

[data-theme="light"] .contact-glow {
  background: radial-gradient(circle, rgba(0,0,0,.05), transparent 60%);
}

#kontak:hover .contact-glow { opacity: 1; }
#kontak > :not(.contact-glow) { position: relative; z-index: 1; }
#kontak { padding-block: clamp(48px, 7vw, 88px); }
#kontak .sec-head { margin-bottom: 20px; }
#kontak .contact-thanks { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }
#kontak .contact-intro { margin-bottom: 24px; }
#kontak .contact-links { margin-top: 0; flex-wrap: wrap; gap: 12px; }
#kontak .contact-links a, #kontak .contact-links button {
  width: auto; height: auto; min-height: 48px; padding: 12px 24px;
  border-radius: 50px; font: inherit; font-size: .9rem;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
#kontak .contact-links a:hover { background: var(--accent); color: var(--bg); }
#kontak .contact-links button:disabled { opacity: .45; cursor: not-allowed; }

/* Shine sweep pada tombol kirim */
.contact-form .btn {
  position: relative;
  overflow: hidden;
}

.contact-form .btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}

.contact-form .btn:hover::after { left: 130%; }

/* Input: tampilkan checkmark saat valid */
.contact-form .field { position: relative; }

.contact-form .field .tick {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 800;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .25s, transform .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}

.contact-form .field.valid .tick { opacity: 1; transform: scale(1); }
.contact-form .field.valid input,
.contact-form .field.valid textarea { border-color: var(--accent2); }

/* ============ TOAST NOTIFICATION ============ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 80px);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 50px;
  padding: 14px 26px;
  font-size: .9rem;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transition: transform .45s cubic-bezier(.34,1.56,.64,1), opacity .35s;
  pointer-events: none;
  box-shadow: 0 12px 40px var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ============ CONFETTI ============ */
.confetti {
  position: fixed;
  width: 9px;
  height: 9px;
  z-index: 10001;
  pointer-events: none;
  animation: confettiFall 1.6s cubic-bezier(.25,.8,.4,1) forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(70vh) rotate(720deg); opacity: 0; }
}

/* ============ MAGNETIC ELEMENTS ============ */
.magnetic {
  transition: transform .25s cubic-bezier(.22,1,.36,1);
  will-change: transform;
}

/* ============ HERO PARALLAX LAYERS ============ */
.hero-visual { transition: transform .35s ease-out; will-change: transform; }

/* ============ SPOTLIGHT PADA KARTU KARYA ============ */
.sw-card { position: relative; }

.sw-card .spotlight {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.14), transparent 45%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
  z-index: 2;
}

.sw-card:hover .spotlight { opacity: 1; }

[data-theme="light"] .sw-card .spotlight {
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(0,0,0,.08), transparent 45%);
}

/* ============ TIMELINE DRAW-ON-SCROLL ============ */
.timeline::before {
  transform-origin: top;
  transform: scaleY(var(--tl-progress, 0));
  transition: transform .2s linear;
}

.t-item::before {
  transition: transform .4s cubic-bezier(.34,1.56,.64,1), box-shadow .4s;
}

.t-item.visible::before {
  transform: scale(1.25);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent);
}

#kontak .sec-head {
  margin-left: auto;
  margin-right: auto;
}

#kontak h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  margin-bottom: 16px;
}

#kontak .contact-intro {
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 40px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.contact-form {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
  text-align: left;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: .92rem;
  transition: .25s;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form .btn {
  justify-self: center;
  margin-top: 8px;
}

.form-note {
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 12px;
}

.form-note.shake {
  animation: noteShake .45s ease;
}

@keyframes noteShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.socials {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 40px;
}

.socials a {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: .8rem;
  transition: .3s;
}

.socials a:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-4px);
}

/* ============ FOOTER ============ */
footer {
  padding: 32px 10%;
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  border-top: 1px solid var(--line);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 100px 10% 50px;
    gap: 48px;
    justify-content: center;
  }
  .hero-text { max-width: none; }
  .hero h1 { margin-bottom: 12px; }
  .hero p { margin: 0 auto 28px; font-size: 1rem; }
  .hero-cta { justify-content: center; }
  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 40px;
    padding-top: 32px;
    width: 100%;
  }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .photo-frame { width: 300px; height: 380px; }
  .sw-project { grid-template-columns: 1fr; gap: 32px; }
  .sw-media { order: -1; }
  .sw-sub { text-align: left; }
}

@media (max-width: 768px) {
  section { padding: 60px 5%; border-bottom: 1px solid var(--line); }
  .sec-head { margin-bottom: 36px; }
  .sw-head { margin-bottom: 40px; }
  .sw-list { gap: 56px; }
  .sw-stats b { font-size: .95rem; }
  .nav-links {
    position: fixed;
    inset: 0;
    background: var(--nav-menu);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    font-size: 1.1rem;
    transform: translateY(-100%);
    transition: .4s;
    display: flex;
  }
  .nav-links.open { transform: none; }
  .burger { display: block; z-index: 101; position: relative; }
  nav .btn { display: none; }
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 80px 5% 50px;
    gap: 32px;
  }
  .hero-text { max-width: none; }
  .hero-intro { margin-bottom: 32px; }
  .hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 12px; }
  .hero p { font-size: 1rem; margin-bottom: 28px; margin-left: auto; margin-right: auto; }
  .tag { font-size: .72rem; padding: 7px 16px; margin-bottom: 16px; }
  .typed-wrap { font-size: .95rem; margin-bottom: 16px; }
  .hero-cta-section { margin-bottom: 32px; }
  .hero-cta { justify-content: center; }
  .hero-note { justify-content: center; }
  .hero-stats-wrap { padding-top: 32px; border-top: 1px solid rgba(255, 255, 255, .05); }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .stat b { font-size: 1.8rem; }
  .stat small { font-size: .8rem; text-align: center; }
  .photo-frame { width: 260px; height: 330px; }
  .timeline::before { left: 7px; }
  #kontak h2 { font-size: clamp(1.6rem, 4vw, 2.8rem); }

  /* LIGHTBOX MOBILE: fullscreen & ramah sentuh */
  .lightbox { padding: 0; }
  .lb-card {
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .lb-gallery { aspect-ratio: auto; height: 52dvh; }
  .lb-slide { font-size: 3rem; }
  .lb-body { flex: 1; padding: 22px; }

  /* Panah antar-proyek disembunyikan ( geser foto saja ) */
  .lb-nav { display: none; }

  /* Kontrol galeri selalu terlihat & besar */
  .lb-gnav { opacity: 1; width: 44px; height: 44px; }
  .lb-close { width: 44px; height: 44px; top: 12px; right: 12px; }
}

@media (max-width: 480px) {
  nav { padding: 12px 4%; }
  nav.scrolled { padding: 10px 4%; }
  section { padding: 48px 4%; }
  .sec-head { margin-bottom: 28px; }
  
  /* HERO MOBILE */
  .hero {
    padding: 70px 4% 40px;
    gap: 28px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .hero-text { max-width: 100%; text-align: center; }
  .hero-intro { margin-bottom: 24px; }
  .hero h1 {
    font-size: clamp(1.8rem, 6.5vw, 2.6rem);
    margin-bottom: 8px;
    letter-spacing: -.5px;
  }
  .typed-wrap { font-size: .9rem; margin-bottom: 14px; min-height: 1.5em; }
  .hero p { font-size: .95rem; margin-bottom: 24px; max-width: 100%; line-height: 1.6; }
  .tag {
    display: inline-flex;
    justify-content: center;
    padding: 6px 14px;
    font-size: .65rem;
    margin-bottom: 12px;
    letter-spacing: 1px;
  }
  .hero-cta-section { margin-bottom: 28px; }
  .hero-cta { justify-content: center; gap: 10px; flex-wrap: wrap; }
  .hero-note { justify-content: center; font-size: .8rem; margin-top: 14px; }
  .hero-stats-wrap { padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .05); width: 100%; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .stat { text-align: center; }
  .stat b { font-size: 1.5rem; margin-bottom: 4px; }
  .stat small { font-size: .75rem; text-align: center; }
  
  /* PHOTO FRAME MOBILE */
  .photo-frame { width: 220px; height: 280px; flex-shrink: 0; }
  .hero-visual { width: 100%; display: flex; justify-content: center; }
  
  .sw-list { gap: 48px; }
  .sw-project { gap: 24px; padding-top: 32px; }
  .sw-stats { gap: 10px; }
  .sw-actions { gap: 16px; }
  .contact-form { gap: 12px; }
  .contact-form input, .contact-form textarea { padding: 14px 16px; font-size: .88rem; }
  .socials { gap: 12px; }
  footer { padding: 24px 4%; font-size: .75rem; }

  /* LIGHTBOX LAYAR KECIL */
  .lb-gallery { height: 46dvh; }
  .lb-body { padding: 18px 18px 24px; }
  .lb-body h3 { font-size: 1.2rem; }
  .lb-body p { font-size: .88rem; }
}

/* Shared layout, accessible controls, and theme-safe finishing details. */
:root { --gutter: max(5%, calc((100vw - 1200px) / 2)); }
nav, nav.scrolled { padding-inline: var(--gutter); background: var(--nav-bg); }
.hero, section:not(#software), footer { padding-inline: var(--gutter); }
.hero { gap: clamp(32px, 5vw, 72px); padding-top: 140px; }
section { scroll-margin-top: 90px; }
.hero-text, .sw-info, .sw-media { min-width: 0; }
.hero-intro { margin-bottom: 24px; }
.hero-stats-wrap { border-color: var(--line); padding-top: 28px; }
.stats { margin-top: 0; padding-top: 0; }
.stat b { color: var(--text); }
.sw-stats { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.sw-info { gap: 20px; }
.sw-desc { line-height: 1.8; }
.sw-title { max-width: 7.5ch; }
.sw-card .thumb img, .lb-slide img { object-fit: contain; }
.sw-overlay { background: rgba(0,0,0,.12); }
.sw-project:focus-within .sw-view span { opacity: 1; transform: none; }
.sw-project:hover .sw-card { border-color: var(--muted); }
#photoFrame { width: clamp(260px, 27vw, 340px); max-width: 85vw; flex-shrink: 0; }
[data-theme="light"] .grad { background-image: linear-gradient(90deg, #111, #595959); }
.socials a:hover, .sw-visit:hover { color: var(--bg); }
.lang-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 30px; }
.lang-btn { min-width: 40px; min-height: 38px; border-radius: 24px; font: inherit; font-size: .75rem; color: var(--muted); background: transparent; cursor: pointer; }
.lang-btn.active { background: var(--text); color: var(--bg); }
.nav-right { gap: 16px; }
.nav-links { gap: 24px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 5px; }
.contact-form input:focus-visible, .contact-form textarea:focus-visible { outline: 2px solid var(--text); }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--muted); opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.lightbox:not(.open) { visibility: hidden; }
.lb-count { color: #fff; }
.lb-progress b { background: #fff; }
.lb-dot { width: 32px; height: 32px; background: transparent; border: 1px solid var(--muted); }
.lb-dot.active { width: 32px; background: var(--text); }
.lb-dots { flex-wrap: wrap; }
.lb-gnav { opacity: 1; }
.lb-body { min-height: 0; }
.lb-dim:empty { display: none; }
.marquee-track { width: max-content; }
.btn:active, .lang-btn:active, .theme-toggle:active { scale: .95; }
.btn:focus-visible, .theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 1100px) { .nav-cta { display: none; } }
@media (max-width: 1024px) {
  .hero { padding-top: 120px; }
  .hero-note { justify-content: center; }
  .stat { text-align: center; }
}
@media (max-width: 768px) {
  .nav-right { gap: 8px; }
  .logo { font-size: 1.2rem; white-space: nowrap; }
  .burger { width: 40px; height: 44px; }
  .lang-switch, .theme-toggle { position: relative; z-index: 101; }
  .nav-links { inset: 72px 0 auto; padding: 28px; transform: none; visibility: hidden; opacity: 0; border-bottom: 1px solid var(--line); }
  .nav-links.open { visibility: visible; opacity: 1; }
  .hero { padding-top: 110px; }
  #photoFrame { width: 280px; }
  .sw-title { max-width: none; }
  .lb-gallery { aspect-ratio: 16/9; height: auto; }
  .lb-card { padding-bottom: 68px; }
  .lb-nav { display: block; top: auto; bottom: 12px; transform: none; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
}
@media (max-width: 380px) {
  nav, nav.scrolled { padding-inline: 12px; }
  .nav-right { gap: 4px; }
  .lang-btn { min-width: 32px; }
  .theme-toggle { width: 38px; }
}
html[data-motion="off"] {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .cursor, .typed-caret { display: none; }
  #photoFrame:hover, .sw-card { transform: none !important; }
}