/* ============================================================
   GAMESTACK.FUN — Design tokens
   Soft pastel, Duolingo-adjacent warmth, built around the brand's
   literal "stack" — practical life skills you collect one card
   at a time.
   ============================================================ */

:root {
  /* --- Core palette (from logo) --- */
  --ink: #14152b;              /* headline text, "Game" in logo */
  --ink-soft: #3d3e58;
  --muted: #6b6d85;
  --bg: #faf8fc;               /* warm lavender-white, page bg */
  --surface: #ffffff;
  --border: #eae7f5;

  --purple: #7c3aed;
  --pink: #ec4899;
  --orange: #f97316;
  --yellow: #fbbf24;

  --brand-gradient: linear-gradient(100deg, var(--purple) 0%, var(--pink) 45%, var(--orange) 75%, var(--yellow) 100%);

  /* --- Pastel skill-card tints (signature system) --- */
  --mint: #dcf5e8;      --mint-deep: #1f9d68;
  --peach: #ffe8d9;     --peach-deep: #e8672a;
  --lavender: #ece4ff;  --lavender-deep: #7c3aed;
  --sky: #dceeff;       --sky-deep: #2483d6;
  --rose: #ffe1ec;      --rose-deep: #e23b73;
  --butter: #fff3d0;    --butter-deep: #c98a12;

  /* --- Type --- */
  --font-display: 'Baloo 2', ui-rounded, 'Segoe UI', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', sans-serif;

  /* --- Layout --- */
  --nav-width: 236px;
  --nav-height-mobile: 64px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 2px 4px rgba(20, 21, 43, 0.04), 0 8px 20px rgba(20, 21, 43, 0.06);
  --shadow-nav: 1px 0 0 var(--border);
  --content-max: 1180px;
}

/* ============================================================
   Reset & base
   ============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Guarantees the native `hidden` attribute always wins over any
   component's `display:` rule, on this page and every future one.
   Without this, any element styled with display:flex/grid/block that
   also uses [hidden] to toggle visibility will show up incorrectly. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  margin: 0;
}

p { line-height: 1.65; margin: 0; }

:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 999;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   App shell — left sidebar (desktop) / bottom bar (mobile)
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar / primary nav ---- */
.site-nav {
  width: var(--nav-width);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  z-index: 200;
}

.nav-logo {
  display: block;
  padding: 6px 8px 20px;
}
.nav-logo img {
  width: 100%;
  max-width: 168px;
  height: auto;
}

.nav-search {
  position: relative;
  margin-bottom: 18px;
}
.nav-search input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.nav-search input::placeholder { color: var(--muted); font-weight: 600; }
.nav-search input:focus { border-color: var(--purple); outline: none; background: var(--surface); }
.nav-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-links .nav-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 12px 8px;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-links a svg { flex-shrink: 0; color: var(--muted); transition: color 0.15s ease; }
.nav-links a:hover { background: var(--lavender); color: var(--purple); }
.nav-links a:hover svg { color: var(--purple); }
.nav-links a.active {
  background: var(--lavender);
  color: var(--purple);
}
.nav-links a.active svg { color: var(--purple); }

.nav-cta {
  margin-top: auto;
  padding-top: 18px;
}
.nav-cta .btn { width: 100%; }

/* ---- Mobile bottom-bar variant of the same nav ---- */
.mobile-topbar { display: none; }
.mobile-bottom-nav { display: none; }

/* ============================================================
   Main column
   ============================================================ */
.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content-grid {
  flex: 1;
  width: 100%;
  max-width: calc(var(--content-max) + 300px);
  margin: 0 auto;
  padding: 36px 40px 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 44px;
  align-items: start;
}

.content-main { min-width: 0; }

.rail { position: sticky; top: 28px; display: flex; flex-direction: column; gap: 20px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 6px 18px rgba(236, 73, 153, 0.28);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(236, 73, 153, 0.38); transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--purple); color: var(--purple); }

/* ============================================================
   Hero — signature "skill stack" visual
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 36px;
  align-items: center;
  padding: 20px 0 44px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--lavender);
  color: var(--purple);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pink); }

.hero h1 {
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hero h1 .grad {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lede {
  margin-top: 16px;
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.hero-note {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 700;
}

/* --- The stack itself --- */
.skill-stack {
  position: relative;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-card {
  position: absolute;
  width: 230px;
  padding: 20px 20px 22px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(20, 21, 43, 0.04);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease;
}

.skill-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: rgba(255,255,255,0.6);
}

.skill-card .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}
.skill-card .tag {
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0.75;
}

.skill-card.c1 { background: var(--butter); color: #6b4e05; transform: rotate(-9deg) translate(-86px, 34px); z-index: 1; }
.skill-card.c2 { background: var(--sky);    color: #123a5c; transform: rotate(-3deg) translate(-30px, -6px); z-index: 2; }
.skill-card.c3 { background: var(--rose);   color: #6b1436; transform: rotate(4deg)  translate(34px, -44px); z-index: 3; }
.skill-card.c4 { background: var(--mint);   color: #0e5636; transform: rotate(10deg) translate(90px, 4px);  z-index: 4; }

.hero:hover .skill-card.c1 { transform: rotate(-13deg) translate(-108px, 46px); }
.hero:hover .skill-card.c2 { transform: rotate(-5deg) translate(-42px, 6px); }
.hero:hover .skill-card.c3 { transform: rotate(6deg) translate(46px, -58px); }
.hero:hover .skill-card.c4 { transform: rotate(14deg) translate(112px, 18px); }

@media (prefers-reduced-motion: reduce) {
  .skill-card { transition: none; }
}

/* ============================================================
   Section scaffolding
   ============================================================ */
.section { padding: 46px 0; border-top: 1px solid var(--border); }
.section:first-of-type { border-top: none; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 26px; font-weight: 800; }
.section-head .section-sub { color: var(--muted); font-size: 14.5px; font-weight: 600; margin-top: 6px; }
.section-link { font-weight: 800; font-size: 14px; color: var(--purple); white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

/* ============================================================
   Category grid
   ============================================================ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.category-card {
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 34px;
  min-height: 148px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  border: 1px solid rgba(20,21,43,0.04);
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }

.category-card .icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,0.55);
  display: flex; align-items: center; justify-content: center;
}
.category-card .cat-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.category-card .cat-count { font-size: 12.5px; font-weight: 700; opacity: 0.7; margin-top: 2px; }

.category-card.tone-mint     { background: var(--mint);     color: #0e5636; }
.category-card.tone-peach    { background: var(--peach);    color: #7a3311; }
.category-card.tone-lavender { background: var(--lavender); color: #4a2496; }
.category-card.tone-sky      { background: var(--sky);      color: #123a5c; }
.category-card.tone-rose     { background: var(--rose);     color: #6b1436; }
.category-card.tone-butter   { background: var(--butter);   color: #6b4e05; }

/* ============================================================
   Games grid
   ============================================================ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: transparent; }

.game-thumb {
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.game-thumb .thumb-icon { width: 46px; height: 46px; opacity: 0.85; }
.game-thumb .badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(2px);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--ink-soft);
}

.game-body { padding: 14px 16px 16px; }
.game-body .g-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.game-body .g-desc { font-size: 13.5px; color: var(--muted); font-weight: 600; line-height: 1.5; margin-bottom: 10px; min-height: 40px; }
.game-body .g-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 800; color: var(--muted); }
.game-body .g-meta .g-play { color: var(--purple); display: flex; align-items: center; gap: 4px; }

.thumb-mint { background: linear-gradient(160deg, var(--mint), #eefbf3); }
.thumb-peach { background: linear-gradient(160deg, var(--peach), #fff4ea); }
.thumb-lavender { background: linear-gradient(160deg, var(--lavender), #f5f0ff); }
.thumb-sky { background: linear-gradient(160deg, var(--sky), #eef7ff); }
.thumb-rose { background: linear-gradient(160deg, var(--rose), #fff0f5); }
.thumb-butter { background: linear-gradient(160deg, var(--butter), #fffaea); }

/* ============================================================
   "Why practical games" — crawlable text block
   ============================================================ */
.why-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.why-block h2 { font-size: 26px; margin-bottom: 14px; }
.why-block p { color: var(--ink-soft); margin-bottom: 14px; }
.why-block p:last-child { margin-bottom: 0; }

.why-points { display: flex; flex-direction: column; gap: 16px; }
.why-point { display: flex; gap: 14px; }
.why-point .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--purple);
  background: var(--lavender);
  width: 30px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.why-point h4 { font-size: 15px; margin-bottom: 3px; }
.why-point p { font-size: 13.5px; color: var(--muted); }

/* ============================================================
   Audience strip
   ============================================================ */
.audience-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.audience-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  background: var(--surface);
}
.audience-item .a-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--lavender);
  color: var(--purple);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.audience-item h4 { font-size: 14.5px; margin-bottom: 4px; }
.audience-item p { font-size: 12.5px; color: var(--muted); }

/* ============================================================
   CTA banner
   ============================================================ */
.cta-banner {
  background: var(--brand-gradient);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
  flex-wrap: wrap;
}
.cta-banner h2 { color: #fff; font-size: 24px; margin-bottom: 8px; }
.cta-banner p { color: rgba(255,255,255,0.9); font-weight: 600; font-size: 14.5px; }
.cta-banner .btn-ghost { background: #fff; color: var(--ink); border: none; }

/* ============================================================
   Ad rail slots (placeholders — wire up real AdSense units later)
   ============================================================ */
.ad-slot {
  border: 1.5px dashed #d7d3e8;
  border-radius: var(--radius-md);
  background: var(--surface);
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.ad-slot .ad-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.7; }

.rail-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--surface);
}
.rail-card h4 { font-size: 14.5px; margin-bottom: 8px; }
.rail-card p { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* ============================================================
   Legal / long-form text pages (Terms, Privacy Policy, etc.)
   ============================================================ */
.legal-doc {
  max-width: 720px;
}
.legal-doc h2 {
  font-size: 20px;
  margin-top: 34px;
  margin-bottom: 12px;
}
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc p {
  color: var(--ink-soft);
  margin-bottom: 14px;
  font-size: 15px;
}
.legal-doc ul {
  margin: 0 0 14px;
  padding-left: 22px;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legal-doc li {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}
.legal-doc a { color: var(--purple); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.legal-doc a:hover { color: var(--pink); }
.legal-doc strong { color: var(--ink); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 20px;
}
.footer-inner {
  max-width: calc(var(--content-max) + 300px);
  margin: 0 auto;
  padding: 40px 40px 30px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 30px;
  padding-bottom: 30px;
}
.footer-brand img { width: 150px; margin-bottom: 12px; }
.footer-brand p { font-size: 13.5px; color: var(--muted); max-width: 34ch; }
.footer-col h5 {
  font-family: var(--font-display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col a { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.footer-col a:hover { color: var(--purple); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}
.footer-bottom .coppa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--mint);
  color: #0e5636;
  padding: 5px 11px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 11.5px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .content-grid { grid-template-columns: 1fr; }
  .rail { position: static; flex-direction: row; overflow-x: auto; }
  .rail .ad-slot { min-width: 260px; }
  .rail .rail-card { min-width: 220px; }
  .why-block { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .skill-stack { height: 300px; order: -1; }
}

@media (max-width: 840px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .audience-strip { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .app-shell { flex-direction: column; }

  .site-nav { display: none; }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 150;
  }
  .mobile-topbar img { width: 118px; }
  .mobile-topbar .icon-btn {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-soft);
    border: 1px solid var(--border);
  }

  .content-grid { padding: 22px 18px 90px; }
  .hero { padding: 10px 0 30px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }

  /* Bottom sticky nav bar */
  .mobile-bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: var(--nav-height-mobile);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 800;
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 10px;
  }
  .mobile-bottom-nav a.active { color: var(--purple); }
  .mobile-bottom-nav a svg { width: 21px; height: 21px; }

  .footer-top { grid-template-columns: 1fr; gap: 22px; }
  .footer-inner { padding: 30px 18px 100px; }
}

@media (max-width: 520px) {
  .category-grid { grid-template-columns: 1fr 1fr; }
  .games-grid { grid-template-columns: 1fr 1fr; }
  .audience-strip { grid-template-columns: 1fr 1fr; }
}

/* Phones: the overlapping fan doesn't have room to stay legible,
   so the same four cards lay out as a simple, un-rotated 2x2 grid
   instead. The fan stays reserved for screens with room to breathe. */
@media (max-width: 640px) {
  .skill-stack {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 6px 0 10px;
  }
  .skill-card,
  .hero:hover .skill-card {
    position: static;
    width: auto;
    transform: none !important;
  }
}
