/*
 * subpage.css — shared stylesheet for all aiplaysgames-site subpages.
 *
 * Loaded after /static/brand.css in every subpage HTML file.
 * NEVER hard-code hex colors, rgba() literals, or pixel radii here —
 * use var(--*) tokens from brand.css only.  See AGENTS.md PINNED RULE #3.
 *
 * Page-specific prose color scoping: add class="page-prose" to <main> on
 * any page whose body <p> / <li> elements should render in var(--text-muted)
 * (currently: why/, how-it-works/, press/).
 */

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

/* ── Page shell ───────────────────────────────────────── */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.6;
}

/* Fixed header + scrollable body (all site-chrome subpages). Top-bar / .brand-logo
   placement lives ONLY in /static/brand.css — see HEADER-LOCKUP.snippet.html. */
body.site-chrome {
  padding-top: var(--top-bar-h, var(--brand-header-height));
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

body.site-chrome .page {
  padding: 24px 20px 64px;
}

@media (min-width: 720px) {
  body.site-chrome .page {
    padding: 32px 24px 80px;
  }
}

/* ── Back nav link ────────────────────────────────────── */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 40px;
}
.back:hover { color: var(--text); }

/* ── Headings ─────────────────────────────────────────── */
h1 {
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 700;
  margin: 0 0 20px;
  line-height: 1.2;
}

h2 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 32px 0 14px;
}

/* Homepage-aligned titles on site-chrome pages (mirror style.css .faq-card__title). */
.page-heading,
.section-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(16px, 4vw, 20px);
  line-height: 2.2;
  word-spacing: -0.45em;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  text-transform: none;
}

.section-title {
  font-size: 13px;
  margin: 28px 0 10px;
}

.page-intro {
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
}

.page-intro p {
  margin: 0 0 12px;
}

.page-intro p:last-child {
  margin-bottom: 0;
}

.page-intro a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.page-intro a:hover {
  color: var(--text);
}

/* ── Lede panel ───────────────────────────────────────── */
.lede {
  font-size: 16px;
  line-height: 1.75;
  margin: 0 0 40px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius);
}
.lede p { margin: 0 0 12px; }
.lede p:last-child { margin-bottom: 0; }

/* ── Body prose, scoped to .body class (game / agent pages) ── */
p.body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 16px;
}
p.body strong { color: var(--text); font-weight: 600; }

/* ── Body prose, scoped to pages that opt in via .page-prose ── */
/* Add class="page-prose" to <main> on why/, how-it-works/, press/. */
.page-prose p,
.page-prose li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}
.page-prose p { margin: 0 0 16px; }
.page-prose p strong,
.page-prose li strong { color: var(--text); font-weight: 600; }

/* ── Bulleted lists (how-it-works / press) ────────────── */
ul.body-list {
  padding-left: 20px;
  margin: 0 0 20px;
}
ul.body-list li { margin-bottom: 8px; }

/* Unclassed links inside body-list items (press page) */
.body-list a { color: var(--accent); text-decoration: none; }
.body-list a:hover { color: var(--text); }

/* ── More / CTA links ─────────────────────────────────── */
.more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 0;
  margin-right: 18px;
}
.more-link:hover { color: var(--text); }

/* Inline variant: resets padding/margin when .more-link is
   embedded inside body prose (agents/*/index.html). */
.more-link--reset { margin: 0; padding: 0; }

/* ── Shows grid (about + agent pages) ────────────────── */
.shows-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.show-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s;
}
.show-item:hover {
  background: var(--panel-hover);
  border-color: var(--panel-stroke-strong);
}
.show-item__cta {
  color: var(--accent);
  font-size: 12px;
  flex-shrink: 0;
}

/* ── How-it-works numbered list (about page) ─────────── */
.how-list {
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.how-list li {
  display: flex;
  gap: 12px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}
.step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* ── Prompt CTA block (game pages) ───────────────────── */
.prompt-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s;
  margin: 8px 0 24px;
}
.prompt-cta:hover {
  background: var(--panel-hover);
  border-color: var(--panel-stroke-strong);
}
.prompt-cta__cta {
  color: var(--accent);
  font-size: 12px;
  flex-shrink: 0;
}

/* ── Cross-links footer (game pages) ─────────────────── */
.cross-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--panel-stroke);
}
.cross-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 0;
}
.cross-links a:hover { color: var(--text); }


/* ── Body copy block (agent pages) ───────────────────── */
.body-copy {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-muted);
}
.body-copy p { margin: 0 0 14px; }
.body-copy p:last-child { margin-bottom: 0; }

/* Inline links within body-copy prose (agent pages) */
.body-copy a { color: var(--accent); text-decoration: none; }
.body-copy a:hover { color: var(--text); }

/* ── Homepage feed cards (keep in sync with style.css) ─── */
.faq-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-card__item {
  background: var(--panel-2);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-card__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq-card__question::-webkit-details-marker {
  display: none;
}

.faq-card__question::after {
  content: "+";
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.faq-card__item[open] .faq-card__question::after {
  content: "−";
}

.faq-card__answer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-muted);
}

.faq-card__answer p {
  margin: 0;
}

.faq-card__answer a {
  color: var(--accent);
  text-decoration: none;
}

.faq-card__answer a:hover {
  color: var(--text);
}

.faq-card__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.faq-card__more::after {
  content: "⟶";
  display: block;
  line-height: 1;
  align-self: center;
  font-family: "Segoe UI Symbol", "Noto Sans Math", system-ui, sans-serif;
  transform: translateY(-0.1em);
}

.faq-card__more:hover {
  color: var(--text);
}

.join-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

a.join-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  transition: border-color 150ms ease, background 150ms ease;
}

a.join-card__row:hover {
  border-color: var(--panel-stroke-strong);
  background: var(--panel-hover);
}

.join-card__row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.join-card__label {
  min-width: 0;
}

.join-card__arrow {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
}

/* Numbered steps on /about/ (panel rows, homepage density). */
.steps-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.steps-list__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
}

.steps-list__num {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
