:root {
  --bg: #16161a;
  --surface: #202026;
  --surface-2: #2a2a31;
  --line: #34343c;
  --text: #ececf1;
  --dim: #a3a3ad;
  --accent: #4cc2ff;
  --accent-strong: #0f8bd6;
  --radius: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f3f6; --surface: #ffffff; --surface-2: #f0f0f4; --line: #e1e1e8;
    --text: #1b1b1f; --dim: #5d5d68; --accent: #0067c0; --accent-strong: #005aa8;
    color-scheme: light;
  }
}
/* chosen by the switch (site.js): light also on a dark system; dark is the default above */
:root[data-theme="light"] {
  --bg: #f3f3f6; --surface: #ffffff; --surface-2: #f0f0f4; --line: #e1e1e8;
  --text: #1b1b1f; --dim: #5d5d68; --accent: #0067c0; --accent-strong: #005aa8;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }


.hero { padding: 56px 0 40px; }
.hero-split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; justify-content: space-between; }
.hero h1 { font-size: clamp(32px, 6vw, 48px); line-height: 1.15; margin: 0 0 12px; font-weight: 600; letter-spacing: -0.01em; }
.hero p.lead { font-size: 19px; color: var(--dim); max-width: 680px; margin: 0; }
.hero .app { display: flex; gap: 20px; align-items: center; margin-bottom: 18px; }
.hero .app img { width: 72px; height: 72px; }

.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-weight: 600; border: 1px solid var(--line); color: var(--text); background: var(--surface); }
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent-strong); }
.btn small { font-weight: 400; opacity: .8; }
.btn.gh { margin-left: auto; }
.hero-split .btn.gh { margin-left: 0; }
@media (max-width: 600px) { .btn.gh { margin-left: 0; } }
.note { color: var(--dim); font-size: 14px; margin-top: 14px; }

.shot { margin: 28px 0 8px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.shot img { display: block; width: 100%; height: auto; }

section { padding: 36px 0; }
section h2 { font-size: 24px; margin: 0 0 18px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.card p { margin: 0; color: var(--dim); font-size: 15px; }
a.card { display: block; color: var(--text); }
a.card:hover { text-decoration: none; border-color: var(--accent); }
.card .tag { display: inline-block; font-size: 12px; color: var(--dim); background: var(--surface-2); border-radius: 999px; padding: 1px 9px; margin-top: 10px; }
.card .tag.live { color: var(--accent); }
.project-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.project-head img { width: 40px; height: 40px; }
.project-head .glyph { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--accent); }

table.req { width: 100%; border-collapse: collapse; }
table.req td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.req td:first-child { color: var(--dim); width: 34%; padding-right: 16px; }

footer { border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; padding: 26px 0 40px; margin-top: 30px; }

.prose { max-width: 760px; }
.prose h2 { margin-top: 30px; }
.prose li { margin: 4px 0; }
.back { margin: 0 0 18px; font-size: 14px; }
.back a { color: var(--dim); }
.back a:hover { color: var(--text); }
code { font-family: "Cascadia Mono", Consolas, monospace; font-size: .9em; background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
table.req ul { margin: 6px 0 0; padding-left: 20px; }
.app-card { display: flex; flex-direction: column; }
.app-card p { flex: 1; }
.app-card .project-head { color: var(--text); }
.app-card .project-head:hover { text-decoration: none; color: var(--accent); }
.app-card .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.btn.small { padding: 7px 12px; font-size: 14px; border-radius: 8px; }
/* the whole card opens the page of the app (its title link is stretched over it); the download buttons stay above */
.app-card { position: relative; }
.app-card .project-head::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.app-card .actions { position: relative; z-index: 1; }
/* ───── the top bar ───── */
.topbar { position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; }
.brand img { width: 26px; height: 26px; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 20px; font-size: 15px; }
.topbar nav a { color: var(--dim); }
.topbar nav a:hover { color: var(--text); text-decoration: none; }

/* ───── the launcher on top ───── */
.launch-hero { position: relative; overflow: hidden; text-align: center; padding: 64px 0 24px; }
.launch-hero .lead { margin: 0 auto; max-width: 640px; font-size: 19px; color: var(--dim); }
.launch-hero h1 { font-size: clamp(36px, 7vw, 64px); line-height: 1.08; margin: 18px 0 16px; font-weight: 700; letter-spacing: -0.02em; }
.hero-icon { width: 96px; height: 96px; filter: drop-shadow(0 10px 30px color-mix(in srgb, var(--accent) 45%, transparent)); animation: float 6s ease-in-out infinite; }
.grad { background: linear-gradient(90deg, var(--accent), #8a7dff, #e66bd0, var(--accent)); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 9s linear infinite; }
.buttons.center { justify-content: center; }
.btn { transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.big { padding: 14px 24px; font-size: 17px; border-radius: 12px; box-shadow: 0 8px 28px color-mix(in srgb, var(--accent-strong) 45%, transparent); }
.btn.big:hover { box-shadow: 0 12px 34px color-mix(in srgb, var(--accent-strong) 60%, transparent); }
.hero-shot { max-width: 860px; margin: 40px auto 0; box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px var(--line);
  transform: scale(1); transform-origin: 50% 50%; transition: transform .5s cubic-bezier(.2,.8,.2,1); will-change: transform; }
.hero-shot:hover { transform: scale(1.025); }
.aurora { position: absolute; inset: -30% -10% auto; height: 760px; z-index: -1; filter: blur(70px); opacity: .55;
  background: radial-gradient(40% 50% at 30% 40%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%),
              radial-gradient(35% 45% at 70% 35%, rgba(138,125,255,.5), transparent 70%),
              radial-gradient(30% 40% at 55% 70%, rgba(230,107,208,.35), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate; }
.launch-hero { isolation: isolate; }
.sub { color: var(--dim); margin: -8px 0 20px; }
.grid.four { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.rule .dot { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; margin-bottom: 10px; font-weight: 700; font-size: 14px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* ───── movement: cards lift, sections come up when scrolled to ───── */
.card { transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.app-card:hover, .rule:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 14px 34px rgba(0,0,0,.25); }
.app-card .project-head img { transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.app-card:hover .project-head img { transform: scale(1.08) rotate(-3deg); }
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0s); }
html.js .reveal.in { opacity: 1; transform: none; }
html.js .reveal.card.in:hover { transform: translateY(-3px); transition-delay: 0s; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shimmer { to { background-position: 300% 0; } }
@keyframes drift { 0% { transform: translate(-4%, 0) scale(1); } 100% { transform: translate(4%, 6%) scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal { opacity: 1; transform: none; }
  .hero-shot { transform: none; }
}
@media (max-width: 600px) {
  .topbar nav { gap: 14px; font-size: 14px; }
  .launch-hero { padding-top: 40px; }
  .hero-shot { transform: none; }
}

/* ───── the latest version (filled in by site.js) ───── */
.ver { display: inline-block; font-size: 12px; font-weight: 400; color: var(--dim); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.project-head .ver { margin-left: auto; }
.ver.big { font-size: 13px; margin-left: 4px; }
.note .ver { margin-right: 6px; vertical-align: 1px; }

/* ───── questions ───── */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px; transition: border-color .2s ease; }
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 400; font-size: 20px; line-height: 1; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--dim); }

/* ───── the top bar: the logo at the left edge, the links with icons at the right ───── */
.topbar .bar { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 28px; }
.topbar .brand img { width: 30px; height: 30px; display: block; transition: transform .25s ease; }
.topbar .brand:hover img { transform: rotate(-6deg) scale(1.06); }
.topbar nav { gap: 6px; }
.topbar nav a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px; transition: background-color .15s ease, color .15s ease; }
.topbar nav a:hover { background: var(--surface-2); }
.topbar nav svg { opacity: .85; }
@media (max-width: 600px) { .topbar .bar { padding: 0 14px; } .topbar nav a { padding: 6px 8px; } }

/* ───── the launcher drawn, not photographed: cards come in, one installs, one waits with an update ───── */
.sketch { max-width: 860px; margin: 40px auto 0; text-align: left; background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); border-radius: 14px; padding: 0 22px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
a.sketch { display: block; color: inherit; text-decoration: none; transition: transform .5s cubic-bezier(.2,.8,.2,1), border-color .3s ease; }
a.sketch:hover { text-decoration: none; border-color: var(--accent); }
.sk-title { display: flex; align-items: center; gap: 8px; height: 38px; font-size: 13px; color: var(--dim); }
.sk-title img { width: 16px; height: 16px; }
.sk-win { margin-left: auto; display: flex; gap: 18px; }
.sk-win i { width: 10px; height: 10px; border: 1.5px solid var(--dim); border-radius: 2px; opacity: .6; }
.sk-win i:first-child { height: 0; border-width: 0 0 1.5px; align-self: center; }
.sk-head { display: flex; align-items: center; margin: 6px 0 16px; }
.sk-head b { font-size: 24px; font-weight: 700; }
.sk-tools { margin-left: auto; display: flex; align-items: center; gap: 16px; color: var(--dim); }
.sk-tools small { font-size: 12px; }
.sk-tools svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 480px) { .sk-tools small { display: none; } }
.sk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sk-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 7px;
  animation: sk-in .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * .12s + .2s); }
.sk-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sk-top img { width: 30px; height: 30px; }
.sk-top b { display: block; font-size: 14px; }
.sk-top small { display: block; font-size: 11px; color: var(--dim); }
.sk-top em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--dim); }
.sk-update .sk-top em { color: var(--accent); }
.sk-line { display: block; height: 7px; border-radius: 4px; background: var(--line); }
.sk-short { width: 62%; }
.sk-btns { position: relative; display: flex; align-items: center; gap: 8px; height: 30px; margin-top: 6px; }
.sk-btn { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); }
.sk-accent { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.sk-update { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
/* the pulse of Update: a ring that fades (opacity and scale only – no repaint of the tilted sketch) */
.sk-update .sk-btn { position: relative; }
.sk-update .sk-btn::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent);
  opacity: 0; animation: sk-pulse 2.4s ease-in-out infinite 1.5s; }
/* installing: the button, the progress, "Installed" – again and again */
.sk-install .sk-go { animation: sk-go 7s infinite 1.2s; }
.sk-progress { position: absolute; left: 0; width: 70%; height: 5px; border-radius: 3px; background: var(--line); opacity: 0; animation: sk-show 7s infinite 1.2s; }
.sk-progress { overflow: hidden; }
.sk-progress span { display: block; height: 100%; width: 100%; border-radius: 3px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; animation: sk-fill 7s infinite 1.2s; }
.sk-done { position: absolute; left: 0; font-size: 12px; font-weight: 600; color: #3fb950; opacity: 0; animation: sk-done 7s infinite 1.2s; }
@keyframes sk-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sk-pulse { 0% { opacity: 0; transform: scale(.9); } 30% { opacity: 1; } 60%, 100% { opacity: 0; transform: scale(1.12); } }
@keyframes sk-go { 0%, 12% { opacity: 1; } 15%, 92% { opacity: 0; } 96%, 100% { opacity: 1; } }
@keyframes sk-show { 0%, 13% { opacity: 0; } 16%, 62% { opacity: 1; } 66%, 100% { opacity: 0; } }
@keyframes sk-fill { 0%, 16% { transform: scaleX(0); } 60%, 100% { transform: scaleX(1); } }
@keyframes sk-done { 0%, 64% { opacity: 0; } 68%, 90% { opacity: 1; } 94%, 100% { opacity: 0; } }
@media (max-width: 760px) { .sk-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .sk-grid { grid-template-columns: 1fr; } .sk-card:nth-child(n+4) { display: none; } }
.sk-win i:last-child { border: 0; border-radius: 0; background: linear-gradient(45deg, transparent 44%, var(--dim) 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, var(--dim) 44% 56%, transparent 56%); }

/* the switch of the theme: Automatic (as the system) → Light → Dark; in the top bar, else in the top right corner */
.theme-switch { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--dim);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; transition: color .2s, border-color .2s; }
.theme-switch:hover { color: var(--text); border-color: var(--accent); }
.theme-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.theme-switch.float { position: fixed; top: 14px; right: 16px; z-index: 20; background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar .theme-switch { margin-left: 6px; }
@media (max-width: 600px) { .theme-switch span { display: none; } .theme-switch { padding: 7px; } }

/* "Other" under the apps: HeMi Dark is skins, not an app */
.other-head { margin: 28px 0 12px; font-size: 1.05rem; color: var(--dim); }

/* the launcher sketch: "Other" above HeMi Dark (skins, not an app), as in the app */
.sk-other { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--dim); margin: 2px 0 -4px; }
/* "Other" folded: a click unfolds it */
details.other > summary { cursor: pointer; list-style: none; }
details.other > summary::-webkit-details-marker { display: none; }
details.other > summary::before { content: "›"; display: inline-block; width: 1em; transition: transform .15s; }
details.other[open] > summary::before { transform: rotate(90deg); }
