/* The VistaWASM site: a landing page, guides and the API reference. */
/* Plain CSS, no build step, like the demo. */

:root {
  color-scheme: dark;
  --bg: #0b1011;
  --bg-raised: #111819;
  --surface: #152022;
  --surface-hover: #1b2a2c;
  --border: rgb(255 255 255 / 10%);
  --border-strong: rgb(255 255 255 / 18%);
  --text: #eef3ef;
  --muted: #a9b8b1;
  --faint: #7d8c86;
  --accent: #d7f078;
  --accent-ink: #151817;
  --green: #8fd694;
  --sky: #86c9ec;
  --code-bg: #0d1415;
  --radius: 12px;
  --max: 1160px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: #e8f7a8;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
}

:not(pre) > code {
  padding: 0.12em 0.4em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--code-bg);
  color: #dfe8e3;
  overflow-wrap: anywhere;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: min(var(--max), 100% - 32px);
  margin-inline: auto;
}

/* Navigation */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgb(11 16 17 / 82%);
  backdrop-filter: blur(12px);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand svg {
  width: 30px;
  height: 30px;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 28px rgb(215 240 120 / 22%);
}

.button-primary:hover {
  background: #e3f79a;
  color: var(--accent-ink);
  box-shadow: 0 10px 34px rgb(215 240 120 / 32%);
}

.button-ghost {
  border-color: var(--border-strong);
  background: rgb(10 16 17 / 55%);
  color: var(--text);
  backdrop-filter: blur(6px);
}

.button-ghost:hover {
  border-color: rgb(255 255 255 / 34%);
  background: rgb(20 30 32 / 75%);
  color: var(--text);
}

.button-small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 14px;
}

.stars {
  padding: 1px 9px;
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  font-size: 0.88em;
  font-variant-numeric: tabular-nums;
}

.button-primary .stars {
  background: rgb(0 0 0 / 12%);
}

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr);
  min-height: min(860px, 92vh);
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 40%;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgb(8 12 13 / 88%) 0%, rgb(8 12 13 / 62%) 42%, rgb(8 12 13 / 8%) 78%),
    linear-gradient(0deg, var(--bg) 0%, rgb(11 16 17 / 0%) 26%);
}

.hero-content {
  padding: 72px 0 96px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 5px 12px;
  border: 1px solid rgb(215 240 120 / 35%);
  border-radius: 999px;
  background: rgb(215 240 120 / 10%);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hero h1 {
  max-width: 15ch;
  margin: 0 0 20px;
  font-size: clamp(42px, 6.4vw, 76px);
  font-weight: 800;
  text-wrap: balance;
}

.hero h1 em {
  background: linear-gradient(92deg, var(--accent), var(--green) 55%, var(--sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
}

.lead {
  max-width: 36em;
  margin: 0 0 32px;
  color: #d4ded9;
  font-size: clamp(18px, 1.6vw, 21px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.install {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 6px 6px 6px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgb(8 12 13 / 72%);
  backdrop-filter: blur(6px);
}

.install code {
  min-width: 0;
  overflow-x: auto;
  color: #dfe8e3;
  font-size: 15px;
  white-space: nowrap;
}

.install code::before {
  content: "$ ";
  color: var(--faint);
}

.copy {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.copy:hover {
  background: var(--surface-hover);
}

.fine {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Sections */

.section {
  padding: 96px 0;
}

.section-alt {
  border-block: 1px solid var(--border);
  background: var(--bg-raised);
}

.section-head {
  max-width: 44em;
  margin-bottom: 44px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section h2 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 800;
  text-wrap: balance;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 19px;
}

/* Numbers */

.numbers {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  overflow: hidden;
  list-style: none;
}

.numbers li {
  padding: 22px 16px;
  background: var(--bg-raised);
  text-align: center;
}

.numbers strong {
  display: block;
  color: var(--text);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.numbers span {
  color: var(--muted);
  font-size: 14px;
}

/* Feature cards */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

/* Six features sit in two even rows of three. */
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.card h3 {
  margin: 14px 0 8px;
  font-size: 19px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

.icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: rgb(215 240 120 / 11%);
  color: var(--accent);
}

.icon svg {
  width: 24px;
  height: 24px;
}

.card-link {
  color: inherit;
  text-decoration: none;
}

.card-link:hover {
  color: inherit;
}

.card-link .more {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

/* Cover the whole card with the link, so the card is one target. */
.card-link a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

/* Gallery */

.gallery {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 16px;
  margin: 0;
}

.gallery figure {
  position: relative;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.gallery figure:first-child {
  grid-row: span 2;
}

.gallery a {
  display: block;
  height: 100%;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.gallery a:hover img {
  transform: scale(1.03);
}

.gallery figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 36px 16px 14px;
  background: linear-gradient(0deg, rgb(8 12 13 / 88%), rgb(8 12 13 / 0%));
  color: #dfe8e3;
  font-size: 14.5px;
  pointer-events: none;
}

.gallery figcaption strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

/* Code */

.code {
  position: relative;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
}

.code-title {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 13px;
}

pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 14.5px;
  line-height: 1.65;
  tab-size: 2;
}

pre code {
  color: #d9e4de;
}

.code .copy {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0.75;
}

.code .copy:hover,
.code .copy:focus-visible {
  opacity: 1;
}

.tok-comment {
  color: #7f918a;
  font-style: italic;
}

.tok-string {
  color: #bfe3a0;
}

.tok-keyword {
  color: #f3a6c8;
}

.tok-number {
  color: #f7c97e;
}

.tok-type {
  color: #8fd3f2;
}

.tok-call {
  color: #e2f0a2;
}

.tok-tag {
  color: #f3a6c8;
}

.tok-attr {
  color: #8fd3f2;
}

/* Split layouts */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 48px;
  align-items: center;
}

.checks {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  margin: 10px 0;
  padding-left: 30px;
  color: #d4ded9;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgb(143 214 148 / 18%) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%238fd694' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* Star band */

.star-band {
  position: relative;
  overflow: hidden;
  padding: 56px;
  border: 1px solid rgb(215 240 120 / 25%);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 85% 0%, rgb(215 240 120 / 16%), transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgb(134 201 236 / 14%), transparent 55%),
    var(--surface);
  text-align: center;
}

.star-band h2 {
  margin: 0 auto 12px;
  max-width: 20ch;
}

.star-band p {
  max-width: 38em;
  margin: 0 auto 28px;
  color: #d4ded9;
  font-size: 18px;
}

.star-band .actions {
  justify-content: center;
  margin: 0;
}

/* FAQ */

.faq {
  display: grid;
  gap: 12px;
  max-width: 860px;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details > div {
  padding: 0 22px 18px;
  color: var(--muted);
}

.faq details p {
  margin: 0 0 10px;
}

/* Documentation pages */

.doc-hero {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 90% -20%, rgb(215 240 120 / 12%), transparent 55%),
    var(--bg-raised);
}

.doc-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 800;
}

.doc-hero .lead {
  margin-bottom: 24px;
}

.doc {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 56px;
  padding: 48px 0 96px;
}

.toc {
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  font-size: 14.5px;
}

.toc p {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 5px 10px;
  border-left: 2px solid var(--border);
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--text);
}

.toc a[aria-current="true"] {
  border-left-color: var(--accent);
  color: var(--text);
}

.prose {
  max-width: 820px;
}

.prose h2 {
  margin: 56px 0 14px;
  padding-top: 8px;
  font-size: 30px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin: 36px 0 10px;
  font-size: 21px;
}

.prose p,
.prose li {
  color: #d4ded9;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li {
  margin: 6px 0;
}

.callout {
  margin: 24px 0;
  padding: 16px 20px;
  border: 1px solid rgb(134 201 236 / 30%);
  border-left: 4px solid var(--sky);
  border-radius: 10px;
  background: rgb(134 201 236 / 7%);
}

.callout p {
  margin: 0;
}

.table-wrap {
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

td code {
  white-space: nowrap;
}

.api-list {
  display: grid;
  gap: 1px;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  overflow: hidden;
}

.api-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 18px;
  padding: 13px 16px;
  background: var(--bg);
}

.api-list dt {
  font-family: var(--mono);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.api-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.next {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 56px;
}

/* Footer */

.footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--muted);
  font-size: 15px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 32px;
}

.footer h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer li {
  margin: 6px 0;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text);
}

.footer .small {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}

/* Small screens */

@media (max-width: 980px) {
  .numbers {
    grid-template-columns: repeat(3, 1fr);
  }

  .split,
  .gallery,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery figure:first-child {
    grid-row: auto;
  }

  .doc {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .toc {
    position: static;
    max-height: none;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .nav .wrap {
    flex-wrap: wrap;
    gap: 0;
    padding-block: 8px;
  }

  .nav nav {
    order: 3;
    width: 100%;
    min-width: 0;
  }

  .nav-links {
    margin: 6px 0 0;
    overflow-x: auto;
  }

  .nav-links a {
    padding: 6px 10px;
    white-space: nowrap;
  }

  .nav .button {
    margin-left: auto;
  }

  .hero {
    min-height: 0;
  }

  .hero::before {
    background:
      linear-gradient(180deg, rgb(8 12 13 / 80%) 0%, rgb(8 12 13 / 66%) 60%, var(--bg) 100%);
  }

  .hero-content {
    padding: 56px 0 64px;
  }

  .actions .button {
    flex: 1 1 100%;
  }

  .section {
    padding: 64px 0;
  }

  .numbers {
    grid-template-columns: repeat(2, 1fr);
  }

  .star-band {
    padding: 36px 20px;
  }

  .api-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
