/* SUB — Simple Universal Builder site styles.
   Minimal, static, responsive-first. One accent color on deep dark. */

:root {
  --bg: #0a0e12;
  --bg-alt: #0d1218;
  --panel: #10161d;
  --code-bg: #0b1015;
  --border: #1f2937;
  --border-soft: #18202b;
  --text: #e6edf3;
  --text-dim: #9aa7b4;
  --muted: #8b97a4;
  --accent: #4f9cf9;
  --accent-dim: rgba(79, 156, 249, 0.12);
  --accent-border: rgba(79, 156, 249, 0.35);
  --radius: 10px;
  --radius-sm: 8px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

code { font-family: var(--mono); font-size: 0.875em; }
p code, li code, h3 code {
  background: var(--accent-dim);
  border: 1px solid rgba(79, 156, 249, 0.18);
  border-radius: 5px;
  padding: 0.05em 0.35em;
  color: #a8cdf5;
  white-space: nowrap;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.1rem); margin-bottom: 10px; }
h3 { font-size: 1.02rem; margin-bottom: 8px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header / nav ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1.02rem; letter-spacing: 0.06em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand img { display: block; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  color: var(--text-dim); font-size: 0.92rem; font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav .nav-gh {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 13px; color: var(--text);
  transition: border-color 0.15s;
}
.site-nav .nav-gh:hover { border-color: var(--accent-border); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  width: 40px; height: 36px; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span {
  display: block; width: 16px; height: 1.5px;
  background: var(--text); transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.3px) rotate(-45deg); }

/* ── Hero ── */
.hero {
  padding: clamp(88px, 14vw, 150px) 0 clamp(72px, 10vw, 110px);
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
}
.hero h1 {
  font-size: clamp(1.9rem, 5.2vw, 3.1rem);
  font-weight: 700; line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: 16px;
  max-width: 22ch;
}
.hero-sub {
  color: var(--text-dim);
  font-size: clamp(1rem, 2.1vw, 1.13rem);
  max-width: 46rem;
  margin-bottom: 36px;
}
.hero-sub code {
  background: var(--accent-dim); border-radius: 5px;
  padding: 0.05em 0.35em; color: #a8cdf5; font-size: 0.9em;
}

.install-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  max-width: 640px;
  margin-bottom: 28px;
  overflow-x: auto;
}
.install-row code {
  font-size: 0.84rem; color: #9ecb7a; white-space: nowrap; flex: 1;
}
.install-sm { padding: 10px 12px; margin: 12px 0 8px; max-width: 100%; width: 100%; }
.install-sm code { font-size: 0.78rem; }

.copy-btn {
  flex-shrink: 0;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 6px;
  padding: 5px 11px; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; font-family: var(--sans);
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent-border); }
.copy-btn.ok { color: var(--accent); border-color: var(--accent-border); }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 0.93rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent); color: #07111c;
}
.btn-primary:hover { background: #6baefb; }
.btn-quiet {
  color: var(--text); border-color: var(--border);
  background: transparent;
}
.btn-quiet:hover { border-color: var(--accent-border); color: var(--text); }

/* ── Sections ── */
.section { padding: clamp(64px, 9vw, 96px) 0; }
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.section-lead {
  color: var(--text-dim);
  font-size: 1.02rem;
  max-width: 44rem;
  margin-bottom: clamp(32px, 5vw, 48px);
}
.section-lead code {
  background: var(--accent-dim); border-radius: 5px;
  padding: 0.05em 0.35em; color: #a8cdf5; font-size: 0.88em;
}

/* ── Features ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.feature {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 24px 26px;
  min-width: 0;
  transition: border-color 0.2s;
}
.feature:hover { border-color: var(--border); }
.feature h3 { color: var(--text); }
.feature p { color: var(--text-dim); font-size: 0.93rem; }

/* ── Code blocks / tabs ── */
.code-tabs { max-width: 780px; }
.tab-list { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  padding: 6px 16px;
  font-size: 0.86rem; font-weight: 600;
  cursor: pointer; font-family: var(--sans);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-color: var(--accent-border); background: var(--accent-dim); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted); font-family: var(--mono); font-size: 0.78rem;
}
.code-body {
  padding: 18px 20px;
  font-family: var(--mono); font-size: 0.87rem; line-height: 1.7;
  overflow-x: auto;
}
.code-out {
  border-top: 1px solid var(--border-soft);
  padding: 12px 20px;
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.6;
  color: var(--text-dim);
  white-space: pre-wrap;
}
.targets-cmd { max-width: 560px; margin-top: 36px; }

/* Syntax highlight tokens (restyled, calm palette) */
.tok-kw  { color: #7fb7f0; font-weight: 600; }
.tok-str { color: #9ecb7a; }
.tok-num { color: #d9a16c; }
.tok-com { color: #5c6b7a; font-style: italic; }
.tok-fn  { color: #c8a7e8; }
.tok-shell { color: #d9a16c; }

/* ── Targets ── */
.target-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px;
  max-width: 780px;
}
.target-grid li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: 11px 15px;
  font-size: 0.92rem; font-weight: 600;
  transition: border-color 0.15s;
}
.target-grid li:hover { border-color: var(--border); }
.target-grid em { font-style: normal; font-weight: 400; font-size: 0.72rem; color: var(--muted); }

/* ── Quick start steps ── */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  counter-reset: step;
}
.steps > li {
  position: relative;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  counter-increment: step;
}
.steps > li::before {
  content: counter(step);
  position: absolute; top: -14px; left: 20px;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #07111c;
  font-size: 0.86rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps p { color: var(--text-dim); font-size: 0.93rem; margin-bottom: 8px; }
.steps .code-block { margin-top: 10px; }
.steps .code-body { padding: 13px 16px; font-size: 0.8rem; }
.steps-alt { color: var(--muted); font-size: 0.86rem; margin-top: 6px; }
.steps .install-row { margin: 12px 0 6px; }

.doc-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 40px; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 44px 0 36px;
}
.footer-inner {
  display: flex; flex-direction: column; gap: 22px; align-items: flex-start;
}
.footer-brand { display: flex; align-items: center; gap: 13px; }
.footer-brand strong { display: block; font-size: 0.98rem; }
.footer-brand span { color: var(--muted); font-size: 0.82rem; }
.footer-links { list-style: none; display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); font-size: 0.88rem; }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-note { color: var(--muted); font-size: 0.8rem; }
.footer-note a { color: var(--text-dim); }

/* ── Responsive ── */
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }

  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 10px 18px 16px;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    padding: 12px 4px; font-size: 1rem;
    border-bottom: 1px solid var(--border-soft);
  }
  .site-nav a:last-child { border-bottom: none; }
  .site-nav .nav-gh { border: none; padding: 12px 4px; border-radius: 0; }

  .feature-grid { grid-template-columns: 1fr; gap: 10px; }
  .feature { padding: 20px; }

  .install-row { flex-direction: row; }
  .install-row code { font-size: 0.76rem; }
  .copy-btn { padding: 6px 9px; font-size: 0.72rem; }

  .hero { text-align: left; }
  .hero-actions .btn { flex: 1 1 auto; }

  .code-body { font-size: 0.8rem; padding: 14px 16px; }
  .target-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
  .target-grid { grid-template-columns: 1fr; }
}

/* ── Focus indicators ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--accent);
  color: #07111c;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  z-index: 100;
  transition: top 0.2s;
}
.skip-link:focus { top: 8px; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Matrix rain + terminal demo ── */
.hero { position: relative; overflow: hidden; }
#matrixRain {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.16; pointer-events: none; z-index: 0;
}
.hero .container { position: relative; z-index: 1; }

.terminal-demo {
  margin-top: 40px; max-width: 640px;
  background: rgba(8, 12, 16, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(79, 156, 249, 0.06);
  font-family: var(--mono);
  overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px; background: #131a22;
  border-bottom: 1px solid var(--border-soft);
}
.term-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.term-dot.r { background: #ff5f57; } .term-dot.y { background: #febc2e; } .term-dot.g { background: #28c840; }
.term-title { margin-left: 8px; color: var(--muted); font-size: 0.75rem; }
.term-body { padding: 14px 16px 18px; min-height: 148px; position: relative; }
.term-body pre {
  margin: 0; font-family: var(--mono); font-size: 0.82rem; line-height: 1.7;
  color: #b9f2c2; white-space: pre-wrap; word-break: break-word;
}
.term-body pre .t-prompt { color: var(--accent); }
.term-body pre .t-out { color: var(--text-dim); }
.term-cursor {
  display: inline-block; width: 8px; height: 15px; margin-top: 2px;
  background: #b9f2c2; animation: termBlink 1.05s steps(1) infinite;
  vertical-align: text-bottom;
}
@keyframes termBlink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  #matrixRain { display: none; }
  .term-cursor { animation: none; }
}

/* ── Download cards ── */
.dl-version { font-size: 0.6em; font-weight: 500; color: var(--accent); vertical-align: middle; margin-left: 6px; font-family: var(--mono); }
.dl-grid {
  display: grid; gap: 16px; margin-top: 26px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.dl-card {
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 20px 20px 22px;
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
  transition: border-color .15s, box-shadow .15s;
}
.dl-card h3 { margin: 0; font-size: 1.05rem; }
.dl-card p { margin: 0; color: var(--text-dim); font-size: 0.85rem; }
.dl-card .dl-btn { width: 100%; text-align: center; }
.dl-card.dl-hit { border-color: var(--accent-border); box-shadow: 0 0 0 1px var(--accent-border), 0 8px 26px rgba(79,156,249,0.12); }
.dl-card.dl-hit::before {
  content: "Detected"; align-self: flex-end;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-dim);
  border: 1px solid var(--accent-border); border-radius: 999px; padding: 2px 9px; margin-bottom: -4px;
}
.dl-alt { color: var(--accent); font-size: 0.82rem; text-decoration: none; }
.dl-alt:hover { text-decoration: underline; }
.dl-alt-row { display: flex; flex-wrap: wrap; gap: 10px; }
.dl-foot { margin-top: 22px; color: var(--text-dim); font-size: 0.86rem; }
