:root {
  color-scheme: dark;
  --bg: #16181d;
  --panel: #1e2128;
  --border: #2c303a;
  --text: #e6e8ec;
  --text-dim: #9aa0ac;
  --accent: #6551c9;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 24px;
  height: 24px;
}

.topnav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.topnav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
}

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

/* ── Account (sign in) ──────────────────────────────────── */
.account {
  position: relative;
  margin-left: 20px;
}

.account-trigger {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: white;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.account-trigger:hover,
.account-trigger[aria-expanded="true"] {
  border-color: var(--accent);
}

.account-trigger.is-signed-in {
  background: var(--accent);
  border-color: var(--accent);
}

.account-icon {
  display: block;
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.account-trigger:hover .account-icon,
.account-trigger[aria-expanded="true"] .account-icon {
  opacity: 1;
}

.account-menu,
.account-note {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.account-menu {
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--border);
}

.account-menu-email {
  margin: 0;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.account-menu-item {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu-item:hover {
  background: var(--bg);
}

.account-note {
  width: 240px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #7a3a3a;
  color: #ff8a8a;
  font-size: 13px;
}

.beta-banner {
  padding: 8px 24px;
  background: #3a2f14;
  border-bottom: 1px solid #5c4a1e;
  color: #e8c777;
  font-size: 13px;
  text-align: center;
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 32px 0 0 0;
}

.hero-copy {
  flex: 1;
  min-width: 0;
}

.hero-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero h1 {
  font-size: 56px;
  line-height: 1.1;
  margin: 0 0 16px;
}

.hero-tagline {
  font-size: 19px;
  color: var(--text-dim);
  margin: 0 0 28px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-art {
  flex-shrink: 0;
  width: 320px;
}

.hero-art img {
  display: block;
  width: 100%;
  border-radius: 12px;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
}

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

.btn-secondary {
  border-width: 3px;
  border-color: var(--accent);
  color: white;
  background: none;
}
.btn-primary:hover {
  filter: brightness(1.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

.btn-ghost {
  background: var(--panel);
  color: var(--text);
}

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

/* ── Sections ───────────────────────────────────────────── */
section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

section h2 {
  font-size: 28px;
  margin: 0 0 8px;
}

.section-sub {
  color: var(--text-dim);
  margin: 0 0 40px;
  max-width: 560px;
}

/* ── Features ───────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-grid-title {
  grid-column: 1 / -1;
  margin: 24px 0 0;
  font-size: 20px;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
}

.feature-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: -22px -22px 16px;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.feature-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  object-fit: cover;
}

.feature-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.feature-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* ── Pricing ────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pricing-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pricing-card--highlight {
  border-color: var(--accent);
  margin: -10px 0;
}

.pricing-card h3 {
  margin: 0;
  font-size: 18px;
}

.pricing-price {
  margin: 4px 0 12px;
  font-size: 22px;
  font-weight: 700;
}

.pricing-price-was {
  margin-right: 6px;
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 400;
  text-decoration: line-through;
}

.pricing-desc {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 14px;
}

.pricing-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  color: var(--text-dim);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pricing-list li {
  padding-left: 20px;
  position: relative;
}

.pricing-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.pricing-card .btn {
  margin-top: auto;
  text-align: center;
}

/* ── Gallery ────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.gallery-grid img {
  display: block;
  width: 100%;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* ── Download ───────────────────────────────────────────── */
.download-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.version-pill {
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}

.download-panel-copy h3 {
  margin: 0 0 6px;
}

.download-panel-copy p {
  margin: 0;
  color: var(--text-dim);
}

.download-panel-copy .download-note {
  color: #e8c777;
  font-weight: 600;
}

.download-panel-platforms {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.btn-platform {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: min(220px, 100%);
  padding: 24px 32px;
  font-size: 16px;
}

.btn-platform-icon {
  display: block;
  width: 32px;
  height: 32px;
  filter: brightness(0) invert(1);
}

.btn-platform-os {
  margin-top: -6px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
}

.btn-platform--disabled {
  background: var(--panel);
  border-style: dashed;
  border-color: var(--border);
  color: var(--text-dim);
  cursor: not-allowed;
  user-select: none;
}

.btn-platform--disabled .btn-platform-icon {
  filter: none;
  opacity: 0.35;
}

.btn-platform--disabled .btn-platform-os {
  opacity: 0.7;
}

.download-panel-secondary {
  display: flex;
  justify-content: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.download-panel-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
}

.download-panel-link:hover {
  color: var(--text);
}

/* ── Community / footer ────────────────────────────────── */
.community-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.community-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--brand);
  border: 1px solid var(--brand);
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.community-link:hover {
  filter: brightness(1.1);
}

.community-link-icon {
  display: block;
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.community-link--discord {
  --brand: #5865f2;
}

.community-link--bluesky {
  --brand: #1185fe;
}

.community-link--youtube {
  --brand: #ff0000;
}

.community-link--itch {
  --brand: #fa5c5c;
}

.community-link--wiki {
  --brand: var(--accent);
}

footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

footer a {
  color: var(--text-dim);
}

/* ── Checkout ───────────────────────────────────────────── */
.checkout-error {
  margin: 12px 0 0;
  color: #ff8a8a;
  font-size: 13px;
}

.checkout-error[hidden] {
  display: none;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 800px) {
  .topnav {
    display: none;
  }

  .account {
    margin-left: auto;
  }

  .hero {
    flex-direction: column;
    padding: 48px 0;
    text-align: center;
  }

  .hero-copy {
    order: 2;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero-tagline {
    max-width: none;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-art {
    order: 1;
    width: 220px;
  }

  .feature-grid,
  .pricing-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .download-panel {
    flex-direction: column;
    align-items: flex-start;
  }
}
