/* ============================================================
   FATAPLUS DESIGN SYSTEM — COMPONENTS (Molecules)
   Buttons, badges, tags, inputs, cards, glass
   Anti-slop: no hover boop, no fill+outline pair, no pill chips everywhere
   ============================================================ */

/* ============================================================
   BUTTONS
   MDN: <button> semantic, transition Baseline
   Anti-slop: NO translateY boop, NO glow. Color shift only.
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-family-body);
  font-size: var(--font-ui);
  font-weight: var(--weight-medium);
  line-height: var(--font-ui-lh);
  border-radius: var(--radius-md);
  transition: background-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard);
  white-space: nowrap;
  cursor: pointer;
}

/* Primary — solid brand fill */
.btn-primary {
  background: var(--brand);
  color: var(--white);
  border: 1px solid var(--brand);
}

.btn-primary:hover {
  background: var(--brand-secondary);
  border-color: var(--brand-secondary);
}

/* Secondary — transparent, subtle border. NOT the slop ghost-outline pair */
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--border-hover);
}

/* Text button — for tertiary actions */
.btn-text {
  background: transparent;
  color: var(--brand-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.btn-text:hover {
  color: var(--brand);
  background: var(--brand-lighter);
}

/* Icon inside button — slides slightly, button doesn't move */
.btn .btn-icon {
  transition: transform var(--duration-fast) var(--ease-standard);
}

.btn:hover .btn-icon {
  transform: translateX(2px);
}

/* ============================================================
   BADGES & TAGS
   Anti-slop: NOT pill chips everywhere. Typographic, not container
   ============================================================ */

.tag {
  display: inline-block;
  font-size: var(--font-caption);
  font-weight: var(--weight-semibold);
  color: var(--brand-secondary);
  text-transform: none;
  letter-spacing: 0;
}

.tag-coral { color: var(--accent-coral); }
.tag-purple { color: var(--accent-purple-bright); }
.tag-blue { color: var(--accent-blue-bright); }

/* Eyebrow label — used sparingly, not on every section */
.eyebrow {
  font-size: var(--font-caption);
  font-weight: var(--weight-semibold);
  color: var(--brand-secondary);
  margin-bottom: var(--space-4);
  display: block;
}

/* ============================================================
   INPUTS
   ============================================================ */

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-family-body);
  font-size: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-standard);
}

.input:focus {
  outline: none;
  border-color: var(--brand-secondary);
}

.input::placeholder {
  color: var(--text-tertiary);
}

/* ============================================================
   CARDS
   Anti-slop: NO hover-lift, NO translateY. Tonal shift only.
   ============================================================ */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: background-color var(--duration-normal) var(--ease-standard);
}

.card:hover {
  background: var(--bg-surface);
}

/* Stat card — large number + label */
.card-stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-12);
  min-height: 200px;
}

.card-stat .stat-number {
  font-family: var(--font-family-display);
  font-size: var(--font-stat);
  font-weight: var(--weight-bold);
  line-height: var(--font-stat-lh);
  letter-spacing: var(--font-stat-ls);
  color: var(--text-primary);
}

.card-stat .stat-label {
  font-size: var(--font-h4);
  font-weight: var(--weight-normal);
}

.card-stat .stat-desc {
  font-size: var(--font-body);
  color: var(--text-secondary);
}

/* ============================================================
   GLASSMORPHISM
   MDN: backdrop-filter Baseline 2024 (Chrome 76+, FF 103+, Safari 18+)
   -webkit prefix for Safari 9-17
   Anti-slop: only over rich backdrop, never on flat fill
   ============================================================ */

.glass {
  background: rgba(8, 88, 63, 0.12);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-xl);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    var(--shadow-medium);
}

.glass-nav {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-small);
}

/* ============================================================
   DIVIDER
   Anti-slop: no unrounded hairline rules
   ============================================================ */

.divider {
  height: 1px;
  background: var(--border-default);
  border: none;
  border-radius: var(--radius-full);
  margin: var(--space-8) 0;
}

/* ============================================================
   CONTAINER
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* ============================================================
   SECTION
   ============================================================ */

.section {
  padding-block: var(--section-padding-y);
}

.section-dark {
  background: var(--brand-dark);
  color: var(--white);
}

.section-tinted {
  background: var(--brand-lighter);
}

/* ============================================================
   GRID SYSTEM
   MDN: CSS Grid Baseline widely available
   ============================================================ */

.grid {
  display: grid;
  gap: var(--space-8);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Responsive: stack to 1 column on narrow viewports */
@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* 2-col → 1-col at tablet */
@media (max-width: 1024px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   FLEX UTILITIES
   ============================================================ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-8 { gap: var(--space-8); }

/* ============================================================
   MARQUEE — for logos/testimonials
   Anti-slop: authored motion, not decoration
   ============================================================ */

.marquee {
  overflow: hidden;
  white-space: nowrap;
}

.marquee-track {
  display: inline-flex;
  gap: var(--space-12);
  animation: marquee-scroll 40s linear infinite;
  padding-block: var(--space-4);
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

/* ============================================================
   SCROLL-DRIVEN ANIMATIONS
   MDN: animation-timeline: view() Baseline 2024
   Anti-slop: content visible by default, scroll adds parallax only
   ============================================================ */

@supports (animation-timeline: view()) {
  .scroll-reveal {
    animation: reveal-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }

  @keyframes reveal-up {
    from {
      transform: translateY(30px);
    }
    to {
      transform: translateY(0);
    }
  }

  /* Parallax background */
  .scroll-parallax {
    animation: parallax-bg linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }

  @keyframes parallax-bg {
    from { transform: translateY(-10%); }
    to { transform: translateY(10%); }
  }
}

/* Fallback: if animation-timeline unsupported, content is static + visible */
@supports not (animation-timeline: view()) {
  .scroll-reveal {
    transform: none;
  }
}
