/* ================================================================
   NiuAIGO — Dark Tech Theme
   ================================================================ */

/* ── CSS Variables ── */
:root {
  /* Backgrounds */
  --color-bg:        #0a0a1a;
  --color-surface:   rgba(18, 18, 42, 0.85);
  --color-surface-2: rgba(26, 26, 62, 0.6);

  /* Text */
  --color-text:      #e8e8f0;
  --color-muted:     #8888aa;
  --color-heading:   #ffffff;

  /* Neon accents */
  --color-cyan:      #00f0ff;
  --color-purple:    #a855f7;
  --color-magenta:   #ff00cc;

  /* Gradients */
  --gradient-main:   linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  --gradient-bg:     linear-gradient(180deg, #0a0a1a 0%, #111827 100%);

  /* Glow */
  --glow-cyan:       rgba(0, 240, 255, 0.4);
  --glow-purple:     rgba(168, 85, 247, 0.4);

  /* Spacing / radius */
  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  32px;

  /* Layout */
  --max-width:  1200px;
  --header-h:   72px;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--gradient-bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: #fff;
}

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

/* ================================================================
   HEADER / NAVIGATION
   ================================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  background: rgba(10, 10, 26, 0.8);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 1px 0 var(--color-surface-2);
}

.logo img {
  max-height: 40px;
  width: auto;
  opacity: 0.85;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.15));
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.logo img:hover {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.3));
}

/* Desktop nav */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

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

/* Hamburger */
.nav-toggle {
  display: none;
}

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

.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(10, 10, 26, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: calc(var(--header-h) + 1.5rem) 2rem 2rem;
    gap: 1.5rem;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.5);
  }

  .nav-toggle:checked ~ .nav-links {
    right: 0;
  }

  /* Hamburger → X animation */
  .nav-toggle:checked ~ .hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle:checked ~ .hamburger span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle:checked ~ .hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

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

/* ================================================================
   HERO SECTION
   ================================================================ */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--header-h) + 2rem) 1.5rem 4rem;
  text-align: center;
  overflow: hidden;
}

/* Aurora background blobs */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

.hero::before {
  background: var(--glow-purple);
  top: -15%;
  left: -10%;
  animation: aurora-drift-1 14s ease-in-out infinite alternate;
}

.hero::after {
  background: var(--glow-cyan);
  bottom: -15%;
  right: -10%;
  animation: aurora-drift-2 18s ease-in-out infinite alternate;
}

@keyframes aurora-drift-1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(80px, 40px) scale(1.15); }
}

@keyframes aurora-drift-2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-60px, -30px) scale(1.1); }
}

/* Floating particles */
.particle-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--color-cyan);
  border-radius: 50%;
  opacity: 0;
  animation: particle-float linear infinite;
}

.particle:nth-child(1)  { left: 8%;  animation-duration: 8s;   animation-delay: 0s;    width: 3px; height: 3px; }
.particle:nth-child(2)  { left: 20%; animation-duration: 11s;  animation-delay: 1.2s;  width: 2px; height: 2px; background: var(--color-purple); }
.particle:nth-child(3)  { left: 35%; animation-duration: 7s;   animation-delay: 0.5s;  }
.particle:nth-child(4)  { left: 48%; animation-duration: 13s;  animation-delay: 2.8s;  width: 2px; height: 2px; }
.particle:nth-child(5)  { left: 62%; animation-duration: 9s;   animation-delay: 1.8s;  background: var(--color-purple); }
.particle:nth-child(6)  { left: 75%; animation-duration: 10s;  animation-delay: 3.5s;  width: 4px; height: 4px; }
.particle:nth-child(7)  { left: 88%; animation-duration: 12s;  animation-delay: 0.8s;  width: 2px; height: 2px; background: var(--color-magenta); }
.particle:nth-child(8)  { left: 42%; animation-duration: 9.5s; animation-delay: 4.2s;  width: 2px; height: 2px; background: var(--color-cyan); }
.particle:nth-child(9)  { left: 15%; animation-duration: 14s;  animation-delay: 2s;    width: 3px; height: 3px; background: var(--color-purple); }
.particle:nth-child(10) { left: 92%; animation-duration: 8.5s; animation-delay: 3s;    width: 2px; height: 2px; }

@keyframes particle-float {
  0%   { bottom: -5%;  opacity: 0;   transform: translateX(0); }
  8%   { opacity: 0.6; }
  50%  { opacity: 0.3; transform: translateX(25px); }
  92%  { opacity: 0.6; }
  100% { bottom: 105%; opacity: 0;   transform: translateX(-20px); }
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-purple), var(--color-cyan));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradient-sweep 6s linear infinite;
}

@keyframes gradient-sweep {
  to { background-position: 300% 0; }
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--color-muted);
  margin-bottom: 2.5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: scroll-bounce 2s ease-in-out infinite;
}

.scroll-hint svg {
  width: 20px;
  height: 20px;
  stroke: var(--color-cyan);
  stroke-width: 2;
  fill: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .hero-title { animation: none; }
  .particle { animation: none; opacity: 0.3; }
  .scroll-hint { animation: none; }
  .hero::before, .hero::after { animation: none; }
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 2px solid var(--color-cyan);
  border-radius: 999px;
  background: transparent;
  color: var(--color-cyan);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.3s ease, color 0.3s ease, background 0.3s ease;
  box-shadow:
    inset 0 0 0.5em rgba(0, 240, 255, 0.15),
    0 0 0.5em rgba(0, 240, 255, 0.15),
    0 0 1.5em rgba(0, 240, 255, 0.08);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px) scale(1.03);
  color: #fff;
  background: rgba(0, 240, 255, 0.12);
  box-shadow:
    inset 0 0 0.8em rgba(0, 240, 255, 0.4),
    0 0 1.2em rgba(0, 240, 255, 0.5),
    0 0 2.5em rgba(0, 240, 255, 0.2);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-pulse {
  animation: btn-pulse-anim 2.5s ease-in-out infinite;
}

@keyframes btn-pulse-anim {
  0%, 100% {
    box-shadow:
      inset 0 0 0.5em rgba(0, 240, 255, 0.15),
      0 0 0.5em rgba(0, 240, 255, 0.15),
      0 0 1.5em rgba(0, 240, 255, 0.08);
  }
  50% {
    box-shadow:
      inset 0 0 0.8em rgba(0, 240, 255, 0.3),
      0 0 1em rgba(0, 240, 255, 0.4),
      0 0 2.5em rgba(0, 240, 255, 0.18);
  }
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* ================================================================
   GLASS CARD
   ================================================================ */
.glass {
  background: rgba(18, 18, 42, 0.65);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(18, 18, 42, 0.95); }
}

@media (prefers-reduced-transparency: reduce) {
  .glass {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(18, 18, 42, 0.95);
  }
}

/* ================================================================
   MAIN CONTENT / SECTIONS
   ================================================================ */
.main-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: var(--color-heading);
  text-align: center;
  margin-bottom: 0.6rem;
  position: relative;
  display: inline-block;
  width: 100%;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  margin: 0.8rem auto 0;
  background: var(--gradient-main);
  border-radius: 2px;
}

.section-subtitle {
  text-align: center;
  color: var(--color-muted);
  font-size: 1rem;
  margin-bottom: 3rem;
}

/* ================================================================
   GAME CARD
   ================================================================ */
.game-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 12px 50px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 240, 255, 0.15);
}

.game-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-surface-2);
}

.game-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.game-card:hover .game-card-image img {
  transform: scale(1.05);
}

.game-card-body {
  padding: 1.8rem;
}

.game-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 0.6rem;
}

.game-card-desc {
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.game-card-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* Game grid */
.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 600px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }
}

@media (min-width: 1024px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ================================================================
   ABOUT SECTION
   ================================================================ */
.about-content {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  color: var(--color-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* ================================================================
   CONTACT SECTION
   ================================================================ */
.contact-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  color: var(--color-cyan);
  padding: 1rem 2rem;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(0, 240, 255, 0.05);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.contact-email:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.4);
  color: #fff;
}

.contact-email svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  padding: 0 1.5rem;
}

.footer-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-purple), var(--color-cyan), transparent);
  opacity: 0.4;
  margin-bottom: 3rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-brand p {
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 300px;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.6rem;
}

.footer-col a {
  color: var(--color-muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--color-cyan);
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--color-muted);
  font-size: 0.8rem;
}

/* ================================================================
   SCROLL REVEAL ANIMATION
   ================================================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ================================================================
   PRIVACY / TERMS PAGE STYLES
   ================================================================ */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding-top: calc(var(--header-h) + 2rem);
}

.legal-content h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-heading);
  margin: 2.5rem 0 1rem;
}

.legal-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-heading);
  margin: 2rem 0 0.8rem;
}

.legal-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-heading);
  margin: 1.5rem 0 0.6rem;
}

.legal-content p {
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.legal-content ol,
.legal-content ul {
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

.legal-content a {
  color: var(--color-cyan);
}

.legal-content a:hover {
  color: #fff;
}

/* ================================================================
   404 PAGE
   ================================================================ */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  text-align: center;
  padding: 2rem;
}

.error-code {
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 900;
  line-height: 1;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 0.5rem;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 1rem;
}

.error-desc {
  color: var(--color-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  max-width: 400px;
}

/* ================================================================
   UTILITY
   ================================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-center { text-align: center; }
.text-gradient {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
