/* Carton documentation — trenoxahq.com */

:root {
  --bg: #ffffff;
  --surface: #f5f5f4;
  --border: #d6d3d1;
  --fg: #1c1917;
  --muted: #57534e;
  --accent: #1c1917;
  --link: #1d4ed8;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16130f;
    --surface: #211d18;
    --border: #3b352d;
    --fg: #f5f1ea;
    --muted: #b4aa9c;
    --accent: #f5f1ea;
    --link: #8fb2ff;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* Header ------------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.wordmark {
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 18px;
  color: var(--fg);
  text-decoration: none;
}

.wordmark span { color: var(--muted); font-weight: 400; }

nav.top { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; }
nav.top a { color: var(--muted); text-decoration: none; font-size: 15px; }
nav.top a:hover, nav.top a[aria-current="page"] { color: var(--fg); text-decoration: underline; }

/* Type --------------------------------------------------------------- */

h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 48px 0 12px; }
h3 { font-size: 1.05rem; margin: 32px 0 8px; }
p, ul, ol { max-width: var(--measure); }
p, li { margin: 0 0 12px; }
ul, ol { padding-left: 22px; }
a { color: var(--link); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
}
.lede { font-size: 1.1rem; color: var(--muted); max-width: var(--measure); }

/* Tables ------------------------------------------------------------- */

.scroller { overflow-x: auto; margin: 20px 0; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--border); }
th { font-weight: 600; white-space: nowrap; }
td:last-child, th:last-child { padding-right: 0; }

/* Callout ------------------------------------------------------------ */

.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 24px 0;
  max-width: var(--measure);
}
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.note strong { font-weight: 600; }

/* Cards -------------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 16px;
  margin: 32px 0;
  padding: 0;
  list-style: none;
  max-width: none;
}
.cards li { margin: 0; }
.cards a {
  display: block;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
}
.cards a:hover { border-color: var(--fg); }
.cards h2 { margin: 0 0 6px; font-size: 1.05rem; }
.cards p { margin: 0; color: var(--muted); font-size: 15px; }

/* Footer ------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding-top: 20px;
  color: var(--muted);
  font-size: 14px;
}
footer a { color: var(--muted); }

:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
