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

* {
  margin: 0;
  padding: 0;
}

body {
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 400;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* CSS Variables — dark mode first */
:root {
  --bg: #0d0d10;
  --bg-secondary: #16161a;
  --bg-card: #1a1a20;
  --text: #f0f0f4;
  --text-muted: #9898a8;
  --text-light: #56566a;
  --accent: #7c3aed;
  --accent-bright: #a855f7;
  --accent-hover: #9333ea;
  --accent-glow: rgba(124, 58, 237, 0.25);
  --green: #22c55e;
  --yellow: #eab308;
  --border: #2a2a35;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --radius: 8px;
  --max-width: 800px;
  --spacing: 1.5rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --bg-secondary: #f3f3f6;
    --bg-card: #ffffff;
    --text: #111118;
    --text-muted: #555568;
    --text-light: #999aaa;
    --accent: #7c3aed;
    --accent-bright: #6d28d9;
    --accent-hover: #5b21b6;
    --accent-glow: rgba(124, 58, 237, 0.12);
    --green: #16a34a;
    --yellow: #ca8a04;
    --border: #e2e2ea;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }
}

/* Layout */
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

nav h1 a {
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
}

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

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--text);
}

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem var(--spacing) 3rem;
  width: 100%;
}

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
  background: var(--bg-secondary);
}

footer a {
  color: var(--text-light);
}

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

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

h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem 0;
}

h4 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

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

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

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

li {
  margin-bottom: 0.375rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
  text-decoration: none;
}

/* Tags */
.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tag-status {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.tag-in-development {
  background: rgba(234, 179, 8, 0.12);
  color: var(--yellow);
  border-color: rgba(234, 179, 8, 0.3);
}

.tag-released {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.3);
}

.tag-engine {
  background: rgba(124, 58, 237, 0.12);
  color: var(--accent-bright);
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.tag-genre {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.625rem;
}

/* Logo card */
.logo-card {
  display: block;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px var(--accent-glow), 0 8px 32px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 220px;
  transition: box-shadow 0.3s ease;
}

.logo-card:hover {
  box-shadow: 0 0 0 2px var(--accent), 0 8px 40px var(--accent-glow);
}

/* Hero */
.hero {
  padding: 4rem 0 3rem;
  margin-bottom: 3rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3rem;
  width: 100%;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-logo {
  flex: 0 0 200px;
  width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 1.25rem;
}

.hero h2 {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* About layout */
.about-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.about-logo {
  flex-shrink: 0;
}

.about-logo .logo-card {
  max-width: 180px;
}

.about-body {
  flex: 1;
  min-width: 0;
}

/* Game Grid */
.featured-games,
.recent-posts {
  margin-bottom: 3.5rem;
}

.featured-games h3,
.recent-posts h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.game-grid-full {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.game-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.2s ease;
  color: var(--text);
}

.game-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 20px var(--accent-glow);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}

.game-card-cover {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-secondary);
}

.game-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  border-bottom: 1px solid var(--border);
}

.game-card-placeholder span {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--border);
  letter-spacing: -0.05em;
}

.game-card-info {
  padding: 1rem 1.125rem 1.125rem;
}

.game-card-info h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.game-card-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Page */
.page-content {
  max-width: 660px;
}

.page-content h2 {
  margin-bottom: 1.5rem;
}

.page-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Posts */
.posts {
  display: grid;
  gap: 1rem;
}

.post-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.post-card time {
  font-size: 0.8125rem;
  color: var(--text-light);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  display: block;
  margin-bottom: 0.5rem;
}

.post-card h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.0625rem;
}

.post-card h4 a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.post-card h4 a:hover {
  color: var(--accent-bright);
  text-decoration: none;
}

.post-card p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.see-all {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
}

.see-all a {
  color: var(--text-muted);
  font-weight: 500;
}

.see-all a:hover {
  color: var(--accent-bright);
  text-decoration: none;
}

/* Post content */
.post-content {
  max-width: 660px;
}

.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-header time {
  display: block;
  font-size: 0.875rem;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.post-header h2 {
  margin: 0;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
}

.post-content p {
  font-size: 1.0625rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.post-content h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.375rem;
}

.post-content h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-content strong {
  color: var(--text);
  font-weight: 600;
}

.post-content code {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.post-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
}

/* Game page */
.game-page {
  max-width: 700px;
}

.game-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.game-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
}

.game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-meta h2 {
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.game-meta .tagline {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.game-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.game-body p {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.game-body h3 {
  margin-top: 2rem;
  margin-bottom: 0.875rem;
  font-size: 1.25rem;
}

.game-body ul {
  color: var(--text-muted);
  line-height: 1.7;
}

/* Responsive */
@media (max-width: 640px) {
  :root {
    --spacing: 1rem;
  }

  nav {
    flex-direction: column;
    gap: 0.875rem;
    align-items: flex-start;
  }

  nav ul {
    gap: 1.25rem;
  }

  .hero {
    padding: 2.5rem 0 2rem;
    margin-bottom: 2rem;
    flex-direction: column;
    gap: 1.5rem;
  }

  .hero-logo {
    justify-content: flex-start;
  }

  .logo-card,
  .about-logo .logo-card {
    max-width: 140px;
  }

  .hero h2 {
    font-size: 2.25rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .about-layout {
    flex-direction: column;
    gap: 1.5rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .post-header h2 {
    font-size: 1.75rem;
  }

  .game-meta h2 {
    font-size: 1.75rem;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .post-card {
    padding: 1.125rem;
  }
}
