@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-color: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(255, 255, 255, 0.9);
  --primary-blue: #0f172a;
  --accent-blue: #2563eb;
  --accent-green: #10b981;
  --accent-green-hover: #059669;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(37, 99, 235, 0.2);
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.15);
  border-radius: 100px;
  border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.3);
}

html {
  scrollbar-color: rgba(15, 23, 42, 0.15) transparent;
  scrollbar-width: thin;
}

/* Background */
/* .app-container animates a transform, which makes it the containing block for
   position:fixed children — so this is effectively absolute, and .shape-2's
   right:-20vw (plus the float animation drifting further right) became real
   page width. overflow:hidden clips the decorative blobs to the backdrop.
   100% not 100vw: 100vw ignores the scrollbar and overflows by its width. */
.background-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, hsla(217, 100%, 96%, 1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, hsla(160, 100%, 94%, 1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, hsla(215, 100%, 95%, 1) 0px, transparent 50%);
}

.shape {
  position: absolute;
  filter: blur(120px);
  border-radius: 50%;
  animation: float 25s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
  opacity: 0.8;
}

.shape-1 {
  width: 50vw;
  height: 50vw;
  background: #bfdbfe;
  top: -10vw;
  left: -10vw;
}

.shape-2 {
  width: 60vw;
  height: 60vw;
  background: #a7f3d0; /* subtle green mix */
  bottom: -20vw;
  right: -20vw;
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 60px) scale(1.1); }
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 7rem 2rem 2rem; /* top clears the fixed navbar */
  opacity: 0;
  transform: translateY(20px);
  animation: pageFadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Navbar - same shape as kaskita.appshub.id: transparent bar that turns into a
   white blurred one past 20px of scroll (.scrolled is set by the inline script
   in the header partial). Lives outside .app-container: that element animates a
   transform, which would make it the containing block for position:fixed. */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 20px 0;
  background: transparent;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar.scrolled {
  padding: 12px 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary-blue);
  text-decoration: none;
  line-height: 1;
}

.logo span {
  color: var(--accent-blue);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-blue);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--accent-blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-primary:active,
.btn-nav:active {
  transform: scale(0.97);
}

/* Menu toggle, no JS: the checkbox sits next to .nav-links so :checked ~ opens
   the dropdown. Kept focusable (not [hidden]) so it still works from the keyboard. */
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mobile-menu-btn {
  display: none;
  padding: 8px;
  color: var(--text-primary);
  cursor: pointer;
}

.nav-toggle:focus-visible + .mobile-menu-btn,
.nav-link:focus-visible,
.btn-primary:focus-visible,
.logo:focus-visible,
.btn-nav:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

.btn-nav {
  text-decoration: none;
  background: var(--primary-blue);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.btn-nav:hover {
  background: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.2);
}

.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.badge-title {
  display: inline-block;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-blue);
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* App Catalog Hub */
.catalog-main {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 2rem;
}

.catalog-hero {
  text-align: center;
  margin-bottom: 5rem;
  max-width: 800px;
}

.catalog-headline {
  font-size: clamp(2.1rem, 5.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.catalog-description {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.article-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.article-body pre {
  overflow-x: auto;
  max-width: 100%;
}

.article-body table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

.share-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--card-border);
}

.share-label {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-right: 0.25rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-blue);
  border: 1px solid rgba(37, 99, 235, 0.15);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
}

.share-btn:hover {
  background: var(--accent-blue);
  color: #fff;
  transform: translateY(-2px);
}

.share-btn.copied {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.promo-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 1000px;
  margin-bottom: 3rem;
  padding: 1.5rem 2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  text-decoration: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

.promo-banner:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.4);
}

.promo-banner-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  flex-shrink: 0;
}

.promo-banner-text {
  flex: 1;
  text-align: left;
}

.promo-banner-text h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin: 0.4rem 0 0.3rem;
}

.promo-banner-text p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
}

.app-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.5rem;
  width: 100%;
  max-width: 1000px;
}

.app-catalog-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.app-catalog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.1);
  border-color: rgba(37, 99, 235, 0.4);
}

.card-image-wrapper {
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: blur(3px) scale(1.1);
  opacity: 0.7;
  transition: transform 0.6s var(--ease);
}

.app-catalog-card:hover .card-bg {
  transform: scale(1.08);
}

.app-catalog-card:hover .card-app-icon {
  transform: translateY(-4px);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.6));
}

.card-app-icon {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  z-index: 2;
  border: 3px solid rgba(255, 255, 255, 0.9);
  transition: transform 0.4s var(--ease);
}

.card-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-content h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 0.8rem;
}

.card-content p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
  flex: 1;
}

.card-action {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap 0.3s ease;
}

.app-catalog-card:hover .card-action {
  gap: 0.8rem;
}

.coming-soon {
  cursor: default;
  opacity: 0.8;
}

.coming-soon:hover {
  transform: none;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  border-color: var(--card-border);
}

.skeleton-bg {
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: shine 1.5s linear infinite;
  filter: none;
  opacity: 1;
}

@keyframes shine {
  to {
    background-position-x: -200%;
  }
}

.skeleton-icon {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  z-index: 2;
}

.card-action.disabled {
  color: var(--text-secondary);
}

/* Footer */
.footer {
  text-align: center;
  padding: 4rem 0 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .app-container {
    padding: 6rem 1rem 1rem;
  }

  .mobile-menu-btn {
    display: flex;
  }

  /* The menu is collapsed here, never removed: the hamburger toggles it back.
     Hiding .nav-links without a toggle would leave phones with no navigation. */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 20px;
    background: var(--bg-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  }

  .nav-toggle:checked ~ .nav-links {
    display: flex;
  }

  .nav-link, .nav-links .btn-primary {
    padding: 12px 0;
    text-align: center;
    justify-content: center;
    border-radius: 8px;
  }

  .logo {
    font-size: 1.3rem;
  }

  .btn-nav {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .catalog-hero {
    margin-bottom: 3rem;
  }
  
  .app-catalog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .card-image-wrapper {
    height: 180px;
  }

  .promo-banner {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .promo-banner-text {
    text-align: center;
  }
}
