/* ============================================================
   FUNSEMBLY.NET — main.css
   Design tokens → Reset → Layout → Hero → Games → About →
   Newsletter → Footer → Animations → RWD
   ============================================================ */

/* ── TOKENS ────────────────────────────────────────────────── */
:root {
  /* Palette — dark base, consistent with chess-pong */
  --bg:           #0a0a0f;
  --bg-2:         #111118;
  --bg-card:      rgba(24, 24, 36, 0.6);
  --bg-card-hover:rgba(32, 32, 48, 0.8);
  --border:       rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text:         #e8e8e8;
  --text-muted:   #888;
  --text-dim:     #555;

  /* Accents — fun-branded */
  --accent:       #c9a84c;          /* gold — chess heritage */
  --accent-glow:  rgba(201,168,76,.20);
  --accent-2:     #4ca8c9;          /* teal — pong heritage */
  --accent-2-glow:rgba(76,168,201,.20);
  --fun:          #e06cba;          /* pink — funsembly brand */
  --fun-glow:     rgba(224,108,186,.15);

  /* Typography */
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Spacing */
  --sp-xs:  .4rem;
  --sp-sm:  .8rem;
  --sp-md:  1.6rem;
  --sp-lg:  3rem;
  --sp-xl:  5rem;
  --sp-2xl: 8rem;

  /* Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Transitions */
  --t-fast:   150ms ease;
  --t-normal: 300ms ease;
  --t-slow:   600ms cubic-bezier(.16,1,.3,1);

  /* Layout */
  --nav-h:   68px;
  --max-w:   960px;
  --max-w-wide: 1200px;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100dvh;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul[role="list"], ol[role="list"] { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── UTILITY ────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-md); }
.container--narrow { max-width: 640px; }
.text-link {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--t-fast);
}
.text-link:hover { color: var(--accent); }

/* ── HEADER ─────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 var(--sp-md);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.logo-icon { font-size: 1.4rem; }
.logo-text { opacity: .9; }

.nav-links {
  display: flex;
  gap: var(--sp-lg);
}
.nav-links a {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color var(--t-fast);
}
.nav-links a:hover { color: var(--text); }

/* ── HERO ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: calc(var(--nav-h) + var(--sp-xl)) var(--sp-md) var(--sp-xl);
}

/* Animated particle background */
.hero__particles {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__particles canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Film grain overlay */
.hero__grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

.hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
}
.hero__eyebrow {
  font-size: .85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--accent-2);
  margin-bottom: var(--sp-sm);
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 9rem);
  line-height: .95;
  letter-spacing: .02em;
  margin-bottom: var(--sp-md);
}
.word-fun {
  color: var(--fun);
  text-shadow: 0 0 40px var(--fun-glow), 0 0 80px var(--fun-glow);
}
.word-sembly {
  color: var(--text);
}
.hero__lead {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto var(--sp-lg);
}
.hero__lead em {
  color: var(--text-dim);
  font-style: italic;
}
.hero__cta {
  display: flex;
  gap: var(--sp-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Scroll hint */
.hero__scroll-hint {
  position: absolute;
  bottom: var(--sp-lg);
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  color: var(--text-dim);
  animation: bounce-down 2s infinite;
  z-index: 2;
}

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 2rem;
  border-radius: var(--r-xl);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .02em;
  transition: all var(--t-normal);
}
.btn--primary {
  background: var(--fun);
  color: #fff;
  box-shadow: 0 0 20px var(--fun-glow), 0 4px 16px rgba(0,0,0,.3);
}
.btn--primary:hover {
  background: #e880c5;
  box-shadow: 0 0 30px var(--fun-glow), 0 6px 24px rgba(0,0,0,.4);
  transform: translateY(-2px);
}
.btn--ghost {
  border: 1px solid var(--border-hover);
  color: var(--text-muted);
}
.btn--ghost:hover {
  border-color: var(--text-muted);
  color: var(--text);
  background: rgba(255,255,255,.04);
}

/* ── SECTIONS ───────────────────────────────────────────────── */
.section {
  padding: var(--sp-2xl) 0;
}
.section--alt {
  background: var(--bg-2);
}
.section__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: .04em;
  text-align: center;
  margin-bottom: var(--sp-sm);
}
.section__lead {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto var(--sp-xl);
}

/* ── GAMES GRID ─────────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-md);
}
.game-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg) var(--sp-md);
  text-align: center;
  transition: all var(--t-normal);
  overflow: hidden;
}
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--t-normal);
}
.game-card--featured::before {
  background: radial-gradient(ellipse at 50% 0%, var(--accent-glow), transparent 70%);
}
.game-card--featured {
  border-color: rgba(201,168,76,.15);
}
.game-card--featured:hover {
  border-color: rgba(201,168,76,.35);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 0 30px var(--accent-glow);
}
.game-card--featured:hover::before { opacity: 1; }

.game-card--soon {
  opacity: .6;
  border-style: dashed;
}

.game-card__badge {
  position: absolute;
  top: var(--sp-sm);
  right: var(--sp-sm);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .2rem .6rem;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #000;
}
.badge--soon {
  background: var(--text-dim);
  color: var(--bg);
}
.game-card__icon {
  font-size: 3rem;
  margin-bottom: var(--sp-sm);
  position: relative;
  z-index: 1;
}
.game-card__title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: .04em;
  margin-bottom: var(--sp-xs);
  position: relative;
  z-index: 1;
}
.game-card__tagline {
  font-size: .85rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .03em;
  margin-bottom: var(--sp-sm);
  position: relative;
  z-index: 1;
}
.game-card--soon .game-card__tagline {
  color: var(--text-dim);
}
.game-card__desc {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.6;
  position: relative;
  z-index: 1;
}
.game-card__link {
  display: inline-block;
  margin-top: var(--sp-md);
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: .03em;
  transition: color var(--t-fast);
  position: relative;
  z-index: 1;
}
.game-card--featured:hover .game-card__link {
  color: var(--accent);
}

/* ── ABOUT GRID ─────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--sp-md);
}
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg) var(--sp-md);
  text-align: center;
  transition: border-color var(--t-normal);
}
.about-card:hover {
  border-color: var(--border-hover);
}
.about-card__icon {
  font-size: 2.4rem;
  margin-bottom: var(--sp-sm);
}
.about-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: .04em;
  margin-bottom: var(--sp-xs);
}
.about-card p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── NEWSLETTER ─────────────────────────────────────────────── */
.newsletter-placeholder {
  text-align: center;
  padding: var(--sp-lg);
  border: 1px dashed var(--border-hover);
  border-radius: var(--r-lg);
  background: var(--bg-card);
}
.newsletter-note {
  font-size: .95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-xl) 0 var(--sp-lg);
}
.footer__inner {
  text-align: center;
}
.footer__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--sp-xs);
}
.footer__tagline {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-md);
}
.footer__copy {
  font-size: .75rem;
  color: var(--text-dim);
}

/* ── REVEAL ANIMATIONS ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1),
              transform .7s cubic-bezier(.16,1,.3,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.reveal:nth-child(2) { transition-delay: .08s; }
.reveal:nth-child(3) { transition-delay: .16s; }
.reveal:nth-child(4) { transition-delay: .24s; }

@keyframes bounce-down {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: .4; }
  50% { transform: translateX(-50%) translateY(10px); opacity: .8; }
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links { gap: var(--sp-md); }
  .nav-links a { font-size: .75rem; }
  .hero__lead { font-size: 1rem; }
  .hero__cta { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 280px; justify-content: center; }
  .games-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
}
