/* MaluApps. Tokens first; the header is always dark because the logo's wordmark is white. */
:root {
  --blue: #1a6ef0; --blue-2: #0f4fc0; --cyan: #14b4e6; --cyan-2: #0a8fc0; --orange: #f2691c; --orange-2: #c94f0f;
  --bg: #f5f7fb; --card: #ffffff; --ink: #161b26; --muted: #5c6678; --line: #e2e6ee; --soft: #eef2f8; --code: #f0f3f8;
  --head: #0b1324; --head-ink: #e8edf7; --head-muted: #9aa7c0; --head-line: #1c2740;
  --accent: var(--blue); --accent-ink: #fff; --focus: #ffb454;
  --radius: 14px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -16px rgba(16, 24, 40, .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1422; --card: #151d30; --ink: #e6ebf5; --muted: #9aa6bd; --line: #243049; --soft: #192338; --code: #111a2c;
    --accent: #5b9bff; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -18px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1422; --card: #151d30; --ink: #e6ebf5; --muted: #9aa6bd; --line: #243049; --soft: #192338; --code: #111a2c;
  --accent: #5b9bff; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -18px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Ubuntu Mono", monospace; font-size: .92em; }
p code, li code, td code, dd code { background: var(--code); border: 1px solid var(--line); border-radius: 5px; padding: .05em .35em; }
pre { background: var(--code); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
pre code { font-size: .86rem; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: clamp(28px, 4.5vw, 40px); }
h2 { font-size: clamp(21px, 2.6vw, 26px); }
h3 { font-size: 17px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.i { width: 1.1em; height: 1.1em; vertical-align: -.2em; flex: none; }

/* header */
.site-head { background: var(--head); color: var(--head-ink); border-bottom: 1px solid var(--head-line); position: sticky; top: 0; z-index: 50; }
.site-head .wrap { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand img { height: 40px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav > a { color: var(--head-muted); padding: 8px 12px; border-radius: 8px; font-size: 15px; font-weight: 500; }
.nav > a:hover, .nav > a.is-active { color: #fff; background: rgba(255, 255, 255, .07); text-decoration: none; }
.nav > a.btn { color: #fff; border-color: rgba(255, 255, 255, .25); margin-left: 6px; }
.nav > a.btn:hover { background: rgba(255, 255, 255, .1); }
.nav-search { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; padding: 0 10px; margin-left: 8px; color: var(--head-muted); }
.nav-search input { background: none; border: 0; color: #fff; padding: 8px 0; width: 150px; font: inherit; font-size: 15px; outline: none; }
.nav-search input::placeholder { color: var(--head-muted); }
.nav-search:focus-within { border-color: var(--cyan); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--head-line); color: var(--head-ink); border-radius: 8px; padding: 8px; cursor: pointer; }
.nav-toggle .i { width: 22px; height: 22px; display: block; }

/* buttons, chips, tiles */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 15px; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; line-height: 1.2; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-2); }
.btn-ghost { background: transparent; color: inherit; border-color: var(--line); }
.btn-ghost:hover { background: var(--soft); }
.btn-sm { padding: 6px 12px; font-size: 14px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 500; line-height: 1.6; white-space: nowrap; }
a.chip:hover { text-decoration: none; color: var(--ink); }
.chip-blue { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); border-color: transparent; }
.chip-cyan { background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan-2); border-color: transparent; }
.chip-orange { background: color-mix(in srgb, var(--orange) 13%, transparent); color: var(--orange-2); border-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip-cyan { color: var(--cyan); } :root:not([data-theme="light"]) .chip-orange { color: #ff8a47; } :root:not([data-theme="light"]) .chip-blue { color: #7db1ff; } }
.badge { display: inline-flex; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; line-height: 1.6; }
.badge-stable { background: color-mix(in srgb, #16a34a 14%, transparent); color: #15803d; }
.badge-beta { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.badge-early { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange-2); }
.tile { display: inline-grid; place-items: center; border-radius: 22%; color: #fff; flex: none; box-shadow: inset 0 -2px 6px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .25); }
.tile .i { width: 54%; height: 54%; }
.tile-sm { width: 36px; height: 36px; } .tile-md { width: 52px; height: 52px; } .tile-lg { width: 64px; height: 64px; } .tile-xl { width: 96px; height: 96px; }
.tile-blue { background: linear-gradient(160deg, #3b8cff 0%, #1a6ef0 55%, #0f4fc0 100%); }
.tile-cyan { background: linear-gradient(160deg, #3fd0ff 0%, #14b4e6 55%, #0a8fc0 100%); }
.tile-orange { background: linear-gradient(160deg, #ff9550 0%, #f2691c 55%, #c94f0f 100%); }

/* cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.three .card h3 { margin-top: 12px; }
.app-card { display: flex; gap: 16px; color: inherit; transition: transform .12s ease, border-color .12s ease; }
.app-card:hover { text-decoration: none; transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.app-card h3 { margin: 0 0 4px; }
.app-card p { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; }
.app-card-body { min-width: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 40px 0 16px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 500; white-space: nowrap; }

/* hero */
.hero { background: radial-gradient(1200px 500px at 20% -20%, rgba(26, 110, 240, .35), transparent 60%), radial-gradient(800px 400px at 90% 0%, rgba(242, 105, 28, .28), transparent 60%), var(--head); color: #fff; padding: 64px 0 96px; }
.hero h1 { font-size: clamp(32px, 5.4vw, 54px); letter-spacing: -.02em; margin-bottom: 12px; }
.hero .lede { font-size: 19px; color: var(--head-muted); max-width: 640px; margin: 0 0 28px; }
.hero-search { display: flex; align-items: center; gap: 10px; background: #fff; color: #161b26; border-radius: 14px; padding: 6px 6px 6px 16px; max-width: 640px; box-shadow: 0 12px 40px -12px rgba(0, 0, 0, .5); }
.hero-search .i { color: #5c6678; width: 22px; height: 22px; }
.hero-search input { flex: 1; border: 0; font: inherit; font-size: 17px; padding: 10px 0; min-width: 0; outline: none; background: none; color: inherit; }
.hero-hint { margin: 14px 0 0; font-size: 14px; color: var(--head-muted); }
.hero-hint a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.page-head .hero-search { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: none; margin-top: 16px; }
.page-head .hero-search .i { color: var(--muted); }
.prose .hero-search { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }

/* category tiles on the home page */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: -48px; position: relative; }
.cat-card { display: flex; gap: 18px; color: inherit; border-top: 4px solid var(--blue); }
.cat-card.cat-cyan { border-top-color: var(--cyan); } .cat-card.cat-orange { border-top-color: var(--orange); }
.cat-card:hover { text-decoration: none; border-color: var(--line); border-top-color: inherit; box-shadow: 0 12px 30px -16px rgba(16, 24, 40, .4); }
.cat-card h2 { font-size: 19px; margin: 2px 0 4px; display: flex; align-items: center; gap: 8px; }
.cat-card .count { font-size: 12.5px; background: var(--soft); color: var(--muted); border-radius: 999px; padding: 1px 9px; font-weight: 600; }
.cat-card p { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.cat-card .more { color: var(--accent); font-weight: 600; font-size: 14px; display: inline-flex; gap: 4px; align-items: center; }

/* steps and recent */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps strong { display: block; margin: 12px 0 4px; }
.steps span:not(.tile) { color: var(--muted); font-size: 15px; }
.steps code { font-size: .85em; }
.how p { margin-top: 20px; }
.recent { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.recent a { display: grid; grid-template-columns: 36px 1fr auto; grid-template-areas: "tile name time" "tile desc time"; column-gap: 14px; align-items: center; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.recent a:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.recent .tile { grid-area: tile; }
.recent .name { grid-area: name; font-weight: 600; }
.recent .muted { grid-area: desc; font-size: 14px; }
.recent time { grid-area: time; color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.getos { margin: 48px auto 64px; }
.getos-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; background: linear-gradient(135deg, var(--card), var(--soft)); }
.getos-card h2 { margin-bottom: 6px; }
.getos-card p { margin: 0; max-width: 620px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* page heads and lists */
.page-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 40px 0 32px; }
.page-head.cat-blue { border-top: 4px solid var(--blue); } .page-head.cat-cyan { border-top: 4px solid var(--cyan); } .page-head.cat-orange { border-top: 4px solid var(--orange); }
.page-head .lede { color: var(--muted); font-size: 17px; margin: 0; max-width: 760px; }
.page-head-row { display: flex; gap: 20px; align-items: flex-start; }
.list-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 24px auto 8px; }
.filter { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--muted); flex: 1 1 240px; max-width: 360px; }
.filter input { border: 0; background: none; font: inherit; padding: 9px 0; width: 100%; outline: none; color: inherit; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
button.chip { cursor: pointer; font: inherit; font-size: 12.5px; }
button.chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }
.cat-foot { margin: 40px auto 56px; }
.cat-foot p { margin: 0; }
.wrap > .grid { margin-bottom: 8px; }

/* app page */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); padding: 18px 16px 0; flex-wrap: wrap; }
.crumbs .i { width: 14px; height: 14px; }
.app-head { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: start; padding: 24px 16px 8px; }
.app-head .lede { font-size: 18px; color: var(--muted); margin: 0 0 12px; }
.app-head-actions { display: flex; flex-direction: column; gap: 10px; min-width: 260px; }
.app-head-actions .btn { justify-content: center; }
.cmd { display: flex; align-items: center; gap: 8px; background: var(--code); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 14px; }
.cmd code { flex: 1; overflow-x: auto; white-space: pre; font-size: 13.5px; padding: 4px 0; }
.copy { background: var(--card); border: 1px solid var(--line); border-radius: 7px; color: var(--muted); width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; flex: none; }
.copy:hover { color: var(--ink); }
.copy.is-done { color: #15803d; border-color: #15803d; }
.app-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding-top: 24px; }
.app-main section { margin-bottom: 36px; }
.app-main h2 { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.app-main h3 { margin: 20px 0 8px; }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.features li { display: flex; gap: 10px; align-items: flex-start; }
.features .i { color: #16a34a; margin-top: .3em; }
.note { display: flex; gap: 10px; background: color-mix(in srgb, var(--blue) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line)); border-radius: 10px; padding: 12px 14px; font-size: 15px; }
.note .i { color: var(--blue); flex: none; margin-top: .3em; }
.install-steps { padding-left: 22px; margin: 0; display: grid; gap: 10px; }
.install-steps li.step-cmd { list-style: none; margin-left: -22px; }
.install-steps .cmd { margin-top: 6px; }
.downloads { width: 100%; border-collapse: collapse; font-size: 15px; }
.downloads th, .downloads td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.downloads th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.downloads td:last-child { text-align: right; }
.facts { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0; position: sticky; top: 84px; }
.facts dt { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 12px; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 2px 0 0; font-size: 15px; }
.facts dd a { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.facts .line { display: block; }
.facts .tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* prose pages */
.prose { padding: 32px 16px 64px; max-width: 860px; }
.prose section { margin-bottom: 40px; }
.prose h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.prose .grid.three .card h3 { margin-top: 14px; }
.prose .grid.three .card p { margin: 0; font-size: 14.5px; }
.prose .cmd { margin: 8px 0 12px; }
.toc { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 28px; }
.toc a { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; color: var(--ink); }
.toc a:hover { border-color: var(--accent); text-decoration: none; }

/* footer */
.site-foot { border-top: 1px solid var(--line); background: var(--card); margin-top: 48px; padding: 36px 0 28px; font-size: 14.5px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 24px; }
.site-foot ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.site-foot strong { display: block; margin-bottom: 4px; }
.site-foot p { margin: 6px 0; }
.foot-legal { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

/* responsive */
@media (max-width: 900px) {
  .app-body { grid-template-columns: 1fr; gap: 24px; }
  .facts { position: static; }
  .app-head { grid-template-columns: auto 1fr; }
  .app-head-actions { grid-column: 1 / -1; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-grid; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: var(--head); border-bottom: 1px solid var(--head-line); flex-direction: column; align-items: stretch; padding: 10px 16px 16px; gap: 2px; }
  .nav.is-open { display: flex; }
  .nav-search { margin: 8px 0; }
  .nav-search input { width: 100%; }
  .nav > a.btn { margin: 6px 0 0; justify-content: center; }
  .brand img { height: 34px; }
  .hero { padding: 44px 0 80px; }
  .hero-search { padding: 4px 4px 4px 12px; }
  .hero-search .btn { padding: 10px 14px; }
  .app-head { grid-template-columns: 1fr; }
  .tile-xl { width: 72px; height: 72px; }
  .recent a { grid-template-columns: 36px 1fr; grid-template-areas: "tile name" "tile desc" "tile time"; }
  .foot-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; gap: 4px; align-items: flex-start; }
  .downloads th:nth-child(2), .downloads td:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .app-card { transition: none; } }
