/* Flawless sub-pages (/download, /help): the landing page's look in one shared file.
   Tokens and base styles mirror landing/index.html; change both together. */
:root {
  --bg: #09080d;
  --raised: #14121b;
  --raised-2: #1b1825;
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #f5f3fa;
  --muted: #aba5ba;
  --faint: #878198;
  --violet: #a78bfa;
  --pink: #f472b6;
  --hl: rgba(167, 139, 250, 0.2);
  --hl-text: #e0d4ff;
  --danger: #fb7185;
  --ok: #34d399;
  --grad: linear-gradient(135deg, var(--violet) 0%, var(--pink) 100%);
  --grad-text: linear-gradient(100deg, #c4b5fd 0%, #a78bfa 30%, #f472b6 75%, #fb9fcf 100%);
  --body: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-3: clamp(2rem, 1.35rem + 2.5vw, 3.25rem);
  --step-4: clamp(2.4rem, 1.5rem + 4vw, 4.5rem);
  --radius: 20px;
  --ease: cubic-bezier(0.2, 0.9, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--bg); scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; text-rendering: optimizeLegibility;
}
::selection { background: rgba(167, 139, 250, 0.35); color: #fff; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.035em; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; }
.serif {
  font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: 0.08em; margin-right: -0.04em;
}
.wrap {
  width: 100%; max-width: 1152px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.02em; color: var(--hl-text); }
.lead { font-size: var(--step-1); line-height: 1.6; color: var(--muted); max-width: 40em; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: var(--step--1); color: var(--faint); }

kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 7px; font: 500 0.8125rem/1 var(--body); color: var(--text); background: linear-gradient(180deg, #24202f, #1a1723);
  box-shadow: inset 0 0 0 1px var(--line-2), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 1px 0 rgba(0, 0, 0, 0.5); vertical-align: middle;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 12px; border: 0; font: 600 var(--step-0)/1 var(--body); letter-spacing: -0.01em; text-decoration: none; cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.2s, box-shadow 0.25s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: #fff; color: #0d0b12; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 10px 30px -10px rgba(167, 139, 250, 0.7); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 12px 40px -6px rgba(167, 139, 250, 0.8); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: var(--step--1); border-radius: 10px; }

.spark-mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--grad); display: grid; place-items: center; flex: none;
  box-shadow: 0 0 18px rgba(167, 139, 250, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.spark-mark svg { width: 14px; height: 14px; }

.card {
  position: relative; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* header + footer, as on the landing page */
header.top {
  position: sticky; top: 0; z-index: 20; background: rgba(9, 8, 13, 0.78);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.125rem; letter-spacing: -0.03em; text-decoration: none; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: var(--step--1); font-weight: 500; padding: 6px 12px; border-radius: 8px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav .btn { margin-left: auto; }
footer { border-top: 1px solid var(--line); margin-top: clamp(64px, 9vw, 112px); }
.foot { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; padding-block: 32px; color: var(--faint); font-size: var(--step--1); }
.foot .brand { font-size: 1rem; color: var(--text); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { color: var(--text); }

/* page hero */
.page-hero { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(48px, 7vw, 88px) clamp(32px, 5vw, 56px); }
.page-hero::after {
  content: ""; position: absolute; left: 50%; top: -280px; width: 1100px; height: 640px; max-width: 160vw; transform: translateX(-50%); z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side at 38% 50%, rgba(167, 139, 250, 0.24), transparent 72%), radial-gradient(closest-side at 64% 56%, rgba(244, 114, 182, 0.15), transparent 72%);
  filter: blur(24px);
}
.page-hero .wrap { display: grid; gap: 20px; justify-items: center; text-align: center; }
.page-hero h1 { font-size: var(--step-4); letter-spacing: -0.045em; max-width: 16ch; }

/* download */
.dl-main { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.dl-note { color: var(--faint); font-size: var(--step--1); }
.dl-note a { color: var(--hl-text); }
.platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.platform { padding: clamp(22px, 3vw, 32px); display: grid; gap: 18px; align-content: start; }
.platform.picked { box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.55), 0 0 40px -12px rgba(167, 139, 250, 0.45); }
.platform-head { display: flex; align-items: center; gap: 14px; }
.platform-head .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--raised-2); box-shadow: inset 0 0 0 1px var(--line-2); flex: none; }
.platform-head .ic svg { width: 22px; height: 22px; }
.platform-head h2 { font-size: 1.5rem; }
.platform .btns { display: flex; flex-wrap: wrap; gap: 8px; }
ol.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 14px; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 12px; color: var(--muted); }
ol.steps li::before {
  content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.8125rem; font-weight: 600; color: var(--text); background: var(--raised-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
ol.steps b { color: var(--text); font-weight: 600; }
.req { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.req .card { padding: 22px; display: grid; gap: 6px; }
.req h3 { font-size: 1.0625rem; }
.section { margin-top: clamp(48px, 7vw, 80px); }
.section > h2 { font-size: var(--step-3); margin-bottom: 8px; }

/* help */
.help-hero h1 { max-width: 14ch; }
.search { position: relative; width: min(620px, 100%); margin-top: 8px; }
.search svg { position: absolute; left: 18px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input {
  width: 100%; min-height: 56px; padding: 0 56px 0 48px; border-radius: 16px; border: 1px solid var(--line-2); outline: none;
  background: rgba(255, 255, 255, 0.045); color: var(--text); font: 500 var(--step-1)/1 var(--body);
  box-shadow: 0 20px 60px -24px rgba(167, 139, 250, 0.45); transition: border-color 0.2s, background 0.2s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: rgba(167, 139, 250, 0.7); background: rgba(255, 255, 255, 0.07); }
.search kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
.search input:not(:placeholder-shown) + kbd { display: none; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.quick a { font-size: var(--step--1); color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); background: rgba(255, 255, 255, 0.03); }
.quick a:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }

.block { margin-top: clamp(40px, 6vw, 72px); }
.block-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.block-head h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.block-head p { color: var(--muted); }

.start { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; counter-reset: st; }
.start .card { padding: 24px; display: grid; gap: 10px; align-content: start; }
.start .n { font-size: 0.8125rem; font-weight: 600; color: var(--hl-text); }
.start h3 { font-size: 1.1875rem; }
.start p { color: var(--muted); font-size: 0.9375rem; }
.start a.more { color: var(--hl-text); font-size: var(--step--1); font-weight: 600; text-decoration: none; }

.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cats a { padding: 22px; display: grid; gap: 10px; text-decoration: none; transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.cats a:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.45), 0 18px 40px -20px rgba(167, 139, 250, 0.5); }
.cat-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.cat-ic svg { width: 20px; height: 20px; color: #fff; }
.cats h3 { font-size: 1.0625rem; }
.cats p { color: var(--muted); font-size: var(--step--1); }

.spark {
  --size: 40px; --gap: #0c0a11; position: relative; width: var(--size); height: var(--size); flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--grad); box-shadow: 0 0 0 2.5px transparent, 0 0 0 4.5px transparent, 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.spark svg { width: 40%; height: 40%; fill: #fff; }
.spark[data-state="checking"] svg { animation: twinkle 1.1s ease-in-out infinite; }
.spark[data-state="bad"], .spark[data-state="risk"] { box-shadow: 0 0 0 2.5px var(--gap), 0 0 0 4.5px var(--danger), 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.spark[data-state="ok"] { box-shadow: 0 0 0 2.5px var(--gap), 0 0 0 4.5px var(--ok), 0 0 26px rgba(52, 211, 153, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.spark .count {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #f43f5e; color: #fff;
  font: 700 0.6875rem/20px var(--body); text-align: center; box-shadow: 0 0 0 2px var(--gap);
}
.spark[data-state="ok"] .count {
  color: transparent; background: #10b981 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 8.5 2.6 2.6L12 5.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(0.78) rotate(45deg); opacity: 0.75; } }
.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.glance .card { padding: 20px; display: grid; gap: 14px; align-content: start; }
.composer { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: #0a090e; box-shadow: inset 0 0 0 1px var(--line); }
.composer span:first-child { flex: 1; min-width: 0; font-size: 0.875rem; line-height: 1.9; padding-bottom: 2px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer mark { background: none; color: inherit; text-decoration: underline wavy var(--danger); text-underline-offset: 3px; }
.glance h3 { font-size: 1rem; }
.glance p { color: var(--muted); font-size: var(--step--1); }

.keys-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; padding: 8px 24px; }
.keys-list div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.keys-list div:nth-last-child(-n + 2) { border-bottom: 0; }
.keys-list span:last-child { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: end; }

.group { scroll-margin-top: 88px; }
.qa { padding: 4px 24px; }
.qa details { border-bottom: 1px solid var(--line); scroll-margin-top: 88px; }
.qa details:last-child, .qa details.last { border-bottom: 0; }
.qa summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0;
  font-weight: 600; font-size: 1.0625rem; line-height: 1.35; letter-spacing: -0.01em;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { color: #fff; }
.qa summary::after {
  content: ""; width: 28px; height: 28px; flex: none; border-radius: 50%; transition: transform 0.25s var(--ease), background-color 0.25s;
  background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23c4b5fd' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M8 3.5v9M3.5 8h9'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.qa details[open] summary::after { transform: rotate(45deg); background-color: rgba(167, 139, 250, 0.16); }
.qa .a { display: grid; gap: 10px; padding: 0 44px 20px 0; color: var(--muted); max-width: 46em; }
.qa .a b { color: var(--text); font-weight: 600; }
.qa .a a { color: var(--hl-text); }
.qa .a ol, .qa .a ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.path { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 2px 9px; border-radius: 8px; font-size: 0.875rem; font-weight: 500; color: var(--hl-text); background: var(--hl); white-space: nowrap; }
.trouble summary::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--danger); box-shadow: 0 0 10px rgba(251, 113, 133, 0.6); margin-right: -4px; }
.trouble summary { justify-content: flex-start; }
.trouble summary::after { margin-left: auto; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.contact { margin-top: clamp(40px, 6vw, 72px); padding: clamp(24px, 4vw, 40px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.contact h2 { font-size: 1.5rem; margin-bottom: 6px; }
.contact p { color: var(--muted); }

@media (max-width: 980px) {
  .cats, .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .platforms, .start, .keys-list { grid-template-columns: 1fr; }
  .keys-list div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .qa .a { padding-right: 0; }
}
@media (max-width: 480px) {
  .glance { grid-template-columns: 1fr; }
  .cats a { padding: 16px; gap: 8px; }
  .cats p { display: none; }
  .start .card { padding: 18px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spark[data-state="checking"] svg { animation: none; }
}
