/* NVserve landing page. Dark by design, whatever the docs palette. */

.nvl {
  --nv-bg: #07070f;
  --nv-bg2: #0e0e1c;
  --nv-panel: rgba(22, 20, 44, 0.62);
  --nv-line: rgba(160, 140, 255, 0.18);
  --nv-fg: #ecebff;
  --nv-dim: #a4a2c8;
  --nv-purple: #8b5cf6;
  --nv-violet: #c084fc;
  --nv-teal: #2ee6c5;
  --nv-amber: #ffb547;
  --nv-radius: 14px;
  color: var(--nv-fg);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(139, 92, 246, 0.22), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(46, 230, 197, 0.10), transparent 60%),
    var(--nv-bg);
  font-family: var(--md-text-font-family, "Roboto"), system-ui, sans-serif;
  /* The theme's base font is tiny outside its article styles; set a readable one. */
  font-size: 0.8rem;
  line-height: 1.5;
  overflow: hidden;
}

/* The docs theme puts the hero inside a padded container; let it go edge to edge. */
.md-main__inner:empty { display: none; }
.md-main { background: var(--nv-bg, #07070f); }

.nvl a { color: inherit; }
.nvl code {
  font-family: var(--md-code-font-family, "Roboto Mono"), ui-monospace, monospace;
  font-size: 0.85em;
  background: rgba(139, 92, 246, 0.14);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

/* ---------- Hero ---------- */

.nvl-hero {
  position: relative;
  min-height: min(100vh, 900px);
  min-height: min(100svh, 900px);
  display: flex;
  align-items: center;
  padding: 5rem clamp(1rem, 5vw, 5rem) 6rem;
  isolation: isolate;
}

.nvl-hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

.nvl-hero__glow {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(600px 420px at 70% 55%, rgba(139, 92, 246, 0.25), transparent 70%);
  pointer-events: none;
}

/* min-width: 0 lets the column shrink below the install command's unwrapped width. */
.nvl-hero__text { max-width: 38rem; width: 100%; min-width: 0; position: relative; }

.nvl-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--nv-dim);
  border: 1px solid var(--nv-line);
  background: rgba(14, 14, 28, 0.6);
  backdrop-filter: blur(6px);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}

.nvl-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--nv-teal);
  box-shadow: 0 0 12px var(--nv-teal);
  animation: nvl-pulse 1.8s ease-in-out infinite;
}

@keyframes nvl-pulse { 50% { opacity: 0.35; } }

.nvl-hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 1.2rem 0 1rem;
  color: var(--nv-fg);
}

.nvl-grad {
  background: linear-gradient(100deg, var(--nv-violet), var(--nv-purple) 40%, var(--nv-teal));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: nvl-shine 6s ease-in-out infinite alternate;
}

@keyframes nvl-shine { to { background-position: 100% 0; } }

.nvl-lead {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.6;
  color: var(--nv-dim);
  max-width: 34rem;
}

.nvl-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.6rem 0 1.4rem; }

.nvl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.3rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid var(--nv-line);
  background: rgba(22, 20, 44, 0.55);
  backdrop-filter: blur(8px);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.nvl-btn:hover { transform: translateY(-2px); border-color: var(--nv-violet); }

.nvl-btn--primary {
  border: none;
  color: #fff !important;
  background: linear-gradient(120deg, var(--nv-purple), #6d28d9 60%, #4f46e5);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.45);
}

.nvl-btn--primary:hover { box-shadow: 0 12px 40px rgba(139, 92, 246, 0.6); }

.nvl-btn--ghost { background: transparent; }

.nvl-install {
  border: 1px solid var(--nv-line);
  border-radius: var(--nv-radius);
  background: rgba(10, 10, 22, 0.72);
  backdrop-filter: blur(10px);
  overflow: hidden;
  max-width: 36rem;
}

.nvl-install__tabs { display: flex; border-bottom: 1px solid var(--nv-line); }

.nvl-install__tabs button {
  all: unset;
  cursor: pointer;
  padding: 0.5rem 1rem;
  font-size: 0.78rem;
  color: var(--nv-dim);
  border-bottom: 2px solid transparent;
}

.nvl-install__tabs button[aria-selected="true"] { color: var(--nv-fg); border-bottom-color: var(--nv-teal); }
.nvl-install__tabs button:focus-visible { outline: 2px solid var(--nv-teal); }

.nvl-install__panel { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 0.9rem; }
.nvl-install__panel[hidden] { display: none; }

.nvl-install__panel code {
  flex: 1;
  min-width: 0;
  background: none;
  padding: 0;
  font-size: 0.74rem;
  color: var(--nv-teal);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.nvl-copy {
  all: unset;
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0.3rem 0.7rem;
  border-radius: 7px;
  border: 1px solid var(--nv-line);
  color: var(--nv-dim);
  flex-shrink: 0;
}

.nvl-copy:hover, .nvl-copy:focus-visible { color: var(--nv-fg); border-color: var(--nv-teal); }
.nvl-copy.is-done { color: var(--nv-teal); }

.nvl-hud {
  position: absolute;
  right: clamp(1rem, 3vw, 3rem);
  top: 5.5rem;
  width: 15rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--nv-line);
  border-radius: var(--nv-radius);
  background: var(--nv-panel);
  backdrop-filter: blur(10px);
  font-size: 0.74rem;
  color: var(--nv-dim);
}

.nvl-hud__title { color: var(--nv-fg); font-weight: 600; margin-bottom: 0.5rem; font-size: 0.76rem; }
.nvl-hud__row { display: flex; justify-content: space-between; padding: 0.12rem 0; }
.nvl-hud__row b { color: var(--nv-fg); font-variant-numeric: tabular-nums; font-weight: 600; }
.nvl-hud__legend { margin-top: 0.6rem; display: grid; gap: 0.25rem; font-size: 0.68rem; }

.nvl-sw {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 3px;
  margin-right: 0.45rem;
  vertical-align: -0.05rem;
}

.nvl-sw--disk { background: var(--nv-teal); box-shadow: 0 0 8px var(--nv-teal); }
.nvl-sw--cache { background: var(--nv-amber); box-shadow: 0 0 8px var(--nv-amber); }
.nvl-sw--slot { background: var(--nv-violet); box-shadow: 0 0 8px var(--nv-violet); }

.nvl-stream {
  position: absolute;
  right: clamp(1rem, 3vw, 3rem);
  bottom: 5.5rem;
  width: 22rem;
  max-width: calc(100% - 2rem);
  padding: 0.8rem 1rem;
  border: 1px solid var(--nv-line);
  border-radius: var(--nv-radius);
  background: var(--nv-panel);
  backdrop-filter: blur(10px);
}

.nvl-stream__label { font-size: 0.68rem; color: var(--nv-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.35rem; }
.nvl-stream__text { font-size: 0.86rem; line-height: 1.5; min-height: 3em; color: var(--nv-fg); }
.nvl-stream__text .nvl-tok { animation: nvl-tok 0.5s ease-out; }

@keyframes nvl-tok { from { color: var(--nv-teal); text-shadow: 0 0 10px var(--nv-teal); } }

.nvl-caret {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--nv-teal);
  animation: nvl-blink 1s steps(1) infinite;
}

@keyframes nvl-blink { 50% { opacity: 0; } }

.nvl-scroll {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  width: 1.5rem;
  height: 2.4rem;
  margin-left: -0.75rem;
  border: 2px solid var(--nv-line);
  border-radius: 1rem;
}

.nvl-scroll span {
  position: absolute;
  left: 50%;
  top: 0.4rem;
  width: 4px;
  height: 0.5rem;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--nv-teal);
  animation: nvl-wheel 1.6s ease-in-out infinite;
}

@keyframes nvl-wheel { 60% { transform: translateY(0.8rem); opacity: 0; } }

/* Without WebGL, the hero keeps its gradient. */
.nvl-nogl .nvl-hero__canvas { display: none; }

/* ---------- Sections ---------- */

.nvl-section { padding: 5rem clamp(1rem, 5vw, 5rem); max-width: 76rem; margin: 0 auto; }

.nvl-h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.8rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem !important;
  color: var(--nv-fg) !important;
}

.nvl-sub { color: var(--nv-dim); font-size: 1.05rem; margin: 0 0 2.4rem; max-width: 40rem; }

.nvl-reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.nvl-reveal.is-visible { opacity: 1; transform: none; }

/* Stats band. */
.nvl-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--nv-line);
  border-top: 1px solid var(--nv-line);
  border-bottom: 1px solid var(--nv-line);
}

.nvl-stat { background: var(--nv-bg2); padding: 2.2rem 1rem; text-align: center; }

.nvl-stat__num {
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--nv-fg), var(--nv-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nvl-stat__label { color: var(--nv-dim); font-size: 0.85rem; margin-top: 0.3rem; }

/* Pipeline. */
.nvl-pipe { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 3rem; }

.nvl-pipe__node {
  flex: 0 0 11rem;
  text-align: center;
  padding: 1.2rem 0.8rem;
  border-radius: var(--nv-radius);
  border: 1px solid var(--nv-line);
  background: var(--nv-panel);
}

.nvl-pipe__node b { display: block; margin: 0.4rem 0 0.2rem; font-size: 1.05em; }
.nvl-pipe__node small { color: var(--nv-dim); font-size: 0.74rem; line-height: 1.35; display: block; }
.nvl-pipe__icon { font-size: 1.6rem; color: var(--nv-teal); text-shadow: 0 0 14px rgba(46, 230, 197, 0.7); }

.nvl-pipe__wire {
  position: relative;
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.2), rgba(46, 230, 197, 0.4));
  overflow: visible;
}

.nvl-pipe__wire i {
  position: absolute;
  top: -3px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nv-teal);
  box-shadow: 0 0 10px var(--nv-teal);
  animation: nvl-flow 2.4s linear infinite;
}

.nvl-pipe__wire i:nth-child(2) { animation-delay: 0.8s; }
.nvl-pipe__wire i:nth-child(3) { animation-delay: 1.6s; }

@keyframes nvl-flow {
  from { left: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  to { left: calc(100% - 8px); opacity: 0; }
}

/* Cards. */
.nvl-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }

.nvl-card {
  padding: 1.5rem;
  border-radius: var(--nv-radius);
  border: 1px solid var(--nv-line);
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.10), rgba(14, 14, 28, 0.6) 55%);
}

.nvl-card h3 { margin: 0 0 0.6rem !important; font-size: 1.1rem !important; color: var(--nv-fg) !important; }
.nvl-card p { color: var(--nv-dim); font-size: 0.9rem; line-height: 1.6; margin: 0 0 1rem; }
.nvl-card a, .nvl-link { color: var(--nv-teal) !important; font-size: 0.85rem; font-weight: 600; text-decoration: none; }

/* 3D tilt on hover (set by script). */
.nvl-tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.8s ease;
  will-change: transform;
}

.nvl-tilt:hover { border-color: rgba(192, 132, 252, 0.5); box-shadow: 0 20px 50px rgba(139, 92, 246, 0.25); }
.nvl-tilt.nvl-reveal:not(.is-visible) { transform: translateY(24px); }

/* Split section with the terminal. */
.nvl-section--split { display: grid; grid-template-columns: 1fr 1.25fr; gap: 3rem; align-items: center; }

.nvl-checks { list-style: none; padding: 0; margin: 0 0 1.8rem; }
.nvl-checks li { padding-left: 1.6rem; position: relative; margin: 0.5rem 0; color: var(--nv-dim); }
.nvl-checks li::before { content: "✓"; position: absolute; left: 0; color: var(--nv-teal); font-weight: 700; }

.nvl-term {
  border-radius: var(--nv-radius);
  border: 1px solid var(--nv-line);
  background: #05050b;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.08);
  overflow: hidden;
}

.nvl-term__bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--nv-line); background: #0c0c18; }
.nvl-term__bar i { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #ff5f57; }
.nvl-term__bar i:nth-child(2) { background: #febc2e; }
.nvl-term__bar i:nth-child(3) { background: #28c840; }
.nvl-term__bar span { margin-left: 0.6rem; font-size: 0.72rem; color: var(--nv-dim); }

.nvl-term__replay { all: unset; cursor: pointer; margin-left: auto; color: var(--nv-dim); font-size: 0.9rem; }
.nvl-term__replay:hover, .nvl-term__replay:focus-visible { color: var(--nv-teal); }

.nvl-term__body {
  margin: 0;
  padding: 1rem 1.1rem;
  height: 21rem;
  overflow: hidden;
  font-family: var(--md-code-font-family, "Roboto Mono"), ui-monospace, monospace;
  font-size: 0.74rem;
  line-height: 1.6;
  color: #cfd0ef;
  white-space: pre-wrap;
  word-break: break-word;
}

.nvl-term__body .p { color: var(--nv-teal); }
.nvl-term__body .c { color: #fff; }
.nvl-term__body .d { color: #7f7da8; }
.nvl-term__body .a { color: var(--nv-amber); }
.nvl-term__body .g { color: #7ee787; }

/* Benchmarks. */
.nvl-bench { border: 1px solid var(--nv-line); border-radius: var(--nv-radius); background: var(--nv-panel); padding: 1.6rem; }
.nvl-bench__legend { display: flex; gap: 1.4rem; font-size: 0.78rem; color: var(--nv-dim); margin-bottom: 1.2rem; }
.nvl-bench__row { display: grid; grid-template-columns: 15rem 1fr; gap: 1rem; align-items: center; padding: 0.7rem 0; border-top: 1px solid var(--nv-line); }
.nvl-bench__name { font-weight: 600; }
.nvl-bench__name small { display: block; font-weight: 400; color: var(--nv-dim); font-size: 0.76rem; }
.nvl-bench__bars { display: grid; gap: 0.35rem; }

.nvl-bar {
  height: 1.35rem;
  width: 0;
  border-radius: 6px;
  position: relative;
  transition: width 1.4s cubic-bezier(0.2, 0.7, 0.2, 1);
  min-width: 0;
}

.nvl-bar span { position: absolute; left: calc(100% + 0.5rem); top: 50%; transform: translateY(-50%); font-size: 0.74rem; color: var(--nv-dim); white-space: nowrap; }
.nvl-bar--disk { background: linear-gradient(90deg, rgba(46, 230, 197, 0.25), var(--nv-teal)); box-shadow: 0 0 18px rgba(46, 230, 197, 0.25); }
.nvl-bar--ram { background: linear-gradient(90deg, rgba(192, 132, 252, 0.3), var(--nv-violet)); box-shadow: 0 0 18px rgba(192, 132, 252, 0.3); }
.nvl-bench .nvl-link { display: inline-block; margin-top: 1rem; }

/* Models. */
.nvl-models { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }

.nvl-model {
  padding: 1.3rem 1rem;
  border-radius: var(--nv-radius);
  border: 1px solid var(--nv-line);
  background: radial-gradient(120% 100% at 0% 0%, rgba(46, 230, 197, 0.10), rgba(14, 14, 28, 0.7) 60%);
}

.nvl-model b { display: block; font-size: 1rem; }
.nvl-model span { color: var(--nv-dim); font-size: 0.8rem; }

/* Final band. */
.nvl-final {
  text-align: center;
  padding: 6rem 1rem 7rem;
  background: radial-gradient(700px 300px at 50% 100%, rgba(139, 92, 246, 0.3), transparent 70%);
}

.nvl-final h2 { font-size: clamp(1.8rem, 4vw, 3rem) !important; font-weight: 800 !important; color: var(--nv-fg) !important; margin: 0 0 1.4rem !important; }
.nvl-final .nvl-cta { justify-content: center; }

/* ---------- Smaller screens ---------- */

@media (max-width: 76.1875em) {
  .nvl-hud { display: none; }
}

@media (max-width: 60em) {
  .nvl-hero { align-items: flex-start; padding-top: 3rem; min-height: 0; padding-bottom: 24rem; }
  .nvl-hero h1 { font-size: clamp(2rem, 10.5vw, 2.6rem); }
  .nvl-badge { font-size: 0.6rem; }
  .nvl-stream { left: 1rem; right: 1rem; width: auto; bottom: 4.5rem; }
  .nvl-stats { grid-template-columns: repeat(2, 1fr); }
  .nvl-pipe { flex-direction: column; }
  .nvl-pipe__node { flex: none; width: 100%; max-width: 20rem; }
  .nvl-pipe__wire { width: 2px; height: 2.2rem; flex: none; background: linear-gradient(180deg, rgba(139, 92, 246, 0.2), rgba(46, 230, 197, 0.4)); }
  .nvl-pipe__wire i { left: -3px; animation-name: nvl-flow-v; }
  .nvl-grid3, .nvl-section--split { grid-template-columns: 1fr; }
  .nvl-models { grid-template-columns: repeat(2, 1fr); }
  .nvl-bench__row { grid-template-columns: 1fr; }
}

@keyframes nvl-flow-v {
  from { top: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  to { top: calc(100% - 8px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .nvl *, .nvl *::before { animation: none !important; transition: none !important; }
  .nvl-reveal { opacity: 1; transform: none; }
  .nvl-bar { transition: none; }
}
