/*
 * The site follows the app: IBM Plex Mono for notes and headings, the Mac's own
 * system font for reading. Fonts are served from this site, never a font CDN —
 * the privacy promise covers the website too.
 */

@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-400-normal-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 700;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-700-normal-latin.woff2') format('woff2');
}

:root {
  --paper: #f5f7f6;
  --ink: #23272e;
  --muted: #5b6370;
  --marker: #8c95a3;
  --accent: #2647a8;
  --accent-ink: #ffffff;
  --rule: #dde2e6;
  --well: #eaeeef;

  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --text: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --measure: 38rem;
  --wide: 58rem;
  --gutter: 1rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161b26;
    --ink: #e4e7ec;
    --muted: #a3abb8;
    --marker: #6b7485;
    --accent: #9db4ff;
    --accent-ink: #161b26;
    --rule: #2a3242;
    --well: #1e2533;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.55 var(--text);
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.page {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}

/* Site header: the name on the left, three plain links on the right. */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.5rem 0 3rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font: 700 1.0625rem var(--mono);
  color: var(--ink);
  text-decoration: none;
}
.site-header nav {
  display: flex;
  gap: 1.25rem;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-header nav a:hover,
.site-header nav a[aria-current='page'] {
  color: var(--ink);
}

/*
 * Headings keep their Markdown marker, as they do in the editor. The marker
 * hangs in the margin so the words line up with the body text; on a narrow
 * screen there is no margin, so it sits inline.
 */
h1,
h2 {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(1.9rem, 1.2rem + 3vw, 2.75rem);
  line-height: 1.12;
  margin: 0 0 1.25rem;
}
h2 {
  font-size: 1.3125rem;
  line-height: 1.3;
  margin: 3.5rem 0 1rem;
}
h3 {
  font-size: 1.0625rem;
  margin: 2rem 0 0.5rem;
}
.md {
  color: var(--marker);
  font-weight: 400;
}
@media (min-width: 48rem) {
  .md {
    display: inline-block;
    margin-left: -2ch;
    width: 2ch;
  }
  h2 .md {
    margin-left: -3ch;
    width: 3ch;
  }
}

p,
ul,
ol,
dl,
table {
  margin: 0 0 1rem;
}
li + li {
  margin-top: 0.4rem;
}
.lead {
  font-size: 1.25rem;
  line-height: 1.45;
}
.quiet {
  color: var(--muted);
}

kbd {
  font: 0.9em var(--mono);
  white-space: nowrap;
}
code {
  font: 0.9em var(--mono);
  overflow-wrap: anywhere;
}

/* The one filled button on a page is the thing to do next. */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 2rem 0 0.75rem;
}
.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}
.button.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

/*
 * The live demo: a note on the left, the entry Plainkeep writes for it on the
 * right. It is wider than the text column because it is the point of the page.
 */
.demo {
  margin: 3rem 0 0;
}
@media (min-width: 62rem) {
  .demo {
    width: var(--wide);
    margin-left: calc((var(--measure) - var(--wide)) / 2);
  }
}
.panes {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}
@media (min-width: 44rem) {
  .panes {
    grid-template-columns: 1fr 1fr;
  }
}
.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--paper);
}
.pane-title {
  margin: 0;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--muted);
}
.pane textarea,
.pane pre {
  flex: 1;
  min-height: 15rem;
  margin: 0;
  padding: 1rem;
  font: 0.875rem/1.6 var(--mono);
  color: var(--ink);
}
.pane textarea {
  width: 100%;
  border: 0;
  resize: vertical;
  background: transparent;
}
.pane textarea:focus-visible {
  outline-offset: -3px;
}
.pane pre {
  background: var(--well);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.demo figcaption {
  max-width: var(--measure);
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Free and Pro side by side, split by one rule rather than boxed. */
.plans {
  display: grid;
  gap: 1.5rem 2.5rem;
  margin: 1.5rem 0;
}
@media (min-width: 40rem) {
  .plans {
    grid-template-columns: 1fr 1fr;
  }
  .plans > div + div {
    border-left: 1px solid var(--rule);
    padding-left: 2.5rem;
  }
}
.plans h3 {
  margin: 0;
}
.plans .price {
  font: 700 1.5rem var(--mono);
  margin: 0.25rem 0 0.75rem;
}
.plans ul {
  padding-left: 1.1rem;
}

dt {
  font-weight: 600;
  margin-top: 1.25rem;
}
dd {
  margin: 0.25rem 0 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
th {
  font-weight: 600;
}
td:last-child,
th:last-child {
  text-align: right;
  padding-left: 1rem;
}

.site-footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--muted);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0.75rem;
}
.site-footer a {
  color: var(--muted);
}
