/* ZerX website. Single stylesheet, no build step. Palette and sizes: docs/TZ-site.md §6. */

:root {
  --bg: #05070D;
  --surface: #0C111B;
  --border: #1B2433;
  --text: #F3F6FB;
  --muted: #94A0B4;
  --accent: #2B8CFF;
  --accent-2: #19D3FF;
  --gradient: linear-gradient(135deg, #2B8CFF 0%, #19D3FF 100%);
  --glow: 0 0 40px rgba(43, 140, 255, .35);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  --container: 1080px;
  --section: 96px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/28px var(--font);
}

[hidden] { display: none !important; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 48px; line-height: 56px; letter-spacing: -0.02em; }
h2 { font-size: 30px; line-height: 38px; }
h3 { font-size: 20px; line-height: 28px; font-weight: 600; }
p { margin: 0 0 16px; }
code { font-family: var(--mono); font-size: .94em; }
p code, li code, h2 code { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.caption { font-size: 14px; line-height: 20px; color: var(--muted); }
.grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Skip link and visually hidden helper */
.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 16px; }
.vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 7, 13, .86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.nav-wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  min-height: 68px; padding-top: 6px; padding-bottom: 6px;
}
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { width: 111px; height: 56px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 2px; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  border-radius: 8px; color: var(--muted); font-size: 15px; text-decoration: none;
}
.site-nav a:hover { color: var(--text); }
.site-nav .lang { margin-left: 6px; border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.site-nav .lang:hover { border-color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: var(--radius); border: 1px solid transparent;
  font: 600 17px/24px var(--font); text-decoration: none; white-space: nowrap;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--gradient); color: var(--bg); }
.btn-primary:hover { color: var(--bg); box-shadow: var(--glow); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { color: var(--text); border-color: var(--accent); }

/* Code block with optional Copy button (button appears only when JS is running) */
.code {
  display: flex; align-items: stretch; min-width: 0; max-width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.code pre {
  flex: 1 1 auto; min-width: 0; margin: 0; padding: 11px 16px;
  overflow-x: auto; white-space: pre; font: 15px/24px var(--mono);
}
.code code { font: inherit; }
.copy { display: none; }
.js .copy {
  display: inline-flex; align-items: center; flex: 0 0 auto; min-width: 44px; padding: 0 14px;
  border: 0; border-left: 1px solid var(--border); background: transparent;
  color: var(--muted); font: 600 14px/20px var(--font); cursor: pointer;
}
.copy:hover { color: var(--text); background: rgba(43, 140, 255, .12); }
.copy.is-done { color: var(--accent-2); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 64px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; }
.hero-copy { min-width: 0; }
.hero h1 { margin-bottom: 20px; }
.hero .sub { font-size: 19px; line-height: 30px; color: var(--muted); max-width: 580px; margin-bottom: 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-cta .code { flex: 0 1 auto; }
.hero-note { margin: 18px 0 0; }
.hero-art { position: relative; display: flex; justify-content: center; order: -1; }
.hero-art::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 460px; height: 460px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(43, 140, 255, .38) 0%, rgba(25, 211, 255, .12) 42%, rgba(5, 7, 13, 0) 70%);
  pointer-events: none;
  animation: pulse 7s ease-in-out infinite;
}
.hero-art img {
  position: relative; width: 160px; height: 160px;
  filter: drop-shadow(0 0 40px rgba(43, 140, 255, .45));
}
@keyframes pulse {
  0%, 100% { opacity: .75; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}
#screenshot { margin: 56px 0 0; }
#screenshot img { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--glow); }
#screenshot figcaption { margin-top: 12px; }

/* Sections */
.section { padding: var(--section) 0; border-top: 1px solid var(--border); }
.section > .container > h2 { margin-bottom: 40px; max-width: 760px; }

.cards, .steps, .layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.cards > li, .steps > li, .layers > li { min-width: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.card svg { display: block; width: 28px; height: 28px; margin-bottom: 18px; color: var(--accent-2); }
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); }

.steps { counter-reset: step; gap: 28px 24px; }
.steps > li { counter-increment: step; }
.steps > li::before {
  content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gradient); color: var(--bg); font-weight: 700; font-size: 18px;
}
.steps h3 { margin: 14px 0 8px; }
.steps p { margin: 0; color: var(--muted); }

.layers > li { position: relative; padding-left: 22px; }
.layers > li::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 2px;
  background: var(--gradient);
}
.layers h3 { margin-bottom: 8px; }
.layers p { margin: 0; color: var(--muted); }

.install-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
.install-grid p { max-width: 620px; }
.install-grid .code { max-width: 520px; }
.install-grid .more { margin-top: 20px; }

/* FAQ */
.faq { border-top: 1px solid var(--border); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 44px; padding: 18px 0; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 18px; line-height: 28px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border);
  color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1;
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 22px; color: var(--muted); max-width: 720px; }

/* Text pages: privacy, changelog */
.page { padding: 64px 0 var(--section); }
.prose { max-width: 720px; }
.prose h1 { margin-bottom: 8px; }
.prose .meta { margin-bottom: 40px; }
.prose h2 { font-size: 24px; line-height: 32px; margin: 40px 0 12px; }
.prose ul { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }

/* Centered pages: 404, download */
.center { padding: 120px 0; text-align: center; }
.center h1 { margin-bottom: 16px; }
.center p { color: var(--muted); max-width: 520px; margin: 0 auto 16px; }
.center .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 28px 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.footer-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; }
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; margin: 0 -8px; padding: 0; display: flex; flex-wrap: wrap; gap: 0 4px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 767px) {
  :root { --section: 56px; }
  h1 { font-size: 34px; line-height: 40px; }
  h2 { font-size: 26px; line-height: 34px; }
  .hero { padding: 40px 0 48px; }
  .hero .sub { font-size: 17px; line-height: 28px; }
  .hero-cta .btn, .hero-cta .code { width: 100%; }
  .hero-art::before { width: 340px; height: 340px; }
}
@media (max-width: 599px) {
  .site-nav { width: 100%; }
  .site-nav ul { margin-left: -12px; }
}
@media (min-width: 768px) {
  .hero { padding: var(--section) 0 80px; }
  .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; }
  .hero-art { order: 0; }
  .hero-art img { width: 320px; height: 320px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
  .install-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; }
}
@media (min-width: 1080px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art::before { animation: none; }
  .btn, .faq summary::after, .copy { transition: none; }
  .btn-primary:hover { transform: none; }
}
