/* ===================================================
   PLAY HAPPY — Global Design System
   playhappyy.com
=================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&family=Noto+Sans+Arabic:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ─── TOKENS ──────────────────────────────────────── */
:root {
  /* Palette */
  --bg-base:        #09090f;
  --bg-surface:     #111119;
  --bg-card:        rgba(255, 255, 255, 0.04);
  --bg-card-hover:  rgba(255, 255, 255, 0.08);
  --border-subtle:  rgba(255, 255, 255, 0.08);
  --border-glow:    rgba(245, 168, 35, 0.35);

  /* Brand */
  --amber:          #f5a823;
  --amber-light:    #ffd470;
  --amber-dim:      rgba(245, 168, 35, 0.15);
  --rose:           #e8536a;
  --violet:         #8b5cf6;

  /* Text */
  --text-primary:   #f0ede8;
  --text-secondary: #9896a0;
  --text-muted:     #5a5862;

  /* Glow */
  --glow-amber:     0 0 60px rgba(245, 168, 35, 0.18), 0 0 120px rgba(245, 168, 35, 0.08);
  --glow-card:      0 8px 32px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255,255,255,0.05) inset;

  /* Spacing */
  --gap-xs:  8px;
  --gap-sm:  16px;
  --gap-md:  32px;
  --gap-lg:  64px;
  --gap-xl:  96px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  /* Type */
  --font-body:    'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

html[lang="fa"] body {
  font-family: 'Noto Sans Arabic', Tahoma, system-ui, sans-serif;
}

html[lang="fa"] .display-xl,
html[lang="fa"] .display-lg,
html[lang="fa"] .display-md,
html[lang="fa"] .nav__logo,
html[lang="fa"] .btn,
html[lang="fa"] .game-card__title,
html[lang="fa"] .service-card__title,
html[lang="fa"] .stat__number {
  font-family: 'Noto Sans Arabic', Tahoma, system-ui, sans-serif;
  letter-spacing: 0;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ─── TYPOGRAPHY ──────────────────────────────────── */
.display-xl {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.display-md {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
}

.body-lg { font-size: 1.125rem; line-height: 1.7; }
.body-md { font-size: 1rem; line-height: 1.6; }
.body-sm { font-size: 0.875rem; line-height: 1.5; }
.label   { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }

/* ─── GRADIENT TEXT ──────────────────────────────── */
.text-gradient {
  background: linear-gradient(135deg, var(--amber-light) 0%, var(--amber) 50%, var(--rose) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ─── LAYOUT ──────────────────────────────────────── */
.container {
  width: min(1200px, 100% - 48px);
  margin-inline: auto;
}

.section {
  padding-block: var(--gap-xl);
}

/* ─── NAV ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: background 0.3s, backdrop-filter 0.3s, padding 0.3s;
}

.nav.scrolled {
  background: rgba(9, 9, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.nav__logo img { width: 36px; height: 36px; }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
}

.nav__links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}

.lang-switch:hover {
  border-color: var(--border-glow);
}

.nav__mobile-lang {
  display: none;
}

/* ─── BUTTONS ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--r-xl);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-primary {
  background: linear-gradient(135deg, var(--amber) 0%, #e8891a 100%);
  color: #0d0a00;
  box-shadow: 0 4px 24px rgba(245, 168, 35, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(245, 168, 35, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border-glow);
}

/* ─── GLASS CARD ─────────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--glow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.3s, border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: var(--glow-card), 0 0 40px rgba(245, 168, 35, 0.08);
}

/* ─── TAG / BADGE ─────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(245, 168, 35, 0.2);
}

/* ─── HERO ────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 100px;
  position: relative;
  overflow: hidden;
}

.hero__bg-grid {
  position: absolute;
  inset: 0;
  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: 80px 80px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 100%);
}

.hero__glow {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(245, 168, 35, 0.12) 0%, rgba(232, 83, 106, 0.06) 50%, transparent 70%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  margin-inline: auto;
}

.hero__eyebrow {
  margin-bottom: var(--gap-sm);
}

.hero__title {
  margin-bottom: var(--gap-sm);
}

.hero__sub {
  color: var(--text-secondary);
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 580px;
  margin: 0 auto var(--gap-md);
}

.hero__cta {
  display: flex;
  gap: var(--gap-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── MARQUEE ─────────────────────────────────────── */
.marquee-section {
  padding-block: var(--gap-md);
  overflow: hidden;
  position: relative;
}

.marquee-section::before,
.marquee-section::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}

.marquee-section::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-base), transparent);
}

.marquee-section::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-base), transparent);
}

.marquee-track {
  display: flex;
  gap: var(--gap-sm);
  width: max-content;
  animation: marquee 30s linear infinite;
}

.marquee-track:hover { animation-play-state: paused; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee-card {
  flex-shrink: 0;
  width: 180px;
  height: 240px;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-subtle);
}

.marquee-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

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

.marquee-card__label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 32px 12px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  font-size: 0.8rem;
  font-weight: 600;
}

/* ─── ABOUT ───────────────────────────────────────── */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-lg);
  align-items: center;
}

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-sm);
  padding: var(--gap-md);
}

.stat {
  text-align: center;
  padding: var(--gap-sm);
}

.stat__number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--amber-light), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat__label { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }

/* ─── GAMES GRID ──────────────────────────────────── */
.games__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap-sm);
}

.game-card {
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.game-card__cover {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.game-card__body {
  padding: var(--gap-sm);
}

.game-card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.game-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.game-card__studio { color: var(--text-secondary); font-size: 0.85rem; }

/* ─── SERVICES ────────────────────────────────────── */
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap-sm);
}

.service-card {
  padding: var(--gap-md);
}

.service-card__icon {
  font-size: 2rem;
  margin-bottom: var(--gap-sm);
}

.service-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.service-card__desc { color: var(--text-secondary); font-size: 0.9rem; }

/* ─── SECTION HEADER ─────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: var(--gap-lg);
}

.section-header .tag { margin-bottom: var(--gap-sm); }

.section-header .body-lg {
  color: var(--text-secondary);
  max-width: 560px;
  margin: var(--gap-xs) auto 0;
}

/* ─── CONTACT ─────────────────────────────────────── */
.contact__card {
  max-width: 640px;
  margin-inline: auto;
  padding: var(--gap-lg);
  text-align: center;
}

.contact__links {
  display: flex;
  gap: var(--gap-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--gap-md);
}

.contact__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.25s;
}

.contact__link:hover {
  color: var(--text-primary);
  border-color: var(--border-glow);
  background: var(--amber-dim);
}

/* ─── FOOTER ──────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding-block: var(--gap-md);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

.footer__copy { color: var(--text-muted); font-size: 0.85rem; }

.footer__links {
  display: flex;
  gap: var(--gap-md);
}

.footer__links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}

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

/* ─── LEGAL PAGE ─────────────────────────────────── */
body.legal-page {
  background:
    radial-gradient(circle at top left, rgba(245, 168, 35, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(232, 83, 106, 0.1), transparent 24%),
    linear-gradient(180deg, #0b0b12 0%, var(--bg-base) 36%, #07070b 100%);
}

.legal-shell {
  width: min(960px, calc(100% - 32px));
  margin-inline: auto;
  padding-block: 28px 56px;
}

.legal-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3vw, 30px);
}

.legal-hero::after {
  content: '';
  position: absolute;
  inset: auto -8% -40% auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(245, 168, 35, 0.12) 0%, transparent 72%);
  pointer-events: none;
}

.legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.legal-topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.legal-hero .tag {
  position: relative;
  z-index: 1;
  margin-top: 18px;
}

.legal-title {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  max-width: 10ch;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
}

.legal-intro {
  position: relative;
  z-index: 1;
  max-width: 68ch;
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.72;
}

.legal-meta {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.legal-meta__item {
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.legal-meta__label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.legal-meta__value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.legal-section {
  padding: 22px 24px;
  border-radius: 20px;
}

.legal-section--wide {
  grid-column: 1 / -1;
}

.legal-section h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.legal-section p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.72;
}

.legal-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin-top: 10px;
}

.legal-list li {
  position: relative;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.72;
}

.legal-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--amber-light), var(--amber));
  transform: translateY(-50%);
}

.legal-note {
  background: linear-gradient(135deg, rgba(245, 168, 35, 0.06), rgba(232, 83, 106, 0.035));
}

.legal-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: var(--gap-sm);
}

.legal-links a {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.legal-links a:hover {
  color: var(--text-primary);
  border-color: var(--border-glow);
  background: var(--amber-dim);
}

.legal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.legal-footer__links {
  display: flex;
  gap: var(--gap-md);
  flex-wrap: wrap;
}

.legal-footer__links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.legal-footer__links a:hover {
  color: var(--text-primary);
}

.legal-page .reveal,
.legal-page .reveal.visible {
  opacity: 1;
  transform: none;
  transition: none;
}

/* ─── SCROLL REVEAL ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.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; }

/* ─── DIVIDER ─────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-subtle), transparent);
}

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 768px) {
  .about__grid { grid-template-columns: 1fr; }
  .nav__links { display: none; }
  .nav__mobile-lang { display: inline-flex; }
  .about__stats { grid-template-columns: repeat(2, 1fr); }
  .contact__card { padding: var(--gap-md); }
  .legal-shell { width: min(100% - 24px, 960px); padding-block: 22px 44px; }
  .legal-hero { padding: 20px; }
  .legal-meta,
  .legal-grid { grid-template-columns: 1fr; }
  .legal-section--wide { grid-column: auto; }
  .legal-footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .hero__cta { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 280px; justify-content: center; }
  .legal-topbar { align-items: flex-start; }
}
