/* ===== CUSTOM PROPERTIES ===== */
:root {
  --clr-bg-deep: #050a14;
  --clr-bg-card: #0a1220;
  --clr-bg-surface: #0f1c2e;
  --clr-primary: #00aaff;
  --clr-primary-lt: #4dc8ff;
  --clr-accent-red: #cc1010;
  --clr-white: #f0f4ff;
  --clr-silver: #8a9bc0;
  --clr-border: rgba(0, 170, 255, 0.15);

  --glow-blue: 0 0 20px rgba(0, 170, 255, 0.4), 0 0 60px rgba(0, 170, 255, 0.15);
  --glow-blue-sm: 0 0 10px rgba(0, 170, 255, 0.35);

  --font-display: 'Rajdhani', 'Impact', sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  --section-pad: clamp(4rem, 8vw, 8rem);
  --container-max: 1400px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-height: 72px;

  scroll-behavior: smooth;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--clr-bg-deep);
  color: var(--clr-white);
  line-height: 1.6;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  color: var(--clr-white);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.btn--primary {
  background: var(--clr-primary);
  color: var(--clr-bg-deep);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-blue);
}

.btn--secondary {
  background: transparent;
  color: var(--clr-primary);
  border: 1px solid var(--clr-primary);
}

.btn--secondary:hover {
  background: rgba(0, 170, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: var(--glow-blue-sm);
}

/* ===== NAVIGATION ===== */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: var(--clr-bg-deep);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#site-header.scrolled {
  background: var(--clr-bg-deep);
}

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

.nav-logo img {
  height: 44px;
  width: 44px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.25), 0 0 12px rgba(255, 255, 255, 0.1);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-silver);
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--clr-primary);
  transition: width 0.3s var(--ease-out-expo), left 0.3s var(--ease-out-expo);
}

.nav-links a:hover {
  color: var(--clr-primary);
}

.nav-links a:hover::after {
  width: 100%;
  left: 0;
}

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

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--clr-white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== HERO ===== */
#hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  perspective: 1000px;
  overflow: hidden;
}

#hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 130%;
  background-image: url('../images/cover.jpeg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  will-change: transform;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(5, 10, 20, 0.7) 0%, rgba(5, 10, 20, 0.3) 45%, transparent 70%),
    linear-gradient(to bottom, rgba(5, 10, 20, 0.3) 0%, rgba(5, 10, 20, 0.1) 30%, rgba(5, 10, 20, 0.1) 60%, rgba(5, 10, 20, 0.6) 85%, rgba(5, 10, 20, 1) 100%);
}

#hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 clamp(1.5rem, 5vw, 6rem);
  padding-top: var(--nav-height);
  max-width: 800px;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--clr-primary);
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 7rem);
  text-transform: uppercase;
  color: var(--clr-white);
  text-shadow: 0 0 20px rgba(0, 170, 255, 0.4), 0 0 60px rgba(0, 170, 255, 0.15);
  margin-bottom: 1rem;
  line-height: 0.95;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--clr-silver);
  margin-bottom: 2rem;
  max-width: 480px;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--clr-silver);
  opacity: 0.6;
  animation: scrollBounce 2s ease-in-out infinite;
  transition: opacity 0.3s ease;
}

/* ===== GAMES SECTION ===== */
#games {
  padding: var(--section-pad) 0;
  background: var(--clr-bg-deep);
  overflow: hidden;
}

.section-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.games-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* ===== GAME CARD ===== */
.game-card {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--glow-blue);
}

.game-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.game-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out-expo);
}

.game-card:hover .game-card__media img {
  transform: scale(1.04);
}

.game-card__badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--clr-primary);
  color: var(--clr-bg-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.75rem;
  border-radius: 3px;
}

.game-card__body {
  padding: 1.5rem;
}

.game-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.game-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

.game-card__title {
  font-size: 1.5rem;
  color: var(--clr-white);
}

.game-card__genre {
  font-size: 0.85rem;
  color: var(--clr-primary-lt);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.game-card__desc {
  color: var(--clr-silver);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* Heroes */
.game-card__heroes {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.game-card__heroes figure {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--clr-border);
}

.game-card__heroes img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: top;
  transition: transform 0.4s var(--ease-out-expo);
}

.game-card__heroes figure:hover img {
  transform: scale(1.08);
}

.game-card__heroes figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  background: linear-gradient(to top, rgba(5, 10, 20, 0.9), transparent);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  color: var(--clr-white);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.game-card__heroes figcaption span {
  font-size: 0.7rem;
  color: var(--clr-primary-lt);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Stats */
.game-card__stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.game-card__stats span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--clr-primary-lt);
  border: 1px solid var(--clr-border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  white-space: nowrap;
}

/* Dungeons */
.game-card__dungeons {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.dungeon-thumb {
  flex: 1;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.dungeon-thumb:hover {
  border-color: var(--clr-primary);
}

.dungeon-thumb img {
  width: 100%;
  height: 80px;
  object-fit: cover;
}

.dungeon-thumb span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.3rem 0.5rem;
  background: linear-gradient(to top, rgba(5, 10, 20, 0.85), transparent);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-silver);
}

/* Coming Soon card */
.game-card--coming-soon {
  display: flex;
  flex-direction: column;
}

.game-card__media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, var(--clr-bg-surface), var(--clr-bg-card));
}

.coming-soon-label {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  color: var(--clr-border);
}

.game-card--coming-soon .game-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-card--coming-soon .game-card__title {
  color: var(--clr-silver);
}

/* ===== ABOUT SECTION ===== */
#about {
  padding: var(--section-pad) 0;
  background: var(--clr-bg-surface);
  overflow: hidden;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text p {
  color: var(--clr-silver);
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.about-tagline {
  font-family: var(--font-display);
  font-size: 1.25rem !important;
  font-weight: 700;
  color: var(--clr-primary) !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 1rem;
}

.about-logo-glow {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  border-radius: 8px;
  filter: drop-shadow(0 0 30px rgba(0, 170, 255, 0.5)) drop-shadow(0 0 80px rgba(0, 170, 255, 0.2));
}

/* ===== NEWSLETTER ===== */
#newsletter {
  padding: var(--section-pad) 0;
  background: var(--clr-bg-deep);
  overflow: hidden;
}

.newsletter-container {
  text-align: center;
  max-width: 600px;
}

.newsletter-container > p {
  color: var(--clr-silver);
  margin-bottom: 2rem;
}

.newsletter-form__group {
  display: flex;
  gap: 0.75rem;
}

.newsletter-form__group input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--clr-white);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.newsletter-form__group input::placeholder {
  color: var(--clr-silver);
  opacity: 0.6;
}

.newsletter-form__group input:focus {
  border-color: var(--clr-primary);
  box-shadow: var(--glow-blue-sm);
}

.newsletter-form__status {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  min-height: 1.25em;
}

.newsletter-form__status--success {
  color: #22c55e;
}

.newsletter-form__status--error {
  color: var(--clr-accent-red);
}

/* ===== FOOTER ===== */
#site-footer {
  padding: 2.5rem 0;
  background: var(--clr-bg-card);
  border-top: 1px solid var(--clr-border);
  overflow: hidden;
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--clr-silver);
  opacity: 0.6;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--clr-border);
}

.footer-email {
  font-size: 0.9rem;
  color: var(--clr-silver);
  transition: color 0.3s ease;
}

.footer-email:hover {
  color: var(--clr-primary);
}

.footer-legal {
  display: flex;
  gap: 1.5rem;
}

.footer-legal a {
  font-size: 0.85rem;
  color: var(--clr-silver);
  transition: color 0.3s ease;
}

.footer-legal a:hover {
  color: var(--clr-primary);
}

/* ===== LEGAL PAGE ===== */
.legal-page {
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: var(--section-pad);
  background: var(--clr-bg-deep);
  min-height: 100vh;
}

.legal-page__container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  color: var(--clr-silver);
  font-size: 0.95rem;
  line-height: 1.7;
}

.legal-page__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-white);
  margin-bottom: 0.5rem;
}

.legal-page__date {
  font-size: 0.8rem;
  color: var(--clr-primary-lt);
  margin-bottom: 2rem;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legal-page__container h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--clr-white);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.legal-page__container p {
  margin-bottom: 0.75rem;
}

.legal-page__container ul {
  list-style: none;
  margin-bottom: 0.75rem;
  padding-left: 1rem;
}

.legal-page__container ul li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.35rem;
}

.legal-page__container ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--clr-primary);
}

.legal-page__container a {
  color: var(--clr-primary);
  transition: color 0.2s ease;
}

.legal-page__container a:hover {
  color: var(--clr-primary-lt);
}

/* ===== ANIMATIONS & KEYFRAMES ===== */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes flipIn {
  0% {
    opacity: 0;
    transform: perspective(800px) rotateX(90deg) translateY(30px);
    filter: blur(4px);
  }
  60% {
    opacity: 1;
    transform: perspective(800px) rotateX(-10deg) translateY(0);
    filter: blur(0);
  }
  80% {
    transform: perspective(800px) rotateX(5deg);
  }
  100% {
    opacity: 1;
    transform: perspective(800px) rotateX(0deg);
    filter: blur(0);
  }
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 10px rgba(0, 170, 255, 0.4); }
  50% { text-shadow: 0 0 30px rgba(0, 170, 255, 0.8), 0 0 60px rgba(0, 170, 255, 0.3); }
}

/* Hero animation */
[data-animate] {
  opacity: 0;
  transform: perspective(800px) rotateX(90deg) translateY(30px);
  transform-origin: center bottom;
  filter: blur(4px);
}

[data-animate].anim-ready {
  animation: flipIn 1s var(--ease-out-expo) forwards;
}

/* Scroll reveal — base */
[data-reveal] {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s var(--ease-out-expo), filter 0.8s ease;
}

/* fade-up (default) */
[data-reveal="fade-up"] {
  transform: translateY(40px);
}

/* slide from right */
[data-reveal="slide-right"] {
  transform: translateX(-60px);
}

/* slide from left */
[data-reveal="slide-left"] {
  transform: translateX(60px);
}

/* scale up */
[data-reveal="scale"] {
  transform: scale(0.85);
  filter: blur(4px);
}

/* stagger container — children animate */
[data-reveal="stagger"] {
  opacity: 1;
}

[data-reveal="stagger"] > * {
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s var(--ease-out-expo);
}

[data-reveal="stagger"].in-view > * {
  opacity: 1;
  transform: none;
}

/* stagger delays for children */
[data-reveal="stagger"].in-view > *:nth-child(1) { transition-delay: 0s; }
[data-reveal="stagger"].in-view > *:nth-child(2) { transition-delay: 0.1s; }
[data-reveal="stagger"].in-view > *:nth-child(3) { transition-delay: 0.2s; }
[data-reveal="stagger"].in-view > *:nth-child(4) { transition-delay: 0.3s; }
[data-reveal="stagger"].in-view > *:nth-child(5) { transition-delay: 0.4s; }

/* all reveal types — visible state */
[data-reveal].in-view {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Glow pulse on hero title */
.hero-title.anim-ready {
  animation: flipIn 1s var(--ease-out-expo) forwards, glowPulse 4s ease-in-out 1s infinite;
}

/* ===== RESPONSIVE ===== */

/* Mobile */
@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(5, 10, 20, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .nav-links.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    font-size: 1.5rem;
  }

  #hero {
    height: 100svh;
    min-height: 500px;
    align-items: center;
  }

  #hero-bg {
    background-position: 35% 20%;
  }

  #hero::before {
    background: rgba(5, 10, 20, 0.45);
  }

  .hero-content {
    padding: 0 1.5rem;
    padding-top: calc(var(--nav-height) + 2rem);
    padding-bottom: 0;
    text-align: center;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-sub {
    max-width: 300px;
  }

  .hero-scroll-indicator {
    bottom: 1.5rem;
  }

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

  .game-card__heroes img {
    height: 140px;
  }

  .game-card__dungeons {
    flex-direction: column;
  }

  .dungeon-thumb img {
    height: 120px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .about-logo-display {
    order: -1;
  }

  .about-logo-glow {
    max-width: 250px;
  }

  .newsletter-form__group {
    flex-direction: column;
  }

  .footer-top {
    flex-direction: column;
    text-align: center;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .games-grid {
    grid-template-columns: 1fr;
  }

  .game-card--coming-soon {
    max-width: 400px;
  }
}

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

  [data-animate] {
    opacity: 1;
    transform: none;
  }

  [data-reveal],
  [data-reveal] > * {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .hero-scroll-indicator {
    animation: none;
  }

  #hero-particles {
    display: none;
  }
}

.btn--sm {
  font-size: 0.8rem;
  padding: 0.5rem 1.25rem;
}
