/* Spaceman Productions site styles.
   Colours are variables so light/dark themes and the editable accent colour
   (Settings → Site settings) apply everywhere. */

:root {
  --accent: #6c5ce7;
  --bg: #ffffff;
  --surface: #f4f4f8;
  --text: #16161d;
  --muted: #55556a;
  --border: #d4d4de;
  --focus: #0b57d0;
  --radius: 0.5rem;
  --max-width: 72rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e16;
    --surface: #1a1a26;
    --text: #ececf4;
    --muted: #a8a8bc;
    --border: #34344a;
    --focus: #8ab4ff;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e0e16;
  --surface: #1a1a26;
  --text: #ececf4;
  --muted: #a8a8bc;
  --border: #34344a;
  --focus: #8ab4ff;
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  /* Keep the footer at the bottom of short pages. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

[hidden] { display: none !important; }

img { max-width: 100%; height: auto; }

a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 2px; }
a:hover { color: var(--accent); }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -10rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--text); color: var(--bg);
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

main:focus { outline: none; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 2rem 1rem; }
.container--narrow { max-width: 48rem; }

/* Header and navigation */

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
}
.site-logo { font-weight: 700; font-size: 1.25rem; text-decoration: none; }
.site-logo img { display: block; height: 3rem; width: auto; }

/* Logo, account links and theme switch share the top row; the menu gets its own row. */
.site-logo { margin-right: auto; }
.site-nav { flex-basis: 100%; order: 3; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav__list { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.site-nav__item { position: relative; display: flex; align-items: center; }
.site-nav a, .site-nav button {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  text-decoration: none;
}
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); }
.site-nav button, .theme-switch button {
  font: inherit; color: inherit; background: none; border: 1px solid transparent; cursor: pointer;
}
.site-nav button:hover, .site-nav a:hover { background: var(--bg); color: var(--text); }
.dropdown-toggle::after { content: " ▾"; }
.dropdown {
  position: absolute; top: 100%; left: 0; z-index: 10;
  min-width: 12rem;
  padding: 0.25rem !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.15);
}
.site-nav__toggle { display: none !important; border-color: var(--border) !important; }

.theme-switch { display: flex; gap: 0.25rem; }
.theme-switch button { padding: 0.35rem 0.6rem; border-radius: var(--radius); border-color: var(--border); font-size: 0.875rem; }
.theme-switch button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

@media (max-width: 48rem) {
  .site-nav__toggle { display: block !important; }
  .site-nav__list { flex-direction: column; margin-top: 0.5rem !important; }
  .site-nav__item { flex-wrap: wrap; }
  .dropdown { position: static; box-shadow: none; flex-basis: 100%; }
}

/* Footer */

.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.site-footer__columns {
  max-width: var(--max-width); margin: 0 auto; padding: 2rem 1rem;
  display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}
.site-footer h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.25rem 0; }
.site-footer__bottom {
  max-width: var(--max-width); margin: 0 auto; padding: 1rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem;
}
.site-footer__bottom p { margin: 0; }
.site-footer__bottom ul { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Content blocks */

.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.button {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  font: inherit; font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button--primary { background: var(--accent); color: #fff; }
.button--primary:hover { color: #fff; filter: brightness(1.1); }
.button--secondary { background: transparent; color: var(--text); }

.hero {
  display: grid; gap: 2rem; align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  padding: 2rem 0 3rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.15; margin: 0 0 1rem; }
.hero__image img { border-radius: var(--radius); }

.figure { margin: 2rem 0; }
.figure img { border-radius: var(--radius); }
figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

.cards__grid {
  list-style: none; padding: 0;
  display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.card img { border-radius: calc(var(--radius) / 2); }
.card h3 { margin: 0.75rem 0 0.25rem; }

.faq details { border-bottom: 1px solid var(--border); padding: 0.75rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }

.quote { margin: 2rem 0; padding-left: 1.25rem; border-left: 4px solid var(--accent); }
.quote blockquote { margin: 0; font-size: 1.2rem; }

.video iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }

.intro { font-size: 1.2rem; color: var(--muted); }

form[role="search"] { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
form[role="search"] label { flex-basis: 100%; }
input[type="search"] {
  flex: 1; min-width: 12rem;
  padding: 0.6rem; font: inherit;
  color: var(--text); background: var(--bg);
  border: 2px solid var(--border); border-radius: var(--radius);
}
.search-results { list-style: none; padding: 0; }
.pagination { display: flex; gap: 1rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* News */

.post-list { list-style: none; padding: 0; }
.post-list__item { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.post-list__item article > :last-child { margin-bottom: 0; }
.post-list__title { margin: 0 0 0.25rem; font-size: 1.35rem; }
.latest-news .post-list__title { font-size: 1.15rem; }
.post-meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.5rem; }
.post-meta a { color: var(--muted); }
.post-meta__sep { margin: 0 0.35rem; }
.category-filter ul, .post-tags ul, .pagination ul {
  list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.category-filter a {
  display: inline-block; padding: 0.3rem 0.8rem;
  border: 1px solid var(--border); border-radius: 999px; text-decoration: none;
}
.category-filter a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.news-search { margin: 1.5rem 0; }
.filter-status { background: var(--surface); padding: 0.75rem 1rem; border-radius: var(--radius); }
.pagination { flex-direction: column; margin-top: 1.5rem; }
.pagination p { margin: 0; color: var(--muted); }
.post-tags { margin-top: 2rem; }
.post-nav { margin-top: 2rem; }

/* Forms */

.site-form { margin-top: 1.5rem; }
.form-field { margin-bottom: 1.25rem; }
.form-field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.form-field .helptext { display: block; color: var(--muted); font-size: 0.9rem; }
.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.6rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.form-field textarea { min-height: 10rem; }
.form-field fieldset { border: 0; padding: 0; margin: 0; }
.form-field legend { font-weight: 600; margin-bottom: 0.35rem; padding: 0; }
.form-field ul, .form-field fieldset > div { list-style: none; padding: 0; }
.form-field ul label { font-weight: normal; display: inline; }
.form-field--error input, .form-field--error select, .form-field--error textarea { border-color: #c62828; }
.errorlist { color: #c62828; padding: 0; list-style: none; margin: 0.25rem 0; font-weight: 600; }
:root[data-theme="dark"] .errorlist { color: #ff8a80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .errorlist { color: #ff8a80; } }
.form-error-summary { border: 3px solid #c62828; border-radius: var(--radius); padding: 1rem; margin-bottom: 1.5rem; }
.form-error-summary h2 { margin-top: 0; font-size: 1.15rem; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Audio and gallery blocks */

.audio { margin: 2rem 0; padding: 1rem; background: var(--surface); border-radius: var(--radius); }
.audio figcaption { font-weight: 600; color: var(--text); margin: 0 0 0.5rem; }
.audio audio { width: 100%; }
.audio__description { color: var(--muted); margin-bottom: 0; }
.gallery__grid {
  list-style: none; padding: 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}
.gallery figure { margin: 0; }
.gallery img { border-radius: var(--radius); display: block; }

/* Games */

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.badge--released, .badge--maintained, .badge--completed { border-color: #2e7d32; }
.badge--early_access, .badge--testing, .badge--in_progress { border-color: var(--accent); }
.badge--discontinued, .badge--cancelled, .badge--blocked, .badge--paused { border-color: #c62828; }
.game-card h2, .game-card h3 { margin: 0.75rem 0 0.35rem; font-size: 1.2rem; }
.game-card p { margin: 0.5rem 0 0; }
.game-group { margin-bottom: 2.5rem; }
.game-group__description { color: var(--muted); }
.game-header {
  display: grid; gap: 2rem; align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  margin-bottom: 2rem;
}
.game-header h1 { margin: 0 0 0.5rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; }
.game-header__series { margin: 0; color: var(--muted); font-weight: 600; }
.game-header__image img { border-radius: var(--radius); display: block; }
.game-layout { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
.game-layout__side > section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem;
}
.game-layout__side h2 { font-size: 1.1rem; margin-top: 0; }
.download-box .button { width: 100%; text-align: center; }
.download-box__meta { color: var(--muted); font-size: 0.9rem; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin: 0.35rem 0; }
@media (max-width: 56rem) { .game-layout { grid-template-columns: 1fr; } }
.release { border-bottom: 1px solid var(--border); padding-bottom: 1rem; }

/* DevHub */

.progress { margin: 0.5rem 0 1rem; }
.progress__label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.progress progress { width: 100%; height: 0.75rem; accent-color: var(--accent); }
.devbook-status { margin: 0.5rem 0; }
.task-list { list-style: none; padding: 0; }
.task { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.task__name { margin: 0 0 0.25rem; }
.task__updates summary { cursor: pointer; font-weight: 600; }
.update { border-left: 3px solid var(--border); padding-left: 1rem; margin: 1rem 0; }
.update__title { margin: 0 0 0.25rem; }

/* Accounts and messages */

.account-links { display: flex; align-items: center; gap: 0.75rem; }
.account-links form { margin: 0; }
.button--small { padding: 0.35rem 0.8rem; font-size: 0.9rem; }
.template-auth main > :not(.messages) { max-width: 48rem; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
.template-auth main { padding-top: 2rem; }
.messages { padding-bottom: 0 !important; }
.message { padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--surface); border-left: 4px solid var(--accent); margin: 0 0 0.5rem; }
.message--error { border-left-color: #c62828; }
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); border: 2px solid #c62828; margin-bottom: 1rem; }
.account-section { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.details-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; }
.details-list dt { font-weight: 600; }
.details-list dd { margin: 0; }

/* Store */

.currency-switcher { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1rem 0 2rem; }
.currency-switcher select, .site-form select, .season-picker select {
  padding: 0.4rem; font: inherit; color: var(--text); background: var(--bg);
  border: 2px solid var(--border); border-radius: var(--radius);
}
.plans {
  list-style: none; padding: 0;
  display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}
.plan { border: 2px solid var(--border); border-radius: var(--radius); padding: 1.25rem; background: var(--surface); }
.plan--highlighted { border-color: var(--accent); }
.plan h2 { margin-top: 0; }
.plan__features { padding-left: 1.25rem; }
.plan__periods, .licenses__table { width: 100%; border-collapse: collapse; }
.plan__periods th, .plan__periods td, .licenses__table th, .licenses__table td {
  text-align: left; padding: 0.6rem 0.4rem; border-top: 1px solid var(--border); vertical-align: middle;
}
.plan__periods thead th, .licenses__table thead th { border-top: 0; font-size: 0.85rem; color: var(--muted); }
.plan__days { color: var(--muted); font-size: 0.85rem; font-weight: normal; }
.licenses { margin-top: 3rem; }
.order-summary { background: var(--surface); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.order-summary h2 { margin-top: 0; }
.discount-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.discount-form .form-field { margin: 0; flex: 1; min-width: 12rem; }
.checkout-note { color: var(--muted); font-size: 0.9rem; margin-top: 1rem; }
.order-status { font-size: 1.15rem; font-weight: 600; padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--surface); border-left: 4px solid var(--accent); }
.order-status--paid { border-left-color: #2e7d32; }
.order-status--failed, .order-status--cancelled, .order-status--refunded { border-left-color: #c62828; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border); }
.data-table thead th { color: var(--muted); font-size: 0.85rem; }
.nav-badge { font-size: 0.75rem; font-weight: 600; padding: 0.05rem 0.4rem; border-radius: 999px; background: var(--accent); color: #fff; margin-left: 0.25rem; }
.vault-progress progress { width: 100%; height: 1rem; accent-color: var(--accent); }
.credit-balance { font-size: 1.2rem; }
.rating-form fieldset { border: 0; padding: 0; margin: 0 0 0.75rem; }
.rating-form legend { font-weight: 600; margin-bottom: 0.35rem; }
.rating-form label { margin-right: 0.75rem; }
.checkbox-field { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-field label { font-weight: normal !important; margin: 0 !important; }
.checkbox-field input { width: 1.15rem; height: 1.15rem; }

/* Leaderboards */
.breadcrumb { margin: 1rem 0 0; color: var(--muted); }
.season-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1rem 0 0.25rem; }
.season-status { color: var(--muted); }
.leaderboard-game { margin: 2rem 0; }
.data-table caption { text-align: left; font-weight: 600; padding-bottom: 0.25rem; }
.leaderboard-table th[scope="row"] { font-weight: normal; }
.leaderboard-table tr.is-me { background: var(--surface); font-weight: 600; }
.my-place { font-weight: 600; }
.achievement-list { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.achievement { display: flex; gap: 0.75rem; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; }
.achievement h3 { margin: 0; font-size: 1.05rem; }
.achievement p { margin: 0.25rem 0 0; }
.achievement--unlocked { border-color: var(--accent); }
.achievement__meta { color: var(--muted); font-size: 0.9rem; }

/* Launcher sign-ins on the account page */
.sign-in-list { list-style: none; padding: 0; }
.sign-in-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.inline-form { display: inline; margin-left: 0.5rem; }

/* Game categories on cards and game pages. */
.game-card__categories, .game-header__categories { color: var(--muted); font-size: 0.9rem; }
