html {
  scroll-behavior: smooth;
}
body {
  font-family: "Inter", sans-serif;
  background: #fafaf8;
  color: #0d0d0d;
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}
h1,
h2,
h3,
h4,
.font-display {
  font-family: "Plus Jakarta Sans", sans-serif;
}
section {
  scroll-margin-top: 84px;
}

.full-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* ---- scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1.in-view {
  transition-delay: 0.08s;
}
.reveal-delay-2.in-view {
  transition-delay: 0.16s;
}
.reveal-delay-3.in-view {
  transition-delay: 0.24s;
}
.reveal-delay-4.in-view {
  transition-delay: 0.32s;
}

/* ---- hero load sequence ---- */
.hero-el {
  opacity: 0;
  transform: translateY(18px);
  animation: heroIn 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
@keyframes heroIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- drawer active state ---- */
.drawer-nav-link {
  position: relative;
  padding-left: 0;
  transition:
    color 0.3s ease,
    padding-left 0.3s ease;
}
.drawer-nav-link.active {
  color: #ff5a1f !important;
  padding-left: 16px;
}
.drawer-nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #ff5a1f;
}

/* ---- nav underline ---- */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}
.nav-link.active {
  color: #ff5a1f;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: #ff5a1f;
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ---- mobile drawer ---- */
#mobileDrawer {
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#mobileDrawer.open {
  transform: translateX(0);
}
#drawerOverlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
#drawerOverlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* hamburger to X */
.burger-line {
  transition:
    transform 0.35s ease,
    opacity 0.25s ease;
  transform-origin: center;
}
.burger-open .burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger-open .burger-line:nth-child(2) {
  opacity: 0;
}
.burger-open .burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.work-card {
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.work-card:hover {
  transform: translateY(-6px);
}
.work-card .work-img {
  transition: transform 0.7s ease;
}
.work-card:hover .work-img {
  transform: scale(1.06);
}

.service-card,
.cert-card {
  cursor: pointer;
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease,
    border-color 0.4s ease,
    background-color 0.4s ease;
}
.service-card:hover,
.cert-card:hover {
  transform: translateY(-4px);
  border-color: #e44e16 !important;
  box-shadow:
    0 18px 40px -18px rgba(228, 78, 22, 0.35),
    0 0 0 1px rgba(228, 78, 22, 0.08) !important;
}

#cert-track::-webkit-scrollbar {
  display: none;
}

@media (max-width: 1023px) {
  #cert-track .cert-card {
    width: calc((100% - 1.5rem) / 2);
  }
}

@media (max-width: 639px) {
  #cert-track .cert-card {
    width: calc(100% - 2.5rem);
  }
}

.cert-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background-color: rgba(15, 15, 15, 0.15);
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  padding: 0;
}

.cert-dot:hover {
  background-color: rgba(15, 15, 15, 0.3);
}

.cert-dot.active {
  width: 24px;
  background-color: #ff5a1f;
}

/* Dark mode */
html.dark .cert-dot {
  background-color: rgba(255, 255, 255, 0.18);
}

html.dark .cert-dot:hover {
  background-color: rgba(255, 255, 255, 0.35);
}

html.dark .cert-dot.active {
  background-color: #e44e16;
}

.btn-primary {
  transition:
    transform 0.3s ease,
    background-color 0.3s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
}
.btn-outline {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    transform 0.3s ease;
}
.btn-outline:hover {
  transform: translateY(-2px);
}

.timeline-dot {
  transition:
    transform 0.4s ease,
    background-color 0.4s ease;
}
.timeline-item:hover .timeline-dot {
  transform: scale(1.15);
  background: #ff5a1f;
}

::selection {
  background: #ff5a1f;
  color: #fff;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #0d0d0d;
}

/* ---- marquee ---- */
.marquee-row {
  display: flex;
  width: max-content;
  animation: marqueeScroll 28s linear infinite;
}
.marquee-row:hover {
  animation-play-state: paused;
}
@keyframes marqueeScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ---- theme toggle ---- */
.theme-toggle {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}
.theme-toggle svg {
  transition:
    opacity 0.25s ease,
    transform 0.4s ease;
}
.icon-sun,
.icon-moon {
  position: absolute;
}

/* =====================================================
         DARK MODE OVERRIDES
         ===================================================== */
html.dark body {
  background-color: #0a0a0b;
  color: #f2f2f0;
}
html.dark header {
  background-color: rgba(10, 10, 11, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
html.dark .bg-paper {
  background-color: #0a0a0b !important;
}
html.dark .bg-white {
  background-color: #141416 !important;
}
html.dark .bg-cloud {
  background-color: #1d1d20 !important;
}
html.dark .text-ink {
  color: #f2f2f0 !important;
}
html.dark .text-ink\/70 {
  color: rgba(242, 242, 240, 0.72) !important;
}
html.dark .text-ink\/60 {
  color: rgba(242, 242, 240, 0.62) !important;
}
html.dark .text-ink\/55 {
  color: rgba(242, 242, 240, 0.58) !important;
}
html.dark .text-ink\/50 {
  color: rgba(242, 242, 240, 0.52) !important;
}
html.dark .text-ink\/45 {
  color: rgba(242, 242, 240, 0.48) !important;
}
html.dark .border-ink\/10 {
  border-color: rgba(255, 255, 255, 0.1) !important;
}
html.dark .border-ink\/15 {
  border-color: rgba(255, 255, 255, 0.15) !important;
}
html.dark .border-ink {
  border-color: rgba(255, 255, 255, 0.4) !important;
}
html.dark .bg-ink {
  background-color: #050506 !important;
}
html.dark input,
html.dark select,
html.dark textarea {
  background-color: #1d1d20 !important;
  color: #f2f2f0 !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder {
  color: rgba(242, 242, 240, 0.45);
}
html.dark select {
  color: rgba(242, 242, 240, 0.72) !important;
}
html.dark #mobileDrawer {
  background-color: #0d0d0d !important;
}
html.dark #certModalPanel {
  background-color: #141416 !important;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .hero-el,
  #mobileDrawer,
  .work-card,
  .work-img,
  .service-card,
  .cert-card,
  .btn-primary,
  .btn-outline,
  .timeline-dot,
  .marquee-row {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =====================================================
   SECTION BACKGROUND ACCENTS
   ===================================================== */
section[id] {
  position: relative;
}
#about,
#journey,
#expertise,
#certificate,
#contact,
#work {
  overflow: hidden;
}

#about::before {
  content: "";
  position: absolute;
  top: -15%;
  left: -10%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(255, 90, 31, 0.07), transparent 70%);
  z-index: -1;
  pointer-events: none;
}
#journey::before {
  content: "";
  position: absolute;
  top: 5%;
  right: -12%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 90, 31, 0.06), transparent 70%);
  z-index: -1;
  pointer-events: none;
}
#expertise::before {
  content: "";
  position: absolute;
  bottom: -20%;
  right: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 90, 31, 0.06), transparent 70%);
  z-index: -1;
  pointer-events: none;
}
#certificate::before {
  content: "";
  position: absolute;
  top: -10%;
  left: -10%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(255, 90, 31, 0.06), transparent 70%);
  z-index: -1;
  pointer-events: none;
}
#contact::before {
  content: "";
  position: absolute;
  bottom: -15%;
  left: -10%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(255, 90, 31, 0.07), transparent 70%);
  z-index: -1;
  pointer-events: none;
}
#work::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 90, 31, 0.12), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

/* =====================================================
   DARK MODE POLISH & FIXES
   ===================================================== */

/* aksen background sedikit lebih terang di dark mode biar tetap kelihatan */
html.dark #about::before,
html.dark #journey::before,
html.dark #expertise::before,
html.dark #certificate::before,
html.dark #contact::before,
html.dark #work::before {
  background: radial-gradient(circle, rgba(255, 90, 31, 0.15), transparent 70%);
}

/* FIX: ikon inline yang warnanya hardcode hitam, supaya kelihatan di dark mode */
html.dark [stroke="#0D0D0D"] {
  stroke: #f2f2f0;
}

/* FIX: border hover card yang hardcode hitam, supaya kelihatan di dark mode */
html.dark .service-card:hover,
html.dark .cert-card:hover {
  border-color: #e44e16 !important;
  box-shadow:
    0 18px 40px -18px rgba(228, 78, 22, 0.35),
    0 0 0 1px rgba(228, 78, 22, 0.08) !important;
}

/* FIX: tombol bg-ink (bukan bg-flame) supaya kontras di dark mode, tanpa mengubah tombol yang memang sudah orange */
html.dark .btn-primary:not(.bg-flame) {
  background-color: #f2f2f0 !important;
  color: #0a0a0b !important;
}
html.dark .btn-primary:not(.bg-flame):hover {
  background-color: #ff5a1f !important;
  color: #ffffff !important;
}

/* =====================================================
   BACKGROUND TEXTURE — HOME & FOOTER (yang belum ada)
   ===================================================== */
#home {
  background-image: radial-gradient(
    rgba(13, 13, 13, 0.05) 1px,
    transparent 1px
  );
  background-size: 26px 26px;
}
html.dark #home {
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.055) 1px,
    transparent 1px
  );
}

footer {
  position: relative;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  overflow: hidden;
}

/* =====================================================
   SOFT AMBIENT GLOW — semua section
   ===================================================== */
#home,
#about,
#journey,
#expertise,
#certificate,
#contact,
#work,
footer {
  isolation: isolate;
}
#home::after,
#about::after,
#journey::after,
#expertise::after,
#certificate::after,
#contact::after,
#work::after,
footer::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 9999px;
  filter: blur(70px);
  pointer-events: none;
  animation: glowPulse 8s ease-in-out infinite;
}

#home::after {
  top: 10%;
  left: 50%;
  width: 600px;
  height: 300px;
  background: rgba(255, 90, 31, 0.16);
}
#about::after {
  top: 20%;
  right: 5%;
  width: 380px;
  height: 380px;
  background: rgba(255, 90, 31, 0.12);
}
#journey::after {
  bottom: 10%;
  left: 8%;
  width: 360px;
  height: 360px;
  background: rgba(255, 90, 31, 0.1);
}
#expertise::after {
  top: 30%;
  left: 4%;
  width: 400px;
  height: 400px;
  background: rgba(255, 90, 31, 0.1);
}
#certificate::after {
  bottom: 5%;
  right: 6%;
  width: 420px;
  height: 420px;
  background: rgba(255, 90, 31, 0.11);
}
#work::after {
  top: 15%;
  left: 15%;
  width: 460px;
  height: 460px;
  background: rgba(255, 90, 31, 0.22);
}
#contact::after {
  top: 5%;
  left: 40%;
  width: 500px;
  height: 260px;
  background: rgba(255, 90, 31, 0.14);
}
footer::after {
  bottom: -40%;
  left: 30%;
  width: 400px;
  height: 200px;
  background: rgba(255, 90, 31, 0.15);
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

/* glow sedikit lebih terang di dark mode biar terasa "menyala" */
html.dark #about::after,
html.dark #journey::after,
html.dark #expertise::after,
html.dark #certificate::after,
html.dark #contact::after {
  background: rgba(255, 90, 31, 0.18);
}

/* hormati preferensi reduced motion */
@media (prefers-reduced-motion: reduce) {
  #home::after,
  #about::after,
  #journey::after,
  #expertise::after,
  #certificate::after,
  #contact::after,
  #work::after,
  footer::after {
    animation: none !important;
    opacity: 0.85;
  }
}

/* =====================================================
   BACKGROUND TEXTURE — bertingkat (full → subtle → none)
   ===================================================== */

/* HOME — FULL: grid kotak-kotak */
#home {
  background-image:
    linear-gradient(to right, rgba(13, 13, 13, 0.07) 2px, transparent 2px),
    linear-gradient(to bottom, rgba(13, 13, 13, 0.07) 2px, transparent 2px);
  background-size: 40px 40px;
}
html.dark #home {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 2px, transparent 2px);
}

/* ABOUT — MEDIUM: dot grid */
#about {
  background-image: radial-gradient(
    rgba(13, 13, 13, 0.07) 2.5px,
    transparent 2.5px
  );
  background-size: 22px 22px;
}
html.dark #about {
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.09) 2.5px,
    transparent 2.5px
  );
}

/* JOURNEY — tanpa texture (biar timeline bersih) */

/* EXPERTISE — SUBTLE: grain halus */
#expertise {
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(13, 13, 13, 0.06) 0px,
      rgba(13, 13, 13, 0.06) 0.7px,
      transparent 0.7px,
      transparent 20px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(13, 13, 13, 0.045) 0px,
      rgba(13, 13, 13, 0.045) 0.7px,
      transparent 0.7px,
      transparent 20px
    );
  background-size: 40px 40px;
}
html.dark #expertise {
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.08) 0px,
      rgba(255, 255, 255, 0.08) 0.7px,
      transparent 0.7px,
      transparent 20px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.06) 0px,
      rgba(255, 255, 255, 0.06) 0.7px,
      transparent 0.7px,
      transparent 20px
    );
  background-size: 40px 40px;
}

/* CERTIFICATE — tanpa texture (biar card grid nggak ramai) */

/* WORK — MEDIUM: dot grid rapat (bg gelap) */
#work {
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.07) 1.5px,
    transparent 1.5px
  );
  background-size: 18px 18px;
}

/* CONTACT — SUBTLE: diagonal lines tipis */
#contact {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(13, 13, 13, 0.025) 0px,
    rgba(13, 13, 13, 0.025) 1px,
    transparent 1px,
    transparent 16px
  );
}
html.dark #contact {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.035) 0px,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 16px
  );
}

/* FOOTER — SUBTLE: grid lines (dipertahankan dari sebelumnya) */
footer {
  position: relative;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  overflow: hidden;
}

/* ============ MOBILE FIXES ============ */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}
#home {
  overflow: hidden;
}

@supports (height: 100svh) {
  #home {
    min-height: 100svh;
  }
}

#certModalPanel {
  max-height: 90vh;
  overflow-y: auto;
}
#certModalImg {
  max-height: 76vh;
  object-fit: contain;
}

@media (max-width: 639px) {
  /* jarak antar section lebih masuk akal */
  section[id] {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  #home {
    padding-top: 6.5rem;
  }

  /* skala tipografi */
  #home h1 {
    font-size: 2.05rem;
    line-height: 1.12;
  }
  section[id] h2 {
    font-size: 1.85rem;
    line-height: 1.22;
  }

  /* kartu sertifikat: satu kartu penuh, tanpa min-width yang maksa */
  #cert-track .cert-card {
    width: calc(100vw - 4.5rem);
    min-width: 0;
  }
  #cert-track {
    scroll-padding-left: 0.25rem;
  }

  /* timeline tidak terlalu terdorong ke kanan */
  #journey .timeline-item {
    padding-left: 4.25rem;
  }

  /* grid background di hero terlalu tebal di layar kecil */
  #home {
    background-size: 26px 26px;
  }
  #home,
  html.dark #home {
    background-image:
      linear-gradient(to right, rgba(13, 13, 13, 0.05) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(13, 13, 13, 0.05) 1px, transparent 1px);
  }

  /* glow besar + blur berat = berat & bocor keluar layar */
  #home::after,
  #about::after,
  #journey::after,
  #expertise::after,
  #certificate::after,
  #contact::after,
  #work::after,
  footer::after {
    width: 60vw;
    height: 200px;
    filter: blur(45px);
    opacity: 0.55;
    animation: none;
  }
}
