/*
 * Styles for the documentation site, shared by index.html and tools.html.
 *
 * One stylesheet, no build step and no external requests: the site is static files served
 * by GitHub Pages, and a docs page that cannot render without a CDN is a docs page that
 * eventually cannot render.
 *
 * Deliberately not Render's brand colours. This is an unofficial project, and dressing it
 * in the vendor's palette would imply otherwise.
 */

:root {
  color-scheme: light dark;

  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-alt: #f2f4f7;
  --border: #dfe3e8;
  --text: #14181f;
  --text-dim: #5a6472;
  --accent: #0d7c72;
  --accent-strong: #0a6159;
  --accent-soft: #e2f2f0;
  --code-bg: #12161c;
  --code-text: #e7ecf3;
  --code-comment: #7f8b9c;

  --radius: 10px;
  --measure: 62rem;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161b22;
    --surface-alt: #1b222c;
    --border: #2b333e;
    --text: #e7ecf3;
    --text-dim: #97a2b2;
    --accent: #3fd0c0;
    --accent-strong: #6be3d5;
    --accent-soft: #12312e;
    --code-bg: #090c11;
    --code-text: #e7ecf3;
    --code-comment: #6f7c8e;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-strong);
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.5rem;
  margin: 3rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.12rem;
  margin: 2rem 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 46rem;
}

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

.page-head {
  padding: 3.5rem 0 1rem;
}

.crumb {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  margin-bottom: 1.25rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  list-style: none;
  padding: 0;
  margin: 1.75rem 0 0;
}

.stats li {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.stats strong {
  display: block;
  font-family: var(--sans);
  font-size: 1.6rem;
  font-weight: 650;
  color: var(--text);
  line-height: 1.2;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 2rem 0 0;
}

.button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .button.primary,
  .button.primary:hover {
    color: #06201d;
  }
}

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

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-alt);
  border-radius: 5px;
  padding: 0.12em 0.36em;
}

pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

pre .c {
  color: var(--code-comment);
}

/* --- layout blocks ------------------------------------------------------ */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 1.5rem 0;
}

.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}

.card h3 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
}

.note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
}

.note p:last-child {
  margin-bottom: 0;
}

.scroll {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.92rem;
}

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

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
}

tbody tr:hover {
  background: var(--surface-alt);
}

td code {
  white-space: nowrap;
}

/* The appended usage note on tools that carry one. Set apart so the scannable summary
   stays scannable and the detail does not compete with it. */
.usage {
  margin: 0.5rem 0 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-dim);
}

.usage strong {
  color: var(--accent);
  font-weight: 600;
}

details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.75rem 1.1rem;
  margin-bottom: 0.6rem;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

details[open] summary {
  margin-bottom: 0.75rem;
}

/* --- tool catalogue ----------------------------------------------------- */

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.5rem;
}

.toc a {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  color: var(--text-dim);
}

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

.count {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  vertical-align: middle;
}

section {
  scroll-margin-top: 1.5rem;
}

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

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-dim);
}

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

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