/* The website for Paper.
 *
 * The palette and the measure are lifted from the application's own themes, so
 * the page reads the way the editor does rather than merely describing it.
 * Hand written CSS, no framework and no build step, for the same reason the
 * application has neither.
 */

:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Arial, sans-serif;
  --font-body: "Literata", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas,
    monospace;

  /* 46rem is the editor's own column width. */
  --measure: 46rem;

  --background: #fdfdfc;
  --text: #1c1c1a;
  --text-muted: #6b6b66;
  --text-faint: #a8a8a2;
  --chrome-border: #e3e3de;
  --surface: #ffffff;
  --accent: #2f6f4f;
  --accent-faint: #b9d6c6;
  --on-accent: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --background: #1b1b19;
    --text: #e6e6e1;
    --text-muted: #96968f;
    --text-faint: #63635d;
    --chrome-border: #33332f;
    --surface: #2b2b27;
    --accent: #7fbf9b;
    --accent-faint: #3c5a4b;
    --on-accent: #10221a;
  }
}

@font-face {
  font-family: "Literata";
  src: url("./fonts/literata.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("./fonts/literata-italic.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("./fonts/jetbrains-mono.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

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

body {
  margin: 0;
  padding: 0 1.5rem 6rem;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

section {
  margin-top: 4rem;
}

h1,
h2 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1.1em;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

/* The opening block ------------------------------------------------------- */

.hero {
  padding-top: 6rem;
}

.hero h1 {
  font-size: clamp(3rem, 12vw, 4.5rem);
  font-weight: 500;
  margin: 0 0 0.2em;
}

.lede {
  font-size: 1.3rem;
  color: var(--text-muted);
  max-width: 34rem;
  text-wrap: pretty;
}

.actions {
  margin: 2.2rem 0 0.9rem;
}

.download {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}

.download:hover {
  /* Darkening by hand would need a second colour per theme; letting the
     background show through does it in one line and works in both. */
  opacity: 0.88;
}

.fineprint {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--text-faint);
}

/* The typographic sample -------------------------------------------------- */

.specimen {
  margin-top: 4.5rem;
  padding: 2.5rem 2.75rem 2rem;
  border: 1px solid var(--chrome-border);
  border-radius: 12px;
  background: var(--surface);
}

.specimen-heading {
  font-size: 1.55rem;
  font-weight: 600;
  margin: 0 0 0.7em;
}

.specimen blockquote {
  margin: 1.4em 0;
  padding-left: 1.1em;
  border-left: 3px solid var(--accent-faint);
  color: var(--text-muted);
  font-style: italic;
}

.specimen pre {
  margin: 1.4em 0 0;
  padding: 1rem 1.15rem;
  border-radius: 8px;
  background: var(--background);
  /* Long lines scroll inside the block rather than widening the page. */
  overflow-x: auto;
}

.specimen code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Lists ------------------------------------------------------------------- */

.modes {
  margin: 0;
}

.modes dt {
  font-weight: 600;
  margin-top: 1.2em;
}

.modes dd {
  margin: 0.2em 0 0;
  color: var(--text-muted);
}

.features {
  margin: 0;
  padding-left: 1.2em;
}

.features li {
  margin-bottom: 0.7em;
  color: var(--text-muted);
}

.features strong {
  color: var(--text);
  font-weight: 600;
}

.aside {
  margin-top: 1.6em;
  color: var(--text-faint);
  font-size: 0.95rem;
}

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

footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--chrome-border);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-muted);
}

footer p {
  margin: 0 0 0.5em;
}

@media (max-width: 34rem) {
  .hero {
    padding-top: 3.5rem;
  }

  .specimen {
    padding: 1.75rem 1.5rem 1.4rem;
  }
}
