:root {
  --bg: #0b0e1a;
  --card: #151a2d;
  --card-hover: #1c2238;
  --text: #ffffff;
  --text-muted: #9ca3af;
  --accent: #6366f1;
  --accent-purple: #8b5cf6;
  --border: rgba(255, 255, 255, 0.08);
  --pill-bg: rgba(255, 255, 255, 0.06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #05070f;
  color: var(--text);
  overflow-x: hidden;
}

.phone-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 12px;
  background: linear-gradient(180deg, #0a0c14 0%, #05070f 100%);
}

.phone {
  width: 100%;
  max-width: 390px;
  min-height: 844px;
  background: var(--bg);
  border-radius: 36px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 25px 50px -12px rgba(0, 0, 0, 0.7),
    0 0 80px -20px rgba(99, 102, 241, 0.25);
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  position: relative;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
}

.logo-icon {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: white;
  box-shadow: 0 3px 8px rgba(99, 102, 241, 0.4);
}

.header-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4c9d6;
  cursor: pointer;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

/* Hero */
.hero {
  padding: 6px 16px 20px;
  position: relative;
  overflow: hidden;
  min-height: 130px;
}

/* Efek cahaya (Glow) ungu di latar belakang kanan */
.hero::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Wadah untuk menampung Bintang (Coretan Dihapus) */
.hero-decorations {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Styling Bintang + Posisi menyebar di area kosong (Natural) */
.hero-star {
  position: absolute;
  transform-origin: center;
}

.star-1 {
  width: 14px; height: 14px;
  top: 15px; right: 80px;
  fill: #a78bfa;
  /* Animasi standar: 3 detik, mulai langsung */
  animation: twinkle 3s ease-in-out infinite alternate;
}

.star-2 {
  width: 8px; height: 8px;
  top: 35px; right: 25px;
  fill: #c4b5fd;
  /* Durasi beda, delay 1.2 detik agar kedipnya tidak bersamaan */
  animation: twinkle 4s ease-in-out infinite alternate 1.2s;
}

.star-3 {
  width: 12px; height: 12px;
  top: 85px; right: 40px;
  fill: #8b5cf6;
  /* Durasi lebih cepat */
  animation: twinkle 2.5s ease-in-out infinite alternate 0.5s;
}

.star-4 {
  width: 6px; height: 6px;
  top: 12px; left: 110px; /* Posisi aman di sebelah "Hai!" */
  fill: #c4b5fd;
  /* Durasi sedang, delay lama */
  animation: twinkle 3.5s ease-in-out infinite alternate 2s;
}

.star-5 {
  width: 9px; height: 9px;
  top: 105px; right: 90px;
  fill: #a78bfa;
  animation: twinkle 4.5s ease-in-out infinite alternate 0.8s;
}

/* Keyframe untuk kelap-kelip bintang secara natural:
   Redup mengecil (opacity rendah) -> Terang membesar + berputar tipis */
@keyframes twinkle {
  0% { 
    transform: scale(0.6) rotate(0deg); 
    opacity: 0.15; 
  }
  100% { 
    transform: scale(1.2) rotate(15deg); 
    opacity: 1; 
  }
}

/* Typography (Z-index lebih tinggi agar teks ada di atas dekorasi) */
.greeting {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 2;
}

.title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
  position: relative;
  z-index: 2;
  max-width: 290px; /* Jaga agar teks tidak membentur bintang di paling kanan */
}

.title .highlight {
  color: #8b5cf6;
}

.subtitle {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 260px; /* Jaga agar teks aman dari area bintang */
  position: relative;
  z-index: 2;
}

/* Search */
.search-wrap {
  padding: 0 16px 12px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  transition: border-color 0.2s, background 0.2s;
}

.search:focus-within {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(255, 255, 255, 0.07);
}

.search svg {
  width: 15px;
  height: 15px;
  color: #6b7280;
  flex-shrink: 0;
}

.search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
}

.search input::placeholder {
  color: #6b7280;
}

/* Categories */
.categories {
  display: flex;
  gap: 6px;
  padding: 0 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.cat {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 500;
  background: var(--pill-bg);
  border: 1px solid transparent;
  color: #c4c9d6;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cat.active {
  background: #6366f1;
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
}

.cat svg {
  width: 11px;
  height: 11px;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
}

.see-all {
  font-size: 11px;
  color: #818cf8;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 2px;
}

.see-all:hover {
  color: #a5b4fc;
}

/* Tools grid */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  position: relative;
}

.tool-card:hover {
  background: var(--card-hover);
  transform: translateY(-1px);
}

.tool-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}

.tool-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.tool-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
}

.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.tool-tag {
  font-size: 9px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #9ca3af;
}

.tool-arrow {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.tool-arrow svg {
  width: 12px;
  height: 12px;
}

/* Color variants */
.icon-purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.icon-green  { background: linear-gradient(135deg, #059669, #34d399); }
.icon-pink   { background: linear-gradient(135deg, #db2777, #f472b6); }
.icon-orange { background: linear-gradient(135deg, #d97706, #fbbf24); }
.icon-blue   { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.icon-teal   { background: linear-gradient(135deg, #0d9488, #2dd4bf); }

/* Bottom banner */
.banner {
  margin: 4px 16px 14px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 500;
  color: #c4b5fd;
}

.banner svg {
  width: 12px;
  height: 12px;
  color: #a78bfa;
  flex-shrink: 0;
}

.banner .dot {
  opacity: 0.5;
}

/* Bottom navigation */
.bottom-nav {
  margin-top: auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 6px calc(10px + var(--safe-bottom));
  background: rgba(11, 14, 26, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  color: #6b7280;
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 8px;
  transition: color 0.2s;
  min-width: 54px;
}

.nav-item.active {
  color: #818cf8;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item span {
  font-weight: 500;
}

/* Mobile full-bleed */
@media (max-width: 430px) {
  .phone-wrapper {
    padding: 0;
    background: var(--bg);
  }
  .phone {
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}
