/* ==========================================================================
   companions.css — core features section: NSFW AI Girlfriend / Boyfriend
   character card grids with hover CTA, online dot and "see all" tiles.
   ========================================================================== */

.companions {
  position: relative;
  isolation: isolate;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(76px, 9vw, 116px) 32px;
}
.companions::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  top: -40px;
  height: 460px;
  background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.09), transparent 65%);
  filter: blur(40px);
  pointer-events: none;
}

/* ---------- Section head ---------- */

.companions-head {
  max-width: 720px;
  margin: 0 auto 60px;
  text-align: center;
}
.companions-head h2 {
  margin: 26px 0 16px;
  font-size: clamp(34px, 4.4vw, 58px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}
.companions-intro {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  text-wrap: pretty;
}

/* ---------- Group head (H3 with keyword) ---------- */

.group + .group { margin-top: 76px; }

.group-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}
.group-head > div { max-width: 640px; }

.group-head h3 {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.group-head h3::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--grad);
  transform: rotate(45deg);
}
.group-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.group-link {
  flex: none;
  padding-bottom: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.group-link span {
  display: inline-block;
  margin-left: 8px;
  transition: transform 0.2s ease;
}
.group-link:hover span { transform: translateX(4px); }

/* ---------- Character grid + cards ---------- */

.ch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.ch-card {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.ch-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 77, 141, 0.45);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.5);
}

.ch-art {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--surface-2);
}
.ch-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  transition: transform 0.45s ease;
  -webkit-user-drag: none;
}
.ch-card:hover .ch-art img { transform: scale(1.06); }

.ch-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 7, 16, 0.5) 78%, rgba(10, 7, 16, 0.92) 100%);
}

.ch-cta {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 12px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  background: var(--grad);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(255, 77, 141, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.ch-card:hover .ch-cta,
.ch-card:focus-visible .ch-cta {
  opacity: 1;
  transform: translate(-50%, 0);
}

.ch-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 16px 15px;
}
.ch-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
  animation: dot-pulse 2.4s ease-in-out infinite;
}
@keyframes dot-pulse { 50% { opacity: 0.4; } }
.ch-tags {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.ch-desc {
  font-size: 12px;
  color: var(--faint);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- "See all" tile ---------- */

.ch-cta-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.ch-cta-tile:hover {
  border-color: rgba(255, 77, 141, 0.5);
  background: rgba(255, 255, 255, 0.045);
  transform: translateY(-6px);
}
.cta-icon {
  width: 34px;
  height: 34px;
  color: var(--accent);
  filter: drop-shadow(0 0 14px rgba(255, 77, 141, 0.45));
}
.cta-title { font-size: 16px; font-weight: 700; }
.cta-sub { font-size: 12px; color: var(--muted); }

/* ---------- Reveal on scroll (enhancement only: content is visible without JS) ---------- */

.reveal { transition: opacity 0.6s ease, transform 0.6s ease; }
.js-motion .reveal { opacity: 0; transform: translateY(26px); }
.js-motion .reveal.visible { opacity: 1; transform: none; }

.js-motion .ch-grid li:nth-child(2) { transition-delay: 0.07s; }
.js-motion .ch-grid li:nth-child(3) { transition-delay: 0.14s; }
.js-motion .ch-grid li:nth-child(4) { transition-delay: 0.21s; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .ch-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .companions { padding: 64px 20px; }
  .companions-head { margin-bottom: 44px; }
  .companions-intro { font-size: 14px; }
  .group + .group { margin-top: 58px; }

  .group-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
  }
  .group-head p { font-size: 12.5px; }

  .ch-grid { gap: 14px; }
  .ch-card, .ch-cta-tile { border-radius: 13px; }
  .ch-meta { padding: 11px 12px 13px; }
  .ch-name { font-size: 16px; }
  .ch-tags { font-size: 11px; }
  .ch-desc { font-size: 11px; }
  .ph-letter { font-size: 72px; }
  .cta-title { font-size: 14px; }

  /* hover CTA is a desktop affordance; taps open the card directly */
  .ch-cta { display: none; }
}
