:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1f2328;
  --muted: #59636e;
  --card: #f6f8fa;
  --bd: #d0d7de;
  --accent: #2563eb;
  --accent2: #06b6d4;
  --code: #eef1f4;
  --max: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --fg: #e6edf3;
    --muted: #9198a1;
    --card: #161b22;
    --bd: #30363d;
    --accent: #5b9bff;
    --accent2: #22d3ee;
    --code: #1b2129;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --fg: #e6edf3;
  --muted: #9198a1;
  --card: #161b22;
  --bd: #30363d;
  --accent: #5b9bff;
  --accent2: #22d3ee;
  --code: #1b2129;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 1.6rem; margin-bottom: 1rem; }
kbd {
  font: 12px/1 ui-monospace, Consolas, monospace;
  background: var(--code); border: 1px solid var(--bd); border-bottom-width: 2px;
  border-radius: 5px; padding: 3px 6px; color: var(--fg);
}
code { font-family: ui-monospace, Consolas, monospace; background: var(--code); padding: 2px 5px; border-radius: 4px; font-size: .92em; }
pre { background: var(--code); border: 1px solid var(--bd); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
pre code { background: none; padding: 0; }

.top {
  max-width: var(--max); margin: 0 auto; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--fg); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.top nav { display: flex; gap: 22px; }
.top nav a { color: var(--muted); font-weight: 500; }
.top nav a:hover { color: var(--fg); text-decoration: none; }

main { max-width: var(--max); margin: 0 auto; padding: 0 20px 60px; }

.hero { text-align: center; padding: 56px 0 24px; }
.hero-logo { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 12px 34px rgba(37,99,235,.28); }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); margin: 22px 0 14px; font-weight: 800; }
.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { max-width: 680px; margin: 0 auto 28px; color: var(--muted); font-size: 1.12rem; }

.cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
/* platform download cards */
.platforms { display: grid; grid-template-columns: repeat(2, minmax(240px, 300px)); gap: 16px; justify-content: center; margin: 6px 0 4px; }
.plat { background: var(--card); border: 1px solid var(--bd); border-radius: 16px; padding: 18px 18px 14px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.plat-h { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; color: var(--fg); margin-bottom: 2px; }
.plat-h svg { color: var(--accent); }
.plat .btn { justify-content: center; }
.plat .btn.small { padding: 9px 14px; font-size: .92rem; font-weight: 600; }
.plat-meta { margin: 2px 0 0; color: var(--muted); font-size: .84rem; text-align: center; }
@media (max-width: 640px) { .platforms { grid-template-columns: 1fr; } }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 12px; font-weight: 700; font-size: 1.02rem;
  border: 1px solid transparent; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: 0 8px 24px rgba(37,99,235,.32); }
.btn.primary:hover { box-shadow: 0 12px 30px rgba(37,99,235,.42); }
.btn.ghost { background: var(--card); border-color: var(--bd); color: var(--fg); }
.btn.ghost:hover { background: var(--code); }

.meta { margin: 16px 0 0; color: var(--muted); font-size: .95rem; display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: .82rem;
  background: rgba(37,99,235,.12); color: var(--accent); border: 1px solid rgba(37,99,235,.25);
}
.badge.live { background: rgba(22,163,74,.12); color: #16a34a; border-color: rgba(22,163,74,.3); }

.shot { margin: 44px auto 0; max-width: 1000px; }
.shot img {
  width: 100%; height: auto; display: block; border-radius: 14px;
  border: 1px solid var(--bd); box-shadow: 0 24px 60px rgba(0,0,0,.18);
}

.features { padding: 56px 0 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid article { background: var(--card); border: 1px solid var(--bd); border-radius: 14px; padding: 20px 22px; }
.grid h3 { font-size: 1.08rem; margin-bottom: 6px; }
.grid p { margin: 0; color: var(--muted); font-size: .97rem; }

.security { padding: 48px 0 8px; }
.security ul { padding-left: 20px; color: var(--muted); }
.security li { margin-bottom: 10px; }
.security li b { color: var(--fg); }

.shortcuts { padding: 40px 0 0; }
.shortcuts table { border-collapse: collapse; width: 100%; max-width: 560px; }
.shortcuts td { padding: 9px 10px; border-bottom: 1px solid var(--bd); }
.shortcuts td:first-child { white-space: nowrap; width: 240px; }
.shortcuts td:last-child { color: var(--muted); }

footer { max-width: var(--max); margin: 0 auto; padding: 24px 20px 40px; color: var(--muted); font-size: .92rem; border-top: 1px solid var(--bd); }
footer p { margin: 4px 0; }

@media (max-width: 640px) {
  .top nav { gap: 14px; font-size: .95rem; }
  .hero { padding-top: 36px; }
  .btn { width: 100%; justify-content: center; }
}

/* theme toggle */
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; cursor: pointer;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--bd); border-radius: 9px;
}
.theme-btn:hover { background: var(--code); }
.theme-btn .ico-moon { display: none; }
:root[data-theme="dark"] .theme-btn .ico-sun,
:root:not([data-theme="light"]) .theme-btn .ico-sun { display: none; }
:root[data-theme="dark"] .theme-btn .ico-moon,
:root:not([data-theme="light"]) .theme-btn .ico-moon { display: inline; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .ico-sun { display: inline; }
  :root:not([data-theme="dark"]) .theme-btn .ico-moon { display: none; }
}
:root[data-theme="light"] .theme-btn .ico-sun { display: inline; }
:root[data-theme="light"] .theme-btn .ico-moon { display: none; }

/* made by 404 Friends */
.madeby {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin-bottom: 14px;
  border: 1px solid var(--bd); border-radius: 12px; background: var(--card);
  color: var(--fg);
}
.madeby:hover { text-decoration: none; border-color: var(--accent); }
.madeby img { border-radius: 9px; display: block; }
.madeby span { display: flex; flex-direction: column; line-height: 1.25; font-size: .95rem; }
.madeby small { color: var(--muted); font-size: .82rem; }

/* language switch */
.top nav .lang { font-weight: 700; font-size: .85rem; letter-spacing: .02em; padding: 4px 8px; border: 1px solid var(--bd); border-radius: 8px; background: var(--card); }
.top nav .lang:hover { border-color: var(--accent); color: var(--accent); }
.top nav a[aria-current="page"] { color: var(--fg); }
.meta a { font-weight: 600; }
.muted { color: var(--muted); }

/* sub-pages (releases) */
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 800; }
.page-head .lead { margin-left: 0; max-width: 720px; }
.page-head .cta { justify-content: flex-start; }
.page-head .meta { justify-content: flex-start; }
.howto { padding: 24px 0 8px; }
.howto ul { padding-left: 20px; color: var(--muted); }
.howto li { margin-bottom: 8px; }
.howto li b { color: var(--fg); }

.releases { padding: 24px 0 0; }
.release { background: var(--card); border: 1px solid var(--bd); border-radius: 14px; padding: 20px 22px; margin-bottom: 18px; overflow: hidden; min-width: 0; }
.release header h2 { font-size: 1.4rem; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.release header h2 a { color: var(--fg); }
.release header p { margin: 0 0 14px; font-size: .92rem; overflow-wrap: anywhere; }
.assets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.asset { position: relative; min-width: 0; border: 1px solid var(--bd); border-radius: 10px; background: var(--bg); }
.asset:hover { border-color: var(--accent); }
.asset-main { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 2px; align-items: center; min-width: 0; padding: 12px 14px; color: var(--fg); }
.asset-main:hover { text-decoration: none; }
.asset-os { grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; min-width: 44px; }
.asset-os svg { color: var(--accent); }
.asset-name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.asset-file { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: .78rem; min-width: 0; overflow-wrap: anywhere; }
.asset-meta { color: var(--muted); font-size: .85rem; }
.sums { margin: 0 0 10px; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.sums a { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
.notes { color: var(--fg); font-size: .97rem; min-width: 0; overflow-wrap: anywhere; }
.notes h3, .notes h4, .notes h5, .notes h6 { margin: 14px 0 6px; font-size: 1.05rem; }
.notes p { margin: 8px 0; }
.notes ul, .notes ol { padding-left: 22px; margin: 6px 0; }
.notes li { margin: 3px 0; }
.notes code { overflow-wrap: anywhere; }
.notes pre { margin: 10px 0; max-width: 100%; }
@media (max-width: 640px) { .assets { grid-template-columns: 1fr; } .release { padding: 16px; } }
