:root {
  --bg: #080a0f;
  --bg-elevated: #0f131c;
  --bg-card: rgba(16, 21, 31, 0.78);
  --bg-card-hover: rgba(22, 29, 43, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f6fc;
  --text-muted: #9aa5b8;
  --text-dim: #6f7b90;
  --accent: #38bdf8;
  --accent-secondary: #818cf8;
  --emerald: #34d399;
  --amber: #fbbf24;
  --violet: #a78bfa;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

/* Ambient Background */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 35%, transparent 100%);
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  pointer-events: none;
}

.bg-glow--primary {
  width: 560px;
  height: 560px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, #38bdf8, transparent 70%);
}

.bg-glow--secondary {
  width: 520px;
  height: 520px;
  top: 100px;
  right: -160px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
}

.container {
  width: min(1160px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(8, 10, 15, 0.78);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.25));
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}

.brand-text strong {
  font-size: 1rem;
  font-weight: 700;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

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

.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
}

.nav-external {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text) !important;
}

.nav-external:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
}

/* Hero */
.hero {
  padding: clamp(4rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 4.5rem);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #a7f3d0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-bottom: 1.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse 2.2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.85);
  }
}

.hero-title {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 5.5vw, 4.1rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.gradient-text {
  background: linear-gradient(120deg, #7dd3fc 0%, #c4b5fd 55%, #6ee7b7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  max-width: 64ch;
  margin: 0 0 2rem;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--text-muted);
}

.hero-subtitle strong {
  color: var(--text);
  font-weight: 600;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #060911;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.22);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.32);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-sm {
  padding: 0.56rem 0.95rem;
  font-size: 0.85rem;
}

.btn-disabled {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
  color: var(--text-dim);
  cursor: default;
}

/* Section Headers */
.projects-section {
  padding: 2rem 0 4.5rem;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Filters */
.filter-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.3rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.filter-btn {
  padding: 0.4rem 0.85rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.is-active {
  background: rgba(56, 189, 248, 0.14);
  color: #bae6fd;
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.games-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--bg-card-hover);
}

.game-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #0b101b;
}

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

.game-cover--contain {
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--card-accent, #f59e0b) 24%, transparent), transparent 68%),
    linear-gradient(145deg, rgba(20, 27, 42, 0.96), rgba(10, 14, 22, 0.98));
}

.game-cover--contain .game-cover-grid {
  z-index: 0;
}

.game-cover--contain img {
  position: relative;
  z-index: 1;
  object-fit: contain;
  padding: 0.9rem 1.25rem;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
}

.game-cover-art {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem;
  position: relative;
  isolation: isolate;
}

.game-cover-art::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 80% 20%, var(--card-accent, #38bdf8) 0%, transparent 58%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(8, 10, 15, 0.98));
  opacity: 0.48;
}

.game-cover-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.cover-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.cover-index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
}

.cover-monogram {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.62rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

.status-badge--dev {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}

.status-badge--alpha {
  background: rgba(52, 211, 153, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
}

.status-badge--prototype {
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

.status-badge--released {
  background: rgba(167, 139, 250, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: #ddd6fe;
}

.game-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.35rem;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.meta-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.game-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.25;
}

.game-tagline {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent);
}

.game-summary {
  margin: 0 0 1.25rem;
  font-size: 0.93rem;
  color: var(--text-muted);
  flex: 1;
}

.progress-block {
  margin-bottom: 1.25rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--card-accent, #38bdf8), #818cf8);
}

.progress-note {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
}

.game-actions .btn {
  flex: 1 1 auto;
}

/* Empty Filter State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
}

/* About Section */
.about-section {
  padding: 1rem 0 5rem;
}

.about-card {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(16, 22, 34, 0.85), rgba(10, 14, 22, 0.92));
  border: 1px solid var(--border);
}

.about-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.about-logo {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 18px rgba(56, 189, 248, 0.22));
}

.about-content p {
  color: var(--text-muted);
  margin: 1rem 0 0;
}

.about-note a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.about-note a:hover {
  text-decoration: underline;
}

.about-stats {
  display: grid;
  gap: 0.9rem;
  align-content: center;
}

.stat-box {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  background: rgba(8, 10, 15, 0.65);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.footer-copy {
  margin: 0;
}

.footer-copy a,
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-copy a:hover,
.footer-links a:hover {
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(4, 6, 10, 0.78);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: var(--radius-lg);
  background: #101520;
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-header {
  margin-bottom: 1.25rem;
  padding-right: 2.5rem;
}

.modal-title {
  margin: 0.65rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
}

.modal-tagline {
  margin: 0;
  color: var(--accent);
  font-weight: 500;
}

.modal-section {
  margin-top: 1.35rem;
}

.modal-section h4 {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.modal-section p {
  margin: 0;
  color: var(--text-muted);
}

.modal-section p + p {
  margin-top: 0.75rem;
}

.modal-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.modal-list li + li {
  margin-top: 0.35rem;
}

.devlog-list {
  display: grid;
  gap: 0.7rem;
}

.devlog-item {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.devlog-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.devlog-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 1024px) {
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .games-grid,
  .games-grid--two {
    grid-template-columns: 1fr;
  }

  .nav {
    gap: 0.9rem;
  }

  .nav a:not(.nav-external) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .pulse-dot,
  .game-card,
  .btn {
    animation: none;
    transition: none;
  }
}
