/* =====================
   ROOT & THEME COLOR
===================== */
:root {
  --bg: #0b1220;
  --surface: #111a2e;
  --card: rgba(255,255,255,0.04);
  --text: #e6ebf5;
  --muted: #9aa4bf;
  --primary: #3b82f6;
  --accent: #60a5fa;
  --border: rgba(255,255,255,0.08);
}

body.light {
  --bg: #f4f7fd;
  --surface: #ffffff;
  --card: rgba(0,0,0,0.04);
  --text: #0f172a;
  --muted: #475569;
  --primary: #2563eb;
  --accent: #3b82f6;
  --border: rgba(0,0,0,0.08);
}

/* =====================
   GLOBAL
===================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: radial-gradient(1200px 600px at top, rgba(59,130,246,0.15), transparent),
              var(--bg);
  color: var(--text);
  transition: background .4s ease, color .4s ease;
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

img, video {
  width: 100%;
  display: block;
  border-radius: 16px;
}

/* =====================
   TOGGLE THEME
===================== */
.toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  transition: all .3s ease;
}

.toggle:hover {
  transform: scale(1.08);
}

/* =====================
   LAYOUT
===================== */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 100px 20px;
}

/* =====================
   HERO
===================== */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
  margin-bottom: 120px;
}

.badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 42px;
  margin: 0 0 16px;
}

.profile-card {
  background: linear-gradient(180deg, rgba(59,130,246,0.15), transparent);
  padding: 14px;
  border-radius: 24px;
}

/* =====================
   SECTION TITLE
===================== */
.container > h1 {
  font-size: 32px;
  margin: 80px 0 40px;
}

/* =====================
   PORTFOLIO GRID
===================== */
.portfolio {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

/* =====================
   PROJECT CARD
===================== */
.project {
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  transition: transform .35s ease, box-shadow .35s ease;
}

.project:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(0,0,0,0.25);
}

/* =====================
   PROJECT HOVER ACTION
===================== */
.project {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.project::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10,15,30,0.0),
    rgba(10,15,30,0.85)
  );
  opacity: 0;
  transition: opacity .35s ease;
}

.project:hover::after {
  opacity: 1;
}

.project-action {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all .35s ease;
}

.project:hover .project-action {
  opacity: 1;
}

.project-action button {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 20px 40px rgba(59,130,246,0.4);
  transform: translateY(16px);
  transition: all .35s ease;
}

.project:hover .project-action button {
  transform: translateY(0);
}


.project-action {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all .35s ease;
}

.project:hover .project-action {
  opacity: 1;
}
.project-action button {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 20px 40px rgba(59,130,246,0.4);
  transform: translateY(16px);
  transition: all .35s ease;
}

.project:hover .project-action button {
  transform: translateY(0);
}

.card-media {
  margin-top: 16px;
  overflow: hidden;
}

/* =====================
   PROJECT DETAIL (FULL)
===================== */
.project-detail {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, rgba(59,130,246,0.12), transparent);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
}

.project-header {
  margin-bottom: 20px;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.thumb img {
  transition: transform .3s ease;
}

.thumb:hover img {
  transform: scale(1.08);
}

/* =====================
   FOOTER
===================== */
footer {
  margin-top: 140px;
  text-align: center;
}

/* =====================
   SCROLL REVEAL
===================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all .8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

/* =====================
   PREMIUM ICON
===================== */
.project-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 12px;
  font-size: 18px;
  color: var(--primary);
  background: linear-gradient(
    145deg,
    rgba(59,130,246,0.25),
    rgba(59,130,246,0.05)
  );
  border: 1px solid var(--border);
  box-shadow:
    0 10px 30px rgba(59,130,246,0.25),
    inset 0 0 20px rgba(255,255,255,0.08);
  animation: floatIcon 4s ease-in-out infinite;
}

/* hover react */
.project:hover .project-icon {
  transform: scale(1.15) rotate(8deg);
  box-shadow: 0 20px 50px rgba(59,130,246,0.45);
}

/* floating animation */
@keyframes floatIcon {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

.badge::before {
  content: "⬢";
  margin-right: 8px;
  animation: spinSlow 6s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}



/* =====================
   MODAL PROJECT
===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,10,20,0.75);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
  z-index: 2000;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: linear-gradient(180deg, rgba(59,130,246,0.12), var(--surface));
  border: 1px solid var(--border);
  border-radius: 28px;
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 40px 120px rgba(0,0,0,.45);
  animation: modalIn .5s ease;
}

@keyframes modalIn {
  from {
    transform: translateY(40px) scale(.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  cursor: pointer;
  font-size: 22px;
  opacity: .7;
  transition: .3s;
}

.modal-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.modal-media {
  margin: 20px 0;
}

.modal-info {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}

.modal-info span {
  display: block;
  font-weight: 500;
  color: var(--text);
}

.project-icon::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  border: 1px solid rgba(59,130,246,0.4);
  animation: pulse 2.5s ease-out infinite;
}

@keyframes pulse {
  0% { opacity: 0; transform: scale(.85); }
  50% { opacity: .6; }
  100% { opacity: 0; transform: scale(1.25); }
}
.hint {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  opacity: .7;
}
@media (max-width: 768px) {

  .hint {
     display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    height: 0;
    margin: 0;
    padding: 0;
  }

  /* matikan overlay */
  .project::after {
    display: none;
  }

  /* pastikan konten tidak absolute */
  .project-action {
    position: static;
    opacity: 1;
    z-index: 2;
  }
}


/* =====================
   RESPONSIVE PORTFOLIO
===================== */
@media (max-width: 768px) {
  .portfolio {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {

  /* matikan overlay hover */
  .project::after {
    display: none;
  }

  /* project layout lebih rapi */
  .project {
    padding-bottom: 24px;
  }

  /* action jadi static */
  .project-action {
    position: static;
    opacity: 1;
    margin-top: 16px;
    display: flex;
    justify-content: flex-start;
  }

  .project-action button {
    width: 100%;
    justify-content: center;
    transform: none;
    box-shadow: 0 14px 30px rgba(59,130,246,0.35);
  }

  /* nonaktifkan hover effect */
  .project:hover .project-action {
    opacity: 1;
  }
}

.pdf-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(59,130,246,.35);
  transition: .3s;
}

.pdf-btn:hover {
  transform: translateY(-2px);
}

/* =====================
   PDF MODE (DARK BACKGROUND)
===================== */
body.pdf-mode {
  background-color: #0b1220 !important;  /* Memastikan background gelap */
  color: #e6ebf5 !important;             /* Text terang */
}

/* Pastikan layout desktop tetap 2 kolom */
body.pdf-mode .container {
  max-width: 1200px !important;
  width: 100%;
  background-color: #0b1220 !important;  /* Memastikan background tetap gelap */
}

body.pdf-mode .portfolio {
  grid-template-columns: repeat(2, 1fr) !important; /* 2 kolom */
}

/* Sembunyikan semua interaksi */
body.pdf-mode .toggle,
body.pdf-mode .project-action,
body.pdf-mode .modal-overlay,
body.pdf-mode button,
body.pdf-mode .hint {
  display: none !important;
}

/* Matikan animasi */
body.pdf-mode * {
  animation: none !important;
  transition: none !important;
}

/* Hilangkan efek blur & glass */
body.pdf-mode .project,
body.pdf-mode .profile-card {
  backdrop-filter: none !important;
  box-shadow: none !important;
}

/* Pastikan background konten tetap gelap */
body.pdf-mode .project,
body.pdf-mode .profile-card {
  background-color: transparent !important;
  box-shadow: none !important;
}

/* Pastikan gambar/video tetap visible meskipun video disembunyikan */
body.pdf-mode video {
  visibility: hidden;
  height: 0;
}

/* Ganti semua background elemen ke warna dark */
body.pdf-mode .project {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
}

body.pdf-mode .portfolio {
  grid-template-columns: repeat(2, 1fr) !important;
}

/* =================================
   PDF MODE – FINAL STABLE VERSION
================================= */

body.pdf-mode {
  background: #0b1220 !important;
  color: #e6ebf5 !important;
}

/* Container = ukuran A4 */
body.pdf-mode .container {
  width: 210mm !important;
  max-width: 210mm !important;
  padding: 20mm !important;
  margin: 0 auto !important;
}

/* Hero jadi halaman pertama full */
body.pdf-mode .hero {
  min-height: 260mm;
  display: grid;
  align-content: center;
  page-break-after: always;
}

/* Portfolio jangan pakai grid */
body.pdf-mode .portfolio {
  display: block !important;
}

/* Card project aman dari potong */
body.pdf-mode .project {
  margin-bottom: 20mm;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  overflow: visible !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* Matikan hover & overlay */
body.pdf-mode .project::after {
  display: none !important;
}

/* Action disembunyikan TANPA merusak layout */
body.pdf-mode .project-action {
  display: none !important;
}

/* VIDEO TIDAK DIDUKUNG → sembunyikan */
body.pdf-mode video {
  display: none !important;
}

/* Thumbnail pengganti video */
body.pdf-mode .video-thumb {
  display: block !important;
  width: 100%;
  border-radius: 16px;
}

/* Hilangkan elemen interaktif */
body.pdf-mode .toggle,
body.pdf-mode .modal-overlay,
body.pdf-mode button,
body.pdf-mode .hint {
  display: none !important;
}

/* Matikan animasi */
body.pdf-mode * {
  animation: none !important;
  transition: none !important;
}


.profile-actions {
  margin-top: 24px;
  display: flex;
  gap: 16px;
}

.btn {
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  transition: .3s;
}

.primary {
  background: var(--primary);
  color: white;
}

.ghost {
  border: 1px solid var(--border);
  color: var(--text);
}