:root {
  color-scheme: light;
  --primary: #2472e5;
  --primary-dark: #1b5cbe;
  --accent: #f97316;
  --lightbg: #f8fafc;
  --surface: #ffffff;
  --heading: #111827;
  --text: #1f2937;
  --muted: #4b5563;
  --border: #e5e7eb;
  --ok: #15803d;
}

html.dark {
  color-scheme: dark;
  --lightbg: #0f172a;
  --surface: #1e293b;
  --heading: #f1f5f9;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --ok: #4ade80;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--lightbg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

main { flex: 1; }

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

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

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand img { height: 3rem; width: 3rem; object-fit: contain; }

.brand span {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

nav { display: flex; align-items: center; gap: 1rem; }

.nav-menu { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

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

nav a.active { color: var(--accent); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--lightbg);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.nav-toggle:hover { color: var(--text); background: var(--border); }

.nav-toggle svg { width: 1.25rem; height: 1.25rem; }

@media (max-width: 48rem) {
  .header-inner { padding: 0.25rem 0.5rem; }

  .nav-toggle { display: inline-flex; }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
  }

  .nav-menu.open { display: flex; }

  .nav-menu a { padding: 0.85rem 1.5rem; }

  .nav-menu a.active { background: var(--lightbg); }

  .nav-menu a.nav-cta {
    margin: 0.5rem 1.5rem 0.25rem;
    padding: 0.7rem 1.25rem;
    text-align: center;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--lightbg);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.theme-toggle:hover { color: var(--text); background: var(--border); }

.theme-toggle svg { width: 1rem; height: 1rem; }

@media (min-width: 48.0625rem) {
  .nav-menu { display: contents; }
  nav { gap: 2rem; }
  .theme-toggle { order: 1; }
  nav a.nav-cta { order: 2; }
}

nav a.nav-cta {
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  transition: background 0.15s;
}

nav a.nav-cta:hover { background: var(--accent); color: #fff; }

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: stretch;
  text-align: left;
  padding: 4.5rem 0 3.5rem;
}

.hero .hero-text { align-self: center; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--heading);
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.hero h1 em { color: var(--primary); font-style: normal; }

.hero p {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 44rem;
  margin: 0 0 2rem;
}

@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--primary);
  color: #fff;
  font-weight: 500;
  padding: 0.85rem 2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: background 0.15s;
}

.button svg { width: 1.1em; height: 1.1em; flex: none; }

.button:hover { background: var(--accent); color: #fff; }

.button.secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.button.secondary:hover { color: var(--accent); border-color: var(--accent); background: var(--surface); }

.hero .note { font-size: 0.95rem; color: var(--muted); margin-top: 1rem; }

.hero-text .button { margin-top: 0.5rem; }

.hero-text .button + .button { margin-left: 0.75rem; }

@media (max-width: 40rem) {
  .hero-text .button { display: flex; width: 100%; margin-left: 0; }
  .hero-text .button + .button { margin-left: 0; margin-top: 0.75rem; }
}

section { padding: 3rem 0; }

section.alt { background: var(--surface); }

h2 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--heading);
  text-align: center;
  margin-bottom: 2.25rem;
}

.section-intro {
  color: var(--muted);
  text-align: center;
  max-width: 44rem;
  margin: -1.25rem auto 2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
}

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

section.alt .card { background: var(--lightbg); }

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.card p { color: var(--muted); font-size: 0.97rem; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem;
  counter-reset: step;
}

.step {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.step h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step h3::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.step p { color: var(--muted); font-size: 0.97rem; }

.cta { text-align: center; }

.cta p { color: var(--muted); max-width: 40rem; margin: 0 auto 1.75rem; }

.cta .after { margin: 1.5rem auto 0; }

.page-title { padding: 3.5rem 0 0.5rem; text-align: center; }

.page-title h1 { font-size: 2.2rem; font-weight: 800; color: var(--heading); margin-bottom: 0.75rem; }

.page-title p { color: var(--muted); max-width: 72rem; margin: 0 auto; }

.suggest { margin: 2rem auto 0; text-align: left; }

.suggest .card p { margin-left: 0; margin-right: 0; max-width: none; }

.downloads .card { display: flex; flex-direction: column; }

.downloads .card .button {
  margin-top: auto;
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
  white-space: nowrap;
  border: 1px solid transparent;
}

.downloads .card .button + .button { margin-top: 0.5rem; }

.downloads .card .button.secondary { border-color: var(--border); color: var(--muted); }

.downloads .card .button.secondary.btn-appimage:hover { background: var(--surface); color: #566069; border-color: #566069; }
.downloads .card .button.secondary.btn-deb:hover { background: var(--surface); color: #a81d33; border-color: #a81d33; }
.downloads .card .button.secondary.btn-rpm:hover { background: var(--surface); color: #3c6eb4; border-color: #3c6eb4; }
.downloads .card .button.secondary.btn-mac:hover { background: var(--surface); color: var(--text); border-color: var(--text); }

.downloads .card p { margin-bottom: 1.25rem; }

.downloads .meta { font-size: 0.85rem; color: var(--muted); margin-top: 0.75rem; }

.downloads .card p.meta { margin-bottom: 0; }

.downloads + .notice { margin-top: 1.5rem; }


.btn-appimage:hover { background: #566069; }
.btn-deb:hover { background: #a81d33; }
.btn-rpm:hover { background: #3c6eb4; }
.btn-mac:hover { background: #1d1d1f; }
html.dark .btn-mac:hover { background: #f5f5f7; color: #1d1d1f; }

.tab-buttons { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: -1px; }

.tab-btn {
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 0.6rem 1.4rem;
  border-radius: 0.5rem 0.5rem 0 0;
  cursor: pointer;
}

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

.tab-btn.active {
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  color: var(--primary);
  position: relative;
  z-index: 1;
}

.tab-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0.75rem 0.75rem 0.75rem;
  padding: 1.5rem;
}

.tab-panel + .tab-panel { margin-top: 1.5rem; }

.tabs.ready .tab-panel + .tab-panel { margin-top: 0; }

.tab-panel ul { list-style: none; }

.tab-panel li { color: var(--muted); margin-bottom: 0.9rem; }

.tab-panel li:last-child { margin-bottom: 0; }

.tab-panel ul + p { color: var(--muted); margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.tab-panel li strong { color: var(--text); }

.tab-panel pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  background: var(--lightbg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
  overflow-x: auto;
  line-height: 1.5;
  color: var(--text);
}

.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  color: var(--muted);
  max-width: 46rem;
  margin: 0 auto 2.5rem;
}

.notice.wide { max-width: 72rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--lightbg);
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  padding: 0.1rem 0.4rem;
}

pre code { background: none; border: none; padding: 0; font-size: inherit; }

kbd {
  font-family: inherit;
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 0.3rem;
  padding: 0.05rem 0.4rem;
  color: var(--text);
}

.prose { max-width: 46rem; margin: 0 auto; }

.prose h2 { text-align: left; font-size: 1.3rem; margin: 2rem 0 0.75rem; }

.prose p { color: var(--muted); margin-bottom: 1rem; }

.prose h3 { text-align: left; font-size: 1.05rem; color: var(--heading); margin: 1.5rem 0 0.5rem; }

.prose ul, .prose ol { color: var(--muted); margin: 0 0 1rem 1.25rem; }

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

.prose li strong { color: var(--text); }

.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; font-size: 0.95rem; }

.prose th, .prose td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.prose th { color: var(--heading); font-weight: 600; }

.prose.wide { max-width: 72rem; }

.prose h2:first-child { margin-top: 0; }

.prose .lead { font-size: 1.1rem; color: var(--text); }

.table-wrap { overflow-x: auto; margin-bottom: 1.25rem; }

.table-wrap table { min-width: 40rem; }

.meta-line { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--muted); }

.card .meta-line { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }

.card details { margin-top: 0.75rem; }

.card details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 500;
  font-size: 0.95rem;
  list-style: none;
}

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

.card details summary::before { content: "+ "; }

.card details[open] summary::before { content: "\2013 "; }

.card details p { margin-top: 0.5rem; }

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.badge.ready { color: var(--ok); border-color: var(--ok); }

.badge.built { color: var(--accent); border-color: var(--accent); }

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: center;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  margin: 0 auto 2rem;
  max-width: 64rem;
  color: var(--muted);
}

.faq details { border-bottom: 1px solid var(--border); padding: 0.9rem 0; }

.faq summary { cursor: pointer; font-weight: 600; color: var(--heading); list-style: none; }

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

.faq summary::before { content: "+ "; color: var(--primary); }

.faq details[open] summary::before { content: "\2013 "; }

.faq details p { color: var(--muted); margin: 0.6rem 0 0; }

.section-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; justify-content: center; margin: 1.5rem 0 2rem; }

.section-links a { color: var(--primary); font-size: 0.95rem; }

.gate-list { list-style: none; margin: 0 0 1.5rem; }

.prose .gate-list { margin-left: 0; }

.gate-list li {
  position: relative;
  padding: 0.6rem 0 0.6rem 1.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.gate-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.9rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-radius: 0.25rem;
}

.gate-list li.done::before { border-color: var(--ok); background: var(--ok); }

.gate-list li .badge { margin-right: 0.4rem; }

.not-found { text-align: center; padding: 5rem 0; }

.not-found h1 { font-size: 2.2rem; font-weight: 800; color: var(--heading); margin-bottom: 0.75rem; }

.not-found p { color: var(--muted); margin-bottom: 1.5rem; }

.demo {
  align-self: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
}

.demo-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--lightbg);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--text);
}

.demo-field svg { width: 1rem; height: 1rem; color: var(--muted); flex: none; }

.demo-query {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: demo-type 11s steps(28, end) infinite;
}

.demo-caret {
  width: 1px;
  height: 1.1rem;
  background: var(--primary);
  animation: demo-caret 1s steps(2, start) infinite;
}

.demo-why {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: 600;
  color: #16a34a;
  opacity: 0;
  animation: demo-why 11s infinite;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.demo-tile {
  aspect-ratio: 1;
  border-radius: 0.4rem;
  border: 1px solid var(--border);
  position: relative;
  animation: demo-dim 11s infinite;
}

.demo-tile.hit { animation-name: demo-hit; }

.demo-tile.hit::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 0.4rem;
  border: 1px solid var(--primary);
  box-shadow: 0 2px 8px rgba(36, 114, 229, 0.18), inset 0 0 0 2px var(--primary);
  opacity: 0;
  animation: demo-ring 11s infinite;
}

.t-sea { background: linear-gradient(180deg, #7fc8f8 0%, #7fc8f8 45%, #1d6fb8 46%, #2a86c9 70%, #f1dbb3 71%, #e9cf9d 100%); }
.t-sand { background: linear-gradient(170deg, #f7e2b5 0%, #e6c58a 60%, #c9a46a 100%); }
.t-hills { background: linear-gradient(180deg, #a6d8ff 0%, #a6d8ff 50%, #4f8a3c 51%, #2f6b2a 100%); }
.t-city { background: linear-gradient(180deg, #d9d2e9 0%, #d9d2e9 40%, #5b5f73 41%, #2c2f3d 100%); }
.t-snow { background: linear-gradient(180deg, #e6eefc 0%, #cfdcf5 60%, #ffffff 61%, #eef2f9 100%); }
.t-sunset { background: linear-gradient(180deg, #ff9966 0%, #ff5e62 55%, #2d2b55 56%, #1b1a3a 100%); }
.t-forest { background: linear-gradient(160deg, #3d7a3a 0%, #245c2a 50%, #143d1a 100%); }
.t-dog { background: radial-gradient(circle at 50% 60%, #c48a4d 0 28%, #e8d5bd 30%); }
.t-cake { background: radial-gradient(circle at 50% 55%, #f4c6d7 0 30%, #fff5e6 32%); }
.t-pool { background: linear-gradient(180deg, #d9d9d9 0%, #d9d9d9 30%, #38bdf8 31%, #0ea5e9 100%); }
.t-sign { background: linear-gradient(180deg, #e2e8f0 0%, #e2e8f0 35%, #d97706 36%, #d97706 65%, #e2e8f0 66%); }
.t-room { background: linear-gradient(180deg, #f5efe6 0%, #f5efe6 60%, #8b6b4a 61%, #6b4f36 100%); }

@keyframes demo-type {
  0%, 8% { width: 0; }
  36%, 100% { width: 14.5ch; }
}

@keyframes demo-caret {
  to { visibility: hidden; }
}

@keyframes demo-dim {
  0%, 38% { opacity: 1; filter: none; }
  46%, 92% { opacity: 0.28; filter: saturate(0.3); }
  100% { opacity: 1; filter: none; }
}

@keyframes demo-hit {
  0%, 38% { transform: none; }
  46%, 92% { transform: scale(1.03); }
  100% { transform: none; }
}

@keyframes demo-ring {
  0%, 40% { opacity: 0; }
  48%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes demo-why {
  0%, 44% { opacity: 0; }
  52%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-query, .demo-caret, .demo-tile, .demo-tile.hit::after, .demo-why { animation: none; }
  .demo-query { width: auto; }
  .demo-caret { display: none; }
  .demo-tile { opacity: 0.28; filter: saturate(0.3); }
  .demo-tile.hit { opacity: 1; filter: none; }
  .demo-tile.hit::after { opacity: 1; }
  .demo-why { opacity: 1; }
}

footer {
  background: var(--primary);
  color: #fff;
  padding: 2rem 0;
  margin-top: 2rem;
  text-align: left;
}

footer a { color: #fff; text-decoration: underline; }

footer a:hover { color: #ffe3cd; }

footer .privacy-line { font-size: 0.9rem; opacity: 0.85; margin-top: 0.5rem; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.5rem 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.85; margin-bottom: 0.6rem; }

.footer-col a { display: block; text-decoration: none; font-size: 0.95rem; margin-bottom: 0.4rem; opacity: 0.95; }

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

.footer-bottom { text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.25); padding-top: 1.25rem; }

.footer-bottom p { margin-bottom: 0.4rem; }

.sr-only {
  position: absolute;
  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: -9999px;
  top: 0;
  z-index: 100;
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0 0 0.5rem 0;
}

.skip-link:focus { left: 0; }
