/* ===== RESET & VARIABLES ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ember: #ff6a1a;
  --gold: #ffc940;
  --crimson: #e8233a;
  --deep: #08080c;
  --surface: #0e0e14;
  --card: rgba(14, 14, 20, 0.9);
  --card-hover: rgba(20, 18, 28, 0.95);
  --border: rgba(255, 106, 26, 0.12);
  --text: #c8c8d0;
  --text-dim: #6a6a78;
  --glow: 0 0 40px rgba(255, 106, 26, 0.12);
  --font-heading: 'Bebas Neue', sans-serif;
  --font-body: 'Chakra Petch', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--deep);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  max-width: 100vw;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== BACKGROUND EFFECTS ===== */
.bg-noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

.bg-gradient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(255, 106, 26, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 100%, rgba(232, 35, 58, 0.04) 0%, transparent 70%);
}

.bg-hex {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'><g fill='none' stroke='%23ff6a1a' stroke-width='1'><path d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100'/><path d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50L28 34'/></g></svg>");
  background-size: 56px 100px;
  animation: hexDrift 80s linear infinite;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 100%);
}

@keyframes hexDrift {
  from { background-position: 0 0; }
  to   { background-position: 56px 100px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-hex { animation: none; }
}

/* ===== NAV ===== */
nav {
  position: fixed; top: 0; width: 100%; z-index: 100;
  padding: 1.2rem 3rem;
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(180deg, rgba(8, 8, 12, 0.97) 0%, transparent 100%);
  backdrop-filter: blur(12px); transition: all 0.3s ease;
}

nav.scrolled { background: rgba(8, 8, 12, 0.97); box-shadow: 0 1px 0 var(--border); }

.nav-logo {
  font-family: var(--font-heading); font-size: 1.6rem;
  letter-spacing: 4px; text-transform: uppercase; text-decoration: none;
}

.nav-logo .x { color: var(--ember); }
.nav-logo .h { color: var(--gold); }
.nav-logo .s { color: var(--text-dim); font-size: 1rem; letter-spacing: 2px; }

.nav-links { display: flex; gap: 2.5rem; list-style: none; }

.nav-links a {
  color: var(--text-dim); text-decoration: none;
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 2px; text-transform: uppercase;
  transition: color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active { color: var(--ember); }

.mobile-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}

.mobile-toggle span { width: 22px; height: 1.5px; background: var(--text-dim); }

/* ===== BUTTONS ===== */
.btn {
  font-family: var(--font-body); font-weight: 600;
  font-size: 0.85rem; letter-spacing: 2px; text-transform: uppercase;
  padding: 1rem 2.5rem; border: none; cursor: pointer;
  text-decoration: none; transition: all 0.35s ease;
}

.btn-ember {
  background: var(--ember); color: #000;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}

.btn-ember:hover { background: var(--gold); box-shadow: 0 0 35px rgba(255, 201, 64, 0.3); transform: translateY(-2px); }

.btn-ghost {
  background: transparent; color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}

.btn-ghost:hover { border-color: var(--ember); color: var(--ember); }

/* ===== SECTION UTILITIES ===== */
section { position: relative; z-index: 2; padding: 7rem 3rem; }
.container { max-width: 1140px; margin: 0 auto; }

.tag {
  font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 5px; text-transform: uppercase;
  color: var(--ember); margin-bottom: 1rem; display: inline-block;
}

.heading {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: 4px; text-transform: uppercase; color: #fff; margin-bottom: 1rem;
}

.subtitle {
  font-size: 1.05rem; color: var(--text-dim);
  max-width: 560px; font-weight: 300; line-height: 1.8;
}

.divider {
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--ember) 30%, var(--gold) 70%, transparent 100%);
  opacity: 0.12; position: relative; z-index: 2;
}

/* ===== GAME CARDS (shared base) ===== */
.g-card {
  background: var(--card); border: 1px solid var(--border);
  overflow: hidden; transition: all 0.4s ease; cursor: pointer;
}

.g-card:hover { border-color: rgba(255, 106, 26, 0.35); box-shadow: var(--glow); transform: translateY(-6px); }

.g-thumb {
  height: 210px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #1a0e05 0%, #0e0e14 100%);
}

.g-thumb-icon { font-size: 4rem; opacity: 0.15; transition: all 0.4s ease; }
.g-card:hover .g-thumb-icon { opacity: 0.35; transform: scale(1.1); }
.g-thumb-icon:has(img) { opacity: 1; width: 200%; height: 200%; }
.g-card:hover .g-thumb-icon:has(img) { opacity: 1; transform: scale(1.05); }

.g-badge {
  position: absolute; top: 1rem; right: 1rem;
  font-family: var(--font-mono); font-size: 0.58rem;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 0.3rem 0.7rem; background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px); border: 1px solid;
}

.badge-dev { border-color: var(--ember); color: var(--ember); }
.badge-released { border-color: #22c55e; color: #22c55e; }

.g-body { padding: 1.5rem 1.8rem 2rem; }

.g-genre {
  font-family: var(--font-mono); font-size: 0.6rem;
  color: var(--ember); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 0.6rem;
}

.g-title {
  font-family: var(--font-heading); font-size: 1.6rem;
  letter-spacing: 3px; text-transform: uppercase; color: #eee; margin-bottom: 0.6rem;
}

.g-subtitle {
  font-size: 0.82rem; color: var(--text-dim);
  font-weight: 300; font-style: italic; margin-bottom: 0.5rem;
}

.g-desc { font-size: 0.9rem; color: var(--text-dim); font-weight: 300; line-height: 1.75; }

.g-tag {
  font-family: var(--font-mono); font-size: 0.55rem;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
  padding: 2rem;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  max-width: 700px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none;
  color: var(--text-dim); font-size: 1.5rem;
  cursor: pointer; z-index: 10;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.3s ease;
}

.modal-close:hover { color: var(--ember); }

.modal-hero {
  height: 220px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1a0e05 0%, #0e0e14 100%);
  position: relative;
  overflow: hidden;
}

.modal-hero-icon { font-size: 5rem; opacity: 0.2; }
.modal-hero-icon:has(img) { opacity: 1; width: 350%; height: 350%; }

.modal-hero .g-badge {
  position: absolute; top: 1rem; left: 1rem;
}

.modal-body { padding: 2rem 2.5rem 2.5rem; }

.modal-genre {
  font-family: var(--font-mono); font-size: 0.6rem;
  color: var(--ember); letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 0.5rem;
}

.modal-title {
  font-family: var(--font-heading); font-size: 2.5rem;
  letter-spacing: 4px; text-transform: uppercase;
  color: #fff; margin-bottom: 0.5rem;
}

.modal-subtitle {
  font-size: 1.05rem; color: var(--text-dim);
  font-weight: 300; font-style: italic; margin-bottom: 1rem;
}

.modal-desc {
  font-size: 0.95rem; color: var(--text-dim);
  font-weight: 300; line-height: 1.9;
  margin-bottom: 1.5rem;
}

.modal-info-row {
  display: flex; gap: 2rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.modal-info-item {
  display: flex; flex-direction: column; gap: 0.2rem;
}

.modal-info-label {
  font-family: var(--font-mono); font-size: 0.55rem;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dim);
}

.modal-info-value {
  font-family: var(--font-body); font-size: 0.9rem;
  color: var(--text); font-weight: 500;
}

.modal-tags {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
}

.modal-store-btn {
  display: inline-block; margin-top: 1.5rem;
  font-family: var(--font-body); font-weight: 600;
  font-size: 0.85rem; letter-spacing: 2px;
  text-transform: uppercase; text-decoration: none;
  padding: 0.9rem 2.2rem;
  background: var(--ember); color: #000;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
  transition: all 0.35s ease;
}

.modal-store-btn:hover {
  background: var(--gold);
  box-shadow: 0 0 35px rgba(255, 201, 64, 0.3);
}

.modal-store-btn svg {
  width: 18px; height: 18px;
  fill: currentColor; vertical-align: middle;
  margin-right: 0.4rem;
}

.store-links {
  display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.5rem;
}

/* ===== FOOTER ===== */
footer {
  position: relative; z-index: 2; text-align: center;
  padding: 3rem 2rem; border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.f-logo {
  font-family: var(--font-heading); font-size: 1.3rem; letter-spacing: 5px;
  text-transform: uppercase; margin-bottom: 0.6rem;
}

.f-logo .x { color: var(--ember); }
.f-logo .h { color: var(--gold); }
.f-logo .s { color: var(--text-dim); font-size: 0.85rem; letter-spacing: 3px; }

.f-copy { font-family: var(--font-mono); font-size: 0.6rem; color: #333; letter-spacing: 2px; }

/* ===== SCROLL REVEAL ===== */
.reveal { opacity: 0; transform: translateY(35px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE NAV ===== */
@media (max-width: 900px) {
  nav { padding: 1rem 1.5rem; }
  .mobile-toggle { display: flex; }

  .nav-links {
    position: fixed; top: 0; right: -100%;
    width: 70%; height: 100vh;
    background: rgba(8, 8, 12, 0.98); backdrop-filter: blur(20px);
    flex-direction: column; justify-content: center;
    align-items: center; gap: 2rem; transition: right 0.4s ease;
  }

  .nav-links.open { right: 0; }
  .modal-body { padding: 1.5rem; }
}

@media (max-width: 480px) {
  nav { padding: 0.9rem 1.1rem; }
  .nav-logo { font-size: 1.35rem; letter-spacing: 3px; }
  .nav-logo .s { font-size: 0.85rem; letter-spacing: 1.5px; }
  section { padding: 4.5rem 1.2rem; }
  .heading { letter-spacing: 2px; }
  footer { padding: 2.5rem 1.2rem; }
  .modal-overlay { padding: 1rem; }
  .modal-title { font-size: 2rem; letter-spacing: 2px; }
  .modal-body { padding: 1.25rem; }
}
