:root {
  --bg:      #1e1e2e;
  --surface: #181825;
  --overlay: #313244;
  --text:    #cdd6f4;
  --subtext: #a6adc8;
  --muted:   #6c7086;
  --blue:    #89b4fa;
  --sky:     #89dceb;
  --lavender:#b4befe;
  --green:   #a6e3a1;
  --yellow:  #f9e2af;
  --red:     #f38ba8;
  --mono:    "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
  --sans:    "Inter", system-ui, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* ── Fixed ASCII background ── */
#ascii-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  opacity: 0.28;
  pointer-events: none;
  overflow: hidden;
}

#ascii-bg img, #ascii-bg canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}


/* all page content scrolls above bg */
header, section, footer {
  position: relative;
  z-index: 1;
}

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

/* ── Layout ── */

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem;
}

section { padding: 4rem 0; }
section + section { border-top: 1px solid var(--overlay); }

/* ── Header ── */

.hero-logo {
  display: block;
  width: 340px;
  height: 340px;
  margin: 0 auto 1.5rem;
  object-fit: cover;
  object-position: center 20%; /* push head up slightly */
  border-radius: 72px;
  overflow: hidden;
}

header {
  padding: 5rem 0 4rem;
  text-align: center;
}

@keyframes letterflicker {
  0%,100% { color: var(--text); }
  25%     { color: var(--sky); }
  50%     { color: var(--blue); }
  75%     { color: var(--lavender); }
}

.logo {
  font-family: var(--mono);
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.logo span {
  animation: letterflicker 6s ease-in-out infinite;
}
.logo span:nth-child(1) { animation-delay: 0s; }
.logo span:nth-child(2) { animation-delay: 0.4s; }
.logo span:nth-child(3) { animation-delay: 0.8s; }
.logo span:nth-child(4) { animation-delay: 1.2s; }
.logo span:nth-child(5) { animation-delay: 1.6s; }

.tagline {
  margin-top: 1rem;
  font-size: 1.2rem;
  color: var(--subtext);
}

.badges {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--overlay);
  color: var(--subtext);
}

.cta {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary { background: var(--blue); color: var(--bg); }
.btn-secondary { background: var(--overlay); color: var(--text); }

/* ── Demo block ── */

.demo {
  background: var(--surface);
  border: 1px solid var(--overlay);
  border-radius: 10px;
  overflow: hidden;
}

.demo-bar {
  background: var(--overlay);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.demo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.demo-canvas {
  padding: 1.5rem 2rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}

.c-blue    { color: var(--blue); }
.c-sky     { color: var(--sky); }
.c-green   { color: var(--green); }
.c-yellow  { color: var(--yellow); }
.c-lavender{ color: var(--lavender); }
.c-muted   { color: var(--muted); }
.c-red     { color: var(--red); }
.c-subtext { color: var(--subtext); }

/* ── Features ── */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--overlay);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.feature-icon {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.feature h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.feature p {
  font-size: 0.85rem;
  color: var(--subtext);
  line-height: 1.5;
}

/* ── Sections ── */

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
}

h2 .accent { color: var(--blue); }

p { color: var(--subtext); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Install ── */

.install-block {
  background: var(--surface);
  border: 1px solid var(--overlay);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 1.5rem;
}

.install-tabs {
  display: flex;
  border-bottom: 1px solid var(--overlay);
}

.install-tab {
  padding: 0.6rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  user-select: none;
}

.install-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* ── Release download buttons ── */

.release-wrap {
  margin-top: 1.25rem;
}

.release-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.release-tag {
  color: var(--sky);
  font-family: var(--mono);
}

.release-btns {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--overlay);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.btn-dl:hover {
  border-color: var(--blue);
  background: var(--mantle);
  color: var(--text);
}

.btn-dl .btn-size {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 0.2rem;
}

.btn-dl-unavail {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.release-none {
  font-size: 0.85rem;
  color: var(--muted);
}

.install-content {
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
  white-space: pre;
  overflow-x: auto;
}

.install-content .cmd { color: var(--green); }
.install-content .cmt { color: var(--muted); }
.install-content .arg { color: var(--yellow); }

/* ── Keybinds ── */

.keys-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.88rem;
}

.keys-table th {
  text-align: left;
  padding: 0.5rem 1rem;
  background: #313244;
  color: var(--text);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--overlay);
}

.keys-table tr:nth-child(odd)  td { background: #1e1e2e; }
.keys-table tr:nth-child(even) td { background: #181825; }

.keys-table td {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #45475a;
  color: var(--text);
  vertical-align: top;
}

.keys-table tr:last-child td { border-bottom: none; }

kbd {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: var(--overlay);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--text);
  white-space: nowrap;
}

/* ── Format ── */

.format-example {
  background: var(--surface);
  border: 1px solid var(--overlay);
  border-radius: 8px;
  padding: 1.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-top: 1.5rem;
  overflow-x: auto;
  white-space: pre;
}

.fy { color: var(--yellow); }
.fg { color: var(--green); }
.fb { color: var(--blue); }
.fm { color: var(--muted); }
.fl { color: var(--lavender); }

/* ── Footer ── */

footer {
  padding: 3rem 0;
  border-top: 1px solid var(--overlay);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

footer a { color: var(--subtext); }

@media (max-width: 600px) {
  .logo { font-size: 2.5rem; }
  .demo-canvas { font-size: 0.72rem; padding: 1rem; }
  .container { padding: 0 1.25rem; }
  section { padding: 3rem 0; }
}
