/* quietrender.fyi — one stylesheet, no imports, no web fonts.
   Dark by default; the light variant follows the system setting. */

:root {
  --bg: #0c0e13;
  --bg-soft: #12151c;
  --line: #1f242e;
  --ink: #d7dbe2;
  --ink-dim: #8b93a1;
  --ink-faint: #626a78;
  --accent: #9fb4cc;
  --measure: 34rem;
  --gap: 1.5rem;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f5f2;
    --bg-soft: #eceae5;
    --line: #dcd9d2;
    --ink: #1b1d22;
    --ink-dim: #5a606b;
    --ink-faint: #858b96;
    --accent: #3d5470;
    color-scheme: light;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 ui-serif, Georgia, "Times New Roman", serif;
  letter-spacing: 0.005em;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

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

h1, h2, h3 {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
h1 { font-size: 1.5rem; margin: 0 0 0.6rem; }
h2 { font-size: 1.05rem; margin: 2.2rem 0 0.5rem; }
h3 { font-size: 0.95rem; margin: 1.4rem 0 0.3rem; color: var(--ink); }

p { margin: 0 0 1rem; }

code, pre, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  /* Off deliberately: with ligatures on, the `--seed` in a copyable command
     renders as an em dash and reads like a typo. */
  font-variant-ligatures: none;
}

/* ---------- chrome ---------- */

.bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.bar nav { display: flex; gap: 1.1rem; }
.bar a { text-decoration: none; color: var(--ink-dim); }
.bar a:hover, .bar a.here { color: var(--ink); }
.mark {
  font-family: ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--ink) !important;
}
.foot {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.foot span { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; }

main { padding: clamp(1.5rem, 4vw, 3rem); max-width: 90rem; margin: 0 auto; }
main.narrow { max-width: 46rem; }

/* ---------- gallery ---------- */

.lede { max-width: var(--measure); margin-bottom: 2.5rem; }
.lede p { color: var(--ink-dim); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: var(--gap);
}
.card { text-decoration: none; display: block; }
.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.card-meta {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.card-meta b { color: var(--ink-dim); font-weight: 400; }
.card:hover img { border-color: var(--ink-faint); }
.card:hover .card-meta b { color: var(--ink); }

/* ---------- piece ---------- */

.piece figure { margin: 0 0 1.5rem; }
.piece figure img { border: 1px solid var(--line); }
.piece h1 {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
}

.params { margin: 0 0 1rem; display: grid; grid-template-columns: 1fr; }
.params > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.params dt { color: var(--ink-faint); font-size: 0.85rem; }
.params dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}
.params.wide > div { display: grid; grid-template-columns: 7rem 1fr; }
.params.wide dd { font-family: inherit; color: var(--ink-dim); }

pre.cmd {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 0.7rem 0.9rem;
  overflow-x: auto;
  margin: 0 0 1rem;
}

.downloads ul { list-style: none; padding: 0; margin: 0; }
.downloads li {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}
.downloads span { color: var(--ink-faint); font-size: 0.85rem; }

.walk {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}
.walk a { text-decoration: none; }

.fine { color: var(--ink-faint); font-size: 0.85rem; }
.lead { font-size: 1.05rem; color: var(--ink-dim); }

.button {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 0.45rem 0.9rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--bg-soft);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
}
.button:hover { border-color: var(--ink-faint); }

.prose { max-width: var(--measure); }
.prose p { color: var(--ink-dim); }
.prose h2 + p, .prose h3 + p { margin-top: 0; }

.packs { list-style: none; padding: 0; }
.packs li { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.pack-head { display: flex; align-items: baseline; gap: 0.8rem; }
.pack-head b {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 400;
  color: var(--ink);
}

/* ---------- code page ---------- */

.code-wrap {
  margin-top: 2rem;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  overflow-x: auto;
}
pre.code {
  margin: 0;
  padding: 1.2rem 0;
  counter-reset: ln;
  font-size: 0.8rem;
  line-height: 1.6;
}
pre.code .line {
  display: block;
  padding: 0 1.2rem 0 4rem;
  position: relative;
  white-space: pre;
  /* A blank line has no line box under `white-space: pre` and would collapse to
     zero height, which makes the gutter look like it is skipping numbers. */
  min-height: 1.6em;
}
pre.code .line::before {
  counter-increment: ln;
  content: counter(ln);
  position: absolute;
  left: 0;
  width: 3rem;
  text-align: right;
  color: var(--ink-faint);
  opacity: 0.5;
}
.t-kw { color: #c9a2d8; }
.t-str { color: #9ec49a; }
.t-com { color: var(--ink-faint); font-style: italic; }
.t-num { color: #d8b48a; }
.t-self { color: #8fa8c8; }
@media (prefers-color-scheme: light) {
  .t-kw { color: #7d3f97; }
  .t-str { color: #2f6b3a; }
  .t-num { color: #8a5a1e; }
  .t-self { color: #34567d; }
}

/* ---------- play ---------- */

.play { max-width: 75rem; margin: 0 auto; }
.play canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  display: block;
}
.controls { margin-top: 1.2rem; }
.controls .row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.4rem;
  align-items: center;
  margin-bottom: 0.9rem;
}
.controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.controls output {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-dim);
  min-width: 2.6rem;
}
.controls input[type="range"] { width: 8rem; accent-color: var(--accent); }
.controls input[type="number"], .controls select, .controls button {
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.35rem 0.6rem;
  font: inherit;
  font-size: 0.85rem;
}
.controls button { cursor: pointer; }
.controls button:hover { border-color: var(--ink-faint); }
.sliders label { flex-direction: row; }

@media (max-width: 34rem) {
  .controls input[type="range"] { width: 6rem; }
  .params.wide > div { grid-template-columns: 1fr; }
}
