@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;700&family=Inter:wght@400;600&display=swap");

:root {
  /* Dark Theme (Default - Deep Space) */
  --bg-color: #05070a;
  --surface-color: rgba(16, 22, 30, 0.8);
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent-primary: #79c0ff; /* Soft Blue Glow */
  --accent-secondary: #d2a8ff; /* Galactic Purple */
  --border-color: rgba(48, 54, 61, 0.7);
  --shadow-glow: 0 0 20px rgba(121, 192, 255, 0.15);
  --font-heading: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --radius-lg: 16px;
  --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --banner-bg: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}

[data-theme="light"] {
  /* Light Theme (Lunar Surface) */
  --bg-color: #f0f2f5;
  --surface-color: rgba(255, 255, 255, 0.9);
  --text-primary: #1f2328;
  --text-secondary: #57606a;
  --accent-primary: #0969da;
  --accent-secondary: #8250df;
  --border-color: #d0d7de;
  --shadow-glow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --banner-bg: linear-gradient(135deg, #ffffff 0%, #f6f8fa 100%);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.5s ease;
  overflow-x: hidden;
}

/* Starry Background Effect */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, rgba(0, 0, 0, 0)),
    radial-gradient(1px 1px at 40px 70px, #fff, rgba(0, 0, 0, 0)),
    radial-gradient(1px 1px at 50px 160px, #fff, rgba(0, 0, 0, 0)),
    radial-gradient(
      2px 2px at 80px 120px,
      rgba(255, 255, 255, 0.5),
      rgba(0, 0, 0, 0)
    ),
    radial-gradient(
      2px 2px at 150px 10px,
      rgba(255, 255, 255, 0.3),
      rgba(0, 0, 0, 0)
    );
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: 0.15;
  z-index: -1;
  pointer-events: none;
}

[data-theme="light"] body::before {
  opacity: 0.05;
}

/* Header & Banner */
header {
  position: relative;
  padding-bottom: 4rem;
  background: var(--banner-bg);
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

/* The "Moon/Sun" Glow */
header::after {
  content: "";
  position: absolute;
  top: -100px;
  right: -50px;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    var(--accent-primary) 0%,
    transparent 70%
  );
  opacity: 0.15;
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}

.top-nav {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-primary);
}

#theme-toggle {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  cursor: pointer;
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.site-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 0.8rem;
}

#theme-toggle:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

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

h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(
    to bottom right,
    var(--text-primary),
    var(--accent-primary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: 600;
}

/* Main Content */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.about-section {
  background: var(--surface-color);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 4rem;
  text-align: center;
}

.about-section p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.text-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.text-link:hover {
  opacity: 0.8;
  padding-left: 5px;
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.game-card {
  background: var(--surface-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-5px);
}

.game-card h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--accent-primary);
}

.game-card p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.95rem;
  flex-grow: 1;
}

/* Buttons */
.button-group {
  display: flex;
  gap: 0.75rem;
}

.btn {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
  flex: 1;
  text-align: center;
}

.btn-play {
  background-color: var(--accent-primary);
  color: #000;
}

.btn-play:hover {
  filter: brightness(1.2);
}

.btn-itch {
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-itch:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-primary);
}

/* Footer */
footer {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
}

/* Mobile Adjustments */
@media (max-width: 600px) {
  .hero-content {
    padding-top: 2rem;
  }
  .games-grid {
    grid-template-columns: 1fr;
  }
  .about-section {
    padding: 1.5rem;
  }
  .button-group {
    flex-direction: column;
  }
}
