/* --- 1. CSS VARIABLES & THEMING --- */
:root {
  /* --- TEMA GELAP (REVISI: Abu Gelap Elegan) --- */
  --bg-body: #18181b; /* Abu gelap, bukan hitam pekat */
  --bg-card: #27272a; /* Abu sedikit lebih terang untuk kartu */
  --bg-card-hover: #3f3f46; /* Abu terang saat di-hover */

  --text-primary: #f4f4f5; /* Putih lembut (tidak menyilaukan) */
  --text-secondary: #a1a1aa; /* Abu muda untuk teks sekunder */

  --border-color: #3f3f46; /* Garis batas abu-abu */
  --tag-bg: #27272a;
  --badge-bg: #27272a;

  --accent-color: #3b82f6; /* Biru tetap sama */
}

body.light-theme {
  /* --- TEMA TERANG (Tidak Berubah) --- */
  --bg-body: #f2f4f7;
  --bg-card: #ffffff;
  --bg-card-hover: #fcfcfc;
  --text-primary: #1a1a1a;
  --text-secondary: #555;
  --border-color: #e0e0e0;
  --tag-bg: #eef0f2;
  --badge-bg: #eef0f2;
}

/* --- 2. RESET & BASE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  padding: 20px;
  transition: 0.3s;
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}

/* --- 3. LAYOUT GRID SYSTEM --- */
.container {
  max-width: 1000px;
  margin: 40px auto;
  /* Memberi ruang di bawah agar tidak mentok saat scroll di HP */
  padding-bottom: 40px;
}

.bento-grid {
  display: grid;
  /* Grid 2 Kolom: Kiri (lebar 1 bagian), Kanan (lebar 1.5 bagian) */
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
  align-items: start;
}

.column-left,
.column-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.full-width {
  grid-column: span 2;
}

/* --- 4. STYLE KARTU (BENTO CARD) --- */
.bento-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  transition: transform 0.2s ease, background-color 0.2s;
}
.bento-card:hover {
  background-color: var(--bg-card-hover);
  transform: translateY(-2px);
  border-color: #444;
}

/* --- 5. STYLE SPESIFIK --- */

/* FOTO PROFIL */
.photo-card {
  padding: 10px;
  aspect-ratio: 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-card);
}
.profile-img-full {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}

/* BIO & INTERESTS */
.bio-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}
.bio-card {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bio-card h1 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}
.bio-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.interests-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px 24px;
}
.interests-card h3 {
  font-size: 1rem;
  margin-right: 10px;
  color: var(--text-secondary);
}

/* TAGS & BADGES */
.tags-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tag {
  background-color: var(--tag-bg);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}
.date-badge {
  background-color: var(--badge-bg);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* EXPERIENCE SECTION */
.card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}
.card-header h2 {
  font-size: 1.2rem;
}
.info-list li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 8px;
  list-style-type: disc;
  margin-left: 20px;
}

/* STACK CONTAINERS (Tools & Edu) */
.stack-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.small-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}
.small-card h3 {
  font-size: 1rem;
  color: var(--text-primary);
}

.tool-icons,
.flag-icons {
  display: flex;
  gap: 15px;
  font-weight: 700;
  font-size: 1.1rem;
}

/* EDUCATION SPECIFIC */
.card-header-edu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.education-card {
  padding: 18px 24px;
}
.education-card h3 {
  font-size: 1rem;
  margin-bottom: 2px;
}

/* --- UPDATE: PORTFOLIO MENJADI STYLE TAGS (Mirip Interests) --- */
.portfolio-links {
  display: flex;
  gap: 10px; /* Jarak antar tag lebih rapat (mirip interest) */
  flex-wrap: wrap; /* Agar turun ke bawah jika baris penuh */
  margin-top: 15px;
}

.port-link {
  background-color: var(--tag-bg);
  padding: 6px 16px; /* Padding diperkecil agar berbentuk pil manis */
  border-radius: 50px; /* Sudut bulat sempurna (Capsule shape) */
  font-size: 0.85rem; /* Ukuran font disamakan dengan Interest tag */
  font-weight: 600;
  display: inline-flex; /* Mengikuti lebar teks, bukan lebar layar */
  align-items: center;
  gap: 8px;
  transition: 0.3s;
  color: var(--text-secondary); /* Warna teks default */
}

/* Tetap pertahankan efek warna-warni saat di-hover agar menarik */
.port-link:hover {
  color: white;
  transform: translateY(-2px);
}
.port-link.bento:hover {
  background-color: #3b82f6;
}
.port-link.behance:hover {
  background-color: #0057ff;
}
.port-link.instagram:hover {
  background-color: #e1306c;
}
.port-link.dribbble:hover {
  background-color: #ea4c89;
}
.port-link:hover {
  color: white;
  background-color: var(--accent-color);
}

.details-grid {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  flex-wrap: wrap;
}
.detail-item {
  background-color: var(--badge-bg);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* THEME BUTTON (BARU - POSISI BAWAH) */
.theme-btn {
  position: fixed;
  bottom: 20px; /* <--- GANTI JADI INI */
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center; /* Tambahan agar ikon pas di tengah */
}

/* --- 6. RESPONSIVE MOBILE (CUSTOM ORDER: Foto > Bio > Detail > Interest) --- */
@media (max-width: 768px) {
  /* 1. Setup Container Mobile */
  .bento-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    padding-bottom: 40px;
  }

  /* 2. TEKNIK KUNCI: 'display: contents'
       Kita bongkar Column Kiri/Kanan DAN 'bio-wrapper'.
       Ini membuat Bio-Card dan Interest-Card terlepas dari bungkusnya
       sehingga bisa diatur urutannya satu per satu secara terpisah. */
  .column-left,
  .column-right,
  .bio-wrapper {
    display: contents;
  }

  /* 3. Paksa Lebar Penuh Semua Kartu */
  .bento-card, 
    .stack-container,
    .details-section,
    .portfolio-section,
    .bio-card,       /* Target spesifik anak bio-wrapper */
    .interests-card  /* Target spesifik anak bio-wrapper */ {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Reset container tumpukan agar tetap rapi */
  .stack-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  /* --- 4. PENGATURAN URUTAN (ORDER) --- */

  /* URUTAN 1: FOTO */
  .photo-card {
    order: 1;
  }
  .photo-card .profile-img-full {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
  }

  /* URUTAN 2: BIO-CARD (Nama & Deskripsi) */
  .bio-card {
    order: 2;
    /* Karena wrapper dibongkar, kita pastikan dia punya margin/gap sendiri jika perlu, 
           tapi flex-gap dari parent utama biasanya sudah cukup. */
  }

  /* URUTAN 3: DETAILS (Kontak) */
  .details-section {
    order: 3;
  }
  /* Style isi details agar tombol memanjang */
  .details-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .detail-item {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  /* URUTAN 4: INTERESTS */
  .interests-card {
    order: 4;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  /* URUTAN 5: PORTFOLIO */
  .portfolio-section {
    order: 5;
  }

  /* REVISI: Mengembalikan layout menjadi 'Tags' (bukan list ke bawah) */
  .portfolio-links {
    display: flex;
    flex-direction: row; /* Kembali ke baris (samping) */
    flex-wrap: wrap; /* Bungkus ke bawah jika mentok */
    width: 100%;
    gap: 10px;
  }

  .port-link {
    width: auto; /* HAPUS width 100%, biarkan auto mengikuti teks */
    justify-content: flex-start;
    margin-bottom: 0; /* Hapus margin bawah tambahan */
  }

  /* URUTAN 6 dst: Sisanya */
  .experience-card {
    order: 6;
  }
  .stack-container {
    order: 7;
  }

  /* Tombol Tema di HP ditaruh di bawah juga */
  .theme-btn {
    bottom: 20px; /* <--- GANTI JADI INI */
    right: 20px; /* Sedikit lebih jauh dari pinggir agar rapi */
  }
  .full-width {
    grid-column: auto;
  }
}
