/* Кольори — ті самі, що в темах лаунчера: «Опівніч» для темної, «Денне світло» для світлої.
   Тему можна вибрати в налаштуваннях сайту: <html data-theme="light|dark">; без нього — як у системі. */
:root {
  --bg: #0B0E13;
  --bg-alt: #0F131A;
  --surface: #151A22;
  --surface-2: #1B212B;
  --line: #262D39;
  --text: #E9EFF5;
  --muted: #9AA6B4;
  --accent: #3EDC81;
  --accent-2: #1FC8A0;
  --accent-text: #3EDC81;
  --on-accent: #06140C;
  --glow: #8B7BF7;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, .7);
  --radius: 14px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, "SF Mono", Menlo, "Liberation Mono", monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F6F7F9;
  --bg-alt: #EDEFF3;
  --surface: #FFFFFF;
  --surface-2: #F1F3F6;
  --line: #DCE1E8;
  --text: #1B2129;
  --muted: #5B6573;
  --accent: #2FC873;
  --accent-2: #1FB594;
  --accent-text: #137A45;
  --on-accent: #06140C;
  --glow: #8FB4F0;
  --shadow: 0 24px 50px -24px rgba(20, 30, 50, .35);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F6F7F9;
    --bg-alt: #EDEFF3;
    --surface: #FFFFFF;
    --surface-2: #F1F3F6;
    --line: #DCE1E8;
    --text: #1B2129;
    --muted: #5B6573;
    --accent: #2FC873;
    --accent-2: #1FB594;
    --accent-text: #137A45;
    --on-accent: #06140C;
    --glow: #8FB4F0;
    --shadow: 0 24px 50px -24px rgba(20, 30, 50, .35);
    color-scheme: light;
  }
}

[hidden] { display: none !important; }
/* Поки вантажиться словник іншої мови, сторінка не блимає українською */
html.i18n-wait body { visibility: hidden; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-text); text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--line); padding: .05em .4em; border-radius: 6px; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); font-weight: 600; letter-spacing: -.02em; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- шапка */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.top-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand img { border-radius: 8px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .95rem; }
.nav a:hover { color: var(--text); background: var(--surface); }
/* ---------- налаштування сайту: кнопка в шапці й вікно */
.prefs-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .8rem; font-weight: 700; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; cursor: pointer; flex: none; }
.prefs-btn:hover { color: var(--text); background: var(--surface); }
.prefs-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.prefs { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.prefs::backdrop { background: rgba(5, 8, 12, .55); backdrop-filter: blur(3px); }
.prefs-in { padding: 20px 22px 22px; display: grid; gap: 16px; }
.prefs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prefs-head h2 { font-size: 1.25rem; }
.prefs-close { font: inherit; font-size: 1.4rem; line-height: 1; color: var(--muted); background: none; border: 0; border-radius: 8px; width: 34px; height: 34px; cursor: pointer; }
.prefs-close:hover { color: var(--text); background: var(--surface-2); }
.prefs-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.prefs-group legend { font-weight: 700; font-size: .9rem; margin-bottom: 8px; padding: 0; }
.prefs-langs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.prefs-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.prefs-option { font: inherit; font-size: .9rem; text-align: left; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prefs-option:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.prefs-option[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); font-weight: 700; }

/* ---------- кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  padding: 13px 22px; border-radius: 12px; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { box-shadow: 0 14px 34px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-ghost { color: var(--text); border-color: var(--line); background: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-soft { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-soft:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.btn-wide { width: 100%; }

/* ---------- перший екран */
.hero { position: relative; overflow: hidden; padding-block: 72px 56px; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto 30%; height: 620px; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--glow) 28%, transparent), transparent 70%),
              radial-gradient(closest-side at 30% 60%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  filter: blur(10px);
}
.hero-in { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; background: var(--surface); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }
.eyebrow b { color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.hero h1 { font-size: clamp(1.9rem, 3.1vw, 2.6rem); margin-top: 18px; font-weight: 800; text-wrap: balance; }
.hero h1 .mono { font-family: inherit; font-weight: inherit; letter-spacing: inherit; color: var(--accent-text); white-space: nowrap; }
.lead { color: var(--muted); font-size: 1.12rem; margin-top: 18px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 12px; }

.window { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.hero-shot .window { transform: perspective(2000px) rotateY(-4deg); transform-origin: left center; }
@media (prefers-reduced-motion: reduce) { .hero-shot .window { transform: none; } }

/* ---------- цифри */
.stats { border-block: 1px solid var(--line); background: var(--bg-alt); }
.stats-in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-in div { padding: 22px 12px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.stats-in div + div { border-left: 1px solid var(--line); }
.stats b { font-size: 1.9rem; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="light"] .stats b { background: none; color: var(--accent-text); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .stats b { background: none; color: var(--accent-text); } }
.stats span { color: var(--muted); font-size: .9rem; }

/* ---------- розділи */
.section { padding-block: 88px; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; }
.section-lead { color: var(--muted); margin-top: 10px; font-size: 1.05rem; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: border-color .2s ease, transform .2s ease; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
.card h3 { font-size: 1.08rem; margin-top: 14px; }
.card p { color: var(--muted); margin-top: 8px; font-size: .95rem; }
.ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); }
.ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico svg .fill { fill: currentColor; }

/* ---------- скріншоти */
.tabs { display: inline-flex; gap: 4px; margin-block: 28px 22px; background: var(--surface); border: 1px solid var(--line); padding: 4px; border-radius: 12px; flex-wrap: wrap; }
.tabs button { font: inherit; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 8px 16px; border-radius: 9px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); }
.window-big img { transition: opacity .2s ease; }
.window-big img.swap { opacity: .25; }

/* ---------- завантаження */
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 32px; }
.dl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 18px; }
.dl-card.is-mine { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.dl-head { display: flex; align-items: flex-start; gap: 14px; }
.dl-head > svg { color: var(--accent-text); flex: none; margin-top: 2px; }
.dl-head > div { flex: 1 1 0; min-width: 0; }
.dl-head h3 { font-size: 1.2rem; }
.dl-head p { font-size: .9rem; }
.badge { margin-left: auto; flex: none; font-size: .75rem; font-weight: 700; color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); padding: 3px 9px; border-radius: 999px; }
.steps { margin: 0; padding-left: 1.3em; color: var(--muted); display: grid; gap: 6px; flex: 1; }
.steps li::marker { color: var(--accent-text); font-weight: 700; }
.steps code { white-space: nowrap; }
.sha summary { cursor: pointer; color: var(--muted); font-size: .85rem; width: max-content; }
.sha-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.sha-row code { font-size: .75rem; flex: 1; min-width: 0; padding: 6px 8px; word-break: break-all; }
.copy { font: inherit; font-size: .8rem; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; flex: none; }
.copy:hover { border-color: var(--accent); }

.req { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; }
.req h3 { font-size: 1.05rem; }
.req dl { margin: 14px 0 12px; display: grid; gap: 8px; }
.req dl div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.req dt { font-weight: 600; }
.req dd { margin: 0; color: var(--muted); }

/* ---------- історія версій */
.releases { margin-top: 32px; display: grid; gap: 16px; }
.release { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.release header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.release .ver { font-weight: 800; font-size: 1.25rem; color: var(--accent-text); }
.release time { color: var(--muted); font-size: .9rem; }
/* Альфа — червона в обох темах: це попередження, а не прикраса */
.alpha { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1.5; color: #fff; background: #D93A3F; padding: 1px 8px; border-radius: 999px; vertical-align: middle; cursor: help; }
/* Бета — теж попередження, але м'якше за альфу: версія вже майже готова, просто ще не вийшла */
.beta { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1.5; color: #fff; background: #C77A16; padding: 1px 8px; border-radius: 999px; vertical-align: middle; cursor: help; }
.release .latest { font-size: .72rem; font-weight: 700; color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); padding: 2px 8px; border-radius: 999px; }
.release h3 { font-size: 1.05rem; margin-top: 6px; width: 100%; }
.release ul { margin: 12px 0 0; padding-left: 1.2em; color: var(--muted); display: grid; gap: 6px; }
.release ul li::marker { color: var(--accent-text); }
.more { font: inherit; color: var(--accent-text); background: none; border: 0; cursor: pointer; font-weight: 600; justify-self: start; padding: 4px 0; }

/* ---------- підтримка й зв'язок */
.support-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; margin-top: 32px; align-items: start; }
.support-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: grid; gap: 14px; }
.support-card.is-premium { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.support-card h3 { font-size: 1.25rem; }
.support-card h4 { font-size: .95rem; margin: 4px 0 0; }
.support-head { display: flex; align-items: center; gap: 12px; }
.support-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.support-note { margin-top: 18px; max-width: 60em; }
.perks { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.perks li { position: relative; padding-left: 26px; }
.perks li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 12px; height: 7px; border-left: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text); transform: rotate(-45deg); }
.contact-card { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 32px; align-items: start; }
.contact-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* ---------- питання */
.faq { margin-top: 28px; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-text); font-size: 1.3rem; line-height: 1; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 18px; }
.feed { word-break: break-all; }

/* ---------- підвал */
.foot { border-top: 1px solid var(--line); padding-block: 32px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.foot-in .muted { flex: 1; min-width: 240px; }
.small-brand { font-size: .95rem; }
.foot a { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 90; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- вузькі екрани */
@media (max-width: 980px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero-shot .window { transform: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { display: none; }
  .prefs-btn { margin-left: auto; }
  .support-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .hero { padding-block: 44px 40px; }
  .section { padding-block: 60px; }
  .grid, .dl-grid { grid-template-columns: minmax(0, 1fr); }
  .steps code { white-space: normal; }
  .stats-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-in div:nth-child(3) { border-left: 0; }
  .stats-in div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cta .btn { flex: 1 1 100%; }
  .req dl div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dl-head { flex-wrap: wrap; }
  .badge { margin-left: 42px; }
  .support-head .badge { margin-left: auto; }
  .contact-card { grid-template-columns: minmax(0, 1fr); }
  .prefs-langs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Завантаження ще не відкрите (site.ps1 -NoDownloads).
   Кнопка лишається на місці, але видно, що вона не працює: зникла кнопка
   виглядає як зламана сторінка, а погашена — як свідоме рішення. */
.btn.is-locked {
  cursor: not-allowed;
  opacity: .55;
  filter: grayscale(1);
  pointer-events: none;
  user-select: none;
}

.dl-soon {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--card);
  color: var(--text-soft);
  font-size: 15px;
}
