/**
 * Day in History - December 28, 2025
 * Theme: Tux - Collaboration & Freedom
 * Style: Modern, Dynamic, Grid-Based
 */

/* ===================================
   1. CSS CUSTOM PROPERTIES
   =================================== */

:root {
  /* Primary Colors - Sunday Theme */
  --color-sun-orange: #FF8C00;
  --color-sun-red: #FF4500;
  --color-sun-gold: #FFD700;
  --color-sun-silver: #C0C0C0;
  --color-sun-amber: #FFBF00;
  --color-sun-copper: #B87333;
  --color-sun-bronze: #CD7F32;

  /* Tech Colors */
  --color-terminal-green: #00FF00;
  --color-matrix-green: #00D000;
  --color-electric-blue: #7DF9FF;
  --color-code-blue: #0080FF;
  --color-git-purple: #6E5494;

  /* Tux Colors */
  --color-tux-black: #000000;
  --color-tux-white: #FFFFFF;
  --color-tux-yellow: #FFC107;

  /* Backgrounds */
  --color-bg-dark: #0A0A0A;
  --color-bg-darker: #1A1A2E;
  --color-bg-light: #F5F5F5;
  --color-bg-white: #FFFFFF;

  /* Grays */
  --color-gray-100: #F7F7F7;
  --color-gray-200: #E5E5E5;
  --color-gray-300: #D4D4D4;
  --color-gray-400: #A3A3A3;
  --color-gray-500: #737373;
  --color-gray-600: #525252;
  --color-gray-700: #404040;
  --color-gray-800: #262626;
  --color-gray-900: #171717;

  /* Semantic Colors */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #3B82F6;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-secondary: 'Merriweather', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* Font Sizes */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 1.6rem + 1.375vw, 2.25rem);
  --text-4xl: clamp(2.25rem, 1.9rem + 1.75vw, 3rem);
  --text-5xl: clamp(3rem, 2.5rem + 2.5vw, 4rem);
  --text-6xl: clamp(3.75rem, 3rem + 3.75vw, 6rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* ===================================
   2. RESET & BASE STYLES
   =================================== */

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

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

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-gray-900);
  background: var(--color-bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   3. TYPOGRAPHY
   =================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-6xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-5xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-4xl); }
h4 { font-size: var(--text-3xl); }
h5 { font-size: var(--text-2xl); }
h6 { font-size: var(--text-xl); }

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

a {
  color: var(--color-sun-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-sun-orange);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background: var(--color-gray-100);
  border-radius: 3px;
}

pre {
  font-family: var(--font-mono);
  background: var(--color-bg-dark);
  color: var(--color-terminal-green);
  padding: var(--space-6);
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: var(--space-6);
}

/* ===================================
   4. LAYOUT
   =================================== */

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

/* Grid System */
.grid-container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .grid-container {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-container {
    grid-template-columns: repeat(8, 1fr);
  }
}

/* Grid Tiles */
.grid-tile {
  background: var(--color-bg-white);
  border: 2px solid var(--color-gray-200);
  border-radius: 12px;
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.grid-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-sun-gold);
}

/* Tile Sizes */
.tile-1x1 { grid-column: span 1; }
.tile-2x1 { grid-column: span 2; }
.tile-2x2 { grid-column: span 2; grid-row: span 2; }
.tile-3x2 { grid-column: span 3; grid-row: span 2; }
.tile-4x3 { grid-column: span 4; grid-row: span 3; }
.tile-full { grid-column: 1 / -1; }

@media (max-width: 768px) {
  .tile-1x1, .tile-2x1, .tile-2x2, .tile-3x2, .tile-4x3 {
    grid-column: span 4;
  }
}

/* ===================================
   5. COMPONENTS
   =================================== */

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-sun-orange), var(--color-sun-red));
  color: white;
  box-shadow: 0 4px 6px rgba(255, 69, 0, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 12px rgba(255, 69, 0, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--color-sun-orange);
  border: 2px solid var(--color-sun-orange);
}

.btn-secondary:hover {
  background: var(--color-sun-orange);
  color: white;
}

/* Cards */
.card {
  background: var(--color-bg-white);
  border-radius: 16px;
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-2xl);
}

.info-card {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--color-gray-200);
}

.info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, 
    var(--color-sun-orange), 
    var(--color-sun-red), 
    var(--color-sun-gold)
  );
}

.event-card {
  background: var(--color-bg-white);
  border-left: 4px solid var(--color-sun-red);
  padding: var(--space-6);
  margin: var(--space-4) 0;
  box-shadow: var(--shadow-sm);
}

/* Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-gray-200);
  padding: var(--space-4) 0;
}

.nav-menu {
  display: flex;
  gap: var(--space-6);
  align-items: center;
  list-style: none;
}

.nav-link {
  color: var(--color-gray-700);
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--color-sun-gold);
  transition: width var(--transition-base);
}

.nav-link:hover::after {
  width: 80%;
}

.nav-link.active {
  color: var(--color-sun-orange);
  background: rgba(255, 140, 0, 0.1);
}

/* Badges */
.badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background: var(--color-sun-gold);
  color: var(--color-gray-900);
}

.badge-secondary {
  background: var(--color-gray-200);
  color: var(--color-gray-700);
}

/* ===================================
   6. ANIMATIONS
   =================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-slow) ease-out;
}

.animate-slide-in {
  animation: slideIn var(--transition-slow) ease-out;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* ===================================
   7. UTILITIES
   =================================== */

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Colors */
.text-orange { color: var(--color-sun-orange); }
.text-gold { color: var(--color-sun-gold); }
.text-red { color: var(--color-sun-red); }

.bg-gradient-sun {
  background: linear-gradient(135deg, 
    var(--color-sun-orange), 
    var(--color-sun-red), 
    var(--color-sun-gold)
  );
}

/* Accessibility */
.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;
}

*:focus-visible {
  outline: 3px solid var(--color-sun-gold);
  outline-offset: 2px;
}

/* ===================================
   8. DARK MODE
   =================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg-primary: var(--color-bg-dark);
    --color-text-primary: var(--color-gray-100);
  }

  body {
    background: var(--color-bg-dark);
    color: var(--color-gray-100);
  }

  .grid-tile,
  .card,
  .info-card {
    background: var(--color-gray-800);
    border-color: var(--color-gray-700);
  }

  .site-header {
    background: rgba(10, 10, 10, 0.95);
    border-bottom-color: var(--color-gray-800);
  }

  code {
    background: var(--color-gray-800);
  }
}

/* ===================================
   9. RESPONSIVE
   =================================== */

/* ===================================
   9. UTILITIES & HELPERS
   =================================== */

/* Spacing Utilities */
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-16 { margin-bottom: var(--space-16); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-auto { margin-top: auto; }

/* Text Utilities */
.font-bold { font-weight: 700; }
.italic { font-style: italic; }
.opacity-90 { opacity: 0.9; }
.block { display: block; }

/* Border Utilities */
.border-t { border-top: 1px solid var(--color-gray-200); }
.pt-4 { padding-top: var(--space-4); }

/* specific component styling enhancements */
.hero-section {
  text-align: center;
  margin-bottom: 4rem;
  padding: 4rem 0;
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
}

.hero-title {
  font-size: var(--text-6xl); 
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--color-sun-orange), var(--color-sun-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.quote-card {
  margin-bottom: 4rem; 
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.quote-text {
  font-size: 1.5rem; 
  font-family: var(--font-secondary); 
  font-style: italic;
  position: relative;
  z-index: 10;
}

.quote-translation {
  font-size: 1.2rem; 
  display: block; 
  margin-top: 1rem; 
  opacity: 0.9;
}

/* Enhancing badges */
.badge-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

/* Footer improvements */
.site-footer {
    background: var(--color-bg-dark); 
    color: white; 
    padding: 2rem 0; 
    margin-top: 4rem;
    border-top: 4px solid var(--color-sun-gold);
}

/* ===================================
   10. RESPONSIVE
   =================================== */

@media (max-width: 768px) {
  .section {
    padding: var(--space-12) 0;
  }

  .container {
    padding: 0 var(--space-4);
  }
  
  .hero-title {
      font-size: var(--text-4xl);
  }

  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-8);
  }
}
