/* =========================
   Stellarly Bento (section-only)
   Depends on styles.css variables + .glass-card + .btn
   ========================= */

.bento {
  padding: 5.5rem 0 6.5rem;
}

.bento__container {
  text-align: center;
}

.bento__header {
  max-width: 900px;
  margin: 0 auto 2.25rem;
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.bento__lede {
  max-width: 72ch;
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(1.02rem, 1.2vw, 1.15rem);
  line-height: 1.75;
}

/* Badge + logo */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid currentColor;
  letter-spacing: 0.02em;
}

.badge--pink { color: var(--pink); }

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.brand__logo {
  height: 64px;
  width: auto;
  display: block;
  filter: drop-shadow(0 18px 44px rgba(0,0,0,0.28));
}

/* =========================
   Bento Grid
   ========================= */

.bento__grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  align-items: stretch;
}

/* Tile base */
.tile {
  border-radius: 24px;
  overflow: hidden;
  text-align: left;
  position: relative;

  /* Match your glass language without duplicating .glass-card */
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px) saturate(180%);
  transition: transform 0.35s ease, border-color 0.35s ease;
}

.tile:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-4px);
}

/* CTA tile uses your .glass-card padding rhythm */
.tile--cta.glass-card {
  padding: 0; /* we’ll control spacing inside */
}

.tile__content {
  padding: 2.25rem;
}

.tile__title {
  margin: 0 0 0.75rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-size: clamp(1.4rem, 2.1vw, 2.05rem);
}

.tile__title--sm {
  font-size: 1.05rem;
  margin-bottom: 0.9rem;
}

.tile__text {
  margin: 0 0 1.15rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 70ch;
}

.tile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

/* You currently have .btn-outline (not .btn-secondary). Make the markup resilient. */
.btn-secondary {
  border: 1px solid var(--glass-border);
  color: #fff;
  background: transparent;
}

.btn-secondary:hover {
  background: var(--glass-bg);
}

.tile__fineprint {
  margin: 1rem 0 0;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.64);
}

/* Media tiles */
.tile__media {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
}

.media {
  width: 100%;
  height: auto;
  display: block;
}

/* You switched chat images to contain: perfect for detail */
.media--contain {
  object-fit: contain;
  max-height: 78vh; /* prevents “absurdly tall screenshot” on large screens */
}

/* Character should breathe */
.tile--character .tile__media {
  padding: 22px;
}

.tile__caption {
  padding: 0 1.25rem 1.15rem;
  color: rgba(255,255,255,0.72);
  font-size: 0.95rem;
}

/* Features tile */
.tile--features {
  padding: 1.6rem;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.feature-list__item {
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.82);
}

/* =========================
   Responsive Layout Rules
   ========================= */

/* Tablet: 2-column */
@media (min-width: 760px) {
  .bento__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* CTA spans both columns for readability */
  .tile--cta {
    grid-column: 1 / -1;
  }

  /* Make screenshot tiles feel like bento cards */
  .tile--chat {
    min-height: 520px;
  }
}

/* Desktop: true bento composition (prioritizes scanning + detail) */
@media (min-width: 1100px) {
  .bento__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 86px;
    gap: 18px;
  }

  /* How users scan:
     1) headline/value (CTA) on left
     2) visual proof (big chat) on right
     3) supporting tiles underneath
  */

  .tile--cta {
    grid-column: 1 / span 7;
    grid-row: span 6;
  }

  .tile--chat-wide {
    grid-column: 8 / span 5;
    grid-row: span 6;
  }

  .tile--character {
    grid-column: 1 / span 4;
    grid-row: span 4;
  }

  .tile--chat-tall {
    grid-column: 5 / span 5;
    grid-row: span 4;
  }

  .tile--features {
    grid-column: 10 / span 3;
    grid-row: span 4;
  }

  /* Extra polish: give the whole bento a subtle glow without new colors */
  .bento {
    position: relative;
  }

  .bento::before {
    content: "";
    position: absolute;
    inset: -40px 0 -60px;
    background: radial-gradient(circle at 20% 20%, rgba(100,84,215,0.18), transparent 55%),
                radial-gradient(circle at 80% 25%, rgba(93,169,255,0.14), transparent 55%),
                radial-gradient(circle at 55% 85%, rgba(63,214,214,0.10), transparent 60%);
    pointer-events: none;
    z-index: 0;
  }

  .bento__container,
  .bento__grid,
  .bento__header {
    position: relative;
    z-index: 1;
  }
}

/* Mobile tightening */
@media (max-width: 520px) {
  .tile__content {
    padding: 1.6rem;
  }

  .tile__media {
    padding: 12px;
  }

  .media--contain {
    max-height: 70vh;
  }
}

/* =========================
   FIX: Desktop grid gaps / weird stacking
   ========================= */

@media (min-width: 1100px) {
  /* allow the grid to backfill gaps */
  .bento__grid {
    grid-auto-flow: row dense;
  }

  /* remove any height forcing that breaks row math */
  .tile--chat { min-height: unset; }

  /* make media respect the tile height instead of forcing it */
  .tile__media {
    height: 100%;
  }

  /* contain images should not create extra height beyond the tile */
  .media--contain {
    height: 100%;
    max-height: none;
  }
}
