/* =========================================================================
   Design tokens
   Dark grey base with amber/mint/coral accents pulled from the logo and
   the app's own level badges / unlocked states.
   ========================================================================= */
:root {
  --navy-950: #121212;
  --navy-900: #1B1B1B;
  --navy-800: #262626;
  --navy-700: #333333;
  --panel: #212121;
  --panel-line: rgba(255, 255, 255, 0.12);

  --amber: #F2A93B;
  --amber-dim: #C98A2A;
  --mint: #4FD1C5;
  --coral: #EF6F6C;

  --ink: #F5F3ED;
  --ink-dim: #B4B4B4;
  --ink-faint: #8A8A8A;

  --serif: "Fraunces", "Iowan Old Style", serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--navy-900);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Subtle board-square texture behind the whole page, echoing the checkers
   / sudoku grids in the actual games instead of a generic gradient blob. */
body {
  background-image:
    linear-gradient(var(--navy-900), var(--navy-900)),
    repeating-conic-gradient(rgba(150,150,150,0.035) 0% 25%, transparent 0% 50%);
  background-size: auto, 64px 64px;
  background-position: 0 0, 0 0;
}

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

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0 0 0.4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.05; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.15; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; max-width: 62ch; color: var(--ink-dim); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------------
   Nav
   --------------------------------------------------------------------- */
.site-nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(15, 17, 48, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-line);
}
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.25rem; text-decoration: none; }
.brand-logo { height: 52px; width: auto; display: block; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--amber), var(--coral));
  position: relative; flex-shrink: 0;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 6px;
  background: var(--navy-900); border-radius: 4px;
}
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--ink-dim); font-weight: 700; font-size: 1.05rem; padding: 6px 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); border-color: var(--amber); }
.nav-soon { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; color: var(--ink-faint); background: rgba(150,150,150,0.15); padding: 1px 6px; border-radius: 999px; margin-left: 5px; vertical-align: 2px; }
.nav-cta { display: none; }
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-links { position: absolute; top: 84px; left: 0; right: 0; background: var(--navy-950); flex-direction: column; gap: 0; border-bottom: 1px solid var(--panel-line); max-height: 0; overflow: hidden; transition: max-height .2s ease; }
  .nav-links.open { max-height: 360px; }
  .nav-links a { display: block; padding: 14px 24px; border-bottom: 1px solid var(--panel-line); }
  .nav-toggle { display: block; background: none; border: 0; color: var(--ink); font-size: 1.6rem; cursor: pointer; }
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 0.95rem; text-decoration: none;
  padding: 12px 22px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-amber { background: var(--amber); color: var(--navy-950); }
.btn-amber:hover { background: #ffbc55; }
.btn-outline { border-color: var(--panel-line); color: var(--ink); }
.btn-outline:hover { border-color: var(--amber); }
.btn-mint { background: var(--mint); color: var(--navy-950); }

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero { padding: 96px 0 64px; position: relative; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.eyebrow-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--panel-line);
  padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; color: var(--amber);
  font-weight: 700; margin-bottom: 20px;
}
.eyebrow-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.hero p.lede { font-size: 1.15rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

/* A little "board" illustration built from CSS only: a checkers/sudoku
   hybrid grid with a couple of pieces, standing in for a screenshot. */
.hero-board {
  aspect-ratio: 1; border-radius: 20px; overflow: hidden;
  display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(6, 1fr);
  border: 1px solid var(--panel-line);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.55);
  transform: rotate(2deg);
}
.hero-board .sq { background: var(--panel); }
.hero-board .sq.dark { background: var(--navy-700); }
.hero-board .sq.piece::after {
  content: ""; display: block; width: 62%; height: 62%; margin: 19% auto; border-radius: 50%;
}
.hero-board .sq.piece.amber::after { background: var(--amber); }
.hero-board .sq.piece.mint::after { background: var(--mint); }
.hero-board .sq.piece.coral::after { background: var(--coral); }

/* ---------------------------------------------------------------------
   Section headers
   --------------------------------------------------------------------- */
.section { padding: 72px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head p { margin: 0; }

/* ---------------------------------------------------------------------
   Game tiles — corner notches suggest interlocking puzzle pieces
   without a fussy clip-path.
   --------------------------------------------------------------------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.game-card {
  background: var(--panel); border: 1px solid var(--panel-line);
  border-radius: var(--radius); padding: 22px; position: relative;
  text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s ease, transform .15s ease;
}
.game-card:hover { border-color: var(--amber); transform: translateY(-3px); }
.game-card::before, .game-card::after {
  content: ""; position: absolute; width: 16px; height: 16px; background: var(--navy-900);
  border-radius: 50%; top: -8px;
}
.game-card::before { left: 22px; }
.game-card::after { right: 22px; }
.game-icon { font-size: 1.8rem; }
.game-card h3 { margin-bottom: 2px; }
.game-tag { font-size: 0.78rem; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.game-desc { font-size: 0.92rem; margin: 4px 0 6px; }
.ladder-dots { display: flex; gap: 4px; margin-top: auto; }
.ladder-dots span { width: 9px; height: 9px; border-radius: 2px; background: var(--navy-700); }
.ladder-dots span.on { background: var(--mint); }
.game-links { display: flex; gap: 10px; margin-top: 8px; }
.game-links a { font-size: 0.85rem; font-weight: 700; color: var(--amber); text-decoration: none; }
.game-links a:hover { text-decoration: underline; }

/* Single app-level download banner (Games section) — one product, many
   games inside it, so only this gets store links, not each game card. */
.app-banner {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(242,169,59,0.1), rgba(239,111,108,0.06));
  border: 1px solid rgba(242,169,59,0.35); border-radius: var(--radius);
  padding: 24px 28px; margin-bottom: 28px;
}
.app-banner-icon {
  width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
  background: var(--panel); display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
}
.app-banner-copy { flex: 1 1 260px; }
.app-banner-copy h3 { margin: 4px 0 4px; }
.app-banner-copy p { margin: 0; font-size: 0.92rem; }
.app-banner-links { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   Cohort ladder strip — a real depiction of the game's own progression
   system, used as a hook rather than a generic "how it works" list.
   --------------------------------------------------------------------- */
.ladder-strip { display: flex; align-items: center; overflow-x: auto; padding: 8px 4px 18px; gap: 0; }
.ladder-node { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 108px; }
.ladder-node .badge {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.1rem; border: 2px solid var(--panel-line); color: var(--ink-faint);
}
.ladder-node.unlocked .badge { border-color: var(--amber); color: var(--amber); background: rgba(242,169,59,0.1); }
.ladder-node .name { font-size: 0.78rem; text-align: center; color: var(--ink-dim); font-weight: 600; }
.ladder-connector { flex: 1 1 32px; height: 2px; background: var(--panel-line); min-width: 24px; }
.ladder-connector.unlocked { background: var(--amber); }

/* ---------------------------------------------------------------------
   Blog / devlog
   --------------------------------------------------------------------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.post-card { background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--ink); display: block; }
.post-card:hover { border-color: var(--mint); }
.post-cat { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mint); }
.post-date { font-size: 0.82rem; color: var(--ink-faint); }
.post-card h3 { margin: 8px 0 6px; }

.post-body { max-width: 68ch; margin: 0 auto; }
.post-body h2 { margin-top: 1.4em; }
.post-body p, .post-body li { color: var(--ink-dim); }
.post-hero-meta { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }

/* ---------------------------------------------------------------------
   Community
   --------------------------------------------------------------------- */
.community-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.community-card { background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); padding: 26px; }
.community-card h3 { margin-bottom: 6px; }
.feedback-embed { background: var(--panel); border: 1px dashed var(--panel-line); border-radius: var(--radius); padding: 40px 24px; text-align: center; color: var(--ink-faint); }

.faq-item { border-bottom: 1px solid var(--panel-line); padding: 18px 0; }
.faq-q { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 700; }
.faq-q .plus { color: var(--amber); font-size: 1.3rem; transition: transform .15s ease; }
.faq-item.open .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .2s ease; }
.faq-item.open .faq-a { max-height: 240px; }
.faq-a p { padding-top: 10px; }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--panel-line); padding: 40px 0; margin-top: 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 22px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.footer-links a { text-decoration: none; color: var(--ink-dim); font-size: 0.9rem; }
.footer-links a:hover { color: var(--amber); }
.social-icons { display: flex; gap: 12px; }
.social-icons a {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--panel-line); color: var(--ink-dim);
  transition: color .15s ease, border-color .15s ease, transform .15s ease;
}
.social-icons a:hover { color: var(--amber); border-color: var(--amber); transform: translateY(-2px); }
.social-icons svg { width: 17px; height: 17px; fill: currentColor; }
.fine { color: var(--ink-faint); font-size: 0.85rem; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-board { max-width: 360px; margin: 0 auto; }
}

/* ---------------------------------------------------------------------
   Category cards (homepage "what we build")
   --------------------------------------------------------------------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.cat-card {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius);
  padding: 26px; text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, transform .15s ease;
}
.cat-card:hover { transform: translateY(-3px); }
.cat-card .cat-icon { font-size: 1.9rem; margin-bottom: 10px; display: block; }
.cat-card h3 { margin-bottom: 4px; }
.cat-card p { font-size: 0.92rem; margin-bottom: 10px; }
.cat-card.games { border-color: rgba(242,169,59,0.4); }
.cat-card.games:hover { border-color: var(--amber); }
.cat-card.video { border-color: rgba(79,209,197,0.4); }
.cat-card.video:hover { border-color: var(--mint); }
.cat-card.podcasts { border-color: rgba(239,111,108,0.35); }
.cat-card.podcasts:hover { border-color: var(--coral); }
.cat-card.drama { border-color: rgba(150,150,150,0.35); }
.cat-card.drama:hover { border-color: var(--ink-dim); }

.status-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px;
}
.status-badge.live { background: rgba(79,209,197,0.15); color: var(--mint); }
.status-badge.soon { background: rgba(150,150,150,0.15); color: var(--ink-faint); }

/* ---------------------------------------------------------------------
   Apps page — category filter tabs
   --------------------------------------------------------------------- */
.tab-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 32px; }
.tab-btn {
  background: var(--panel); border: 1px solid var(--panel-line); color: var(--ink-dim);
  font-weight: 700; font-size: 0.88rem; padding: 9px 18px; border-radius: 999px;
  cursor: pointer; transition: all .15s ease;
}
.tab-btn:hover { border-color: var(--amber); color: var(--ink); }
.tab-btn.active { background: var(--amber); border-color: var(--amber); color: var(--navy-950); }
.app-section { display: none; }
.app-section.active { display: block; }
.coming-soon-card {
  background: var(--panel); border: 1px dashed var(--panel-line); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; gap: 8px;
}

/* ---------------------------------------------------------------------
   Motion: scroll reveal, hero entrance, tab fade, button feedback.
   Everything here respects prefers-reduced-motion at the bottom.
   --------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

@keyframes heroIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.hero > .wrap > * { animation: heroIn .7s cubic-bezier(.2,.7,.2,1) both; }
.hero > .wrap > *:nth-child(2) { animation-delay: .08s; }

/* Tactile press feedback on every clickable control. */
.btn:active { transform: scale(0.96); }
.tab-btn:active { transform: scale(0.96); }
.game-card:active, .cat-card:active, .post-card:active { transform: scale(0.985); }

/* Smooth fade when switching app-category tabs instead of an instant cut. */
.app-section { display: none; opacity: 0; transition: opacity .25s ease; }
.app-section.active { display: block; }
.app-section.active.shown { opacity: 1; }

/* Sticky nav is 68px tall — give anchor-linked targets breathing room so
   a jump-link doesn't tuck the target's top edge under the nav bar. */
.game-card, .cat-card, .post-card, .app-section, .faq-item { scroll-margin-top: 108px; }

/* Keyboard-accessible focus ring, visible only for keyboard users. */
a:focus-visible, button:focus-visible, .tab-btn:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px;
}

/* Skip-to-content link: invisible until a keyboard user tabs to it. */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--amber); color: var(--navy-950); font-weight: 800;
  padding: 10px 18px; border-radius: 8px; text-decoration: none; transition: top .2s ease;
}
.skip-link:focus { top: 16px; }

/* Back-to-top button */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 45;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--panel-line); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, border-color .15s ease;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,0.5);
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { border-color: var(--amber); color: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .hero > .wrap > *, .app-section, .to-top, .btn, .tab-btn, .game-card, .cat-card, .post-card {
    animation: none !important; transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}
