/* Home/catalogue layout, shared with apps.agap.it index.html */
.agap-mark {
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.04em;
}

/* ---------- Hero ---------- */
.home-hero {
  padding: 2.5rem 1rem 1.5rem;
  text-align: left;
}

.home-hero .hero-container {
  max-width: var(--max-w-content);
}

.home-hero .hero-title {
  font-size: clamp(2rem, 7.5vw, 3.4rem);
  margin: 0 0 1rem;
  max-width: 16ch;
}

.home-hero .hero-subtitle {
  margin: 0 0 1.5rem;
  max-width: 62ch;
  font-size: clamp(1rem, 3.6vw, 1.18rem);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.hero-stats li {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.8rem;
}

.hero-stats strong {
  color: var(--accent-strong);
}

.hero-visual {
  display: none;
}

@media (min-width: 1080px) {
  .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 3rem;
    align-items: center;
  }
  .hero-visual {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transform: rotate(-1.5deg);
  }
  .hero-visual .app-showcase-frame {
    margin: 0;
  }
  .hero-visual-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .hero-visual-row img {
    width: 100%;
    aspect-ratio: 3 / 1;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-main);
    box-shadow: var(--shadow-md);
  }
}

/* ---------- Search + filters ---------- */
.finder {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0.75rem;
  max-width: 760px;
}

.search-box {
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text-main);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 0.8rem 2.6rem 0.8rem 2.7rem;
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  display: none;
}

.search-clear.visible {
  display: block;
}

.chip-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.65rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-full);
  padding: 0.45rem 0.9rem;
  min-height: 38px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  color: var(--text-main);
  border-color: var(--card-hover-border);
}

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.finder-status {
  margin: 0.6rem 0.25rem 0;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ---------- Featured ---------- */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.featured-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--c);
}

.featured-card img {
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  background: var(--bg-surface-subtle);
}

.featured-body {
  padding: 1.1rem 1.25rem 1.3rem;
  border-top: 4px solid var(--c);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.featured-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: color-mix(in srgb, var(--c) 72%, var(--text-main));
}

.featured-body h3 {
  margin: 0;
  font-size: 1.3rem;
}

.featured-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* ---------- Catalogue ---------- */
.cat-group + .cat-group {
  margin-top: 3rem;
}

.cat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-main);
}

.cat-head h2 {
  margin: 0;
  font-size: clamp(1.3rem, 4.5vw, 1.65rem);
  letter-spacing: -0.02em;
}

.cat-head p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.cat-count {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-card:hover,
.app-card:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--c) 55%, var(--card-border));
}

.app-card-thumb {
  display: block;
  aspect-ratio: 3 / 1;
  background: color-mix(in srgb, var(--c) 14%, var(--bg-surface-subtle));
  border-bottom: 3px solid var(--c);
  overflow: hidden;
}

.app-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-card-body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.app-card-title {
  margin: 0;
  font-size: 1.12rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.app-card-title a {
  color: var(--text-main);
}

/* whole card clickable */
.app-card-title a::after,
.featured-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.featured-card h3 a {
  color: var(--text-main);
}

.app-card-title a:focus-visible,
.featured-card h3 a:focus-visible {
  outline: none;
}

.app-card:focus-within,
.featured-card:focus-within {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.store-tag {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.os-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.os-list li {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-muted);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.1rem 0.45rem;
}

.app-card-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  flex: 1;
}

.app-card-more {
  font-size: 0.86rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--c) 70%, var(--text-main));
  margin-top: 0.2rem;
}

.no-results {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px dashed var(--border-main);
  border-radius: var(--radius-lg);
}

.no-results button {
  margin-top: 1rem;
}

[hidden] {
  display: none !important;
}

/* ---------- Contact CTA ---------- */
.cta-band {
  background: var(--accent-gradient);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  display: grid;
  gap: 1.25rem;
  align-items: center;
  box-shadow: 0 10px 30px var(--accent-glow);
}

.cta-band h2 {
  color: #fff;
  margin: 0 0 0.4rem;
  font-size: clamp(1.35rem, 4.5vw, 1.8rem);
}

.cta-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.cta-band .btn {
  background: #fff;
  color: var(--brand-ink);
  justify-self: start;
}

.cta-band .btn:hover {
  transform: translateY(-2px);
  color: var(--brand-ink);
}

.site-footer .footer-top {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .app-grid,
  .featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .finder {
    padding: 1rem;
  }
  .site-footer .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 860px) {
  .home-hero {
    padding: 4rem 1.25rem 2rem;
  }
  .cta-band {
    grid-template-columns: 1fr auto;
    padding: 2.25rem 2.5rem;
  }
  .cta-band .btn {
    justify-self: end;
  }
}

@media (min-width: 1000px) {
  .app-grid,
  .featured-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .site-footer .footer-top {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

@media (max-width: 990px) {
  .nav-menu.open .nav-link {
    display: block;
    padding: 0.7rem 0.5rem;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-card, .featured-card { transition: none; }
  .app-card:hover, .featured-card:hover { transform: none; }
}
