/* ──────────────────────────────────────────────────────────────────────────
   Theo download site — shared stylesheet
   Palette mirrors the desktop app's MUI dark theme (frontend/src/theme/theme.ts):
     bg #1e1e1e · surface #2c2c2c · primary #90caf9 · secondary #f48fb1
     text #e0e0e0 / #a0a0a0 · divider rgba(255,255,255,.12) · radius 8px
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #1e1e1e;
  --bg-elevated: #242424;
  --surface: #2c2c2c;
  --surface-hover: #343434;
  --primary: #90caf9;
  --primary-dim: #5e9fd4;
  --secondary: #f48fb1;
  --text: #e0e0e0;
  --text-dim: #a0a0a0;
  --text-faint: #6f6f6f;
  --divider: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.09);
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --font: system-ui, Avenir, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  /* Sticky footer: full-height flex column so .footer anchors to the
     bottom of the viewport on short pages, and flows naturally on tall ones. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1000px 460px at 50% -90px, rgba(144, 202, 249, 0.09), transparent 70%);
  background-repeat: no-repeat;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Main content grows to fill remaining height, pushing the footer down. */
main { flex: 1 0 auto; }
.footer { flex: none; }

.wrap { width: min(1080px, 92vw); margin: 0 auto; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(30, 30, 30, 0.72);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap {
  display: flex; align-items: center; gap: 14px;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--text); }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.brand:hover { text-decoration: none; }
.brand .ver { font: 500 12px/1 var(--mono); color: var(--text-dim);
  border: 1px solid var(--border); padding: 4px 7px; border-radius: 999px; }
.topbar nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.topbar nav a { color: var(--text-dim); font-size: 14.5px; }
.topbar nav a:hover { color: var(--text); text-decoration: none; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 15px/1 var(--font); cursor: pointer;
  padding: 13px 22px; border-radius: var(--radius);
  border: 1px solid transparent; transition: all .16s ease;
  color: #0c1418; background: var(--primary);
}
.btn:hover { background: #a6d4fb; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-hover); border-color: var(--divider); }
.btn.sm { padding: 9px 14px; font-size: 13.5px; border-radius: 7px; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { padding: 52px 0 40px; text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); margin-bottom: 16px;
}
.hero .logo {
  width: 84px; height: 84px; border-radius: 20px; margin: 0 auto 20px;
  box-shadow: var(--shadow); display: block;
}
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.2rem); margin: 0 0 12px; letter-spacing: -0.02em; }
.hero h1 .grad {
  background: linear-gradient(180deg, #ffffff 0%, var(--primary) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p.lede { font-size: clamp(1.02rem, 2.2vw, 1.2rem); color: var(--text-dim);
  max-width: 620px; margin: 0 auto 26px; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; align-items: center; }
.hero .hint { color: var(--text-faint); font-size: 13px; margin-top: 16px; }
.hero .hint b { color: var(--text-dim); font-weight: 600; }

/* ── Feature strip ───────────────────────────────────────────────────────── */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 8px 0 48px; }
.feature {
  background: linear-gradient(180deg, var(--surface), var(--bg-elevated));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
}
.feature .ic { width: 32px; height: 32px; color: var(--primary); margin-bottom: 10px; }
.feature h3 { margin: 0 0 6px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--text-dim); font-size: 14px; }

/* ── Section heads ───────────────────────────────────────────────────────── */
.section { padding: 18px 0 10px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 6px; }
.section-head h2 { font-size: 1.5rem; margin: 0; letter-spacing: -0.01em; }
.section-head .sub { color: var(--text-dim); font-size: 14px; }
.section > .desc { color: var(--text-dim); font-size: 14.5px; margin: 0 0 20px; max-width: 720px; }

/* ── Download page header ────────────────────────────────────────────────── */
.dl-head { padding: 60px 0 8px; }
.dl-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 10px; letter-spacing: -0.02em; }
.dl-head p { color: var(--text-dim); margin: 0; font-size: 1.05rem; }
.release-pill {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; color: var(--text-dim);
}
.release-pill b { color: var(--text); font-family: var(--mono); }
.release-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #66bb6a;
  box-shadow: 0 0 0 4px rgba(102, 187, 106, 0.18); }

/* ── Card grid ───────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin: 6px 0 8px; }
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--bg-elevated));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
  transition: border-color .16s ease, transform .16s ease;
}
.card:hover { border-color: var(--divider); transform: translateY(-2px); }
.card.recommended { border-color: rgba(144, 202, 249, 0.55); box-shadow: 0 0 0 1px rgba(144,202,249,0.25); }
.card .ribbon {
  position: absolute; top: -10px; right: 16px;
  background: linear-gradient(100deg, var(--primary), var(--secondary));
  color: #10171c; font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  padding: 4px 10px; border-radius: 999px;
}
.card .top { display: flex; align-items: center; gap: 14px; }
.card .os-ic { width: 40px; height: 40px; color: var(--text); flex: none; }
.card .titles { min-width: 0; }
.card .titles h3 { margin: 0; font-size: 1.12rem; }
.card .titles .badge {
  display: inline-block; margin-top: 4px; font: 600 11.5px/1 var(--mono);
  color: var(--primary); background: rgba(144, 202, 249, 0.10);
  border: 1px solid rgba(144, 202, 249, 0.22); padding: 4px 8px; border-radius: 6px;
}
.card .file { font: 500 12.5px/1.5 var(--mono); color: var(--text-dim); word-break: break-all; }
.card .meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-faint); margin-top: -4px; }
.card .actions { display: flex; gap: 10px; margin-top: auto; }
.card .actions .btn { flex: 1; }

.sha {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.28); border: 1px solid var(--border); border-radius: 7px;
  padding: 8px 10px; font: 500 11px/1.3 var(--mono); color: var(--text-dim);
}
.sha code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sha button {
  flex: none; cursor: pointer; background: transparent; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 5px; padding: 4px 8px; font-size: 11px;
}
.sha button:hover { color: var(--text); border-color: var(--divider); }
.sha button.ok { color: #66bb6a; border-color: rgba(102,187,106,.4); }

/* ── States ──────────────────────────────────────────────────────────────── */
.state { padding: 60px 20px; text-align: center; color: var(--text-dim); }
.state.error {
  background: var(--surface); border: 1px solid rgba(244, 143, 177, 0.3);
  border-radius: var(--radius-lg);
}
.spinner {
  width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton .card { pointer-events: none; }
.skeleton .bar { background: linear-gradient(90deg, var(--surface), var(--surface-hover), var(--surface));
  background-size: 200% 100%; animation: sk 1.2s ease infinite; border-radius: 6px; height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 22px 0 30px; color: var(--text-faint); font-size: 13.5px; }
.footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--text-dim); }
.footer .sp { margin-left: auto; }

@media (max-width: 720px) {
  .features { grid-template-columns: 1fr; }
  .topbar nav { gap: 14px; }
  .hero { padding: 40px 0 32px; }
}
