/* ============================================================
   AI hub page (/ai/).
   Template: src/ai/index.njk. Data: src/_data/ai_hub.yml.

   Uses the shared dark-topo hero treatment (.hero-topo from
   components/hero-topo.css) and the standard .section /
   .section-header / .section-tinted / .cta-section primitives.
   Only the hub-specific wrappers (hero shell, guide grid, in-
   practice grid) live here.

   Card patterns are AI-hub specific for now. If a third hub uses
   the same shapes, lift to a shared component CSS — both grids
   below are intentionally portable (no AI-only styling beyond
   class names).
   ============================================================ */

/* === HERO ===
   Same gradient stack as .case-page-hero / .about-hero /
   .process-hero. Photographic dark-blue topo via .hero-topo
   (shared component). Pull the hero under the transparent
   over-hero nav via the -nav-h margin. */

.ai-hero {
  background:
    radial-gradient(ellipse 700px 450px at 88% 10%, rgba(220, 115, 76, 0.10), transparent 65%),
    radial-gradient(ellipse 600px 420px at 5% 95%, rgba(22, 93, 148, 0.12), transparent 65%),
    linear-gradient(180deg, #100f0e 0%, #15130f 50%, #121110 100%);
  position: relative;
  overflow: hidden;
  color: var(--text-light);
  margin-top: calc(var(--nav-h) * -1);
  padding-top: var(--nav-h);
}

.ai-hero-inner {
  position: relative;
  padding: 96px 0 88px;
  z-index: 2;
}

.ai-hero-content {
  max-width: 820px;
  position: relative;
  z-index: 3;
}

.ai-hero .eyebrow {
  color: var(--orange-bright);
  margin-bottom: 22px;
  display: block;
}

.ai-hero h1 {
  font-size: 56px;
  line-height: 1.05;
  color: var(--text-light);
  margin-bottom: 24px;
}

.ai-hero-sub {
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-light-2);
  max-width: 680px;
  margin-bottom: 32px;
}

.ai-hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* The intro h2 already lives in the standard .section-header; the
   extra hook below just constrains the lede width so the intro
   doesn't span the full container. */
.ai-intro-header { max-width: 820px; }

/* === GUIDES rail === */

.ai-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ai-guide-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-light);
  border: 1px solid var(--border-on-light);
  border-radius: var(--radius-card-lg);
  padding: 28px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease;
}
.ai-guide-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.15);
}

/* Alternate orange/blue accent on the title for rhythm (per
   /docs/02-design-system.md: odd orange, even blue in multi-item
   layouts). Only on the first letter rule below; the rest is
   neutral text. */
.ai-guide-card:nth-child(odd)  { border-top: 2px solid var(--orange); }
.ai-guide-card:nth-child(even) { border-top: 2px solid var(--blue); }

.ai-guide-title {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: var(--tracking-h3);
  color: var(--text-dark);
  margin: 0 0 12px;
}

.ai-guide-summary {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-dark-2);
  margin: 0 0 18px;
}

.ai-guide-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--orange);
  letter-spacing: 0.01em;
}
.ai-guide-card:hover .ai-guide-cta .arrow { transform: translateX(3px); }
.ai-guide-cta .arrow { transition: transform 0.3s var(--ease-out); }

.ai-guide-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 10.5px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(22, 93, 148, 0.10);
  border: 1px solid rgba(22, 93, 148, 0.22);
  border-radius: 999px;
  padding: 4px 10px;
}

/* === IN PRACTICE rail === */

.ai-practice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ai-practice-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-light-2);
  border: 1px solid var(--border-on-light);
  border-radius: var(--radius-card-lg);
  padding: 28px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease;
}
.ai-practice-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.15);
}

.ai-practice-industry {
  display: inline-block;
  font-size: 11px;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 14px;
  font-weight: var(--weight-medium);
}
.ai-practice-card:nth-child(even) .ai-practice-industry { color: var(--blue); }

.ai-practice-title {
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: var(--tracking-h3);
  color: var(--text-dark);
  margin: 0 0 12px;
}

.ai-practice-summary {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dark-2);
  margin: 0 0 20px;
  /* Cap at four lines so cards stay roughly the same height; the
     full narrative lives on the linked /case-studies/{slug}/ page. */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-practice-stat {
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}
.ai-practice-stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-stat);
  line-height: 1;
  color: var(--orange);
  margin-bottom: 4px;
}
.ai-practice-card:nth-child(even) .ai-practice-stat-value { color: var(--blue); }
.ai-practice-stat-label {
  font-size: 11px;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-dark-3);
  font-weight: var(--weight-medium);
}

.ai-practice-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--orange);
}
.ai-practice-card:hover .ai-practice-cta .arrow { transform: translateX(3px); }
.ai-practice-cta .arrow { transition: transform 0.3s var(--ease-out); }

/* === Responsive === */

@media (max-width: 980px) {
  .ai-guide-grid,
  .ai-practice-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .ai-hero-inner { padding: 72px 0 64px; }
  .ai-hero h1 { font-size: 40px; }
  .ai-hero-sub { font-size: 16px; }
}

@media (max-width: 640px) {
  .ai-guide-grid,
  .ai-practice-grid { grid-template-columns: 1fr; }
  .ai-guide-card,
  .ai-practice-card { padding: 24px 22px; }
}
