/* Gherkin Labs — one column, white ground, nothing else. */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&display=swap");

:root {
  --ground: #fbfbf9;
  --ink: #1a1a1a;
  --ink-soft: #55554f;
  --rule: #e4e4df;
  --link: #1a1a1a;
  --code-bg: #f1f1ec;
  --measure: 40rem;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-inline: 20px;
  padding-block: 0 6rem;
}

/* wordmark */
.mark {
  max-width: var(--measure);
  margin: 0 auto;
  padding-block: 2.2rem 3.5rem;
}
.mark a {
  font-family: Montserrat, "Gotham", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.mark a:hover { color: var(--ink-soft); }

main {
  max-width: var(--measure);
  margin: 0 auto;
}

h1, h2, h3, h4 {
  font-family: Montserrat, "Gotham", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  letter-spacing: -0.01em;
}
h1 { font-size: 1.6rem; margin: 0 0 1.6rem; }
h2 { font-size: 1.25rem; margin: 3rem 0 0.8rem; }
h3 { font-size: 1rem;    margin: 2rem 0 0.6rem; }
h4 { font-size: 0.9rem;  margin: 1.6rem 0 0.5rem; color: var(--ink-soft); }

p, ul, ol { margin: 0 0 1.1rem; }
li { margin-bottom: 0.3rem; }

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

strong { font-weight: 600; }

code {
  font: 0.9em/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
pre {
  background: var(--code-bg);
  padding: 0.9rem 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0 0 1.2rem;
}
pre code { background: none; padding: 0; font-size: 0.85em; }

/* figures: never wider than the text column */
img, svg.figure {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 1.8rem 0;
}
figure { margin: 1.6rem 0; }
figure img, figure svg.figure { margin: 0; }
figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.5rem; }
/* the one call to action: a button on the screenshot's bottom-right corner */
figure .shot { position: relative; }
figure .shot img { display: block; }
a.button { position: absolute; right: 1rem; bottom: 1rem; display: inline-block; padding: 0.55rem 1rem; border-radius: 6px; color: #fff; background: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; box-shadow: 0 2px 10px rgba(0,0,0,0.25); }
a.button:hover { background: var(--ink-soft); color: #fff; }

/* tables: appendix material, quiet */
.table-wrap { overflow-x: auto; margin: 0 0 1.4rem; }
table {
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.4;
  width: 100%;
  border: 1px solid #cfcfc8;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.7rem;
  border: 1px solid #cfcfc8;
}
th { font-weight: 600; background: var(--code-bg); }
tbody tr:nth-child(even) td { background: #f7f7f3; }
td:first-child { white-space: nowrap; }
td:nth-child(2) { font-variant-numeric: tabular-nums; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

footer {
  max-width: var(--measure);
  margin: 5rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.85rem;
}
footer a { color: inherit; }

/* table of contents: desktop only, in the left margin, sticks once scrolled */
.toc { display: none; }
@media (min-width: 1180px) {
  .page {
    display: grid;
    grid-template-columns: 13rem var(--measure) 13rem;
    column-gap: 2rem;
    justify-content: center;
  }
  .page > main { grid-column: 2; max-width: none; margin: 0; }
  .toc {
    display: block;
    grid-column: 1;
    align-self: start;
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--ink-soft);
  }
  .toc ul { list-style: none; margin: 0; padding: 0; }
  .toc li { margin: 0 0 0.35rem; }
  .toc li.l3 { padding-left: 0.9rem; }
  .toc a { color: inherit; text-decoration: none; }
  .toc a:hover { color: var(--ink); }
  .toc a.current { color: var(--ink); font-weight: 600; }
}

h2, h3, h4 { scroll-margin-top: 1.5rem; }

/* index */
.index p.lede { font-size: 1.15rem; max-width: 34rem; }
.index ul { list-style: none; padding: 0; }
.index li { margin-bottom: 0.5rem; }
.index .meta { color: var(--ink-soft); font-size: 0.9rem; }
.index .label { font-family: Montserrat, Helvetica, Arial, sans-serif; font-weight: 600; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin: 2.5rem 0 0.6rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
