/* ============================================
   DESIGN PATTERNS (Week 3, Day 3-4)
   Pattern 1: Minimalist Excellence
   Pattern 2: Interactive Storytelling
   ============================================ */

/* ============================================
   PATTERN 1: MINIMALIST EXCELLENCE
   ============================================ */

/* Enhanced Typography System */
:root {
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
  
  /* Typography Scale (Modular Scale 1.25) */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */
  
  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;
  
  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;
  
  /* Color Psychology */
  --color-primary: #00559f;       /* Trust, Professionalism */
  --color-secondary: #0a5cff;     /* Innovation, Energy */
  --color-accent: #05c3ff;        /* Freshness, Clarity */
  --color-success: #27ae60;       /* Achievement, Growth */
  --color-warning: #f39c12;       /* Attention, Urgency */
  --color-danger: #e74c3c;        /* Critical, Alert */
  
  /* Neutral Scale (High Contrast) */
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;
  
  /* Spacing System (8px base) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Enhanced Typography Classes */
.text-display {
  font-size: var(--text-6xl);
  line-height: var(--leading-none);
  letter-spacing: var(--tracking-tighter);
  font-weight: 800;
  color: var(--color-gray-900);
}

.text-heading-1 {
  font-size: var(--text-5xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 700;
  color: var(--color-gray-900);
}

.text-heading-2 {
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 700;
  color: var(--color-gray-800);
}

.text-heading-3 {
  font-size: var(--text-3xl);
  line-height: var(--leading-snug);
  font-weight: 600;
  color: var(--color-gray-800);
}

.text-body-lg {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-gray-700);
}

.text-body {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-gray-600);
}

.text-body-sm {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-gray-500);
}

.text-caption {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-gray-500);
}

/* Visual Hierarchy Enhancements */
.section-eyebrow {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  padding: var(--space-1) var(--space-3);
  background: rgba(0, 85, 159, 0.08);
  border-radius: 999px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-gray-500);
  margin-bottom: var(--space-4);
}

.section-label::before {
  content: '';
  width: 32px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 2px;
}

/* White Space Optimization */
.section-spacing-tight {
  padding: var(--space-12) 0;
}

.section-spacing-normal {
  padding: var(--space-16) 0;
}

.section-spacing-relaxed {
  padding: var(--space-20) 0;
}

.section-spacing-loose {
  padding: var(--space-24) 0;
}

/* Content Max-Width for Readability */
.content-prose {
  max-width: 65ch; /* Optimal reading line length */
  margin-left: auto;
  margin-right: auto;
}

.content-prose p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

/* ============================================
   PATTERN 2: INTERACTIVE STORYTELLING
   ============================================ */

/* Story Progress Indicator */
.story-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-gray-100);
  z-index: 9999;
  pointer-events: none;
}

.story-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 12px rgba(0, 85, 159, 0.5);
}

/* Journey Breadcrumbs */
.journey-breadcrumbs {
  position: fixed;
  top: 80px;
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: 100;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.journey-breadcrumbs.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.journey-crumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-gray-400);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.journey-crumb::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gray-300);
  transition: all 0.2s ease;
}

.journey-crumb.is-active {
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.journey-crumb.is-active::before {
  background: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(0, 85, 159, 0.2);
}

.journey-crumb:hover {
  color: var(--color-primary);
  transform: translateX(-4px);
}

/* Scroll-Triggered Story Sections */
.story-section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.story-section.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Reveal for Story Elements */
.story-element {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.story-element:nth-child(1) { transition-delay: 0.1s; }
.story-element:nth-child(2) { transition-delay: 0.2s; }
.story-element:nth-child(3) { transition-delay: 0.3s; }
.story-element:nth-child(4) { transition-delay: 0.4s; }
.story-element:nth-child(5) { transition-delay: 0.5s; }

.story-section.in-view .story-element {
  opacity: 1;
  transform: translateY(0);
}

/* Section Transitions with Context Hints */
.section-transition {
  position: relative;
  margin: var(--space-16) 0;
}

.section-transition::before {
  content: attr(data-next-section);
  display: block;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  color: var(--color-gray-400);
  margin-bottom: var(--space-4);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.section-transition.in-view::before {
  opacity: 1;
  transform: translateY(0);
}

.section-transition::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  margin: 0 auto;
  opacity: 0.3;
}

/* Micro-Copy Storytelling */
.story-micro-copy {
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-gray-500);
  margin-top: var(--space-2);
  padding-left: var(--space-4);
  border-left: 2px solid var(--color-gray-200);
}

/* Visual Storytelling Cards */
.story-card {
  background: var(--color-gray-50);
  border-radius: 16px;
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  border: 1px solid var(--color-gray-200);
  transition: all 0.3s ease;
}

.story-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-gray-300);
}

.story-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.story-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 12px;
  font-size: var(--text-2xl);
  color: #ffffff;
  flex-shrink: 0;
}

.story-card-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-gray-900);
  line-height: var(--leading-tight);
}

.story-card-body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-gray-600);
}

/* Progressive Narrative Flow */
.narrative-flow {
  position: relative;
  padding-left: var(--space-8);
}

.narrative-flow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-accent) 100%);
  opacity: 0.2;
}

.narrative-step {
  position: relative;
  margin-bottom: var(--space-10);
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.narrative-flow.in-view .narrative-step {
  opacity: 1;
  transform: translateX(0);
}

.narrative-step::before {
  content: attr(data-step);
  position: absolute;
  left: calc(-1 * var(--space-8) - 6px);
  top: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  z-index: 2;
}

/* Smooth Section Transitions */
.section-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  :root {
    --text-6xl: 2.5rem;
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
  }
  
  .journey-breadcrumbs {
    display: none; /* Hide on mobile for cleaner UX */
  }
  
  .narrative-flow {
    padding-left: var(--space-6);
  }
  
  .section-spacing-loose,
  .section-spacing-relaxed {
    padding: var(--space-12) 0;
  }
}

@media (max-width: 480px) {
  .story-card {
    padding: var(--space-4);
  }
  
  .story-card-icon {
    width: 40px;
    height: 40px;
    font-size: var(--text-xl);
  }
}







