/* ============================================
   MATHODA — Design System
   Aesthetic: Liquid Nebula / Dark Futurism
   ============================================ */

/* --- Custom Properties --- */
:root {
  /* Backgrounds */
  --bg-primary: #06060e;
  --bg-secondary: #0b0b18;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-card-border-hover: rgba(255, 255, 255, 0.14);

  /* Text */
  --text-primary: #e8e8f2;
  --text-secondary: #6e6e8a;
  --text-muted: #44445a;

  /* Accents */
  --accent-purple: #7c3aed;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;

  /* Gradients */
  --gradient-main: linear-gradient(135deg, #7c3aed, #3b82f6, #06b6d4);
  --gradient-subtle: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(6, 182, 212, 0.15));
  --gradient-text: linear-gradient(135deg, #a78bfa, #60a5fa, #22d3ee);

  /* Sizing */
  --container-max: 1120px;
  --nav-height: 100px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.4s;
  --duration-slow: 0.7s;

  /* Glass */
  --glass-blur: 24px;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Urbanist', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* --- Noise Grain Overlay --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
}

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
}

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

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

.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 7rem 0;
  position: relative;
}

/* --- Background Orbs --- */
.bg-orbs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  will-change: transform;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: var(--accent-purple);
  top: -10%;
  left: -10%;
  animation: orb-drift-1 25s ease-in-out infinite;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-cyan);
  bottom: -5%;
  right: -10%;
  animation: orb-drift-2 30s ease-in-out infinite;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: var(--accent-blue);
  top: 40%;
  left: 50%;
  animation: orb-drift-3 20s ease-in-out infinite;
}

@keyframes orb-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(80px, 60px) scale(1.1); }
  50% { transform: translate(40px, 120px) scale(0.95); }
  75% { transform: translate(-40px, 60px) scale(1.05); }
}

@keyframes orb-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-70px, -50px) scale(1.08); }
  66% { transform: translate(-30px, -100px) scale(0.92); }
}

@keyframes orb-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-60px, 40px) scale(1.05); }
  50% { transform: translate(40px, -60px) scale(0.95); }
  75% { transform: translate(60px, 20px) scale(1.1); }
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  transition: background var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.navbar.scrolled {
  background: rgba(6, 6, 14, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 120px;
  width: auto;
  filter: brightness(0) invert(1);
  transition: opacity var(--duration-fast) var(--ease-out);
}

.nav-logo:hover img {
  opacity: 0.8;
}

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-out);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-main);
  border-radius: 1px;
  transition: width var(--duration-normal) var(--ease-out);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}

.lang-toggle button {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.lang-toggle button.active {
  background: var(--gradient-main);
  color: white;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  padding: 4px 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--duration-normal) var(--ease-out);
  transform-origin: center;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 6, 14, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 999;
  padding: 2rem 1.5rem;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: color var(--duration-fast) var(--ease-out);
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--text-primary);
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 540px;
  margin-bottom: 2.5rem;
}

.hero-page {
  min-height: 60vh;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
}

.btn-primary {
  background: var(--gradient-main);
  color: white;
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.35);
}

.btn-outline {
  border: 1px solid var(--bg-card-border);
  color: var(--text-primary);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
}

.btn-outline:hover {
  border-color: var(--bg-card-border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.btn-arrow::after {
  content: '→';
  transition: transform var(--duration-fast) var(--ease-out);
}

.btn-arrow:hover::after {
  transform: translateX(4px);
}

/* --- Glass Card --- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 2.5rem;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.glass-card:hover {
  border-color: var(--bg-card-border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* --- Featured App Card (Home) --- */
.featured-app {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.featured-app-info h3 {
  margin-bottom: 0.75rem;
}

.featured-app-info p {
  margin-bottom: 1.5rem;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 100px;
  padding: 6px 14px;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.app-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: var(--gradient-subtle);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.app-icon {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  filter: drop-shadow(0 8px 32px rgba(124, 58, 237, 0.3));
}

.app-name-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.app-icon-inline {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(124, 58, 237, 0.25));
}

.app-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(124, 58, 237, 0.15), transparent 60%);
}

/* --- Feature Grid --- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature-card {
  padding: 2rem;
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--gradient-subtle);
  margin-bottom: 1.25rem;
  font-size: 1.4rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- Apps Page --- */
.app-hero-card {
  padding: 3.5rem;
}

.app-hero-card .app-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.app-hero-card .app-tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 2rem;
}

.app-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.store-badges {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-card-border);
  background: var(--glass-bg);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-out);
}

.store-badge:hover {
  border-color: var(--bg-card-border-hover);
  color: var(--text-primary);
}

.store-badge svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Game list */
.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.game-card {
  padding: 1.75rem;
}

.game-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.game-card p {
  font-size: 0.9rem;
}

.game-card .game-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-purple);
  margin-bottom: 0.75rem;
  display: block;
}

/* --- About Page --- */
.about-content {
  max-width: 680px;
}

.about-content p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.8;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.value-card {
  padding: 2rem;
}

.value-card h3 {
  margin-bottom: 0.6rem;
}

.value-card p {
  font-size: 0.95rem;
}

.value-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* --- Contact Section --- */
.contact-section {
  text-align: center;
}

.contact-section h2 {
  margin-bottom: 1rem;
}

.contact-section p {
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.contact-email {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.contact-email:hover {
  opacity: 0.8;
}

/* --- Privacy Policy --- */
.privacy-content {
  max-width: 740px;
  margin: 0 auto;
}

.privacy-content h2 {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.privacy-content h2:first-child {
  margin-top: 0;
}

.privacy-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.privacy-content ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.privacy-content li {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.5rem;
}

.privacy-content li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
  font-weight: 700;
}

.privacy-updated {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 3rem 0;
  position: relative;
  z-index: 1;
}

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

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-logo {
  display: inline-block;
}

.footer-logo img {
  height: 64px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-out);
}

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

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.footer-social a:hover {
  border-color: var(--bg-card-border-hover);
  color: var(--text-primary);
  background: var(--glass-bg);
}

.footer-social svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --- Scroll Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.reveal.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; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* Hero-specific staggered reveal */
.hero .reveal {
  transform: translateY(40px);
}

/* --- Divider --- */
.section-divider {
  width: 60px;
  height: 3px;
  background: var(--gradient-main);
  border-radius: 2px;
  margin: 2rem 0;
}

.section-divider.center {
  margin-left: auto;
  margin-right: auto;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  section {
    padding: 5rem 0;
  }

  .hero {
    min-height: 80vh;
  }

  .featured-app {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .app-visual {
    min-height: 200px;
  }

  .app-icon {
    width: 140px;
    height: 140px;
  }

  .app-icon-inline {
    width: 56px;
    height: 56px;
  }

  .glass-card {
    padding: 1.75rem;
  }

  .app-hero-card {
    padding: 2rem;
  }

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

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

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

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }

  .store-badges {
    flex-direction: column;
  }

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

  .orb-1 { width: 350px; height: 350px; }
  .orb-2 { width: 300px; height: 300px; }
  .orb-3 { width: 250px; height: 250px; }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: 2.2rem;
  }

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

  .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
  }
}
