/* ==========================================================================
   GamesToVibe — shared stylesheet
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------ */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --maxw: 1080px;
  --radius: 14px;
  --gap: 28px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Light theme (default) */
  --bg: #fafafa;
  --bg-elev: #ffffff;
  --text: #16161a;
  --text-soft: #6b6b73;
  --text-faint: #9a9aa2;
  --border: #ececef;
  --border-strong: #dededf;
  --accent: #16161a;
  --shadow: 0 1px 2px rgba(16, 16, 22, 0.04), 0 8px 24px rgba(16, 16, 22, 0.06);
  --shadow-hover: 0 2px 6px rgba(16, 16, 22, 0.06),
    0 16px 40px rgba(16, 16, 22, 0.12);
}

html[data-theme="dark"] {
  --bg: #0d0d10;
  --bg-elev: #16161a;
  --text: #f3f3f5;
  --text-soft: #a0a0a8;
  --text-faint: #6c6c75;
  --border: #242429;
  --border-strong: #313138;
  --accent: #f3f3f5;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* ---- Reset / base ------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

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

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

::selection {
  background: var(--text);
  color: var(--bg);
}

/* ---- Layout shell ------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.site-main {
  min-height: 60vh;
  padding: 64px 0 96px;
}

/* ---- Header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-icon {
  flex-shrink: 0;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  color: var(--text-soft);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav a:hover {
  color: var(--text);
  background: var(--border);
}

.nav a.active {
  color: var(--text);
}

/* ---- Theme toggle ------------------------------------------------------- */
.theme-toggle {
  margin-left: 6px;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text-soft);
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-faint);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

/* show sun in dark mode, moon in light mode */
.theme-toggle .icon-sun {
  display: none;
}
html[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* ---- Hero / page intro -------------------------------------------------- */
.intro {
  max-width: 640px;
  margin-bottom: 56px;
}

.intro .eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 16px;
}

.intro h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.intro p {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-soft);
}

/* ---- Games grid --------------------------------------------------------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.game-card {
  display: flex;
  flex-direction: column;
}

.game-card .thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

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

.game-card .thumb::after {
  content: "Play ▸";
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #fff;
  background: rgba(16, 16, 22, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 6px 11px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.game-card .thumb:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

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

.game-card .thumb:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* fallback shown when an image is missing/broken */
.game-card .thumb .fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-faint);
  background: var(--bg-elev);
}

.game-card .meta {
  padding: 18px 4px 0;
}

.game-card h3 {
  margin: 0 0 7px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.game-card h3 a {
  transition: color 0.2s var(--ease);
}

.game-card h3 a:hover {
  color: var(--text-soft);
}

.game-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-soft);
}

/* play count badge */
.game-card .plays-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  background: rgba(16, 16, 22, 0.6);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.game-card .plays-badge:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}
.game-card .plays-badge:empty {
  display: none;
}

.game-card .plays-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(54, 224, 192);
  box-shadow: 0 0 7px rgb(54, 224, 192);
}

/* ---- Featured game (hero banner) ----------------------------------------- */
.featured-game {
  margin-bottom: 56px;
}

.badge-featured {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.featured-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--gap);
}

.featured-card .thumb {
  aspect-ratio: 16 / 9;
}

.featured-card .meta {
  padding: 0;
}

.featured-card h3 {
  font-size: clamp(22px, 3vw, 30px);
  margin-bottom: 10px;
}

.featured-card p {
  font-size: 15px;
}

/* "new" badge on a game's thumbnail (top-left; plays-badge owns top-right) */
.game-card .thumb .badge-new {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(54, 224, 192);
  background: rgba(16, 16, 22, 0.6);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* ---- Empty state -------------------------------------------------------- */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 0;
  color: var(--text-faint);
  font-size: 15px;
}

/* ---- Prose pages (about, terms, privacy, contact) ----------------------- */
.prose {
  max-width: 680px;
}

.prose h1 {
  font-size: clamp(28px, 4.5vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0 0 8px;
}

.prose .lede {
  font-size: 17px;
  color: var(--text-soft);
  margin: 0 0 44px;
}

.prose h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
}

.prose p {
  color: var(--text-soft);
  margin: 0 0 18px;
}

.prose ul {
  color: var(--text-soft);
  padding-left: 20px;
  margin: 0 0 18px;
}

.prose li {
  margin-bottom: 8px;
}

.prose a.inline {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
  transition: text-decoration-color 0.2s var(--ease);
}

.prose a.inline:hover {
  text-decoration-color: var(--text);
}

.prose .updated {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ---- Contact button ----------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--bg);
  background: var(--accent);
  padding: 12px 20px;
  border-radius: 10px;
  transition: opacity 0.2s var(--ease);
}

.btn:hover {
  opacity: 0.88;
}

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer .copy {
  font-size: 13px;
  color: var(--text-faint);
}

.site-footer nav {
  display: flex;
  gap: 22px;
}

.site-footer nav a {
  font-size: 13px;
  color: var(--text-soft);
  transition: color 0.2s var(--ease);
}

.site-footer nav a:hover {
  color: var(--text);
}

.site-footer .social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-footer .social a {
  display: inline-flex;
  color: var(--text-soft);
  transition: color 0.2s var(--ease);
}

.site-footer .social a:hover {
  color: var(--text);
}

.site-footer .social svg {
  width: 19px;
  height: 19px;
  display: block;
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 620px) {
  .wrap {
    padding: 0 20px;
  }
  .site-main {
    padding: 44px 0 72px;
  }
  .nav a {
    padding: 8px 9px;
  }
  .brand-icon {
    width: 88px;
    height: 44px;
  }
  .games-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .featured-card {
    grid-template-columns: 1fr;
  }
  .site-footer .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---- vibe-coding SEO copy ---------------------------------------------- */
/* small genre tag under a game-card title */
.card-tag {
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* prose-style content sections (homepage explainer, cornerstone page) */
.about-vibe,
.vibe-games {
  max-width: 700px;
  margin-top: 56px;
}

.vibe-games {
  max-width: none;
}

.about-vibe h2,
.vibe-games h2 {
  margin: 0 0 16px;
  font-size: clamp(22px, 3.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.about-vibe h3 {
  margin: 22px 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.about-vibe p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-soft);
}

/* allow .inline links outside .prose (intro, explainer, cornerstone) */
.intro a.inline,
.about-vibe a.inline {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
  transition: text-decoration-color 0.2s var(--ease);
}

.intro a.inline:hover,
.about-vibe a.inline:hover {
  text-decoration-color: var(--text);
}
