/* nlvm site — dark theme, teal primary */

:root {
  --bg: #0a0f0c;
  --bg-raised: #101613;
  --bg-code: #0d110e;
  --border: #263832;
  --border-strong: #2e423b;
  --text: #e7eeea;
  --text-muted: #93a69e;
  --text-faint: #5f7370;
  --primary: #35c99b;
  --primary-bright: #4ee0ac;
  --primary-dim: rgba(53, 201, 155, 0.12);
  --primary-glow: rgba(53, 201, 155, 0.25);
  --code-keyword: #35c99b;
  --code-type: #82b8dd;
  --code-string: #d4b478;
  --code-number: #c39fd4;
  --code-comment: #5c7069;
  --code-punct: #8ea39c;
  --code-risk: #e0a458;
  --mono: "IBM Plex Mono", ui-monospace, "JetBrains Mono", "Fira Code", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

/* Film-grain overlay: breaks up flat dark surfaces on large displays. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--primary-glow); }

/* Long URLs and runs of inline <code> tokens have no natural break point and
   would push narrow layouts wider than the viewport. */
p, li, h1, h2, h3, h4, dd, dt { overflow-wrap: break-word; }
:not(pre) > code { overflow-wrap: anywhere; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-bright); }

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

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 17, 16, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.wordmark:hover { color: var(--text); }

.wordmark .glyph {
  display: inline-block;
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.wordmark .vm { color: var(--text-faint); font-weight: 400; }

.wordmark .name::after {
  content: "_";
  margin-left: 1px;
  color: var(--primary);
  animation: blink 1.2s steps(1) infinite;
}

.site-nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.site-nav a { color: var(--text-muted); font-size: 14.5px; white-space: nowrap; }
.site-nav a:hover, .site-nav a.active { color: var(--text); }
.site-nav a.gh {
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 5px 12px;
  color: var(--text);
}
.site-nav a.gh:hover { border-color: var(--primary); color: var(--primary); }

@media (max-width: 680px) {
  .site-header .container { gap: 14px; padding: 0 16px; }
  .wordmark { font-size: 16px; }
  .site-nav {
    gap: 15px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { font-size: 13.5px; }
  .site-nav a.gh { padding: 4px 10px; }
}

/* ---------- hero ---------- */

.hero { padding: 76px 0 64px; position: relative; overflow: hidden; }

.hero::before {
  content: "";
  position: absolute;
  top: -240px; left: 14%;
  width: 720px; height: 480px;
  background: radial-gradient(ellipse at center, var(--primary-glow), transparent 65%);
  opacity: 0.4;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 52px;
  align-items: center;
  position: relative;
}

/* grid items default to min-width:auto, so a long unwrappable line (the
   install command) would stretch the column past the viewport */
.hero-grid > * { min-width: 0; }

.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.hero-glyph {
  display: inline-block;
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.accent { color: var(--primary); }

.hero .tagline {
  margin: 18px 0 0;
  max-width: 560px;
  font-size: 1.08rem;
  color: var(--text-muted);
}

.hero .cta-row {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.quick-install { margin-top: 22px; max-width: 480px; }

.quick-install-label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.quick-install pre { margin: 0; padding-right: 46px; }
.quick-install pre .copy-btn { opacity: 1; }

@media (max-width: 920px) {
  .hero { padding: 56px 0 56px; text-align: center; }
  .hero::before { left: 50%; transform: translateX(-50%); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .hero-brand { justify-content: center; }
  .hero .tagline { margin-left: auto; margin-right: auto; }
  .hero .cta-row { justify-content: center; }
  .quick-install { margin-left: auto; margin-right: auto; }
}

@media (max-width: 560px) {
  .hero { padding: 44px 0 48px; }
  .hero-glyph { width: 38px; height: 38px; border-radius: 9px; }
  .hero-eyebrow { font-size: 12px; letter-spacing: 0.1em; }
  .hero .tagline { font-size: 1rem; }
  .hero .cta-row { gap: 10px; }
  /* wrap the install line instead of hiding it behind a scrollbar */
  .quick-install pre { white-space: pre-wrap; word-break: break-word; text-align: left; }
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { /* transform: translateY(-1px); */ }

.btn-primary { background: var(--primary); color: #06231c; }
.btn-primary:hover { background: var(--primary-bright); color: #06231c; box-shadow: 0 4px 24px var(--primary-glow); }

.btn-outline { border: 1px solid var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost { border: 1px solid transparent; color: var(--text); }
.btn-ghost:hover { border-color: transparent; background: var(--bg-raised); }

.btn-ghost-outline { border: 1px solid transparent; color: var(--text); }
.btn-ghost-outline:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- terminal ---------- */

.terminal {
  margin: 0 auto;
  max-width: 680px;
  width: 100%;
  text-align: left;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  position: relative;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.terminal-bar span:first-child { background: #3a4f48; }
.terminal-title { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-faint); }

.terminal-body {
  padding: 18px 20px 22px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  min-height: 280px;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-body .prompt { color: var(--primary); }
.terminal-body .out { color: var(--text-muted); }
.terminal-body .ok { color: var(--primary-bright); }
.terminal-body .err { color: #d9917f; }
.terminal-body .com { color: var(--text-faint); font-style: italic; }

.terminal-body { transition: opacity 0.35s ease; }
.terminal-body.fade-out { opacity: 0; }

.terminal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.terminal-tabs button {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.terminal-tabs button:hover { color: var(--text); border-color: var(--border-strong); }
.terminal-tabs button.active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-dim);
}

.cursor {
  display: inline-block;
  width: 8px; height: 16px;
  background: var(--primary);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- sections ---------- */

section.block { padding: 72px 0; }
section.block + section.block { border-top: 1px solid var(--border); }

.kicker {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker .knum {
  color: var(--text-faint);
  margin-right: 10px;
}
.kicker .knum::after {
  content: "·";
  margin-left: 10px;
}

h2.section-title {
  margin-top: 10px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.01em;
}

.section-sub { margin-top: 10px; color: var(--text-muted); max-width: 640px; }

/* ---------- feature grid ---------- */

.feature-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
}

.feature {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 22px 6px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.feature:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.feature h3 { font-size: 1.05rem; font-weight: 650; }
.feature h3 .dot { color: var(--primary); margin-right: 8px; }
.feature p { margin-top: 6px; font-size: 14.5px; color: var(--text-muted); }
.feature pre { margin: 14px -6px 16px; }

/* ---------- code blocks ---------- */

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  position: relative;
}

pre code { font-family: inherit; }

pre { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
pre::-webkit-scrollbar { height: 8px; }
pre::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
pre::-webkit-scrollbar-track { background: transparent; }

.tok-kw { color: var(--code-keyword); }
.tok-type { color: var(--code-type); }
.tok-str { color: var(--code-string); }
.tok-num { color: var(--code-number); }
.tok-com { color: var(--code-comment); font-style: italic; }
.tok-punct { color: var(--code-punct); }
.tok-risk { color: var(--code-risk); }

pre .copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-faint);
  font-family: var(--sans);
  font-size: 11.5px;
  padding: 3px 9px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
pre:hover .copy-btn { opacity: 1; }
pre .copy-btn:hover { color: var(--primary); border-color: var(--primary); }

pre.sh .prompt { color: var(--primary); user-select: none; }
pre.sh .out { color: var(--text-faint); }

/* ---------- example (tour) layout ---------- */

.example { margin-top: 56px; }
.example:first-of-type { margin-top: 40px; }

.example h3 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.example h3 .num {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-faint);
  margin-right: 10px;
}
.example .desc { margin: 8px 0 18px; color: var(--text-muted); max-width: 720px; }
.example .desc code, p code, li code, .footer-note code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.5px 5px;
}

.result-line {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-faint);
}
.result-line b { color: var(--primary); font-weight: 600; }

/* ---------- stdlib cross-links ---------- */

.stdlib-link {
  color: inherit;
  border-bottom: 1px dotted var(--text-faint);
}
.stdlib-link:hover {
  color: var(--primary-bright);
  border-bottom-color: var(--primary-bright);
}

/* ---------- two-column split ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- spotlight panel (dogfooding) ---------- */

.spotlight-panel {
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 42px 44px;
  background:
    radial-gradient(520px 300px at 12% 20%, var(--primary-dim), transparent 70%),
    var(--bg-raised);
  box-shadow: 0 0 70px var(--primary-dim), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.spotlight-panel pre { border-color: var(--border-strong); }
@media (max-width: 860px) { .spotlight-panel { padding: 28px 22px; } }

/* ---------- dogfooding carousel ---------- */

.dogfood-carousel { margin-top: 20px; overflow: hidden; }

.dogfood-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.dogfood-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.dogfood-controls {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.dogfood-arrow {
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
  color: var(--text-faint);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.dogfood-arrow:hover { color: var(--text); border-color: var(--border-strong); }

.dogfood-dots { display: flex; gap: 8px; }

.dogfood-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.dogfood-dots button:hover { border-color: var(--primary); }
.dogfood-dots button.active {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.2);
}

/* ---------- prose pages ---------- */

.prose { max-width: 780px; padding: 56px 24px 90px; margin: 0 auto; }
.prose h1 { font-size: 2.1rem; font-weight: 780; letter-spacing: -0.015em; }
.prose .lede { margin-top: 12px; color: var(--text-muted); font-size: 1.08rem; }
.prose h2 { margin-top: 46px; font-size: 1.4rem; font-weight: 700; }
.prose h3 { margin-top: 30px; font-size: 1.1rem; font-weight: 650; }
.prose p { margin-top: 14px; }
.prose pre { margin-top: 16px; }
.prose ul, .prose ol { margin: 14px 0 0 24px; }
.prose li { margin-top: 6px; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

.note {
  margin-top: 18px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--bg-raised);
  font-size: 14.5px;
  color: var(--text-muted);
}

/* ---------- devlog cards ---------- */

.post-list { margin-top: 40px; display: grid; gap: 18px; }
.post-list.home-posts {
  margin-top: 36px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.post-card {
  display: block;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.post-card:hover { border-color: var(--primary); color: var(--text); transform: translateY(-2px); }
.post-card .date { font-family: var(--mono); font-size: 12.5px; color: var(--text-faint); }
.post-card h3 { margin-top: 6px; font-size: 1.15rem; font-weight: 680; }
.post-card p { margin-top: 6px; font-size: 14.5px; color: var(--text-muted); }

/* ---------- stats strip ---------- */

.stats {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.stat {
  text-align: center;
  padding: 22px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.stat .value { font-family: var(--mono); font-size: 1.7rem; font-weight: 700; color: var(--primary); }
.stat .label { margin-top: 4px; font-size: 13.5px; color: var(--text-muted); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 48px;
  font-size: 14px;
  color: var(--text-faint);
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px 12px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary); }
.site-footer .footer-note {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--text-faint);
  opacity: 0.85;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.footer-links a:not(:first-child) { position: relative; padding-left: 14px; }
.footer-links a:not(:first-child)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
  transform: translateY(-50%);
}

/* ---------- reveal animation ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; }
  .wordmark .name::after { animation: none; }
  html { scroll-behavior: auto; }
}
