/* ==========================================================================
   STEMSPACE — DESIGN SYSTEM & CORE STYLESHEET
   Brand: StemSpace | Tagline: "Imagine. Build. Code. Create."
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Poppins:wght@600;700;800&display=swap');

:root {
  /* Brand Color Palette — Harmonized with StemSpace Logo */
  --stem-navy: #133863;
  --stem-space-dark: #0B203B;
  --stem-space-blue: #153E6D;
  --stem-blue-primary: #006EDB;
  --stem-blue-electric: #0189F7;
  --stem-blue-bright: #38A4FC;
  --stem-blue-light: #F0F7FF;
  --stem-green: #67B933;
  --stem-green-dark: #539E25;
  --stem-green-light: #F2FBEB;
  --stem-orange: #FF9823;
  --stem-orange-dark: #E57E0E;
  --stem-orange-light: #FFF7ED;
  --stem-pink: #EC558C;
  --stem-pink-dark: #D63D74;
  --stem-pink-light: #FDF2F7;
  --stem-cyan: #00B2FC;
  --stem-cyan-bright: #38CFFF;
  --stem-cyan-light: #F0FAFF;
  --stem-purple: #EC558C;
  --stem-purple-light: #FDF2F7;
  --stem-purple-glow: rgba(236, 85, 140, 0.35);
  --stem-amber: #FF9823;
  --stem-amber-bright: #FFA842;
  --stem-amber-light: #FFF7ED;
  --stem-coral: #FF6B4A;

  /* Neutrals & Surfaces */
  --stem-white: #FFFFFF;
  --stem-bg-soft: #F8FAFC;
  --stem-bg-alt: #F1F5F9;
  --stem-border: #E2E8F0;
  --stem-border-dark: rgba(255, 255, 255, 0.12);
  --stem-text-dark: #0F172A;
  --stem-text-muted: #64748B;
  --stem-text-light: #94A3B8;

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-accent: 'Poppins', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 36px -6px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 24px 50px -10px rgba(15, 23, 42, 0.16);
  --shadow-glow-blue: 0 0 35px rgba(1, 137, 247, 0.35);
  --shadow-glow-green: 0 0 35px rgba(103, 185, 51, 0.35);
  --shadow-glow-orange: 0 0 35px rgba(255, 152, 35, 0.35);
  --shadow-glow-pink: 0 0 35px rgba(236, 85, 140, 0.35);
  --shadow-glow-cyan: 0 0 35px rgba(0, 178, 252, 0.3);

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 0.18s ease;
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--stem-text-dark);
  background-color: var(--stem-white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip; /* clip prevents horizontal overflow without breaking position: sticky */
}

/* Headings & Typographic Hierarchy */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--stem-navy);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1, .h1 { font-size: clamp(2.2rem, 4.5vw, 3.8rem); font-weight: 800; }
h2, .h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 800; }
h3, .h3 { font-size: clamp(1.3rem, 2.2vw, 1.8rem); font-weight: 700; }
h4, .h4 { font-size: 1.35rem; font-weight: 700; }
h5, .h5 { font-size: 1.15rem; font-weight: 600; }
h6, .h6 { font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

p {
  margin-bottom: 1.1rem;
  color: var(--stem-text-muted);
  font-size: 1rem;
}

.lead {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  font-weight: 400;
  line-height: 1.65;
  color: #475569;
}

a {
  color: var(--stem-blue-electric);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--stem-blue-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Gradient Text Utilities */
.text-gradient-stem {
  background: linear-gradient(135deg, #0189F7 0%, #67B933 35%, #FF9823 70%, #EC558C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gradient-blue {
  background: linear-gradient(135deg, #0189F7 0%, #006EDB 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-green {
  background: linear-gradient(135deg, #67B933 0%, #539E25 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-orange {
  background: linear-gradient(135deg, #FF9823 0%, #E57E0E 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-pink {
  background: linear-gradient(135deg, #EC558C 0%, #D63D74 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple {
  background: linear-gradient(135deg, #0189F7 0%, #EC558C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-cyan {
  background: linear-gradient(135deg, #00B2FC 0%, #0189F7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-warm {
  background: linear-gradient(135deg, #FF9823 0%, #EC558C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Background Gradients */
.bg-stem-dark {
  background: linear-gradient(165deg, #071526 0%, #0B203B 50%, #133863 100%);
  color: #F8FAFC;
}

.bg-stem-light-gradient {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 60%, #F0F7FF 100%);
}

.bg-stem-soft {
  background-color: var(--stem-bg-soft);
}

.bg-stem-alt {
  background-color: var(--stem-bg-alt);
}

/* Badges & Pills */
.stem-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stem-badge-primary { background: #E0F0FE; color: #006EDB; }
.stem-badge-green, .stem-badge-success { background: #F0FDF4; color: #539E25; }
.stem-badge-orange, .stem-badge-warning { background: #FFF7ED; color: #C26300; }
.stem-badge-pink,
.stem-badge-purple  { background: #FDF2F7; color: #D63D74; }
.stem-badge-cyan    { background: #F0FAFF; color: #0084BD; }
.stem-badge-danger  { background: #FEE2E2; color: #991B1B; }
.stem-badge-dark    { background: #133863; color: #F8FAFC; }

.stem-badge-glow {
  box-shadow: 0 0 15px rgba(1, 137, 247, 0.4);
}

/* Buttons */
.btn-stem {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-normal);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn-stem-primary {
  background: linear-gradient(135deg, #0189F7 0%, #006EDB 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 20px -3px rgba(1, 137, 247, 0.4);
}

.btn-stem-primary:hover {
  background: linear-gradient(135deg, #007CE4 0%, #005DB8 100%);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -3px rgba(1, 137, 247, 0.55);
}

.btn-stem-secondary {
  background-color: var(--stem-white);
  color: var(--stem-navy);
  border-color: var(--stem-border);
  box-shadow: var(--shadow-sm);
}

.btn-stem-secondary:hover {
  border-color: var(--stem-blue-electric);
  color: var(--stem-blue-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-stem-outline-light {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
}

.btn-stem-outline-light:hover {
  background: #FFFFFF;
  color: var(--stem-navy);
  transform: translateY(-2px);
  border-color: #FFFFFF;
}

.btn-stem-cyan {
  background: linear-gradient(135deg, #00B2FC 0%, #0189F7 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 20px -3px rgba(1, 137, 247, 0.4);
}

.btn-stem-cyan:hover {
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -3px rgba(1, 137, 247, 0.55);
}

.btn-stem-orange,
.btn-stem-amber {
  background: linear-gradient(135deg, #FF9823 0%, #E57E0E 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 20px -3px rgba(255, 152, 35, 0.4);
}

.btn-stem-orange:hover,
.btn-stem-amber:hover {
  background: linear-gradient(135deg, #E57E0E 0%, #CC6A00 100%);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -3px rgba(255, 152, 35, 0.55);
}

.btn-stem-green {
  background: linear-gradient(135deg, #67B933 0%, #539E25 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 20px -3px rgba(103, 185, 51, 0.4);
}

.btn-stem-green:hover {
  background: linear-gradient(135deg, #539E25 0%, #42821B 100%);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -3px rgba(103, 185, 51, 0.55);
}

.btn-stem-pink {
  background: linear-gradient(135deg, #EC558C 0%, #D63D74 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 20px -3px rgba(236, 85, 140, 0.4);
}

.btn-stem-pink:hover {
  background: linear-gradient(135deg, #D63D74 0%, #B82A5C 100%);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -3px rgba(236, 85, 140, 0.55);
}

.btn-stem-sm {
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
}

.btn-stem-lg {
  padding: 0.95rem 2.2rem;
  font-size: 1.05rem;
}

/* Section Header Typography */
.section-header {
  margin-bottom: 3.5rem;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-accent);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stem-blue-electric);
  margin-bottom: 0.75rem;
}

.section-header.text-center .section-eyebrow {
  justify-content: center;
}

.section-title {
  margin-bottom: 1rem;
}

.section-subtitle {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.1rem;
  color: var(--stem-text-muted);
}

/* Card Foundations */
.stem-card {
  background: var(--stem-white);
  border: 1px solid var(--stem-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stem-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(37, 99, 235, 0.3);
}

.stem-card-dark {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
  backdrop-filter: blur(12px);
}

.stem-card-dark:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: var(--shadow-glow-blue);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Accessibility: Focus rings */
:focus-visible {
  outline: 2px solid var(--stem-blue-electric);
  outline-offset: 3px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
