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

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

:root {
  --bg-deep: #07090c;
  --bg-primary: #0c0f14;
  --bg-surface: #12161e;
  --bg-card: #161b25;
  --bg-card-hover: #1a2030;
  --bg-elevated: #1e2434;

  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-default: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(46, 204, 167, 0.3);

  --text-primary: #e8ecf2;
  --text-secondary: #8a92a6;
  --text-tertiary: #555d72;
  --text-accent: #2eccA7;

  --accent: #2eccA7;
  --accent-dim: rgba(46, 204, 167, 0.12);
  --accent-glow: rgba(46, 204, 167, 0.25);

  --cat-finance: #f59e0b;
  --cat-tools: #6366f1;
  --cat-social: #ec4899;
  --cat-gaming: #f43f5e;
  --cat-developer: #22d3ee;
  --cat-commerce: #a78bfa;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-display);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ═══ NOISE TEXTURE ═══ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ═══ GRID BACKGROUND ═══ */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ═══ AMBIENT GLOW ═══ */
.ambient-glow {
  position: fixed;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  filter: blur(200px);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

.ambient-glow--tl {
  top: -300px;
  left: -200px;
  background: var(--accent);
}

.ambient-glow--br {
  bottom: -400px;
  right: -200px;
  background: #6366f1;
}

/* ═══ LAYOUT ═══ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ═══ HEADER / NAV ═══ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 12, 0.8);
  backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid var(--border-subtle);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav__logo {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav__logo svg {
  width: 100%;
  height: 100%;
}

.nav__wordmark {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

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

.nav__links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}

.nav__link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav__link--accent {
  color: var(--accent);
  border: 1px solid var(--border-accent);
  background: var(--accent-dim);
}

.nav__link--accent:hover {
  background: rgba(46, 204, 167, 0.18);
  color: var(--accent);
}

/* ═══ HERO ═══ */
.hero {
  padding: 100px 0 60px;
  text-align: center;
  position: relative;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 28px;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) both;
}

.hero__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

.hero__title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) 0.1s both;
}

.hero__title span {
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 44px;
  line-height: 1.6;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) 0.2s both;
}

.hero__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) 0.3s both;
}

.hero__stat {
  text-align: center;
}

.hero__stat-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.hero__stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* ═══ SEARCH & FILTER BAR ═══ */
.toolbar {
  padding: 40px 0 24px;
  position: sticky;
  top: 64px;
  z-index: 50;
  background: rgba(7, 9, 12, 0.85);
  backdrop-filter: blur(20px);
}

.toolbar__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-box {
  position: relative;
}

.search-box__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  transition: color 0.2s ease;
}

.search-box__input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 48px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.25s ease;
}

.search-box__input::placeholder {
  color: var(--text-tertiary);
}

.search-box__input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--bg-card);
}

.search-box__input:focus ~ .search-box__icon {
  color: var(--accent);
}

.search-box__count {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 7px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-card);
}

.filter-chip.active {
  color: var(--bg-deep);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.filter-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ═══ DAPP GRID ═══ */
.dapp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  padding: 16px 0 80px;
}

.dapp-grid--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  text-align: center;
}

.dapp-grid--empty svg {
  color: var(--text-tertiary);
  margin-bottom: 20px;
  opacity: 0.5;
}

.dapp-grid--empty h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.dapp-grid--empty p {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* ═══ DAPP CARD ═══ */
.dapp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.35s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
  animation: fadeSlideUp 0.5s var(--ease-out-expo) both;
}

.dapp-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(46, 204, 167, 0.03), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.dapp-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(46, 204, 167, 0.1);
}

.dapp-card:hover::before {
  opacity: 1;
}

.dapp-card__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.dapp-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
  position: relative;
}

.dapp-card__icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dapp-card__meta {
  flex: 1;
  min-width: 0;
}

.dapp-card__name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.dapp-card__info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dapp-card__version {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.dapp-card__author {
  font-size: 12px;
  color: var(--text-tertiary);
}

.dapp-card__featured {
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 0 var(--radius-lg) 0 var(--radius-sm);
  border-bottom: 1px solid var(--border-accent);
  border-left: 1px solid var(--border-accent);
}

.dapp-card__description {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
  flex: 1;
}

.dapp-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.dapp-card__category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: 100px;
}

.dapp-card__category-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dapp-card__download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--bg-deep);
  background: var(--accent);
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.dapp-card__download::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dapp-card__download:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.dapp-card__download:hover::before {
  opacity: 1;
}

.dapp-card__download:active {
  transform: translateY(0);
}

.dapp-card__download svg {
  width: 14px;
  height: 14px;
}

/* ═══ INSTALL SECTION ═══ */
.install-section {
  padding: 80px 0;
  border-top: 1px solid var(--border-subtle);
}

.install-section__inner {
  max-width: 720px;
  margin: 0 auto;
}

.install-section__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cat-developer);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.install-section__title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.install-section__subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 40px;
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.install-step {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease;
}

.install-step:hover {
  border-color: var(--border-strong);
}

.install-step__number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.install-step__content h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.install-step__content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.install-step__content code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--accent);
}

/* ═══ FOOTER ═══ */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer__text {
  font-size: 13px;
  color: var(--text-tertiary);
}

.site-footer__text a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer__text a:hover {
  color: var(--accent);
}

.site-footer__links {
  display: flex;
  gap: 20px;
}

.site-footer__links a {
  font-size: 13px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer__links a:hover {
  color: var(--text-secondary);
}

/* ═══ ANIMATIONS ═══ */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .hero {
    padding: 60px 0 40px;
  }

  .hero__stats {
    gap: 28px;
  }

  .hero__stat-value {
    font-size: 22px;
  }

  .dapp-grid {
    grid-template-columns: 1fr;
  }

  .nav__links {
    display: none;
  }

  .install-step {
    flex-direction: column;
    gap: 12px;
  }

  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero__title {
    font-size: 32px;
  }

  .hero__stats {
    flex-direction: column;
    gap: 16px;
  }

  .dapp-card {
    padding: 20px;
  }

  .dapp-card__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .dapp-card__download {
    justify-content: center;
  }
}
