/* ============================================================
   DIBI8 Six-Dimension Bento Design System
   WCAG 2.1 AA compliant | Symmetric Architecture
   ============================================================ */

:root {
  /* Background Colors - Deep Space Theme */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1e1e2e;
  --bg-elevated: rgba(255, 255, 255, 0.05);
  
  /* Border Colors */
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(124, 58, 237, 0.6);
  --border-focus: rgba(124, 58, 237, 0.8);
  
  /* Text Colors - WCAG AA Compliant */
  --text-primary: #f1f5f9;    /* Contrast: 16.5:1 ✓ */
  --text-secondary: #cbd5e1;  /* Contrast: 11.2:1 ✓ */
  --text-muted: #94a3b8;      /* Contrast: 7.5:1 ✓ */
  --text-inverse: #0f172a;
  
  /* Six Dimensions Colors */
  --dim-1-tools: #22d3ee;     /* 工具发现 - Neon Cyan */
  --dim-2-reports: #8b5cf6;   /* 生态报告 - Neon Purple */
  --dim-3-price: #f472b6;     /* 价格对比 - Neon Pink */
  --dim-4-guides: #34d399;    /* 使用指南 - Neon Green */
  --dim-5-community: #fbbf24; /* 社区动态 - Amber */
  --dim-6-dev: #38bdf8;       /* 开发者资源 - Sky Blue */
  
  /* Accent Colors */
  --neon-purple: #8b5cf6;
  --neon-cyan: #22d3ee;
  --neon-pink: #f472b6;
  --neon-green: #34d399;
  
  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 50%, #f472b6 100%);
  --gradient-dim1: linear-gradient(135deg, #22d3ee, #3b82f6);
  --gradient-dim2: linear-gradient(135deg, #8b5cf6, #ec4899);
  --gradient-dim3: linear-gradient(135deg, #f472b6, #fb923c);
  --gradient-dim4: linear-gradient(135deg, #34d399, #22d3ee);
  --gradient-dim5: linear-gradient(135deg, #fbbf24, #f472b6);
  --gradient-dim6: linear-gradient(135deg, #38bdf8, #8b5cf6);
  
  /* Shadows */
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.3);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  
  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Focus Indicators */
:focus-visible {
  outline: 2px solid var(--neon-purple);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--neon-cyan);
  outline-offset: 3px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

p {
  margin: 1.2em 0;
  max-width: 70ch;
}

/* Links */
a {
  color: var(--neon-purple);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
}

/* ============================================================
   BENTO GRID SYSTEM
   ============================================================ */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Span Variants */
.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }

/* Row Span Variants */
.row-span-2 { grid-row: span 2; }
.row-span-3 { grid-row: span 3; }

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .span-3, .span-4 {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .span-1, .span-2, .span-3, .span-4 {
    grid-column: span 1;
  }
  .row-span-2, .row-span-3 {
    grid-row: span 1;
  }
}

/* ============================================================
   GLASS CARD COMPONENT
   ============================================================ */

.glass-card {
  background: var(--bg-elevated);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

/* ============================================================
   DIMENSION CARDS - Six Dimensions
   ============================================================ */

/* Dimension Card Base */
.dim-card {
  position: relative;
  padding: 2rem;
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.dim-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--neon-purple));
  opacity: 0.8;
}

.dim-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Dimension 1: Tools Discovery */
.dim-card--tools {
  --card-accent: var(--dim-1-tools);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
  border-color: rgba(34, 211, 238, 0.2);
}

/* Dimension 2: Ecosystem Reports */
.dim-card--reports {
  --card-accent: var(--dim-2-reports);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(236, 72, 153, 0.05) 100%);
  border-color: rgba(139, 92, 246, 0.2);
}

/* Dimension 3: Price Comparison */
.dim-card--price {
  --card-accent: var(--dim-3-price);
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.1) 0%, rgba(251, 146, 60, 0.05) 100%);
  border-color: rgba(244, 114, 182, 0.2);
}

/* Dimension 4: Usage Guides */
.dim-card--guides {
  --card-accent: var(--dim-4-guides);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.1) 0%, rgba(34, 211, 238, 0.05) 100%);
  border-color: rgba(52, 211, 153, 0.2);
}

/* Dimension 5: Community Hub */
.dim-card--community {
  --card-accent: var(--dim-5-community);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(244, 114, 182, 0.05) 100%);
  border-color: rgba(251, 191, 36, 0.2);
}

/* Dimension 6: Developer Resources */
.dim-card--dev {
  --card-accent: var(--dim-6-dev);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
  border-color: rgba(56, 189, 248, 0.2);
}

/* Card Header */
.dim-card__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dim-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-accent, var(--neon-purple));
  color: var(--card-accent, var(--neon-purple));
}

.dim-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dim-card__subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Card Body */
.dim-card__body {
  color: var(--text-secondary);
}

.dim-card__description {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Card Metrics */
.dim-card__metrics {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dim-card__metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dim-card__metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--card-accent, var(--neon-purple));
}

.dim-card__metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Card Footer */
.dim-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.dim-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--card-accent, var(--neon-purple));
  transition: all 0.2s ease;
}

.dim-card__link:hover {
  gap: 0.75rem;
  color: var(--card-accent, var(--neon-purple));
}

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

.hero-section {
  position: relative;
  overflow: hidden;
  padding: 6rem 0;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(34, 211, 238, 0.1) 50%, rgba(244, 114, 182, 0.1) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: clamp(1.25rem, 3vw, 2rem);
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--neon-cyan);
}

.hero-stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.section-description {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================================
   GRADIENT TEXT
   ============================================================ */

.gradient-text {
  background: var(--gradient-hero);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .gradient-text {
    animation: none;
    background: var(--neon-purple);
    -webkit-text-fill-color: var(--neon-purple);
  }
  
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
  color: white;
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--neon-purple);
  color: white;
}

/* ============================================================
   SKIP LINK
   ============================================================ */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--neon-purple);
  color: white;
  padding: 8px 16px;
  z-index: 100;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 8px 0;
}

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

/* ============================================================
   ACCESSIBILITY UTILITIES
   ============================================================ */

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --border-subtle: rgba(255, 255, 255, 0.3);
    --text-muted: #b0b8c8;
  }
  
  .glass-card {
    border-width: 2px;
  }
}

/* Large Text Mode */
@media (prefers-large-text: large) {
  html {
    font-size: 18px;
  }
}

/* Reduced Data Mode */
@media (prefers-reduced-data: reduce) {
  .glass-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-secondary);
  }
}
