/* ============================================
   FlowPilot — Use Cases Page Styles
   Page hero, filter chips, case cards, flow diagrams.
   ============================================ */

/* ═══════════════════════════════════════════
   PAGE HERO
   ═══════════════════════════════════════════ */

.page-hero {
  position: relative;
  padding: 64px 0 48px;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse, var(--brand-glow-soft), transparent 60%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.page-hero .section-container {
  position: relative;
  z-index: 1;
  text-align: center;
}

.page-hero .eyebrow {
  margin-bottom: 16px;
}

.page-hero__title {
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-0);
  margin-bottom: 20px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.page-hero__subhead {
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.6;
  color: var(--text-1);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 1024px) {
  .page-hero {
    padding: 96px 0 64px;
  }
}

/* ═══════════════════════════════════════════
   FILTER CHIPS
   ═══════════════════════════════════════════ */

.filter-section {
  padding: 24px 0 32px;
  position: sticky;
  top: var(--nav-height-mobile);
  z-index: 10;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .filter-section {
    top: var(--nav-height);
    padding: 32px 0;
  }
}

.filter-section .section-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .filter-section .section-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text-0);
}

.chip--active {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
  box-shadow: 0 0 20px var(--brand-glow-soft);
}

.chip--active:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}

.filter-count {
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.filter-count #result-count {
  color: var(--text-0);
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   CASE CARDS GRID
   ═══════════════════════════════════════════ */

.cases-section {
  padding: 48px 0 64px;
}

@media (min-width: 1024px) {
  .cases-section {
    padding: 64px 0 120px;
  }
}

.cases-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .cases-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  /* Switch to flex on desktop so filtered cards align left naturally
     (instead of grid-column hardcoded positions which would leave gaps). */
  .cases-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
  }

  .case-card {
    flex: 0 0 calc((100% - 48px) / 3);
  }
}

/* ─── Card ─── */
.case-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  transition: all var(--duration-base) var(--ease-out);
  color: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.case-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-border);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
}

.case-card:hover {
  border-color: var(--border-lit);
  transform: translateY(-3px);
  box-shadow: 0 24px 48px -24px var(--brand-glow-soft);
}

.case-card:hover::before {
  opacity: 1;
}

@media (min-width: 1024px) {
  .case-card {
    padding: 28px;
  }
}

/* ─── Card header ─── */
.case-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
}

.case-card__category {
  display: inline-block;
  padding: 4px 10px;
  background: var(--brand-glow-soft);
  border: 1px solid var(--border-lit);
  border-radius: 999px;
  color: var(--brand-300);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.case-card__schedule {
  color: var(--text-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ─── Card title ─── */
.case-card__title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-0);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

/* ─── Flow diagram ─── */
.case-card__flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.flow-node__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-1);
  transition: all var(--duration-base) var(--ease-out);
}

.flow-node__icon svg {
  width: 16px;
  height: 16px;
}

.flow-node--featured .flow-node__icon {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
  box-shadow: 0 0 16px var(--brand-glow-soft);
}

.flow-node__label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}

.flow-node--featured .flow-node__label {
  color: var(--brand-300);
}

.flow-arrow {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-strong), var(--brand-500), var(--border-strong));
  opacity: 0.6;
  margin-bottom: 16px;
  min-width: 12px;
}

/* ─── Card body ─── */
.case-card__body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-1);
  margin-bottom: 20px;
  flex: 1;
}

.case-card__body code {
  padding: 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--brand-300);
}

/* ─── Card CTA ─── */
.case-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-300);
  transition: all var(--duration-base) var(--ease-out);
  margin-top: auto;
}

.case-card:hover .case-card__cta {
  color: var(--brand-300);
  gap: 10px;
}

/* ═══════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════ */

.cases-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-2);
  font-size: 16px;
}

.cases-empty[hidden] {
  display: none;
}

/* ═══════════════════════════════════════════
   FILTER TRANSITIONS
   ═══════════════════════════════════════════ */

.case-card {
  opacity: 1;
  transform: scale(1);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out),
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.case-card[hidden] {
  display: none;
}

.case-card.is-fading {
  opacity: 0;
  transform: scale(0.96);
}
