/* =============================================================================
   EVANGELICAL MINISTRY LANDING PAGE - CSS DESIGN SYSTEM
   A comprehensive mobile-first responsive design system with CSS Grid layouts,
   custom properties, and ministry-appropriate visual styling.
   Optimized for performance with efficient selectors and minimal specificity.
   ============================================================================= */

/* =============================================================================
   CSS RESET / NORMALIZE
   ============================================================================= */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* =============================================================================
   CUSTOM PROPERTIES - DESIGN TOKENS
   ============================================================================= */

:root {
  /* Color System - Ministry-appropriate welcoming palette */
  --color-primary-50: hsl(217, 71%, 97%);
  --color-primary-100: hsl(217, 71%, 92%);
  --color-primary-200: hsl(217, 71%, 82%);
  --color-primary-300: hsl(217, 71%, 72%);
  --color-primary-400: hsl(217, 71%, 62%);
  --color-primary-500: hsl(217, 71%, 53%);
  --color-primary-600: hsl(217, 71%, 43%);
  --color-primary-700: hsl(217, 71%, 33%);
  --color-primary-800: hsl(217, 71%, 23%);
  --color-primary-900: hsl(217, 71%, 13%);

  /* Accent colors - Warm, welcoming tones */
  --color-accent-50: hsl(45, 80%, 95%);
  --color-accent-100: hsl(45, 80%, 87%);
  --color-accent-200: hsl(45, 80%, 77%);
  --color-accent-300: hsl(45, 80%, 67%);
  --color-accent-400: hsl(45, 80%, 57%);
  --color-accent-500: hsl(45, 80%, 47%);
  --color-accent-600: hsl(45, 80%, 37%);
  --color-accent-700: hsl(45, 80%, 27%);

  /* Neutral colors */
  --color-neutral-50: hsl(0, 0%, 98%);
  --color-neutral-100: hsl(0, 0%, 95%);
  --color-neutral-200: hsl(0, 0%, 90%);
  --color-neutral-300: hsl(0, 0%, 80%);
  --color-neutral-400: hsl(0, 0%, 60%);
  --color-neutral-500: hsl(0, 0%, 40%);
  --color-neutral-600: hsl(0, 0%, 30%);
  --color-neutral-700: hsl(0, 0%, 20%);
  --color-neutral-800: hsl(0, 0%, 15%);
  --color-neutral-900: hsl(0, 0%, 10%);

  /* Semantic colors */
  --color-background: hsl(0, 0%, 100%);
  --color-surface: hsl(0, 0%, 98%);
  --color-text: hsl(0, 0%, 15%);
  --color-text-light: hsl(0, 0%, 40%);
  --color-border: hsl(0, 0%, 90%);

  /* Typography System - Professional with Google Fonts fallback */
  --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
                       'Oxygen', 'Ubuntu', 'Helvetica Neue', Arial, sans-serif;
  --font-family-heading: Georgia, 'Times New Roman', 'Merriweather', serif;
  --font-family-mono: 'Courier New', Courier, monospace;

  /* Fluid Typography with clamp() for responsive scaling */
  --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --font-size-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --font-size-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);
  --font-size-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --font-size-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
  --font-size-3xl: clamp(1.875rem, 1.65rem + 1.125vw, 2.25rem);
  --font-size-4xl: clamp(2.25rem, 1.95rem + 1.5vw, 3rem);

  /* Font weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Line heights */
  --line-height-tight: 1.2;
  --line-height-snug: 1.375;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.75;
  --line-height-loose: 2;

  /* Spacing Scale - Consistent rhythm */
  --space-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
  --space-sm: clamp(0.5rem, 0.45rem + 0.25vw, 0.75rem);
  --space-md: clamp(1rem, 0.9rem + 0.5vw, 1.5rem);
  --space-lg: clamp(1.5rem, 1.35rem + 0.75vw, 2rem);
  --space-xl: clamp(2rem, 1.8rem + 1vw, 3rem);
  --space-2xl: clamp(3rem, 2.7rem + 1.5vw, 4rem);
  --space-3xl: clamp(4rem, 3.6rem + 2vw, 6rem);

  /* Layout constraints */
  --max-width-sm: 640px;
  --max-width-md: 768px;
  --max-width-lg: 1024px;
  --max-width-xl: 1280px;
  --max-width-2xl: 1536px;
  --max-width-content: 65ch;

  /* Border radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows for depth */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Z-index layers */
  --z-index-dropdown: 1000;
  --z-index-sticky: 1020;
  --z-index-fixed: 1030;
  --z-index-modal-backdrop: 1040;
  --z-index-modal: 1050;
  --z-index-popover: 1060;
  --z-index-tooltip: 1070;
}

/* =============================================================================
   BASE TYPOGRAPHY STYLES
   ============================================================================= */

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-primary-600);
  margin-bottom: var(--space-md);
}

h1 {
  font-size: var(--font-size-4xl);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--color-primary-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-700);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

strong,
b {
  font-weight: var(--font-weight-bold);
}

em,
i {
  font-style: italic;
}

/* =============================================================================
   LAYOUT UTILITIES - CSS GRID & FLEXBOX
   ============================================================================= */

.container {
  width: 100%;
  max-width: var(--max-width-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.container-sm {
  max-width: var(--max-width-sm);
}

.container-md {
  max-width: var(--max-width-md);
}

.container-lg {
  max-width: var(--max-width-lg);
}

/* CSS Grid Layouts */
.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Auto-fit responsive grid */
.grid-auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
}

.grid-auto-fill {
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
}

/* Flexbox utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.gap-xs {
  gap: var(--space-xs);
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.gap-xl {
  gap: var(--space-xl);
}

/* =============================================================================
   HEADER & NAVIGATION STYLES
   ============================================================================= */

header {
  background-color: var(--color-primary-600);
  color: white;
  padding: var(--space-md) 0;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: var(--z-index-sticky);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

header h1 {
  color: white;
  margin-bottom: 0;
  font-size: var(--font-size-2xl);
}

header p {
  margin-bottom: 0;
  font-size: var(--font-size-sm);
  opacity: 0.95;
}

nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

nav a:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary-600);
  color: white;
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  z-index: var(--z-index-tooltip);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: var(--space-sm);
  outline: 2px solid white;
  outline-offset: 2px;
}

/* =============================================================================
   HERO SECTION STYLES
   ============================================================================= */

.hero {
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-800) 100%);
  color: white;
  padding: var(--space-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h2 {
  color: white;
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-lg);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-xl);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.95;
  line-height: var(--line-height-relaxed);
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-xl);
}

/* =============================================================================
   BUTTON STYLES - WITH MORPHING INTERACTIONS
   ============================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn:focus {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent-500);
  color: var(--color-neutral-900);
}

.btn-primary:hover {
  background-color: var(--color-accent-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: white;
  color: var(--color-primary-600);
}

.btn-secondary:hover {
  background-color: var(--color-neutral-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--color-primary-600);
  color: var(--color-primary-600);
}

.btn-outline:hover {
  background-color: var(--color-primary-600);
  color: white;
  transform: translateY(-2px);
}

/* Morphing button effect */
.cta-button {
  display: inline-block;
  padding: var(--space-sm) var(--space-xl);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              background-color var(--transition-base);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cta-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

section {
  padding: var(--space-3xl) 0;
}

section:nth-child(even) {
  background-color: var(--color-surface);
}

.section-title {
  font-size: var(--font-size-3xl);
  color: var(--color-primary-600);
  margin-bottom: var(--space-xl);
  text-align: center;
}

.section-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-light);
  text-align: center;
  max-width: var(--max-width-content);
  margin: 0 auto var(--space-xl);
}

/* =============================================================================
   CARD COMPONENT STYLES
   ============================================================================= */

.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  transition: transform var(--transition-base),
              box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card h3 {
  font-size: var(--font-size-xl);
  color: var(--color-primary-600);
  margin-bottom: var(--space-sm);
}

.card p {
  color: var(--color-text-light);
  margin-bottom: 0;
}

.card-accent {
  border-left: 4px solid var(--color-accent-500);
}

.card-bordered {
  border: 1px solid var(--color-border);
}

/* Card grid layout */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-lg);
}

/* =============================================================================
   ABOUT SECTION & CORE VALUES
   ============================================================================= */

.about-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--space-xl);
  align-items: start;
}

.core-values {
  margin-top: var(--space-2xl);
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-md);
}

.value-card {
  padding: var(--space-lg);
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent-500);
  border-radius: var(--radius-md);
}

.value-card h4 {
  font-size: var(--font-size-lg);
  color: var(--color-primary-600);
  margin-bottom: var(--space-xs);
}

.value-card p {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  margin-bottom: 0;
}

/* =============================================================================
   SOCIAL PROOF SECTION - STATISTICS & TESTIMONIALS
   ============================================================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: var(--space-lg);
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.stat {
  padding: var(--space-md);
}

.stat-number {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent-500);
  margin-bottom: var(--space-xs);
  display: block;
}

.stat-label {
  color: var(--color-text-light);
  font-weight: var(--font-weight-medium);
}

.testimonials {
  margin-top: var(--space-2xl);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--space-lg);
}

.testimonial {
  background: white;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--color-accent-500);
}

.testimonial-text {
  font-style: italic;
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
}

.testimonial-author {
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary-600);
}

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

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--space-xl);
}

.contact-info h3 {
  font-size: var(--font-size-xl);
  color: var(--color-primary-600);
  margin-bottom: var(--space-md);
}

.contact-item {
  margin-bottom: var(--space-lg);
}

.contact-item h4 {
  font-size: var(--font-size-lg);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  font-weight: var(--font-weight-semibold);
}

.contact-item address {
  font-style: normal;
  color: var(--color-text-light);
  line-height: var(--line-height-relaxed);
}

.contact-item a {
  color: var(--color-primary-600);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
}

.contact-item a:hover {
  color: var(--color-primary-700);
  text-decoration: underline;
}

.service-times {
  background: var(--color-surface);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
}

.service-item {
  margin-bottom: var(--space-md);
}

.service-item:last-child {
  margin-bottom: 0;
}

.service-item h4 {
  font-size: var(--font-size-lg);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  font-weight: var(--font-weight-semibold);
}

.service-item p {
  color: var(--color-text-light);
  line-height: var(--line-height-relaxed);
  margin-bottom: 0;
}

.trust-indicators {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  text-align: center;
}

.trust-indicators p {
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

.trust-indicators p:last-child {
  margin-bottom: 0;
  font-size: var(--font-size-sm);
}

.trust-indicators strong {
  color: var(--color-primary-600);
}

/* =============================================================================
   FOOTER STYLES
   ============================================================================= */

footer {
  background-color: var(--color-primary-600);
  color: white;
  padding: var(--space-xl) 0;
  margin-top: var(--space-2xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

footer h3,
footer h4 {
  color: white;
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-md);
}

footer p {
  opacity: 0.95;
  font-size: var(--font-size-sm);
  margin-bottom: 0;
}

footer ul {
  list-style: none;
  line-height: var(--line-height-loose);
  padding: 0;
}

footer a {
  color: white;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity var(--transition-fast);
}

footer a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-social {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: var(--space-md);
  text-align: center;
  margin-top: var(--space-lg);
}

.footer-bottom p {
  opacity: 0.9;
  font-size: var(--font-size-sm);
}

/* =============================================================================
   SCROLL-TRIGGERED REVEAL ANIMATIONS
   ============================================================================= */

.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease-out,
              transform 0.6s ease-out;
}

.reveal.hidden {
  opacity: 0;
  transform: translateY(30px);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================================================
   SKELETON LOADING STATES
   ============================================================================= */

.skeleton {
  background: linear-gradient(90deg,
    var(--color-neutral-100) 25%,
    var(--color-neutral-200) 50%,
    var(--color-neutral-100) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-sm);
}

.skeleton-title {
  height: 2em;
  width: 60%;
  margin-bottom: var(--space-md);
}

.skeleton-image {
  width: 100%;
  padding-top: 56.25%;
  position: relative;
}

/* =============================================================================
   ACCESSIBILITY - FOCUS STATES
   ============================================================================= */

:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* =============================================================================
   SMOOTH TRANSITIONS & HOVER EFFECTS
   ============================================================================= */

.smooth-transition {
  transition: all var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* =============================================================================
   RESPONSIVE DESIGN - MOBILE-FIRST MEDIA QUERIES
   ============================================================================= */

/* Tablet breakpoint - 768px */
@media (min-width: 768px) {
  :root {
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
  }

  .container {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }

  header h1 {
    font-size: var(--font-size-3xl);
  }

  nav ul {
    margin-top: 0;
  }

  .hero {
    padding: var(--space-3xl) 0;
  }

  .hero h2 {
    font-size: var(--font-size-4xl);
  }

  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

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

/* Desktop breakpoint - 1024px */
@media (min-width: 1024px) {
  :root {
    --space-2xl: 5rem;
    --space-3xl: 8rem;
  }

  header .container {
    flex-wrap: nowrap;
  }

  .hero h2 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
  }

  .about-content {
    grid-template-columns: 1fr 1fr;
  }

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

  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }

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

/* =============================================================================
   SCROLL-TRIGGERED ANIMATIONS - FADE-IN EFFECTS
   ============================================================================= */

/* Base state for fade-in animations - elements start visible for accessibility */
.fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Hidden state applied by JavaScript before animations */
.fade-in:not(.visible) {
  opacity: 0;
  transform: translateY(0);
}

.fade-in-up:not(.visible) {
  opacity: 0;
  transform: translateY(30px);
}

/* Visible state triggered by Intersection Observer */
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* =============================================================================
   MOBILE MENU TOGGLE STYLES
   ============================================================================= */

/* Mobile menu button */
[data-menu-toggle] {
  display: none;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: var(--space-sm);
  transition: opacity var(--transition-fast);
}

[data-menu-toggle]:hover {
  opacity: 0.8;
}

[data-menu-toggle]:focus {
  outline: 2px solid var(--color-accent-500);
  outline-offset: 2px;
}

/* Mobile menu container */
[data-mobile-menu] {
  display: flex;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* Body class when menu is open */
body.menu-open {
  overflow: hidden;
}

/* Mobile menu styles (active on small screens) */
@media (max-width: 768px) {
  [data-menu-toggle] {
    display: block;
  }

  [data-mobile-menu] {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80%;
    max-width: 300px;
    background: var(--color-primary-600);
    padding: var(--space-xl);
    transform: translateX(100%);
    opacity: 0;
    z-index: var(--z-index-modal);
    flex-direction: column;
    box-shadow: var(--shadow-xl);
  }

  [data-mobile-menu].active {
    transform: translateX(0);
    opacity: 1;
  }

  /* Menu backdrop */
  body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-index-modal) - 1);
    animation: fadeIn var(--transition-base);
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}

/* =============================================================================
   MORPHING BUTTON INTERACTIONS - ENHANCED CTA STYLES
   ============================================================================= */

/* Enhanced button hover and active states */
.cta-button,
button[type="submit"],
.button-primary {
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              background-color var(--transition-fast);
  cursor: pointer;
}

.cta-button:hover,
button[type="submit"]:hover,
.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cta-button:active,
button[type="submit"]:active,
.button-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.cta-button:focus-visible,
button[type="submit"]:focus-visible,
.button-primary:focus-visible {
  outline: 2px solid var(--color-accent-500);
  outline-offset: 2px;
}

/* Button loading state */
.cta-button.loading,
button[type="submit"].loading,
.button-primary.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.cta-button.loading::after,
button[type="submit"].loading::after,
.button-primary.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================================================================
   SMOOTH TRANSITIONS FOR INTERACTIVE ELEMENTS
   ============================================================================= */

/* Links with smooth color transitions */
a {
  transition: color var(--transition-fast),
              text-decoration-color var(--transition-fast);
}

/* Form inputs with focus transitions */
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
  transition: outline var(--transition-fast);
}

/* Card hover effects */
.testimonial,
.value-card,
.mission-card {
  transition: transform var(--transition-base),
              box-shadow var(--transition-base);
}

.testimonial:hover,
.value-card:hover,
.mission-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* =============================================================================
   ACCESSIBILITY - REDUCED MOTION PREFERENCE
   ============================================================================= */

@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;
  }

  .reveal,
  .fade-in,
  .fade-in-up {
    opacity: 1 !important;
    transform: none !important;
  }

  .skeleton {
    animation: none !important;
  }

  .cta-button:hover,
  button[type="submit"]:hover,
  .button-primary:hover {
    transform: none !important;
  }
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  h2,
  h3 {
    page-break-after: avoid;
  }

  img {
    max-width: 100% !important;
  }

  .no-print,
  nav,
  .hero-cta,
  .cta-button,
  .skip-link {
    display: none !important;
  }

  @page {
    margin: 2cm;
  }
}
