/*
  Sidonsoft Games Portal
  Design System: Terminal meets Playful
*/

/* ─── Variables ─────────────────────────────────────────────── */
:root {
  /* Terminal Base Colors */
  --terminal-bg: #0a1628;
  --terminal-bg-secondary: #112240;
  --terminal-text: #e6f1ff;
  --terminal-muted: #8892b0;
  
  /* Accent Colors (Nature-inspired, from Monty's) */
  --accent-primary: #376457;
  --accent-primary-light: #5a8f7d;
  --accent-primary-dark: #29564a;
  --accent-secondary: #b7e7d7;
  --accent-tertiary: #e4d7fd;
  
  /* Status Colors */
  --status-success: #4ade80;
  --status-warning: #fbbf24;
  --status-error: #f87171;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #376457 0%, #5a8f7d 100%);
  --gradient-glow: linear-gradient(135deg, rgba(55, 100, 87, 0.3) 0%, rgba(183, 231, 215, 0.1) 100%);
  --gradient-card: linear-gradient(145deg, rgba(17, 34, 64, 0.8) 0%, rgba(10, 22, 40, 0.95) 100%);
  
  /* Typography */
  --font-headline: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Be Vietnam Pro', sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(55, 100, 87, 0.3);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background: var(--terminal-bg);
  color: var(--terminal-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Animated Background ───────────────────────────────────── */
.terminal-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.terminal-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(136, 146, 176, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(136, 146, 176, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
  0% { transform: translate(0, 0); }
  100% { transform: translate(40px, 40px); }
}

.terminal-glow {
  position: absolute;
  inset: -50%;
  background: radial-gradient(ellipse at center, rgba(55, 100, 87, 0.15) 0%, transparent 70%);
  animation: glow-pulse 8s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

/* ─── Header ────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(55, 100, 87, 0.2);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-family: var(--font-mono);
  font-weight: 500;
}

.logo-terminal {
  color: var(--accent-primary-light);
  font-size: 0.875rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--terminal-text);
}

.logo-accent {
  color: var(--accent-primary-light);
}

.nav-links {
  display: flex;
  gap: var(--spacing-md);
}

.nav-link {
  color: var(--terminal-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--terminal-text);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary-light);
  transition: width var(--transition-base);
}

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

/* ─── Hero Section ──────────────────────────────────────────── */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-2xl) var(--spacing-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  align-items: center;
  min-height: calc(100vh - 80px);
}

.hero-content {
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(55, 100, 87, 0.15);
  border: 1px solid rgba(55, 100, 87, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent-primary-light);
  margin-bottom: var(--spacing-md);
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--status-success);
  border-radius: 50%;
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-family: var(--font-headline);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--spacing-md);
}

.title-line {
  display: block;
  color: var(--terminal-text);
}

.title-line.accent {
  color: var(--accent-primary-light);
  text-shadow: 0 0 40px rgba(55, 100, 87, 0.5);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--terminal-muted);
  margin-bottom: var(--spacing-lg);
  max-width: 450px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--gradient-primary);
  color: var(--terminal-text);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-glow);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(55, 100, 87, 0.4);
}

.cta-arrow {
  width: 1.25em;
  height: 1.25em;
  transition: transform var(--transition-fast);
}

.hero-cta:hover .cta-arrow {
  transform: translateX(4px);
}

/* Hero Visual */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.game-card-preview {
  position: relative;
  width: 320px;
  height: 400px;
  background: var(--gradient-card);
  border: 1px solid rgba(55, 100, 87, 0.3);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: card-float 6s ease-in-out infinite;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

@keyframes card-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.card-preview-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
}

.monty-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-sm);
  box-shadow: var(--shadow-glow);
}

.monty-icon svg {
  width: 48px;
  height: 48px;
  color: var(--terminal-text);
}

.card-preview-content h3 {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--terminal-text);
}

.preview-tagline {
  color: var(--terminal-muted);
  font-size: 0.9375rem;
}

.preview-stats {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.preview-stats .stat {
  font-size: 0.8125rem;
  color: var(--terminal-muted);
}

.preview-stats .stat strong {
  color: var(--accent-primary-light);
}

/* ─── Games Section ─────────────────────────────────────────── */
.games-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-2xl) var(--spacing-md);
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.section-title {
  font-family: var(--font-headline);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.title-terminal {
  font-family: var(--font-mono);
  color: var(--accent-primary-light);
  font-size: 0.875em;
}

.section-subtitle {
  color: var(--terminal-muted);
  font-size: 1.0625rem;
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--spacing-lg);
}

/* Game Card */
.game-card {
  background: var(--gradient-card);
  border: 1px solid rgba(55, 100, 87, 0.2);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
}

.game-card:hover {
  transform: translateY(-8px);
  border-color: rgba(55, 100, 87, 0.4);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.game-card.featured {
  border-color: rgba(55, 100, 87, 0.4);
  box-shadow: 0 0 60px rgba(55, 100, 87, 0.15);
}

.game-card.coming-soon {
  opacity: 0.7;
}

.card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.card-image .image-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-primary);
}

.card-image .image-bg.placeholder {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

.card-image .image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 22, 40, 0.8) 100%);
}

.card-image .image-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image .image-icon svg {
  width: 80px;
  height: 80px;
  color: var(--terminal-text);
  opacity: 0.9;
}

.card-image .placeholder-icon svg {
  width: 60px;
  height: 60px;
  opacity: 0.5;
}

.card-badge {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--gradient-primary);
  color: var(--terminal-text);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
}

.card-badge.coming-soon-badge {
  background: rgba(136, 146, 176, 0.2);
  color: var(--terminal-muted);
}

.card-content {
  padding: var(--spacing-lg);
}

.card-meta {
  display: flex;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
  flex-wrap: wrap;
}

.tag {
  padding: 0.25rem 0.625rem;
  background: rgba(55, 100, 87, 0.15);
  border: 1px solid rgba(55, 100, 87, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-primary-light);
}

.tag.mystery {
  background: rgba(136, 146, 176, 0.15);
  border-color: rgba(136, 146, 176, 0.3);
  color: var(--terminal-muted);
}

.card-title {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--terminal-text);
  margin-bottom: var(--spacing-xs);
}

.card-description {
  color: var(--terminal-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: var(--spacing-md);
}

.card-features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.feature {
  font-size: 0.8125rem;
  color: var(--terminal-muted);
}

.card-actions {
  display: flex;
  gap: var(--spacing-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex: 1;
}

.btn svg {
  width: 1em;
  height: 1em;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--terminal-text);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(55, 100, 87, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--terminal-muted);
  border: 1px solid rgba(136, 146, 176, 0.3);
}

.btn-secondary:hover {
  color: var(--terminal-text);
  border-color: rgba(136, 146, 176, 0.5);
}

.btn-tertiary {
  background: rgba(136, 146, 176, 0.1);
  color: var(--terminal-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ─── Features Section ──────────────────────────────────────── */
.features-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-2xl) var(--spacing-md);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.feature-card {
  background: var(--gradient-card);
  border: 1px solid rgba(55, 100, 87, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  text-align: center;
  transition: all var(--transition-base);
}

.feature-card:hover {
  border-color: rgba(55, 100, 87, 0.4);
  transform: translateY(-4px);
}

.feature-icon {
  width: 64px;
  height: 64px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-md);
  box-shadow: var(--shadow-glow);
}

.feature-icon svg {
  width: 32px;
  height: 32px;
  color: var(--terminal-text);
}

.feature-card h3 {
  font-family: var(--font-headline);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--terminal-text);
  margin-bottom: var(--spacing-xs);
}

.feature-card p {
  color: var(--terminal-muted);
  font-size: 0.9375rem;
}

/* ─── Footer ────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid rgba(55, 100, 87, 0.2);
  padding: var(--spacing-xl) var(--spacing-md);
  margin-top: var(--spacing-2xl);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  font-family: var(--font-mono);
  margin-bottom: var(--spacing-md);
}

.footer-brand.small {
  font-size: 0.875rem;
}

.footer-brand .logo-text {
  font-size: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.footer-link {
  color: var(--terminal-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--accent-primary-light);
}

.footer-copyright {
  color: var(--terminal-muted);
  font-size: 0.8125rem;
}

.footer-copyright .heart {
  color: var(--status-error);
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--spacing-lg);
  }
  
  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .hero-subtitle {
    max-width: 100%;
  }
  
  .hero-visual {
    order: -1;
  }
  
  .game-card-preview {
    width: 280px;
    height: 360px;
  }
}

@media (max-width: 600px) {
  .header-content {
    padding: var(--spacing-sm);
  }
  
  .nav-links {
    display: none;
  }
  
  .hero {
    padding: var(--spacing-xl) var(--spacing-sm);
  }
  
  .games-grid {
    grid-template-columns: 1fr;
  }
  
  .card-actions {
    flex-direction: column;
  }
}

/* ─── Accessibility ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--accent-primary-light);
  outline-offset: 2px;
}

/* ─── Selection ─────────────────────────────────────────────── */
::selection {
  background: rgba(55, 100, 87, 0.3);
  color: var(--terminal-text);
}
