/* ============================================================
   FEATURES PAGE — styles
   ============================================================ */

/* ── Page header ── */
.feat-header h1 {
  font-size: clamp(var(--t-5xl), 7vw, var(--t-7xl));
  margin: var(--s3) 0 var(--s5);
  letter-spacing: -0.02em;
}

.feat-header > .container > .feat-intro {
  font-size: var(--t-lg);
  color: var(--text-muted);
  max-width: 440px;
  margin: 0 auto var(--s10);
  line-height: 1.7;
}

/* ── Search bar ── */
.feat-search-wrap {
  position: relative;
  max-width: 380px;
  margin: 0 auto;
}

.feat-search-wrap .search-icon {
  position: absolute;
  left: var(--s4);
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: var(--text-dim);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

#feat-search {
  width: 100%;
  padding: 10px var(--s5) 10px calc(var(--s4) + 15px + var(--s3));
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: var(--t-sm);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

#feat-search::placeholder { color: var(--text-dim); }

#feat-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 1px 4px rgba(0,0,0,0.07);
}

/* ── Main grid area ── */
.feat-main {
  padding: var(--s10) 0 var(--s32);
  background: var(--surface-2);
}

.feat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s5);
  grid-auto-flow: row dense;
}

/* ── Feature card ── */
.feat-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: var(--s6);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.05),
    0 4px 14px rgba(0,0,0,0.04),
    inset 0 3px 0 0 transparent;   /* accent bar slot — invisible at rest */
  /* Entrance: cards fade+rise in when page loads */
  animation: cardIn 0.5s ease-out both;
  transition:
    transform    0.22s cubic-bezier(0.16,1,0.3,1),
    box-shadow   0.22s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Stagger the card entrance by grid position */
.feat-card:nth-child(1)  { animation-delay: 0.02s; }
.feat-card:nth-child(2)  { animation-delay: 0.05s; }
.feat-card:nth-child(3)  { animation-delay: 0.08s; }
.feat-card:nth-child(4)  { animation-delay: 0.11s; }
.feat-card:nth-child(5)  { animation-delay: 0.14s; }
.feat-card:nth-child(6)  { animation-delay: 0.17s; }
.feat-card:nth-child(7)  { animation-delay: 0.20s; }
.feat-card:nth-child(8)  { animation-delay: 0.23s; }
.feat-card:nth-child(9)  { animation-delay: 0.26s; }
.feat-card:nth-child(10) { animation-delay: 0.29s; }
.feat-card:nth-child(11) { animation-delay: 0.32s; }
.feat-card:nth-child(12) { animation-delay: 0.35s; }
.feat-card:nth-child(13) { animation-delay: 0.38s; }
.feat-card:nth-child(14) { animation-delay: 0.40s; }
.feat-card:nth-child(15) { animation-delay: 0.42s; }
.feat-card:nth-child(16) { animation-delay: 0.44s; }
.feat-card:nth-child(17) { animation-delay: 0.46s; }
.feat-card:nth-child(18) { animation-delay: 0.48s; }
.feat-card:nth-child(19) { animation-delay: 0.50s; }
.feat-card:nth-child(20) { animation-delay: 0.52s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.feat-card:hover {
  transform: translateY(-5px);
  box-shadow:
    0 8px 20px rgba(0,0,0,0.09),
    0 24px 48px rgba(0,0,0,0.07),
    inset 0 3px 0 0 var(--accent);  /* accent bar — clipped cleanly by border-radius */
}

.feat-card--wide { grid-column: span 2; }

/* ── Icon ── */
.feat-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s4);
  flex-shrink: 0;
}

.feat-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Image placeholder ── */
.feat-img {
  aspect-ratio: 16 / 8;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  border: 1.5px dashed var(--border-hi);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  margin-bottom: var(--s5);
  color: var(--text-dim);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
  flex-shrink: 0;
}

.feat-img svg {
  width: 26px;
  height: 26px;
  stroke: var(--text-dim);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}

/* ── Card text ── */
.feat-card h3 {
  font-size: var(--t-base);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: var(--s2);
  color: var(--text);
}

.feat-card p {
  font-size: var(--t-sm);
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

/* ── "Learn more →" — slides in on hover ── */
.feat-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--accent);
  margin-top: var(--s4);
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    gap 0.18s ease;
}

.feat-card:hover .feat-more {
  opacity: 1;
  transform: translateX(0);
}

.feat-more svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── No results ── */
.feat-no-results {
  display: none;
  text-align: center;
  color: var(--text-dim);
  font-size: var(--t-lg);
  padding: var(--s20) 0 var(--s12);
}

.feat-no-results strong { color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 1060px) {
  .feat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 740px) {
  .feat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s4);
  }
  .feat-card--wide { grid-column: span 2; }
}

@media (max-width: 480px) {
  .feat-grid { grid-template-columns: 1fr; }
  .feat-card--wide { grid-column: span 1; }
  /* Always show the link on touch devices */
  .feat-more { opacity: 1; transform: none; }
}
