:root {
  --bg: #0f0b18;
  --bg-card: #1a1428;
  --bg-soft: #241c36;
  --text: #f4f0ff;
  --muted: #b8aed4;
  --accent: #ff4d4d;
  --accent-2: #7c5cff;
  --accent-3: #ff9f43;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --max: 980px;
  --legal-max: 820px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(124, 92, 255, 0.18), transparent 32%),
    radial-gradient(circle at top left, rgba(255, 77, 77, 0.12), transparent 28%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a {
  color: #c9b8ff;
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(15, 11, 24, 0.88);
  border-bottom: 1px solid var(--border);
}

.site-header-inner,
.page-shell,
.site-footer-inner {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  box-shadow: var(--shadow);
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 1.05rem;
}

.brand p {
  color: var(--muted);
  font-size: 0.85rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  font-size: 0.92rem;
}

.hero {
  padding: 3rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.hero h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff6b6b);
  color: white;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  color: var(--text);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-top: 0;
}

.muted { color: var(--muted); }

.page-shell {
  padding: 2rem 0 4rem;
}

.page-shell.legal {
  width: min(calc(100% - 2rem), var(--legal-max));
}

.section {
  margin: 3rem 0;
}

.section h2,
.section h3 {
  scroll-margin-top: 5rem;
}

.section h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.section h3 {
  margin-top: 2rem;
  color: #efe8ff;
}

.feature-list,
.legal-list {
  padding-left: 1.2rem;
}

.feature-list li,
.legal-list li {
  margin: 0.45rem 0;
}

.toc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
}

.toc ol {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 2rem;
}

.toc li { break-inside: avoid; margin: 0.35rem 0; }

.screenshot {
  margin: 1.25rem 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.screenshot img {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto;
}

.screenshot figcaption {
  padding: 0.85rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  border-top: 1px solid var(--border);
}

.screenshot-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.18);
  border: 1px solid rgba(124, 92, 255, 0.35);
  font-size: 0.82rem;
}

.badge.orange {
  background: rgba(255, 159, 67, 0.16);
  border-color: rgba(255, 159, 67, 0.35);
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}

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

th {
  background: var(--bg-soft);
}

.callout {
  border-left: 4px solid var(--accent-2);
  background: rgba(124, 92, 255, 0.08);
  padding: 1rem 1.1rem;
  border-radius: 0 12px 12px 0;
  margin: 1rem 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer a { color: #d9ccff; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
  nav { display: none; }
}

@media print {
  :root {
    --bg: #ffffff;
    --bg-card: #ffffff;
    --bg-soft: #ececf1;
    --text: #111111;
    --muted: #444444;
    --border: #999999;
    --shadow: none;
  }

  body {
    background: #ffffff !important;
    color: #111111 !important;
  }

  .site-header,
  .site-footer,
  .hero-actions,
  nav {
    display: none !important;
  }

  a {
    color: #111111;
    text-decoration: none;
  }

  h2,
  h3,
  strong {
    color: #111111 !important;
  }

  h3 {
    color: #222222 !important;
  }

  .muted,
  .screenshot figcaption,
  .site-footer,
  .toc,
  .toc a {
    color: #444444 !important;
  }

  .card,
  .screenshot,
  .toc,
  table,
  .callout,
  .table-wrap {
    break-inside: avoid;
    box-shadow: none !important;
    background: #ffffff !important;
    border: 1px solid #999999 !important;
  }

  .toc {
    background: #f6f6f8 !important;
  }

  .callout {
    background: #f3f0ff !important;
    border: 1px solid #999999 !important;
    border-left: 4px solid #5a3dcc !important;
    color: #111111 !important;
  }

  table {
    width: 100%;
    border-collapse: collapse !important;
    border: 1px solid #666666 !important;
  }

  th,
  td {
    padding: 0.75rem 0.85rem !important;
    border: 1px solid #666666 !important;
    color: #111111 !important;
    background: #ffffff !important;
    vertical-align: top;
  }

  th {
    background: #ececf1 !important;
    font-weight: 700;
  }

  tbody tr:nth-child(even) td {
    background: #f8f8fa !important;
  }

  .badge {
    background: #f3f3f3 !important;
    border: 1px solid #777777 !important;
    color: #111111 !important;
  }

  .badge.orange {
    background: #fff4e5 !important;
    border-color: #b36b00 !important;
    color: #111111 !important;
  }

  .screenshot img {
    max-width: 280px;
  }

  .screenshot figcaption {
    border-top: 1px solid #999999 !important;
    background: #f6f6f8 !important;
  }

  .screenshot-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  code {
    background: #f0f0f0;
    border: 1px solid #bbbbbb;
    padding: 0.08em 0.35em;
    border-radius: 4px;
    color: #111111;
  }
}
