/* =========================================================
   index.css — Home page (downloade.app aligned)
   Tokens come from theme.css:
     --primary, --primary-hover, --primary-soft-bg,
     --footer-bg, --body-bg, --card-bg, --card-border,
     --text-primary, --text-secondary,
     --font-heading, --font-body
   ========================================================= */

/* ---------- Reset (page-scope) ---------- */
.home,
.home * {
  box-sizing: border-box;
}
.home img { max-width: 100%; height: auto; display: block; }
.home a { text-decoration: none; color: inherit; }
.home p { margin: 0; }
.home h1, .home h2, .home h3 { margin: 0; font-family: var(--font-heading); color: var(--text-primary); }

/* ---------- Layout ---------- */
.home {
  width: 100%;
  background: var(--body-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  padding-bottom: 48px;
}

.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 0;
}
.section__hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* ---------- Grids (mobile-safe, immutable column counts) ---------- */
.grid {
  display: grid;
  gap: 16px;
  align-items: stretch;
}
.grid > * { min-width: 0; }
.grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, #f4f8ff 0%, #ffffff 60%, #eef3ff 100%);
  overflow: hidden;
}
.hero__inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 96px;
  z-index: 1;
}
.hero__copy {
  position: relative;
  max-width: 720px;
  z-index: 2;
}
.hero__title {
  font-size: 56px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--primary) 0%, #5fa0ff 60%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__desc {
  margin-top: 18px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 560px;
}
.hero__search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  max-width: 520px;
  box-shadow: 0 12px 32px rgba(15, 37, 87, 0.08);
}
.hero__search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  height: 44px;
  font-size: 15px;
  color: var(--text-primary);
  font-family: var(--font-body);
}
.hero__search-input::placeholder { color: var(--text-secondary); }
.hero__search-btn {
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-heading);
  transition: background .2s;
}
.hero__search-btn:hover { background: var(--primary-hover); }

.hero__deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero__deco-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
}
.hero__deco-blob--1 { width: 320px; height: 320px; top: -80px;  right: -80px; background: rgba(30,119,255,.35); }
.hero__deco-blob--2 { width: 220px; height: 220px; bottom: -60px; right: 22%;  background: rgba(167,139,250,.35); }
.hero__deco-blob--3 { width: 180px; height: 180px; top: 30%;     right: 8%;    background: rgba(95,160,255,.30); }

/* ---------- Ad box ---------- */
.ad-box {
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 0 24px;
}
.ad-box .adTitle {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ---------- App card (Featured / Top Rated / Online Apps) ---------- */
.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.app-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(30, 119, 255, 0.12);
  transform: translateY(-1px);
}
.app-card__free-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--primary-soft-bg);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.app-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.app-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f3f4f6;
}
.app-card__icon--sm { width: 48px; height: 48px; border-radius: 10px; }
.app-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.app-card__body {
  min-width: 0;
  flex: 1;
}
.app-card__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-heading);
}
.app-card__category {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-card__rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.app-card__rating svg { fill: #fbbf24; }
.app-card--compact .app-card__rating { color: var(--text-primary); }
.app-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}
.app-card__cta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--primary);
  background: var(--primary-soft-bg);
  padding: 6px 12px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* ---------- Productivity card (large with desc) ---------- */
.prod-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.prod-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(30, 119, 255, 0.12);
  transform: translateY(-1px);
}
.prod-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f3f4f6;
}
.prod-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.prod-card__body { flex: 1; min-width: 0; }
.prod-card__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-card__desc {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prod-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
}
.prod-card__category {
  color: var(--primary);
  background: var(--primary-soft-bg);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.prod-card__rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-primary);
  font-weight: 600;
}
.prod-card__rating svg { fill: #fbbf24; }

/* ---------- Promo card (New User Exclusive) ---------- */
.promo-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--primary-soft-bg) 0%, #ffffff 100%);
  border: 2px solid var(--primary-soft-bg);
  border-radius: 16px;
  padding: 16px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.promo-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.promo-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
}
.promo-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.promo-card__body { flex: 1; min-width: 0; }
.promo-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.promo-card__tag {
  margin-top: 4px;
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.promo-card__cta {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 6px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
}

/* ---------- Category tile (Explore by Category) ---------- */
.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 16px;
  padding: 20px 12px;
  text-align: center;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  transition: border-color .2s, transform .2s, background .2s;
}
.cat-tile:hover {
  border-color: var(--primary);
  background: var(--primary-soft-bg);
  transform: translateY(-1px);
}
.cat-tile__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-soft-bg);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cat-tile__icon svg { fill: currentColor; }
.cat-tile__icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
.cat-tile__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ---------- Article card (Latest Insights) ---------- */
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.article-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(30, 119, 255, 0.12);
  transform: translateY(-1px);
}
.article-card__cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #f3f4f6;
  overflow: hidden;
}
.article-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-card__body { padding: 14px 16px 18px; }
.article-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-heading);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card__desc {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Type tile (Explore App Types) ---------- */
.type-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 16px;
  padding: 18px 16px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.type-tile:hover { border-color: var(--primary); transform: translateY(-1px); }
.type-tile__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft-bg);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.type-tile__icon svg { fill: currentColor; }
.type-tile__icon-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}
.type-tile__name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.type-tile__cta {
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.type-tile__cta svg { fill: currentColor; }

/* ---------- Testimonial ---------- */
.testimonial {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 16px;
  padding: 22px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.testimonial__stars {
  display: inline-flex;
  gap: 2px;
}
.testimonial__stars svg { fill: #fbbf24; }
.testimonial__quote {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
}
.testimonial__author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}
.testimonial__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-soft-bg);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.testimonial__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

/* =========================================================
   Responsive — breakpoints 1023 / 767 / 480
   ========================================================= */

@media (max-width: 1023px) {
  .section { padding: 36px 20px 0; }
  .section__title { font-size: 24px; }

  .grid--6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .hero__inner { padding: 60px 20px 72px; }
  .hero__title { font-size: 44px; }
  .hero__desc { font-size: 16px; }
}

@media (max-width: 767px) {
  .section { padding: 32px 16px 0; }
  .section__title { font-size: 20px; }
  .grid { gap: 12px; }

  .grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--2 { grid-template-columns: minmax(0, 1fr); }

  /* Section-specific overrides per spec table */
  .section--new-user .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .section--insights .grid--4 { grid-template-columns: minmax(0, 1fr); }

  .hero__inner { padding: 48px 16px 60px; }
  .hero__title { font-size: 34px; }
  .hero__desc { font-size: 15px; margin-top: 14px; }
  .hero__search { padding: 4px 4px 4px 16px; }
  .hero__search-input { height: 40px; font-size: 14px; }
  .hero__search-btn { height: 40px; padding: 0 16px; font-size: 13px; }
  .hero__deco-blob--1 { width: 220px; height: 220px; }
  .hero__deco-blob--2 { width: 160px; height: 160px; }
  .hero__deco-blob--3 { display: none; }

  .app-card { padding: 12px; gap: 10px; }
  .app-card__icon { width: 48px; height: 48px; border-radius: 10px; }
  .app-card__icon--sm { width: 44px; height: 44px; }
  .app-card__free-badge { top: 8px; right: 8px; padding: 2px 6px; font-size: 9px; }

  .prod-card { padding: 16px; gap: 12px; }
  .prod-card__icon { width: 56px; height: 56px; }

  .ad-box { padding: 0 16px; margin-top: 18px; }
}

@media (max-width: 480px) {
  .section { padding: 24px 14px 0; }
  .section__title { font-size: 18px; }

  /* Lock single column where 2 columns get cramped */
  .section--featured .grid--6,
  .section--top-rated .grid--3,
  .section--online-apps .grid--4,
  .section--app-types .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section--testimonials .grid--3 { grid-template-columns: minmax(0, 1fr); }

  .hero__inner { padding: 36px 14px 48px; }
  .hero__title { font-size: 28px; }
  .hero__desc { font-size: 14px; }

  .app-card { padding: 10px; }
  .app-card__name { font-size: 13px; }
  .app-card__category { font-size: 11px; }
}
