/* Global Styles and CSS Custom Properties */

/* Font Face Import */
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/CormorantGaramond-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

/* Press Start 2P is imported via Google Fonts in BaseLayout.astro */

:root {
  /* Color System - Dark Mode Default */
  --color-bg: #010101;
  --color-bg-secondary: #111111;
  --color-bg-elevated: #1a1a1a;
  --color-text: #e5e5e5;
  --color-text-secondary: #a3a3a3;
  --color-text-muted: #737373;
  --color-border: #262626;
  --color-border-subtle: #1f1f1f;
  --color-accent: #3b82f6;
  --color-accent-hover: #60a5fa;
  --color-accent-muted: rgba(59, 130, 246, 0.15);
  --color-accent-glow: rgba(59, 130, 246, 0.25);
  
  /* Gradient Colors */
  --gradient-text: linear-gradient(135deg, #e5e5e5 0%, #a3a3a3 100%);
  --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-card: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  --gradient-border: linear-gradient(135deg, rgba(59, 130, 246, 0.5) 0%, rgba(139, 92, 246, 0.5) 100%);
  
  /* Color Palette */
  --color0: #bcc0cc;
  --color1: #d20f39;
  --color2: #40a02b;
  --color3: #df8e1d;
  --color4: #3b82f6;
  --color5: #8b5cf6;
  --color6: #179299;
  --color7: #e5e5e5;
  --color8: #a3a3a3;
  --color9: #d20f39;
  --color10: #40a02b;
  --color11: #df8e1d;
  --color12: #3b82f6;
  --color13: #8b5cf6;
  --color14: #179299;
  --color15: #a3a3a3;
  
  /* Spacing System */
  --space-xs: 0.25rem;    /* 4px */
  --space-sm: 0.5rem;     /* 8px */
  --space-md: 1rem;       /* 16px */
  --space-lg: 1.5rem;     /* 24px */
  --space-xl: 2rem;       /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */
  --space-4xl: 6rem;      /* 96px */
  
  /* Typography Scale */
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */
  --font-size-4xl: 2.25rem;   /* 36px */
  --font-size-5xl: 3rem;      /* 48px */
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Font Families */
  --font-display: 'Press Start 2P', cursive;
  --font-app: 'Press Start 2P', cursive;
  
  /* Layout */
  --max-width-prose: 65ch;
  --max-width-content: 1200px;
  --border-radius-sm: 0.25rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--color-accent-glow);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* Animation Delays */
  --delay-sm: 100ms;
  --delay-md: 200ms;
  --delay-lg: 300ms;
}

/* Keyframe Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
  }
}

/* CSS Reset and Base Styles */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-app), system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  min-height: 100vh;
}

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent-hover);
}

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

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lists */
ul,
ol {
  list-style-position: inside;
}

/* Code */
code {
  font-family: ui-monospace, 'JetBrains Mono', 'Cascadia Code', Menlo, Consolas, 'Courier New', monospace;
  font-size: 0.9em;
  background-color: var(--color-bg-secondary);
  padding: 0.125rem 0.25rem;
  border-radius: var(--border-radius-sm);
}

pre {
  background-color: var(--color-bg-secondary);
  padding: var(--space-md);
  border-radius: var(--border-radius-md);
  overflow-x: auto;
}

pre code {
  background-color: transparent;
  padding: 0;
}

/* Utility Classes */
.container {
  max-width: var(--max-width-content);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.prose {
  max-width: var(--max-width-prose);
}

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

/* Animation Utility Classes */
.animate-fade-in {
  animation: fadeIn var(--transition-slow) ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp var(--transition-slow) ease forwards;
}

.animate-fade-in-down {
  animation: fadeInDown var(--transition-slow) ease forwards;
}

.animate-slide-in-left {
  animation: slideInLeft var(--transition-slow) ease forwards;
}

.animate-slide-in-right {
  animation: slideInRight var(--transition-slow) ease forwards;
}

.animate-scale-in {
  animation: scaleIn var(--transition-slow) ease forwards;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Staggered animation delays */
.animate-delay-sm {
  animation-delay: var(--delay-sm);
}

.animate-delay-md {
  animation-delay: var(--delay-md);
}

.animate-delay-lg {
  animation-delay: var(--delay-lg);
}

/* Scroll-triggered animations (reduced motion aware) */
.scroll-animate {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .animate-fade-in-up,
  .animate-fade-in-down,
  .animate-slide-in-left,
  .animate-slide-in-right,
  .animate-scale-in,
  .animate-pulse,
  .animate-glow,
  .scroll-animate {
    animation: none !important;
    opacity: 1;
    transform: none !important;
  }
}
