/*
  The one stylesheet every page in this site links to. Keeping it singular is
  deliberate: five hand-written pages plus two partials drift apart fast if
  each carries its own <style> block, the way the reference sites did. One
  file means one place to fix a color or a breakpoint.

  Light and dark both live here, switched by prefers-color-scheme rather than
  a class, because a static marketing site has no script that could toggle a
  class before first paint without a flash of the wrong theme.
*/

:root {
  color-scheme: light dark;
  --bg: #f9fafe;
  --surface: #ffffff;
  --fg: #16171b;
  --muted: #5c6270;
  --line: #e2e4e9;
  --accent: #4d4bd1;
  --accent-contrast: #ffffff;
  --radius: 0.75rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080a10;
    --surface: #1a1b21;
    --fg: #eceef2;
    --muted: #9aa0ad;
    --line: #2b2d35;
    --accent-contrast: #0b0b0d;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent);
}

code {
  font-size: 0.9em;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Content columns. Prose pages read best narrow; the landing page earns a
   wider column because it has room-filling sections rather than paragraphs. */
.prose {
  width: min(100% - 3rem, 44rem);
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.wide {
  width: min(100% - 3rem, 60rem);
  margin: 0 auto;
}

.prose h1 {
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}

.prose h2 {
  font-size: 1.15rem;
  margin: 2.25rem 0 0.5rem;
}

.prose h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.35rem;
}

.prose .updated {
  color: var(--muted);
  margin: 0 0 2rem;
  font-size: 0.95rem;
}

.prose .lead {
  font-size: 1.1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, black);
}

.btn-secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--fg);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: clamp(3rem, 8vw, 5rem) 0 2.5rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  line-height: 1.1;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.hero .tagline {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.hero .lead {
  max-width: 38rem;
  margin: 0;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* Feature grid */
.features {
  padding: 2.5rem 0;
}

.features h2,
.pricing h2,
.faq h2,
.store-row-section h2 {
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
  letter-spacing: -0.01em;
}

.features-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--surface);
}

.feature h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Store row and pricing */
.store-row-section,
.pricing {
  padding: 1rem 0 2.5rem;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.price-line {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.25rem 1.5rem;
  max-width: 32rem;
}

.price-line strong {
  color: var(--fg);
}

/* FAQ */
.faq {
  padding: 1rem 0 3rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 600;
  list-style: none;
}

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

.faq-item[open] summary {
  border-bottom: 1px solid var(--line);
}

.faq-item p {
  padding: 0 1.25rem 1rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
}

/* Callout box, used for auto-renewal and deletion caveats */
.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
}

.callout p {
  margin: 0;
}

/* Tables, used by privacy and credits */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.95rem;
}

th,
td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: color-mix(in srgb, var(--line) 45%, transparent);
}

.scroll {
  overflow-x: auto;
}

/* Footer, shared by every page through partials/footer.html */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding: 1.75rem 0;
}

.site-footer .wide,
.site-footer .prose {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer nav a {
  color: inherit;
  text-decoration: none;
  margin: 0 0.4rem;
}

.site-footer nav a:hover {
  text-decoration: underline;
}

/* Analytics consent bar, built by analytics.js only after the visitor agrees */
.consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.25rem;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.consent p {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
}

.consent__actions {
  display: flex;
  gap: 0.5rem;
}

.consent button {
  font: inherit;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.consent__yes {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

@media (min-width: 640px) {
  .hero .tagline {
    font-size: 1.3rem;
  }
}

/* Hero art, used on the landing page above the title. Capped rather than
   full-bleed so it stays a single <img>, no separate mobile crop needed. */
.hero-art {
  display: block;
  width: 100%;
  max-width: 32rem;
  border-radius: var(--radius);
  margin: 0 0 1.75rem;
}

/* The four-beat core loop, shown on the landing page and echoed in the guide. */
.loop-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  font-weight: 600;
}

.loop-steps li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Breadcrumb trail on the content pages (guide, FAQ, worlds, the idle-RPG
   explainer) and the legal pages. */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.breadcrumb a {
  color: inherit;
}

/* Definition lists, used by the FAQ and the guide glossary. */
.prose dt {
  font-weight: 600;
  margin-top: 1.1rem;
}

.prose dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.prose .cta-line {
  margin-top: 2.5rem;
}
