/* MZForge public website — shares the desktop app's Sage Light / Cosmic Dark identity.
   No framework, no webfonts: the Windows/system stack matches the packaged app. */

/* ---------- tokens ---------- */
:root,
html[data-theme="sage"] {
  color-scheme: light;
  --bg: #eef4e8;
  --bg-2: #e2ecdb;
  --surface: rgba(255, 255, 255, .74);
  --surface-solid: #f9fbf4;
  --surface-sunk: #e5eedf;
  --ink: #15302a;
  --muted: #4b6158;
  --line: rgba(32, 74, 60, .16);
  --line-strong: rgba(32, 74, 60, .3);
  --accent: #2e6a4f;
  --accent-ink: #ffffff;
  --accent-soft: #d5e7d3;
  --gold: #7d5f1c;
  --gold-soft: #f1e6c7;
  --good: #23704a;
  --warn: #8a5a00;
  --glow: rgba(70, 138, 93, .22);
  --shadow: 0 24px 64px rgba(28, 58, 46, .13);
  --art-shade: linear-gradient(180deg, rgba(14, 30, 24, 0) 30%, rgba(14, 30, 24, .62));
  --focus: #1f5aa6;
  --logo-sage: inline;
  --logo-cosmic: none;
}
html[data-theme="cosmic"] {
  color-scheme: dark;
  --bg: #0b0920;
  --bg-2: #120c2b;
  --surface: rgba(26, 19, 54, .72);
  --surface-solid: #18112f;
  --surface-sunk: #100b26;
  --ink: #f4efff;
  --muted: #c3b8da;
  --line: rgba(178, 140, 255, .2);
  --line-strong: rgba(178, 140, 255, .38);
  --accent: #a77bff;
  --accent-ink: #160b33;
  --accent-soft: #2a1a50;
  --gold: #e7c98a;
  --gold-soft: #2c2236;
  --good: #7fd8a3;
  --warn: #f2c86b;
  --glow: rgba(137, 84, 255, .28);
  --shadow: 0 28px 80px rgba(0, 0, 0, .42);
  --art-shade: linear-gradient(180deg, rgba(9, 6, 26, 0) 25%, rgba(9, 6, 26, .78));
  --focus: #ffd47a;
  --logo-sage: none;
  --logo-cosmic: inline;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;
    --bg: #0b0920; --bg-2: #120c2b; --surface: rgba(26, 19, 54, .72); --surface-solid: #18112f; --surface-sunk: #100b26;
    --ink: #f4efff; --muted: #c3b8da; --line: rgba(178, 140, 255, .2); --line-strong: rgba(178, 140, 255, .38);
    --accent: #a77bff; --accent-ink: #160b33; --accent-soft: #2a1a50; --gold: #e7c98a; --gold-soft: #2c2236;
    --good: #7fd8a3; --warn: #f2c86b; --glow: rgba(137, 84, 255, .28); --shadow: 0 28px 80px rgba(0, 0, 0, .42);
    --art-shade: linear-gradient(180deg, rgba(9, 6, 26, 0) 25%, rgba(9, 6, 26, .78)); --focus: #ffd47a;
    --logo-sage: none; --logo-cosmic: inline;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg-2); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 520px at 78% -8%, var(--glow), transparent 70%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--ink);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
h1, h2, h3 { text-wrap: balance; font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(32px, 4.2vw, 50px); letter-spacing: -.03em; font-weight: 750; }
h3 { font-size: 20px; letter-spacing: -.01em; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }
code, kbd { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: .9em; }
kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface-solid); }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.hidden { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.logo-sage { display: var(--logo-sage); }
.logo-cosmic { display: var(--logo-cosmic); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--surface-solid); color: var(--ink); padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-strong); font-weight: 700; }
.skip-link:focus { top: 12px; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.nav-shell { height: 72px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; margin-right: auto; }
.brand picture, .brand img { width: 40px; height: 40px; }
.brand picture.logo-sage { display: var(--logo-sage); }
.brand picture.logo-cosmic { display: var(--logo-cosmic); }
.brand b { display: block; font-size: 18px; letter-spacing: .01em; line-height: 1.1; }
.brand small { display: block; font-size: 13px; color: var(--muted); line-height: 1.2; }
.main-nav { display: flex; gap: 4px; }
.main-nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 650; font-size: 15px; text-decoration: none; }
.main-nav a:hover { color: var(--ink); background: var(--surface); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.theme-switch button {
  border: 0; background: transparent; cursor: pointer; border-radius: 9px;
  padding: 6px 10px; font-size: 13px; font-weight: 650; color: var(--muted); line-height: 1.2;
}
.theme-switch button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.menu-button {
  display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
  height: 42px; padding: 0 14px; cursor: pointer; font-weight: 700; align-items: center; gap: 8px;
}
.menu-button svg { width: 18px; height: 18px; }
.mobile-nav { border-top: 1px solid var(--line); padding: 8px 0 16px; }
.mobile-nav a { display: block; padding: 12px 4px; font-weight: 650; text-decoration: none; border-bottom: 1px solid var(--line); }
.mobile-nav .theme-switch { margin-top: 14px; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 11px 18px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 10px 28px var(--glow); }
.button.primary:hover { transform: translateY(-1px); }
.button.small { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.button .stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.button .stack small { font-size: 13px; font-weight: 600; opacity: .86; }
.button.is-disabled, .button[aria-disabled="true"] {
  background: var(--surface-sunk); color: var(--muted); border: 1px dashed var(--line-strong);
  box-shadow: none; cursor: default; transform: none !important;
}
.button svg { width: 18px; height: 18px; flex: none; }


/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; padding: 76px 0 72px; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; color: var(--muted); border: 1px solid var(--line); background: var(--surface); padding: 5px 12px 5px 8px; border-radius: 999px; }
.hero-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px var(--gold-soft); }
.hero h1 { font-size: clamp(54px, 7vw, 94px); font-weight: 800; letter-spacing: -.05em; line-height: .95; margin: 22px 0 18px; }
.hero h1 span { display: block; }
.hero h1 .last { color: var(--accent); }
.hero .tagline { font-size: 21px; font-weight: 650; margin-bottom: 10px; }
.hero .lead { color: var(--muted); font-size: 18px; max-width: 30em; }
.download { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.download-meta { margin-top: 14px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hero-visual { position: relative; }
.hero-frame { position: relative; border-radius: 26px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); aspect-ratio: 4 / 3; background: var(--surface-sunk); }
.hero-frame picture, .hero-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-frame .art-night { display: var(--logo-cosmic); }
.hero-frame .art-day { display: var(--logo-sage); }

/* ---------- sections ---------- */
.section { padding: 80px 0; }
.section-title { margin-bottom: 32px; }
.section-lead { color: var(--muted); font-size: 18px; margin-top: 14px; max-width: 28em; }

/* feature cards */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cards li { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 22px; }
.cards svg { width: 28px; height: 28px; color: var(--accent); margin-bottom: 12px; display: block; }
.cards b { display: block; font-size: 18px; margin-bottom: 4px; }
.cards p { color: var(--muted); font-size: 15.5px; }

/* three steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.steps li { padding: 22px; border-radius: 20px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: 14px; }
.steps b { display: block; font-size: 18px; margin-bottom: 4px; }
.steps p { color: var(--muted); font-size: 15.5px; }
.steps a { color: var(--accent); font-weight: 650; }
.steps strong { color: var(--ink); }

/* multi-host */
.multihost { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent-soft) 38%, transparent) 30%, transparent); }
.mh-simple { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.mh-simple .section-title { margin-bottom: 0; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticks li { border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 16px 18px 16px 52px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 20px; top: 21px; width: 14px; height: 8px; border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg); }
.ticks b { display: block; font-size: 17px; }
.ticks span { color: var(--muted); font-size: 15.5px; }

/* faq */
.faq details { max-width: 820px; border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; font-weight: 700; font-size: 18px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 8px; top: 26px; width: 10px; height: 10px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg); transition: transform .15s ease; }
.faq details[open] summary::after { transform: rotate(-135deg); top: 30px; }
.faq details > div { padding: 0 0 20px; color: var(--muted); max-width: 44em; }
.faq details > div strong { color: var(--ink); }

/* support */
.support-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 22px; align-items: start; }
.help-list { display: grid; gap: 12px; }
.help-card { display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: start; border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 18px; text-decoration: none; }
a.help-card[href]:hover { border-color: var(--accent); }
.help-card .icon { width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.help-card .icon svg { width: 22px; height: 22px; }
.help-card b { display: block; font-size: 17px; }
.help-card p { color: var(--muted); font-size: 15px; }
.help-card p strong { color: var(--ink); }
.help-card.unavailable { border-style: dashed; }
.tips { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.tips h3 { font-size: 17px; margin-bottom: 6px; }
.tips > p { color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.tip-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tip-links a { display: flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; font-weight: 650; font-size: 15px; text-decoration: none; background: var(--surface-solid); text-align: center; }
.tip-links a:hover { border-color: var(--gold); }
.tip-links svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.tip-links .fine { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 30px 0 34px; font-size: 15px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-brand { display: flex; gap: 10px; align-items: center; }
.footer-brand img { width: 32px; height: 32px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--ink); text-decoration: underline; }
.footer-legal { margin-top: 18px; color: var(--muted); font-size: 13.5px; }

/* ---------- inner pages ---------- */
.page-hero { padding: 64px 0 28px; max-width: 46em; }
.page-hero h1 { font-size: clamp(42px, 6vw, 68px); font-weight: 800; letter-spacing: -.045em; line-height: .98; margin: 6px 0 14px; }
.page-hero p { color: var(--muted); font-size: 19px; }
.prose { max-width: 44em; padding-bottom: 80px; }
.prose > section { padding: 24px 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.prose > section:first-child { border-top: 0; padding-top: 0; }
.prose h2 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 10px; }
.prose p, .prose li { color: var(--muted); }
.prose p + p, .prose p + ul, .prose ul + p, .prose p + ol, .prose ol + p { margin-top: 10px; }
.prose ul, .prose ol { padding-left: 22px; margin: 10px 0 0; }
.prose li + li { margin-top: 6px; }
.prose strong, .prose b { color: var(--ink); }
.prose a { color: var(--accent); font-weight: 650; }
.step-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 800; margin-right: 10px; vertical-align: 3px; }
.page-download { margin: 16px 0 16px; display: flex; flex-wrap: wrap; gap: 12px; }
.file-check { margin-top: 14px; font-size: 14px; color: var(--muted); }
.file-check summary { cursor: pointer; font-weight: 650; }
.checksum { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.checksum code { padding: 4px 8px; border-radius: 8px; background: var(--surface-sunk); border: 1px solid var(--line); word-break: break-all; color: var(--ink); }
.copy-button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 13px; font-weight: 650; }
.release { padding: 20px 0; border-top: 1px solid var(--line); }
.release:first-of-type { border-top: 0; padding-top: 0; }
.release h2 { font-size: 22px; margin: 0 0 4px; }
.release ul { margin-top: 8px; }
.notfound { padding: 120px 0; text-align: center; }
.notfound h1 { font-size: clamp(44px, 6vw, 68px); margin-bottom: 12px; }
.notfound p { color: var(--muted); margin-bottom: 24px; }
.notfound .button { margin: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .main-nav, .nav-actions .theme-switch { display: none; }
  .menu-button { display: inline-flex; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 56px; }
  .hero-visual { max-width: 680px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mh-simple, .support-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (min-width: 1061px) { .mobile-nav { display: none !important; } }
@media (max-width: 760px) {
  body { font-size: 16px; }
  .shell { width: calc(100% - 32px); }
  .nav-shell { height: 64px; gap: 12px; }
  .brand small { display: none; }
  .nav-actions .button { display: none; }
  .hero { padding: 40px 0 48px; }
  .hero h1 { font-size: clamp(46px, 14.5vw, 70px); }
  .hero .tagline { font-size: 18px; }
  .download .button { width: 100%; justify-content: flex-start; }
  .section { padding: 60px 0; }
  .section-title { margin-bottom: 24px; }
  .cards, .steps { grid-template-columns: 1fr; }
  .tip-links { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface-solid); }
}
@media print {
  .site-header, .skip-link, .theme-switch, .menu-button, .tips { display: none !important; }
  body { background: #fff; color: #000; }
}
