/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Tokens mirror apps/desktop/src/styles.css (dark default, light by scheme). */
:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --border: #2a2f3a;
  --text: #e6e8ee;
  --muted: #a3a9b8;
  --accent: #4ade80;
  --accent-strong: #22c55e;
  --accent-fg: #06210f;
  --panel: rgb(23 26 33 / 0.86);
  --scrim: rgb(15 17 21 / 0.35);
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.18), 0 6px 24px rgb(0 0 0 / 0.18);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f8;
    --surface: #ffffff;
    --surface-2: #eceef3;
    --border: #d8dce4;
    --text: #161a22;
    --muted: #4f5666;
    --accent: #16a34a;
    --accent-strong: #15803d;
    --accent-fg: #ffffff;
    --panel: rgb(255 255 255 / 0.86);
    --scrim: rgb(244 245 248 / 0.25);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 6px 24px rgb(0 0 0 / 0.1);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Noto Sans", sans-serif;
}
img, svg { display: block; }
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  padding: 8px 12px; background: var(--surface); border-radius: 8px;
}
.skip:focus { top: 12px; }

/* ---- Background scene (fixed, below everything) ---- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
.bg::after { content: ""; position: absolute; inset: 0; background: var(--scrim); }
.bg .layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg .clouds { position: absolute; top: 0; bottom: 0; left: 0; width: 200%; display: flex; }
.bg .clouds > div { position: relative; width: 50%; height: 100%; }
.bg .far { position: absolute; top: 0; bottom: 0; left: -2%; right: -2%; }
@keyframes bg-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@keyframes bg-sway { from { transform: translate3d(-1.2%, 0, 0); } to { transform: translate3d(1.2%, 0, 0); } }
.bg-drift { animation: bg-drift 160s linear infinite; will-change: transform; }
.bg-sway { animation: bg-sway 40s ease-in-out infinite alternate; will-change: transform; }
@media (prefers-reduced-motion: reduce) {
  .bg-drift, .bg-sway { animation: none !important; will-change: auto; }
}

/* ---- Panels & buttons ---- */
.panel {
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { color: var(--text); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn small { font-weight: 400; opacity: 0.8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-fg); }
.btn.ghost { background: transparent; border-color: transparent; min-height: 40px; padding: 8px 10px; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--border); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---- Layout ---- */
.top, main, .foot { width: min(1200px, 100% - 24px); margin-inline: auto; }
.top {
  position: sticky; top: 10px; z-index: 5; margin-top: 10px;
  display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.brand img { image-rendering: pixelated; }
.top nav { display: flex; gap: 4px; margin-left: auto; }
.top nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.top nav a:hover { background: var(--surface-2); }
.tools { display: flex; gap: 2px; }
main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 40px 0 28px; }
main:focus { outline: none; }
section { scroll-margin-top: 80px; }

.hero { text-align: center; padding: clamp(28px, 6vw, 64px) clamp(16px, 4vw, 48px); justify-self: center; max-width: 820px; width: 100%; }
.hero-logo { width: clamp(72px, 10vw, 112px); height: auto; margin: 0 auto 16px; image-rendering: pixelated; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 900; letter-spacing: -0.02em; }
.pitch { font-size: clamp(1.05rem, 2vw, 1.3rem); margin: 12px auto 24px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 16px; }

.title { justify-self: start; display: inline-block; padding: 10px 18px; font-size: clamp(1.3rem, 3vw, 1.75rem); margin-bottom: 14px; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.card { padding: 18px; }
.card svg { width: 32px; height: 32px; padding: 6px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 18%, transparent); fill: var(--accent); margin-bottom: 12px; shape-rendering: crispEdges; }
.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---- Screenshot gallery + lightbox ---- */
.note { display: inline-block; padding: 6px 12px; margin: -6px 0 14px; color: var(--muted); }
.shots { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
/* min-width: 0 stops the 1600px intrinsic image width from widening grid tracks. */
main > *, .shots > li, .shot, .shot button { min-width: 0; }
.shot { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.shot button {
  display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; cursor: zoom-in; box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.shot button:hover { border-color: var(--accent); transform: translateY(-2px); }
.shot img { width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.shot figcaption { padding: 8px 12px; font-weight: 600; justify-self: start; }
.lightbox {
  width: min(1600px, 96vw); max-width: none; max-height: 96vh; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.5);
}
.lightbox::backdrop { background: rgb(0 0 0 / 0.78); }
.lightbox img { width: 100%; height: auto; max-height: calc(96vh - 58px); object-fit: contain; background: #0f1115; }
.lb-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; }
.lb-bar p { margin: 0 auto 0 0; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .shot button { transition: none; } .shot button:hover { transform: none; } }

/* ---- Download ---- */
.dl { padding: clamp(20px, 4vw, 36px); }
.dl h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.dl > p { margin: 6px 0 20px; }
.dl-cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.dl-cols h3 { font-size: 1.05rem; margin-bottom: 10px; }
.dl-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.dl-btns .btn { flex: 1 1 160px; }

.foot {
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; align-items: center;
  padding: 14px 18px; margin-bottom: 16px;
}

@media (max-width: 640px) {
  .top nav { display: none; }
  .tools { margin-left: auto; }
  main { padding-top: 24px; gap: 22px; }
  .foot { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 2200px) {
  body { font-size: 20px; }
  .top, main, .foot { width: min(1600px, 100% - 48px); }
}

/* Never scroll sideways (drifting clouds are 200% wide). */
html, body { overflow-x: clip; }
.bg { overflow: hidden; }
