/*
 * docs.saasie.io
 *
 * Deliberately a separate, small stylesheet rather than a share of the
 * marketing site's. That one is 54 KB of landing-page layout — hero grids,
 * build cards, pricing tables — and a docs site needs almost none of it.
 * What is shared is the palette and the wordmark, so the two read as one
 * product without one of them carrying the other's weight.
 *
 * Light only, like the rest of Saasie. Code blocks invert instead, which is
 * where the contrast is actually wanted.
 */

:root {
  --ink: #11120e;
  --paper: #f2efe5;
  --white: #fbfaf5;
  --coral: #ff5d42;
  --blue: #4562ff;
  --lime: #d7ff64;
  --line: rgba(17, 18, 14, 0.22);
  --faint: rgba(17, 18, 14, 0.55);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --sidebar: 17rem;
  --measure: 46rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

::selection {
  background: var(--lime);
  color: var(--ink);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0 4vw;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.08em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark-dot {
  display: inline-block;
  margin-left: 0.08em;
  color: var(--coral);
  font-size: 0.5em;
  vertical-align: top;
}

.wordmark-tag {
  margin-left: 0.5em;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  vertical-align: middle;
  color: var(--faint);
}

.top-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
}

.top-nav a {
  text-decoration: none;
  color: var(--faint);
}

.top-nav a:hover {
  color: var(--ink);
}

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

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  align-items: start;
  max-width: 84rem;
  margin: 0 auto;
  padding: 0 4vw;
}

.sidebar {
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 2rem 1.5rem 3rem 0;
  border-right: 1px solid var(--line);
  font-size: 0.875rem;
}

.nav-group + .nav-group {
  margin-top: 1.75rem;
}

.nav-title {
  margin: 0 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

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

.sidebar li a {
  display: block;
  padding: 0.25rem 0.6rem;
  margin-left: -0.6rem;
  text-decoration: none;
  color: var(--faint);
  border-radius: 2px;
}

.sidebar li a:hover {
  color: var(--ink);
  background: rgba(17, 18, 14, 0.05);
}

.sidebar li a.active {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--coral);
  background: rgba(255, 93, 66, 0.07);
}

.nav-toggle,
.nav-toggle-label {
  display: none;
}

main {
  min-width: 0;
  max-width: var(--measure);
  padding: 2.5rem 0 5rem 3rem;
}

/* ------------------------------------------------------------ content */

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

h1 code {
  font-size: 0.85em;
  background: none;
  padding: 0;
}

h1 em {
  font-style: italic;
  color: var(--coral);
}

h2 {
  margin: 3rem 0 1rem;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

h3 {
  margin: 2rem 0 0.6rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

p {
  margin: 0 0 1.1rem;
}

.eyebrow {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.eyebrow a {
  color: inherit;
}

.lede {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink);
}

.footnote {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--faint);
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
  padding: 0.1em 0.35em;
  background: rgba(17, 18, 14, 0.07);
  border-radius: 2px;
}

a code {
  background: rgba(69, 98, 255, 0.1);
}

/*
 * The help and topic bodies, as they come out of the terminal. Horizontal
 * scroll rather than wrapping: they are written to 80 columns and the
 * alignment inside them is load-bearing — a wrapped blueprint example is a
 * blueprint example nobody can copy.
 */
.terminal {
  margin: 1.5rem 0;
  padding: 1.5rem;
  overflow-x: auto;
  background: var(--ink);
  color: #e8e6dd;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  tab-size: 2;
}

.terminal a {
  color: var(--lime);
  text-decoration-color: rgba(215, 255, 100, 0.4);
  text-underline-offset: 2px;
}

/* -------------------------------------------------------------- tables */

.reference {
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}

.reference th {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
  padding: 0 1rem 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.reference td {
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid rgba(17, 18, 14, 0.1);
  vertical-align: top;
}

.reference td:first-child {
  white-space: nowrap;
}

.errors td:first-child code {
  background: rgba(255, 93, 66, 0.14);
}

.req {
  color: var(--coral);
  font-weight: 700;
}

/* Constraints sit after the field's description and qualify it, so they are
   set back rather than reading as a second sentence of equal weight. */
.notes {
  color: var(--faint);
  font-size: 0.9em;
}

.fields td:last-child {
  min-width: 18rem;
}

.options {
  margin: 1.25rem 0;
}

.options dt {
  margin-top: 0.9rem;
}

.options dd {
  margin: 0.2rem 0 0;
  color: var(--faint);
}

/* ------------------------------------------------------------ endpoint */

.endpoint {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.endpoint h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
  flex-wrap: wrap;
}

.endpoint h2 code {
  background: none;
  padding: 0;
  font-size: 1rem;
}

.method {
  padding: 0.15em 0.5em;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--white);
  background: var(--faint);
}

.method-post {
  background: var(--blue);
}
.method-get {
  background: #2f7d4f;
}
.method-delete {
  background: var(--coral);
}

.endpoint-summary {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------- cards */

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

.card {
  display: block;
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 -2px rgba(17, 18, 14, 0.12);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--faint);
}

.card-more {
  margin-top: 0.75rem !important;
  font-family: var(--mono);
  font-size: 0.75rem !important;
  color: var(--coral) !important;
}

.callout {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border-left: 2px solid var(--coral);
}

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

.callout-quiet {
  border-left-color: var(--line);
}

/* --------------------------------------------------------------- split */

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

.button {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 2px;
  font-size: 0.9rem;
}

.button:hover {
  background: var(--coral);
}

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

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 2rem;
  max-width: 84rem;
  margin: 0 auto;
  padding: 2rem 4vw 3rem;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
  max-width: 42rem;
  font-size: 0.8125rem;
  color: var(--faint);
}

/* ------------------------------------------------------------ narrow */

@media (max-width: 60rem) {
  .shell {
    display: block;
  }

  .sidebar {
    position: static;
    max-height: none;
    padding: 1rem 0 2rem;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  /* Collapsed by default on a phone: the contents list is four groups and
     sixteen commands long, and it must not sit between the reader and the
     page they navigated to. */
  .nav-toggle-label {
    display: block;
    margin: 1rem 0 0;
    padding: 0.6rem 0;
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    cursor: pointer;
  }

  .nav-toggle-label::after {
    content: " ▾";
  }

  .nav-toggle:checked ~ .nav-toggle-label::after {
    content: " ▴";
  }

  .sidebar {
    display: none;
  }

  .nav-toggle:checked ~ .sidebar {
    display: block;
  }

  main {
    padding: 2rem 0 4rem;
  }

  .top-nav {
    gap: 1rem;
    font-size: 0.8rem;
  }

  .top-nav a:last-child {
    display: none;
  }
}
