/* The style of www.renderfi.com: the landing page (site/index.html) and the
   demos page (site/demos.html). Dark by default, light when the system asks
   for it. No fonts to download: the system's own. */

:root {
  color-scheme: dark light;
  --bg: #0f1115;
  --bg-2: #14171c;
  --panel: #191c22;
  --line: #2a2f38;
  --text: #e6e9ee;
  --dim: #9aa2ae;
  --accent: #7aa7ff;
  --accent-2: #b48cff;
  --accent-text: #0b1020;
  --good: #6fd39b;
  --code-bg: #12151a;
  --warn-bg: #3a2a12;
  --warn-line: #7a5a20;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa;
    --bg-2: #eef1f5;
    --panel: #ffffff;
    --line: #dde2ea;
    --text: #161a21;
    --dim: #5b6472;
    --accent: #2f62d8;
    --accent-2: #7b4fd6;
    --accent-text: #ffffff;
    --good: #1c8a4f;
    --code-bg: #f3f5f8;
    --warn-bg: #fff4dc;
    --warn-line: #e3c27a;
    --shadow: 0 10px 30px rgba(20, 30, 50, 0.12);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: 0.92em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--panel); color: var(--text); padding: 8px 12px; border-radius: 8px;
}
.skip:focus { left: 8px; z-index: 10; }

/* ---- the bar at the top ---- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.top nav { display: flex; gap: 20px; margin-left: auto; }
.top nav a { color: var(--dim); text-decoration: none; font-size: 15px; }
.top nav a:hover, .top nav a:focus-visible { color: var(--text); }
@media (max-width: 720px) { .top nav .wide { display: none; } }

/* ---- buttons ---- */
.buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font-weight: 600; text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.button:hover, .button:focus-visible { border-color: var(--accent); transform: translateY(-1px); }
.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: var(--accent-text);
}

/* ---- the hero ---- */
.hero { padding: 72px 0 40px; text-align: center; overflow: hidden; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 520px; z-index: -1;
  background:
    radial-gradient(closest-side at 30% 50%, color-mix(in srgb, var(--accent) 28%, transparent), transparent),
    radial-gradient(closest-side at 70% 40%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent);
  filter: blur(20px);
}
.hero h1 {
  margin: 0 auto; max-width: 18em;
  font-size: clamp(32px, 5.4vw, 56px); line-height: 1.1; letter-spacing: -0.025em;
}
.hero .lead { margin: 18px auto 28px; max-width: 40em; color: var(--dim); font-size: clamp(17px, 2vw, 20px); }
.hero .buttons { justify-content: center; }
.hero .shot {
  display: block;
  margin: 48px auto 0; max-width: 1040px;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; background: var(--bg-2);
}
.hero .shot img { display: block; width: 100%; height: auto; }
.hero .caption { margin-top: 12px; color: var(--dim); font-size: 14px; }

/* ---- sections ---- */
section { padding: 64px 0; }
section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
section h2 { margin: 0 0 8px; font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -0.02em; line-height: 1.2; }
section .intro { margin: 0 0 32px; max-width: 46em; color: var(--dim); font-size: 18px; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }

.box {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 20px;
}
.box h3 { margin: 0 0 6px; font-size: 18px; }
.box p { margin: 0; color: var(--dim); }
.box ul { margin: 8px 0 0; padding-left: 18px; color: var(--dim); }
.box li + li { margin-top: 4px; }

.big { display: block; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.big small { font-size: 15px; font-weight: 500; color: var(--dim); }

/* ---- tables ---- */
.table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
thead th { color: var(--dim); font-weight: 600; background: var(--bg-2); }
td b { color: var(--good); }
.note-small { margin-top: 12px; color: var(--dim); font-size: 14px; }

/* ---- the gallery ---- */
.gallery { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.gallery figcaption { padding: 12px 16px; color: var(--dim); font-size: 15px; }
.gallery figcaption b { color: var(--text); }

/* ---- code, with tabs that need no script ---- */
.tabs { border: 1px solid var(--line); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.tabs input { position: absolute; opacity: 0; pointer-events: none; }
.tabs .labels { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: var(--panel); }
.tabs label { padding: 10px 16px; cursor: pointer; color: var(--dim); font-weight: 600; font-size: 15px; border-bottom: 2px solid transparent; }
.tabs label:hover { color: var(--text); }
.tabs .panel { display: none; }
#t-rust:checked ~ .labels [for="t-rust"],
#t-python:checked ~ .labels [for="t-python"],
#t-markup:checked ~ .labels [for="t-markup"] { color: var(--text); border-bottom-color: var(--accent); }
#t-rust:focus-visible ~ .labels [for="t-rust"],
#t-python:focus-visible ~ .labels [for="t-python"],
#t-markup:focus-visible ~ .labels [for="t-markup"] { outline: 2px solid var(--accent); outline-offset: -2px; }
#t-rust:checked ~ .p-rust,
#t-python:checked ~ .p-python,
#t-markup:checked ~ .p-markup { display: block; }
.panel pre { margin: 0; padding: 18px 20px; overflow-x: auto; font: 13.5px/1.55 var(--mono); color: var(--text); tab-size: 4; }
.panel .from { margin: 0; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }

/* ---- chips (platforms, bindings) ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); font-size: 14px; color: var(--text); }

/* ---- the demos page ---- */
.notice { margin: 0 0 28px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--dim); }
.notice b { color: var(--text); }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--text); }
.card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  color: inherit; text-decoration: none; overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover, .card:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.card .pic { overflow: hidden; aspect-ratio: 16 / 10; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.card .pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.card .blank {
  display: grid; place-items: center; height: 100%;
  background:
    radial-gradient(circle at 25% 20%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 55%),
    radial-gradient(circle at 80% 85%, color-mix(in srgb, var(--accent-2) 25%, transparent), transparent 55%),
    var(--bg-2);
}
.card .blank span { font-size: 28px; font-weight: 650; letter-spacing: -0.01em; }
.card .body { padding: 14px 16px 16px; }
.card h2 { margin: 0 0 4px; font-size: 19px; }
.card p { margin: 0; color: var(--dim); }
.card .size { margin-top: 8px; font-size: 13px; }

/* ---- the footer ---- */
footer { padding: 40px 0 56px; border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
footer a { color: var(--dim); }
footer a:hover { color: var(--text); }
