/* CSS Variables Contract - Design System for Site Redesign */
/* Following css-variables-contract.md specification */

/* T045: Color Contrast Verification
 * Light Theme:
 *   --text (#121212) on --bg (#f5f5f5): 16.5:1 ✓ (WCAG AAA)
 *   --text (#121212) on --bg-secondary (#ffffff): 16.6:1 ✓ (WCAG AAA)
 *   --text-muted (#666666) on --bg (#f5f5f5): 4.6:1 ✓ (WCAG AA)
 *   --text-muted (#666666) on --bg-secondary (#ffffff): 5.7:1 ✓ (WCAG AA)
 * Dark Theme:
 *   --text (#f5f5f5) on --bg (#121212): 16.5:1 ✓ (WCAG AAA)
 *   --text (#f5f5f5) on --bg-secondary (#1a1a1a): 15.2:1 ✓ (WCAG AAA)
 *   --text-muted (#999999) on --bg (#121212): 7.1:1 ✓ (WCAG AA)
 *   --text-muted (#999999) on --bg-secondary (#1a1a1a): 6.2:1 ✓ (WCAG AA)
 */

:root {
  /* Primary Colors */
  --primary: #00F2A9;
  --secondary: #00BFFF;
  --primary-hover: #00C289;
  --secondary-hover: #0099CC;
  
  /* Background Colors - Light Theme */
  --bg: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-elevated: #ffffff;
  
  /* Text Colors - Light Theme */
  --text: #121212;
  --text-muted: #666666;
  --text-inverse: #ffffff;
  
  /* Border Colors */
  --border: #e0e0e0;
  --border-light: #f0f0f0;
  --border-dark: #cccccc;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Spacing Scale */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  --spacing-4xl: 6rem;
  
  /* Layout */
  --container-max-width: 1200px;
  --container-padding: 1rem;
  --section-padding-y: 3rem;
  --section-gap: 2rem;
  
  /* Component Variables - Cards */
  --card-bg: #ffffff;
  --card-border: #e0e0e0;
  --card-border-radius: 12px;
  --card-padding: 1.5rem;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --card-hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  
  /* Component Variables - Buttons */
  --button-padding-x: 1.5rem;
  --button-padding-y: 0.75rem;
  --button-border-radius: 8px;
  --button-font-weight: 500;
  --button-min-height: 44px;
  
  /* Component Variables - Navigation */
  --nav-height: 64px;
  --nav-bg: rgba(245, 245, 245, 0.95);
  --nav-text: #121212;
  --nav-link-padding: 1rem;
  
  /* Component Variables - Video Carousel */
  --carousel-height: 400px;
  --carousel-overlay-bg: rgba(0, 0, 0, 0.3);
  --carousel-text-color: #ffffff;
  
  /* Breakpoints */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
  --transition-theme: 300ms ease;
  
  /* Legacy/Compatibility Variables */
  --max-width: var(--container-max-width);
  --radius: var(--card-border-radius);
  --font-base: var(--font-family);
  --h1-size: clamp(var(--font-size-2xl), 5vw, var(--font-size-4xl));
  --h2-size: clamp(var(--font-size-xl), 4vw, var(--font-size-3xl));
  --h3-size: clamp(var(--font-size-lg), 3vw, var(--font-size-2xl));
  --section-padding: var(--section-padding-y);
  --section-padding-mobile: var(--section-padding-y);
  --muted: var(--text-muted);
  --primary-light: var(--secondary);
  --primary-dark: var(--primary-hover);
  --hero-bg: linear-gradient(180deg, var(--primary) 0%, var(--primary-hover) 100%);
  --hero-text: var(--text-inverse);
}

/* Dark Theme */
/* T045: Dark theme color contrast verified - all combinations meet WCAG AA (4.5:1) or AAA (7:1) standards */
[data-theme="dark"],
body.dark-theme {
  /* Background Colors - Dark Theme */
  --bg: #121212;
  --bg-secondary: #1a1a1a;
  --bg-elevated: #252525;
  
  /* Text Colors - Dark Theme */
  --text: #f5f5f5;
  --text-muted: #999999;
  --text-inverse: #121212;
  
  /* Border Colors - Dark Theme */
  --border: #333333;
  --border-light: #2a2a2a;
  --border-dark: #404040;
  
  /* Component Variables - Cards (Dark) */
  --card-bg: #1a1a1a;
  --card-border: #333333;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --card-hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  
  /* Component Variables - Navigation (Dark) */
  --nav-bg: rgba(18, 18, 18, 0.95);
  --nav-text: #f5f5f5;
  --nav-border: #333333;
  
  /* Component Variables - Video Carousel (Dark) */
  --carousel-overlay-bg: rgba(0, 0, 0, 0.5);
}

/* T039: Responsive Container Padding - Mobile-first approach */
/* Mobile: 1rem (default) */
:root {
  --container-padding: 1rem;
  --section-padding-y: 3rem;
  --section-gap: 2rem;
}

/* Tablet: 2rem */
@media (min-width: 768px) {
  :root {
    --container-padding: 2rem;
    --section-padding-y: 4rem;
    --section-gap: 3rem;
  }
}

/* Desktop: 3rem */
@media (min-width: 1024px) {
  :root {
    --container-padding: 3rem;
    --section-padding-y: 5rem;
    --section-gap: 4rem;
    --carousel-height: 600px;
  }
}

/* System Preference Fallback (only if no explicit theme set) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #121212;
    --bg-secondary: #1a1a1a;
    --bg-elevated: #252525;
    --text: #f5f5f5;
    --text-muted: #999999;
    --text-inverse: #121212;
    --border: #333333;
    --border-light: #2a2a2a;
    --border-dark: #404040;
    --card-bg: #1a1a1a;
    --card-border: #333333;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    --nav-bg: rgba(18, 18, 18, 0.95);
    --nav-text: #f5f5f5;
    --nav-border: #333333;
    --carousel-overlay-bg: rgba(0, 0, 0, 0.5);
  }
}

html {
  scroll-behavior: smooth;
}

/* Theme transition for all theme-aware properties */
*,
*::before,
*::after {
  transition: background-color var(--transition-theme),
              color var(--transition-theme),
              border-color var(--transition-theme),
              box-shadow var(--transition-theme);
}

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

/* T041: Global Heading Styles - Using Inter font with responsive clamp() */
/* Responsive typography that scales smoothly from mobile to desktop */
h1 {
  font-family: var(--font-family);
  font-size: clamp(var(--font-size-2xl), 5vw, var(--font-size-4xl));
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-md);
  color: var(--text);
}

h2 {
  font-family: var(--font-family);
  font-size: clamp(var(--font-size-xl), 4vw, var(--font-size-3xl));
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-lg);
  color: var(--text);
}

h3 {
  font-family: var(--font-family);
  font-size: clamp(var(--font-size-lg), 3vw, var(--font-size-2xl));
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  margin-bottom: var(--spacing-md);
  color: var(--text);
}

/* T041: Additional responsive typography adjustments for mobile */
@media (max-width: 767px) {
  h1 {
    font-size: clamp(1.5rem, 8vw, 2rem);
  }
  
  h2 {
    font-size: clamp(1.25rem, 6vw, 1.75rem);
  }
  
  h3 {
    font-size: clamp(1.125rem, 4vw, 1.5rem);
  }
  
  body {
    font-size: var(--font-size-base);
  }
}

/* T041: Typography adjustments for tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  h1 {
    font-size: clamp(1.875rem, 4vw, 2.25rem);
  }
  
  h2 {
    font-size: clamp(1.5rem, 3.5vw, 1.875rem);
  }
  
  h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
  }
}

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  width: 100%;
  box-sizing: border-box;
}

/* Hero Section */
.hero {
  text-align: center;
  background: var(--bg);
  color: var(--text);
  padding: var(--section-padding-y) 0;
  width: 100%;
}

#home {
  padding: 0;
  background: var(--bg);
}

.hero-logo {
  max-width: 150px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: var(--h1-size);
  margin: 0.5rem 0;
}

.tagline {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.btn-primary {
  background: var(--bg);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease;
  /* T042: Ensure minimum touch target size */
  min-height: var(--button-min-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-hero {
  margin-top: 2rem;
  padding: 0.875rem 2rem;
  font-size: 1.125rem;
  box-shadow: 0 4px 6px rgba(0, 82, 204, 0.2);
}

/* Section Base */
.section {
  padding: var(--section-padding-y) 0;
  background: var(--bg);
  width: 100%;
}

.section h2 {
  text-align: center;
  color: var(--text);
  font-size: var(--h2-size);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-2xl);
}

/* Services */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: left;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid var(--card-border);
}

.service-card h3 {
  color: var(--text);
  margin-top: 0;
}

/* Data Grid (for projects, services, partners, organizations) */
/* T025: Style data grid layout with CSS Grid, gap using --spacing-lg, responsive columns */
/* Mobile-first: 1 column by default */
.data-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  width: 100%;
}

/* T026: Style data card components using --card-* variables with border-radius 12px, padding 1.5rem, shadow, hover elevation */
.data-card {
  background: var(--card-bg);
  padding: var(--card-padding); /* 1.5rem from CSS variables */
  border-radius: var(--card-border-radius); /* 12px from CSS variables */
  text-align: left;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow flex items to shrink */
}

.data-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.data-card-link:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* T026: Hover elevation change for cards */
.data-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-hover-shadow);
  background: var(--bg-elevated);
}

/* Ensure cards without links can still have hover effect */
/* Note: :has() selector has limited browser support, using alternative approach */
.data-card:not(.data-card-link):hover {
  /* Cards without links maintain hover effect but don't change cursor */
}

.data-card h3 {
  font-size: var(--h3-size);
  color: var(--text);
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.data-card p {
  color: var(--text);
  margin-bottom: 1rem;
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  /* Display full text - no truncation */
}

/* T043: Image and media responsive scaling - maintain aspect ratios and quality */
.data-card-logo {
  width: 100%;
  max-width: 120px;
  max-height: 120px;
  height: auto;
  margin-bottom: 1rem;
  border-radius: calc(var(--radius) / 2);
  object-fit: contain;
}

/* T043: Ensure all images are responsive */
img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* T043: Video carousel responsive scaling */
video {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

/* Service Card Visual Elements */
.service-visual {
  margin-bottom: 1rem;
  text-align: center;
}

.service-icon {
  font-size: 3rem;
  display: block;
  line-height: 1;
}

/* T027: Style service cards with optional color coding from service.color field */
.service-card[data-service-color] {
  border-left: 4px solid var(--service-color, var(--border));
}

.service-card[data-service-color]:hover {
  border-left-color: var(--service-color, var(--primary));
}

/* T027: Service card logo/icon display */
.service-card .service-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.service-card .service-icon {
  font-size: 3rem;
  line-height: 1;
  color: var(--text);
}

/* Service Learn More Link */
.service-learn-more {
  display: inline-flex;
  align-items: center;
  margin-top: 1rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color 0.2s ease;
  /* T042: Ensure minimum touch target size */
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0;
}

.service-learn-more:hover {
  color: var(--text);
  text-decoration: underline;
  opacity: 0.8;
}

.service-learn-more:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.data-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.tag {
  display: inline-block;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.featured-badge {
  display: inline-block;
  background: #ffd700;
  color: var(--text);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.status-indicator {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.status-indicator.status-active {
  background: #4caf50;
  color: var(--hero-text);
}

.status-indicator.status-archived {
  background: var(--text-muted);
  color: var(--hero-text);
}

.status-indicator.status-in-progress {
  background: #ff9800;
  color: var(--hero-text);
}

.status-indicator.status-completed {
  background: #2196f3;
  color: var(--hero-text);
}

.status-indicator.status-deprecated {
  background: #f44336;
  color: var(--hero-text);
}

.data-card-meta {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.data-card-repo {
  display: inline-flex;
  align-items: center;
  margin-top: 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  /* T042: Ensure minimum touch target size */
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0;
}

.data-card-repo:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.data-card-repo:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Portfolio */
.project-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 700px;
}

.project-list li {
  margin-bottom: 1.5rem;
}

.project-list a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.project-list a:hover {
  text-decoration: underline;
}

/* Contact / Follow Us Section */
.contact p {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 1.5rem auto;
}

/* T031: Empty state handling for missing data */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: var(--spacing-xl);
  background: var(--bg-secondary);
  border-radius: var(--card-border-radius);
  border: 1px dashed var(--border);
}

/* Remove grey overlay from Follow Us social cards */
.contact .data-card {
  background: transparent;
  border: none;
  box-shadow: none;
}

.contact .data-card:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
}

/* Center images in social cards */
.contact .data-card-link {
  align-items: center;
  text-align: center;
}

.contact .data-card-logo {
  margin-left: auto;
  margin-right: auto;
}

/* T028: Style partner cards with logo sizing constraints, full card clickable area, external link indicators */
.partner-card {
  cursor: pointer;
}

.partner-card .data-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.partner-card .data-card-link::after {
  content: "↗";
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.875rem;
  opacity: 0.7;
  transition: opacity var(--transition-base);
  align-self: flex-start;
}

.partner-card .data-card-link:hover::after {
  opacity: 1;
}

/* T028: Partner logo sizing constraints */
.partner-card .data-card-logo {
  max-height: 100px;
  max-width: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--spacing-md);
}

/* T029: Style project cards similar to partner cards with optional GitHub icon indicators */
.project-card {
  cursor: pointer;
}

.project-card .data-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

/* T029: Project card - GitHub icon indicators for repository links */
.project-card .data-card-link[href*="github.com"]::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 0.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4%3E%3C/path%3E%3Cpath d='M9 18c-4.51 2-5-2-7-2%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  vertical-align: middle;
  opacity: 0.7;
  transition: opacity var(--transition-base);
  align-self: flex-start;
}

.project-card .data-card-link[href*="github.com"]:hover::after {
  opacity: 1;
}

.project-card .data-card-logo {
  max-height: 120px;
  max-width: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--spacing-md);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.social-links a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Footer */
.site-footer {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
  font-size: 0.9rem;
}

/* Sticky Navigation */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  max-width: var(--container-max-width);
  margin: 0 auto;
  height: var(--nav-height);
  gap: var(--spacing-xl); /* Add gap between logo and nav-links for spacing */
}

.logo-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  color: var(--nav-text);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  flex-wrap: nowrap;
  flex-shrink: 0; /* Prevent logo from shrinking */
}

.nav-logo {
  max-height: 40px;
  width: auto;
  height: auto;
}

.nav-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--nav-text);
  white-space: nowrap;
}

.nav-subtitle {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-normal);
  color: var(--text-muted);
  margin-left: var(--spacing-sm);
  display: none; /* Hide on mobile by default */
  white-space: nowrap;
}

@media (min-width: 768px) {
  .nav-subtitle {
    display: inline; /* Show on tablet and desktop */
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  margin-left: auto; /* Push nav-links to the right */
  flex-shrink: 0; /* Prevent nav-links from shrinking */
}

.nav-links a {
  color: var(--nav-text);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--button-border-radius);
  transition: color var(--transition-base), background-color var(--transition-base);
  white-space: nowrap;
  /* T042: Ensure minimum touch target size for navigation links */
  min-height: var(--button-min-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-links a:hover {
  color: var(--text);
  background-color: var(--bg-secondary);
}

.nav-links a:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--button-border-radius);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  gap: 0.25rem;
}

.nav-toggle span {
  width: 1.5rem;
  height: 2px;
  background: var(--nav-text);
  transition: all 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Values Section */
.value-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* Theme Toggle Button */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  min-width: var(--button-min-height);
  min-height: var(--button-min-height);
  width: var(--button-min-height);
  height: var(--button-min-height);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-base), border-color var(--transition-base);
  padding: 0;
  position: relative;
  color: var(--text);
}

.theme-toggle:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
}

.theme-toggle:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.theme-icon {
  position: absolute;
  font-size: 1.5rem;
  transition: opacity var(--transition-base), transform var(--transition-base);
  color: inherit;
}

.theme-icon-light {
  opacity: 1;
  transform: rotate(0deg);
}

.theme-icon-dark {
  opacity: 0;
  transform: rotate(180deg);
}

[data-theme="dark"] .theme-icon-light,
body.dark-theme .theme-icon-light {
  opacity: 0;
  transform: rotate(-180deg);
}

[data-theme="dark"] .theme-icon-dark,
body.dark-theme .theme-icon-dark {
  opacity: 1;
  transform: rotate(0deg);
}

/* T037 & T040: Responsive data grid columns - Mobile-first approach */
/* Mobile: 1 column (default, defined above) */
/* Tablet: 2 columns (768px+) */
@media (min-width: 768px) {
  .data-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Will naturally create 2 columns with minmax(300px, 1fr) on tablet */
  }
  
  .nav-links {
    gap: var(--spacing-md);
  }
  
  /* T038: Hide hamburger menu on tablet/desktop */
  .nav-toggle {
    display: none;
  }
  
  /* T038: Show full navigation menu on tablet/desktop */
  .nav-links {
    position: static;
    display: flex;
    flex-direction: row;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    box-shadow: none;
    padding: 0;
  }
  
  /* T043: Responsive image scaling on tablet */
  .data-card-logo {
    max-width: 120px;
    max-height: 120px;
  }
  
  .partner-card .data-card-logo {
    max-width: 150px;
    max-height: 100px;
  }
  
  .project-card .data-card-logo {
    max-width: 120px;
    max-height: 120px;
  }
}

/* Desktop: 3 columns max (1024px+) */
@media (min-width: 1024px) {
  .data-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Will naturally create up to 3 columns with minmax(300px, 1fr) on desktop */
    max-width: 100%;
  }
  
  /* Ensure cards don't get too wide on very large screens */
  .data-grid .data-card {
    max-width: 100%;
  }
  
  /* T043: Responsive image scaling on desktop */
  .data-card-logo {
    max-width: 120px;
    max-height: 120px;
  }
  
  .partner-card .data-card-logo {
    max-width: 150px;
    max-height: 100px;
  }
  
  .project-card .data-card-logo {
    max-width: 120px;
    max-height: 120px;
  }
}

/* T037 & T038: Mobile Navigation - Mobile-first responsive breakpoint */
/* Mobile devices (< 768px) */
@media (max-width: 767px) {
  .hero {
    padding: 4rem 1rem;
  }

  .section {
    padding: var(--section-padding-y) var(--spacing-md);
  }
  
  .nav-container {
    padding: var(--spacing-sm) var(--spacing-md);
    position: relative; /* Enable absolute positioning for nav-links */
  }
  
  /* T038: Mobile hamburger menu toggle button */
  .nav-toggle {
    display: flex;
    min-width: var(--button-min-height);
    min-height: var(--button-min-height);
    /* T042: Ensure minimum touch target size */
    width: var(--button-min-height);
    height: var(--button-min-height);
  }
  
  /* T038: Mobile navigation menu - hidden by default, shown when toggled */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: var(--spacing-md);
    gap: 0;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  .nav-links[data-visible="true"] {
    display: flex;
  }
  
  .nav-links a {
    padding: var(--spacing-md);
    border-radius: var(--button-border-radius);
    min-height: var(--button-min-height);
    display: flex;
    align-items: center;
    /* T042: Ensure minimum touch target size */
    width: 100%;
  }
  
  .nav-links a:hover {
    background: var(--bg-secondary);
  }
  
  /* T038: Theme toggle in mobile menu */
  .nav-links .theme-toggle {
    align-self: center;
    margin-top: var(--spacing-sm);
  }
  
  /* T043: Responsive image scaling on mobile */
  .data-card-logo {
    max-width: 100px;
    max-height: 100px;
  }
  
  .partner-card .data-card-logo {
    max-width: 120px;
    max-height: 80px;
  }
  
  .project-card .data-card-logo {
    max-width: 100px;
    max-height: 100px;
  }
}

/* ========================================
   Multi-Tab Interface Styles
   ======================================== */

/* Tabs Container */
.tabs-container {
  margin: 2rem 0;
}

/* Tab Navigation */
.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tab Button */
.tab-button {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-base);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  min-height: 44px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-button:hover:not(.active) {
  color: var(--text);
  border-bottom-color: var(--border-dark);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tab-button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.tab-button.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 600;
  background-color: transparent;
}

/* Tab Content */
.tabs-content {
  padding: 1.5rem 0;
}

/* Tab Panel */
.tab-panel {
  display: block; /* Default: all visible (progressive enhancement) */
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* JavaScript enhancement: Hide inactive panels */
.js-enabled .tab-panel:not(.active) {
  display: none;
  opacity: 0;
  visibility: hidden;
}

.js-enabled .tab-panel.active {
  display: block;
  opacity: 1;
  visibility: visible;
  animation: fadeIn 0.3s ease;
}

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

/* Responsive Design for Tabs */

/* Mobile devices (< 768px) */
@media (max-width: 768px) {
  .tabs-nav {
    gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .tab-button {
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 44px;
    min-width: 44px;
  }
}

/* Tablet breakpoint (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .tabs-nav {
    gap: 0.5rem;
  }
  
  .tab-button {
    padding: 0.7rem 1.25rem;
    font-size: 0.95rem;
  }
}

/* Large desktop screens (>= 2560px) */
@media (min-width: 2560px) {
  .tabs-container {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
  }
  
  .tabs-nav {
    gap: 0.75rem;
  }
  
  .tab-button {
    padding: 0.875rem 1.75rem;
    font-size: 1.1rem;
  }
}

/* Very small screens (< 320px) */
@media (max-width: 319px) {
  .tabs-nav {
    gap: 0.125rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .tab-button {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-height: 44px;
    min-width: 44px;
  }
}

/* Tab Projects List Styling */
.tab-projects {
  margin-top: 1.5rem;
}

.tab-projects h3 {
  margin-bottom: 1rem;
  color: var(--text);
  font-size: 1.5rem;
}

.tab-projects-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tab-project-item {
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}

.tab-project-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-project-item strong {
  display: block;
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.tab-project-item p {
  margin: 0.5rem 0;
  color: var(--text-muted);
}

.tab-project-link {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  /* T042: Ensure minimum touch target size */
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0;
}

.tab-project-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.tab-project-link:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* T044: Ensure all buttons have proper focus states */
button:focus,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* T044: Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: var(--text-inverse);
  padding: 8px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}
