/* ==========================================================
   Vibe-Coded Games Research — corporate marketing-style page
   Inspired by the redditinc.com tone: clean, generous, orange-accented.
   ========================================================== */

:root {
  --orange: #FF4500;
  --orange-soft: #FFE3D6;
  --ink: #0B0B0C;
  --ink-2: #1A1A1B;
  --gray-1: #F8F8F8;
  --gray-2: #EEEEEE;
  --gray-3: #D7D7D7;
  --gray-4: #888888;
  --gray-5: #4F4F4F;
  --link: #0B5CD8;
  --max-w: 1180px;
  --narrow-w: 780px;
  --radius: 8px;
}

* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
code { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; background: var(--gray-1); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--gray-2); }
em { font-style: italic; }

/* ----- Nav ----- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--gray-2);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 700; font-size: 15px;
}
.nav-brand:hover { text-decoration: none; }
.nav-logo {
  width: 28px; height: 28px;
  background: var(--orange); color: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}
.nav-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 22px;
}
.nav-links a {
  color: var(--ink-2); font-weight: 500; font-size: 14px;
}
.nav-links a:hover { color: var(--orange); text-decoration: none; }
@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ----- Document header ----- */
.doc {
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 24px 56px;
}
.doc-head { margin-bottom: 40px; }
.doc-meta {
  font-size: 13px;
  color: var(--gray-4);
  margin: 0 0 18px;
  letter-spacing: 0.1px;
}
.doc-meta a { color: var(--gray-5); }
.doc-title {
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--ink);
}
.doc-lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--gray-5);
  margin: 0 0 16px;
  max-width: 64ch;
}
.doc-lede:last-of-type { margin-bottom: 0; }
.doc-lede a { color: var(--gray-5); border-bottom: 1px solid var(--gray-3); }
.doc-lede em { color: var(--ink); font-style: italic; }
.doc-lede-2 { color: var(--gray-5); }
.doc-lede-2 strong { color: var(--ink); font-weight: 700; }

.doc-section { margin-top: 36px; }
.doc-h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gray-4);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-2);
}
.doc-list {
  margin: 0; padding: 0 0 0 22px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
}
.doc-list li { margin-bottom: 16px; }
.doc-list li::marker { color: var(--gray-4); font-weight: 600; }
.doc-list strong { color: var(--ink); font-weight: 700; }
.doc-list span[data-stat] { font-weight: 600; color: var(--ink); white-space: nowrap; }
.doc-list a {
  color: var(--ink-2);
  border-bottom: 1px solid var(--gray-3);
}
.doc-list a:hover { color: var(--orange); border-color: var(--orange); text-decoration: none; }

/* "In short" — tight factual bullets, no embellishment */
.doc-shortlist {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--gray-2);
}
.doc-shortlist li {
  padding: 10px 0 10px 22px;
  position: relative;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
  border-bottom: 1px solid var(--gray-2);
}
.doc-shortlist li::before {
  content: "";
  position: absolute;
  left: 0; top: 18px;
  width: 8px; height: 1px;
  background: var(--gray-4);
}
.doc-shortlist span[data-stat] {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.doc-prose {
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-5);
  margin: 0 0 24px;
  max-width: 65ch;
}
.doc-prose a { color: var(--ink-2); border-bottom: 1px solid var(--gray-3); }

.doc-caveat {
  margin: 28px 0 0;
  padding: 14px 16px;
  background: #FFF6E6;
  border-left: 3px solid #F5A623;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}
.doc-caveat strong { color: var(--ink); }

/* Implications: claim → evidence */
.implications { margin: 0; padding: 0; }
.impl-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 18px 0;
  border-top: 1px solid var(--gray-2);
}
.impl-row:last-child { border-bottom: 1px solid var(--gray-2); }
.implications dt {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.35;
}
.implications dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-5);
}
.implications dd span[data-stat] { font-weight: 600; color: var(--ink); white-space: nowrap; }

@media (min-width: 720px) {
  .impl-row {
    grid-template-columns: 38% 1fr;
    gap: 28px;
    align-items: baseline;
  }
}

.doc-jump {
  margin: 28px 0 0;
  padding: 14px 16px;
  background: var(--gray-1);
  border-radius: 6px;
  font-size: 14px;
  color: var(--gray-5);
}
.doc-jump a { color: var(--ink-2); border-bottom: 1px solid var(--gray-3); }
.doc-jump a:hover { color: var(--orange); border-color: var(--orange); text-decoration: none; }

/* ----- Sections ----- */
.section { padding: 56px 24px; border-top: 1px solid var(--gray-2); }
@media (max-width: 720px) { .section { padding: 44px 20px; } }
.section-light { background: #fff; }
.section-tinted { background: var(--gray-1); }

.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-inner.narrow { max-width: var(--narrow-w); }

.section-head { margin-bottom: 32px; }
.section-h2 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
}
.section-head .section-sub {
  font-size: 15px; color: var(--gray-5);
  max-width: 60ch;
  margin: 0;
}

/* ----- Charts ----- */
.charts-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
@media (max-width: 720px) { .charts-grid { grid-template-columns: 1fr; } }
.chart-card {
  background: #fff;
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 26px;
}
.chart-title {
  margin: 0 0 4px;
  font-size: 18px; font-weight: 700;
}
.chart-sub {
  margin: 0 0 18px;
  font-size: 14px; color: var(--gray-4);
}
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 36px; align-items: center; gap: 12px; }
.bar-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.bar-track {
  height: 10px; background: var(--gray-2);
  border-radius: 999px; overflow: hidden;
}
.bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), #FF8B00);
}
.bar-count { font-size: 13px; font-weight: 700; color: var(--gray-5); text-align: right; }

/* ----- Prose ----- */
.prose p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--gray-5);
  margin: 0 0 18px;
}
.prose p strong { color: var(--ink); }
.prose .caveat {
  border-left: 3px solid var(--orange);
  padding-left: 14px;
  font-size: 15px;
  color: var(--ink-2);
  background: var(--orange-soft);
  border-radius: 0 6px 6px 0;
  padding: 14px 18px;
}

/* ----- Browse controls ----- */
.browse-controls {
  display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.browse-controls input[type="search"] {
  flex: 1; min-width: 240px;
  height: 40px;
  background: #fff;
  border: 1px solid var(--gray-3);
  color: var(--ink);
  border-radius: 6px;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
}
.browse-controls input[type="search"]::placeholder { color: var(--gray-4); }
.browse-controls input[type="search"]:focus {
  border-color: var(--ink);
}
.sort-tabs {
  display: flex; gap: 2px;
  background: #fff;
  border: 1px solid var(--gray-3);
  border-radius: 6px;
  padding: 3px;
}
.tab {
  background: transparent;
  border: none;
  color: var(--gray-5);
  font-weight: 600; font-size: 13px;
  padding: 6px 12px;
  border-radius: 4px;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--ink); color: #fff; }

/* ----- Post list ----- */
.post-list { display: flex; flex-direction: column; gap: 8px; }
.loading, .empty {
  background: #fff;
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 28px; text-align: center; color: var(--gray-4);
}
.post {
  background: #fff;
  border: 1px solid var(--gray-2);
  border-radius: 6px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  cursor: pointer;
  transition: border-color .1s ease;
}
.post:hover { border-color: var(--ink); }
.post-vote {
  background: var(--gray-1);
  border-radius: 6px;
  padding: 8px 4px;
  text-align: center;
  align-self: start;
}
.post-vote .arrow {
  width: 0; height: 0;
  margin: 0 auto;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
}
.post-vote .arrow.up { border-bottom: 6px solid var(--gray-3); margin-bottom: 3px; }
.post-vote .arrow.down { border-top: 6px solid var(--gray-3); margin-top: 3px; }
.post-vote .vote-count {
  font-weight: 700; font-size: 13px; color: var(--ink);
}
.post-main { min-width: 0; }
.post-meta {
  font-size: 12px; color: var(--gray-4);
  margin-bottom: 4px;
}
.post-title {
  font-size: 16px; font-weight: 600; line-height: 1.3;
  color: var(--ink);
  margin: 0 0 6px;
  word-break: break-word;
}
.post-preview {
  color: var(--gray-5);
  font-size: 13px;
  margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--gray-4);
}
.post-actions .badge {
  background: var(--gray-1);
  border: 1px solid var(--gray-2);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

/* ----- Data download cards ----- */
.data-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
@media (max-width: 880px) { .data-grid { grid-template-columns: 1fr; } }
.data-card {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 26px;
  color: var(--ink);
  transition: border-color .12s ease, transform .12s ease;
}
.data-card:hover {
  border-color: var(--orange);
  text-decoration: none;
  transform: translateY(-2px);
}
.data-card-icon {
  width: 44px; height: 44px;
  background: var(--orange-soft);
  color: var(--orange);
  border-radius: 10px;
  font-weight: 800; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.data-card h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.data-card p { margin: 0 0 18px; font-size: 14px; color: var(--gray-5); }
.data-card-cta {
  margin-top: auto;
  font-size: 13px; font-weight: 700;
  color: var(--orange);
}

.data-snippet {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  overflow: hidden;
}
.data-snippet-head {
  background: rgba(255,255,255,0.08);
  padding: 12px 18px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.data-snippet pre {
  margin: 0;
  padding: 18px 22px;
  font-size: 13px; line-height: 1.6;
  overflow-x: auto;
  color: #fff;
}
.data-snippet code {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
}

/* ----- Modal ----- */
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 100;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11,11,12,0.72);
  backdrop-filter: blur(3px);
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 760px;
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  overflow: hidden;
  margin-bottom: 40px;
}
.modal-header {
  position: sticky; top: 0;
  background: #fff;
  display: flex; justify-content: flex-end;
  padding: 8px;
  border-bottom: 1px solid var(--gray-2);
  z-index: 1;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 26px;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--gray-4);
  line-height: 1;
}
.modal-close:hover { background: var(--gray-1); color: var(--ink); }
.modal-body { padding: 6px 28px 28px; }

.detail-meta { color: var(--gray-4); font-size: 13px; margin: 6px 0 14px; }
.detail-title {
  font-size: 26px; font-weight: 800; line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--ink);
}
.detail-stats {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 13px; font-weight: 700;
  color: var(--gray-5);
  margin-bottom: 18px;
}
.detail-stats .badge {
  background: var(--gray-1);
  border: 1px solid var(--gray-2);
  padding: 5px 11px;
  border-radius: 999px;
}
.detail-body {
  font-size: 15px;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--gray-1);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 16px 18px;
  line-height: 1.65;
}
.detail-actions {
  display: flex; gap: 10px;
  margin: 18px 0 22px;
  flex-wrap: wrap;
}
.btn-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink); color: #fff;
  font-weight: 700; font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
}
.btn-link:hover { background: #000; text-decoration: none; }
.btn-link.secondary {
  background: #fff; color: var(--ink);
  border: 1px solid var(--gray-3);
}
.btn-link.secondary:hover { background: var(--gray-1); }

.comments-header {
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  margin: 22px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-2);
}
.comment {
  border-left: 3px solid var(--gray-2);
  padding: 8px 0 8px 14px;
  margin-bottom: 14px;
}
.comment-meta {
  font-size: 12px;
  color: var(--gray-4);
  margin-bottom: 4px;
}
.comment-meta strong { color: var(--ink); font-weight: 700; }
.comment-meta .score { color: var(--orange); font-weight: 800; margin-right: 6px; }
.comment-text { font-size: 14px; color: var(--ink-2); word-break: break-word; }
.no-comments { color: var(--gray-4); font-style: italic; padding: 8px 0; }

/* ----- Footer ----- */
.footer {
  background: #fff;
  border-top: 1px solid var(--gray-2);
  padding: 36px 24px;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.footer-note { font-size: 13px; color: var(--gray-4); margin: 0; }
