/* SPDX-License-Identifier: AGPL-3.0-or-later */
/* MuhOS website. No external fonts, scripts or trackers. */

:root {
  --bg: #f5f5f7;
  --bg-raised: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --accent: #007aff;
  --accent-text: #ffffff;
  --code-bg: #1d1d1f;
  --code-text: #f5f5f7;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(0, 0, 0, 0.08);
  --radius: 18px;
  --font: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "Adwaita Sans", Cantarell, Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", "Adwaita Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-raised: #1c1c1e;
    --glass: rgba(28, 28, 30, 0.72);
    --text: #f5f5f7;
    --text-dim: #a1a1a6;
    --line: rgba(255, 255, 255, 0.12);
    --accent: #0a84ff;
    --code-bg: #1c1c1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }

/* Navigation: a translucent bar, like the MuhOS menu bar. */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 52px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.nav ul { display: flex; gap: 22px; list-style: none; margin: 0 0 0 auto; padding: 0; font-size: 15px; }
.nav li a { color: var(--text); opacity: 0.8; }
.nav li a:hover, .nav li a[aria-current="page"] { opacity: 1; text-decoration: none; }
.nav li a[aria-current="page"] { font-weight: 600; }
.nav .cta { padding: 6px 14px; border-radius: 999px; background: var(--accent); color: var(--accent-text); opacity: 1; font-weight: 600; }
@media (max-width: 640px) {
  .nav .wrap { gap: 12px; }
  .nav ul { gap: 14px; font-size: 14px; }
  .nav .hide-small { display: none; }
  .brand span { display: none; }
}

/* Hero */
.hero { text-align: center; padding: 72px 0 40px; }
.hero .logo { width: 88px; height: 88px; margin: 0 auto 20px; filter: drop-shadow(0 10px 24px rgba(0, 122, 255, 0.25)); }
.hero h1 { font-size: clamp(40px, 7vw, 72px); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 14px; }
.hero p.lead { font-size: clamp(19px, 2.4vw, 24px); color: var(--text-dim); max-width: 720px; margin: 0 auto 28px; }
.buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 16px;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.secondary { background: var(--bg-raised); color: var(--text); border-color: var(--line); }
.note { color: var(--text-dim); font-size: 14px; margin-top: 14px; }

.shot {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: var(--bg-raised);
}
.hero .shot { margin: 44px auto 0; }
.shot.fit { width: fit-content; max-width: 100%; justify-self: center; }

/* Sections */
section { padding: 64px 0; }
section.alt { background: var(--bg-raised); }
h2 { font-size: clamp(30px, 4.5vw, 44px); letter-spacing: -0.015em; line-height: 1.12; margin: 0 0 12px; }
h3 { font-size: 21px; margin: 0 0 6px; }
.section-lead { color: var(--text-dim); font-size: 19px; max-width: 680px; margin: 0 0 36px; }
.center { text-align: center; }
.center .section-lead { margin-inline: auto; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
section.alt .card { background: var(--bg); }
.card p { margin: 0; color: var(--text-dim); font-size: 16px; }
.card .icon {
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: 14px;
  display: grid; place-items: center; color: #fff; font-size: 20px; font-weight: 700;
}
.card .icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.split { display: grid; gap: 40px; align-items: center; grid-template-columns: 1fr 1fr; }
.split.reverse > :first-child { order: 2; }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split.reverse > :first-child { order: 0; }
}
.split ul { padding-left: 20px; color: var(--text-dim); }
.split li { margin: 6px 0; }

.gallery { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.gallery figure { margin: 0; }
.gallery .shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: var(--bg); }
.gallery figcaption { color: var(--text-dim); font-size: 15px; margin-top: 10px; text-align: center; }

/* Download */
.release {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 36px;
}
.release .version { font-size: 24px; font-weight: 700; }
.release .meta { color: var(--text-dim); font-size: 15px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #ff9f0a; color: #1d1d1f; vertical-align: middle; margin-left: 6px; }
.files { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.files a { font-family: var(--mono); font-size: 14px; }
.files .size { color: var(--text-dim); font-size: 13px; margin-left: 8px; }

ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 52px; margin-bottom: 32px; }
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  display: grid; place-items: center; font-weight: 700;
}
ol.steps h3 { line-height: 34px; }

pre {
  position: relative;
  background: var(--code-bg); color: var(--code-text);
  border-radius: 12px; padding: 16px 18px; margin: 12px 0;
  overflow-x: auto; font-family: var(--mono); font-size: 14px; line-height: 1.6;
}
pre .comment { color: #8e8e93; }
code { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--line); padding: 1px 6px; border-radius: 6px; }
.copy {
  position: absolute; top: 8px; right: 8px;
  font: 600 12px var(--font); color: var(--code-text);
  background: rgba(255, 255, 255, 0.12); border: 0; border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.copy:hover { background: rgba(255, 255, 255, 0.22); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-dim); font-weight: 600; }
.table-wrap { overflow-x: auto; }
kbd {
  font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg-raised); box-shadow: 0 1px 0 var(--line);
}

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 600; }
details p, details pre { margin-top: 10px; }
details p { color: var(--text-dim); }

.callout {
  border-left: 4px solid var(--accent);
  background: var(--bg-raised);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px; margin: 20px 0; color: var(--text-dim);
}

/* Footer */
footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--text-dim); font-size: 14px; }
footer .wrap { display: grid; gap: 24px; grid-template-columns: 2fr 1fr 1fr 1fr; }
footer h4 { color: var(--text); margin: 0 0 8px; font-size: 14px; }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
footer a { color: var(--text-dim); }
@media (max-width: 720px) { footer .wrap { grid-template-columns: 1fr 1fr; } }

/* Docs: contents on the left on wide screens, one column on phones. */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.docs nav.toc { position: sticky; top: 72px; font-size: 14px; }
.docs nav.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.docs nav.toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text-dim); }
.docs nav.toc a:hover { background: var(--line); color: var(--text); text-decoration: none; }
.docs nav.toc h4 { margin: 0 0 8px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.docs article h2 { scroll-margin-top: 72px; margin-top: 56px; padding-top: 8px; border-top: 1px solid var(--line); font-size: clamp(26px, 3.4vw, 34px); }
.docs article h2:first-child { margin-top: 0; border-top: 0; }
.docs article h3 { scroll-margin-top: 72px; margin-top: 28px; }
.docs article p, .docs article li { color: var(--text); }
.docs article ul { padding-left: 22px; }
.docs article li { margin: 6px 0; }
.docs figure { margin: 20px 0; }
.docs figure .shot { width: fit-content; max-width: 100%; }
.docs figcaption { color: var(--text-dim); font-size: 14px; margin-top: 8px; }
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .docs nav.toc { position: static; border: 1px solid var(--line); border-radius: 14px; padding: 14px 8px; background: var(--bg-raised); }
  .docs nav.toc ol { grid-template-columns: 1fr 1fr; }
}

/* Changelog */
.changelog .entry { padding: 32px 0; border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.changelog .entry:first-child { border-top: 0; padding-top: 8px; }
.changelog .entry h2 { font-size: clamp(24px, 3.2vw, 30px); margin: 0 0 4px; }
.changelog .entry .meta { color: var(--text-dim); font-size: 15px; margin: 0 0 16px; }
.changelog .entry ul { padding-left: 22px; }
.changelog .entry li { margin: 4px 0; }
.changelog .body h2 { font-size: 20px; margin: 24px 0 8px; }
.changelog .body h3 { font-size: 17px; margin: 20px 0 6px; }
.changelog .body pre { overflow-x: auto; }
.changelog .body img { max-width: 100%; height: auto; }
.changelog .more { margin-top: 24px; }
