:root {
  --bg-dark: #07090e;
  --bg-card: rgba(15, 23, 42, 0.7);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(56, 189, 248, 0.3);
  --accent-cyan: #38bdf8;
  --accent-violet: #818cf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --sab: env(safe-area-inset-bottom, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: calc(20px + var(--sab));
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 9, 14, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-card);
  padding: 14px 0;
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.brand { text-decoration: none; color: #fff; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.brand-badge {
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  color: #fff; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px;
}
.brand span { color: var(--accent-cyan); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: #fff; }
.btn-glow {
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #fff; text-decoration: none; padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3); transition: transform 0.2s; display: inline-flex; align-items: center; justify-content: center;
}
.btn-glow:hover { transform: translateY(-1px); }

/* Hero */
.hero-section { padding: 60px 0 40px; text-align: center; }
.hero-wrap { max-width: 860px; }
.hero-badge {
  display: inline-block; background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan); font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 99px; margin-bottom: 20px;
}
.hero-section h1 { font-family: var(--font-display); font-size: 46px; font-weight: 700; line-height: 1.15; margin-bottom: 18px; }
.gradient-text {
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-lead { font-size: 17px; color: var(--text-muted); margin-bottom: 30px; line-height: 1.6; }
.hero-metrics {
  display: inline-flex; align-items: center; gap: 24px; background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-card); padding: 12px 24px; border-radius: 14px;
}
.metric b { display: block; font-size: 20px; color: #fff; }
.metric span { font-size: 12px; color: var(--text-muted); }
.metric-divider { width: 1px; height: 30px; background: var(--border-card); }

/* Directory Controls */
.directory-section { padding: 30px 0 60px; }
.controls-panel { margin-bottom: 30px; display: flex; flex-direction: column; gap: 16px; }
.search-box {
  display: flex; align-items: center; gap: 12px; background: var(--bg-card);
  border: 1px solid var(--border-card); padding: 12px 18px; border-radius: 12px;
}
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
  background: transparent; border: none; outline: none; color: #fff; font-size: 16px !important; width: 100%;
}
.category-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.chip {
  background: rgba(15, 23, 42, 0.6); border: 1px solid var(--border-card); color: var(--text-muted);
  padding: 8px 16px; border-radius: 99px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.chip.active, .chip:hover { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); border-color: rgba(56, 189, 248, 0.4); }

/* App Cards */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.app-card {
  background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 14px; padding: 22px;
  display: flex; flex-direction: column; justify-content: space-between; transition: all 0.2s;
}
.app-card:hover { transform: translateY(-3px); border-color: var(--border-accent); box-shadow: 0 10px 25px rgba(0,0,0,0.4); }
.app-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.app-badge { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.app-category { font-size: 11px; color: var(--text-muted); }
.app-title { font-size: 19px; color: #fff; margin-bottom: 8px; font-weight: 700; }
.app-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 18px; flex-grow: 1; }
.app-link {
  display: block; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-card);
  color: #fff; text-decoration: none; padding: 9px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; transition: all 0.2s; text-align: center;
}
.app-link:hover { background: var(--accent-cyan); color: #000; border-color: var(--accent-cyan); }

/* Stacks */
.stacks-section { padding: 50px 0; border-top: 1px solid var(--border-card); }
.section-header { text-align: center; margin-bottom: 35px; }
.sub-title { color: var(--accent-cyan); font-size: 12px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; }
.section-header h2 { font-family: var(--font-display); font-size: 30px; color: #fff; }
.blueprint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.blueprint-card {
  background: rgba(15, 23, 42, 0.5); border: 1px solid var(--border-card); border-radius: 14px; padding: 22px;
}
.blueprint-tag { color: #a855f7; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.blueprint-card h3 { font-size: 18px; color: #fff; margin-bottom: 8px; }
.blueprint-card p { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; }
.stack-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.stack-badges span { background: rgba(255,255,255,0.05); color: #e2e8f0; font-size: 11px; padding: 3px 8px; border-radius: 6px; }

/* Ad Slot Containers (Prepared for injection) */
.ad-placeholder-container { width: 100%; display: flex; justify-content: center; align-items: center; margin: 15px 0; min-height: 0; }

/* Responsive Overrides */
@media screen and (max-width: 768px) {
  .hero-section h1 { font-size: 30px; }
  .hero-lead { font-size: 15px; }
  .nav-links { display: none; }
  .hero-metrics { flex-direction: column; gap: 12px; width: 100%; }
  .metric-divider { display: none; }
  .apps-grid { grid-template-columns: 1fr; }
  .blueprint-grid { grid-template-columns: 1fr; }
}
