/* ===== Custom styles on top of Tailwind ===== */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --primary: #0ea5e9;       /* sky-500 */
  --primary-dark: #0284c7;  /* sky-600 */
  --accent: #f97316;        /* orange-500 */
  --accent-dark: #ea580c;   /* orange-600 */
  --dark: #0f172a;          /* slate-900 */
  --text: #334155;          /* slate-700 */
  --muted: #64748b;         /* slate-500 */
  --light: #f8fafc;         /* slate-50 */
  --border: #e2e8f0;        /* slate-200 */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  overflow-x: hidden;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ===== Gradient text ===== */
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Gradient backgrounds ===== */
.gradient-bg {
  background: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 50%, #f97316 100%);
}

.gradient-bg-subtle {
  background: linear-gradient(135deg, #f0f9ff 0%, #fef3c7 50%, #fff7ed 100%);
}

/* ===== Animated gradient border ===== */
.gradient-border {
  position: relative;
  background: white;
  border-radius: 1rem;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  z-index: -1;
}

/* ===== Card hover effects ===== */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ===== Metric card pulse ===== */
.metric-card {
  transition: all 0.3s ease;
}
.metric-card:hover {
  transform: scale(1.05);
}
.metric-card:hover .metric-number {
  color: var(--accent);
}

/* ===== Tag styles ===== */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag-product { background: #dbeafe; color: #1d4ed8; }
.tag-ml { background: #f3e8ff; color: #7c3aed; }
.tag-cost { background: #dcfce7; color: #16a34a; }
.tag-engineering { background: #fef3c7; color: #d97706; }
.tag-experimentation { background: #ffe4e6; color: #e11d48; }

/* ===== Scroll animations ===== */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 0.8s ease-out;
}
.fade-in.visible {
  opacity: 1;
}

/* Respect reduced motion preferences (FINDING-006) */
@media (prefers-reduced-motion: reduce) {
  .fade-up, .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .card-hover:hover {
    transform: none;
  }
  .metric-card:hover {
    transform: none;
  }
}

/* ===== Section divider ===== */
.section-divider {
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

/* ===== Case study page styles ===== */
.case-study-header {
  background: linear-gradient(135deg, #FFF9E6 0%, #FFF3CC 30%, #FFEDB3 60%, #FFF9E6 100%);
}

.step-connector {
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

/* ===== Navigation ===== */
.nav-scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-link {
  position: relative;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ===== Mobile menu ===== */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.mobile-menu.open {
  transform: translateX(0);
}

/* ===== Before/After metric ===== */
.metric-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.metric-arrow .before {
  text-decoration: line-through;
  opacity: 0.5;
}
.metric-arrow .arrow {
  color: var(--accent);
  font-weight: 700;
}
.metric-arrow .after {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.25em;
}

/* ===== Timeline ===== */
.timeline-item {
  position: relative;
  padding-left: 2rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.timeline-item::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1.5rem;
  width: 2px;
  height: calc(100% - 0.5rem);
  background: var(--border);
}
.timeline-item:last-child::after {
  display: none;
}

/* ===== Blog card ===== */
.blog-card {
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}
.blog-card:hover {
  border-left-color: var(--primary);
  background: #f8fafc;
}

/* ===== Button styles ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.35);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.35);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}
