/*
 * blog.stramme.cloud — one page, three styles.
 *
 *   plain     quiet and modern; follows the light or dark setting of the device
 *   terminal  a phosphor screen at night: monospace, green glow, scanlines
 *   writer    a printed book: Garamond on warm paper, drop caps, indented paragraphs
 *
 * The style is the `data-style` attribute on <html>, written by the server from a cookie, so the
 * page arrives in it and nothing flickers. Each style is a set of tokens first and a few
 * flourishes after; everything else is shared.
 */

/* ------------------------------------------------------------- typefaces --- */

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/eb-garamond-roman.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/eb-garamond-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/jetbrains-mono-roman.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------------------------------------------------------------- tokens --- */

:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --gutter: 1.25rem;
}

:root,
[data-style="plain"] {
  color-scheme: light dark;
  --paper: #fbfbf9;
  --ink: #19191b;
  --muted: #6f6f74;
  --faint: #e6e5e1;
  --accent: #2647d0;
  --on-accent: #ffffff;
  --selection: #d8e0ff;
  --code-paper: #f1f0ec;
  --font-text: var(--font-sans);
  --font-display: var(--font-sans);
  --font-meta: var(--font-sans);
  --text-size: 1.0625rem;
  --leading: 1.7;
  --measure: 38rem;
  --title-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.4rem);
  --entry-title-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.75rem);
  --radius: 999px;
  --glow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-style]),
  [data-style="plain"] {
    --paper: #121214;
    --ink: #e9e9eb;
    --muted: #8e8e95;
    --faint: #27272b;
    --accent: #8ea4ff;
    --on-accent: #0c0f1e;
    --selection: #2b3568;
    --code-paper: #1b1b1f;
  }
}

[data-style="terminal"] {
  color-scheme: dark;
  --paper: #050807;
  --ink: #b6f3c6;
  --muted: #5d8b69;
  --faint: #15281c;
  --accent: #3dff8e;
  --link: #ff5bd8;
  --on-accent: #03140a;
  --selection: #3dff8e;
  --code-paper: #0a1510;
  --font-text: var(--font-mono);
  --font-display: var(--font-mono);
  --font-meta: var(--font-mono);
  --text-size: 0.9375rem;
  --leading: 1.75;
  --measure: 44rem;
  --title-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.75rem);
  --entry-title-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  --radius: 0;
  --glow: 0 0 0.4em rgb(61 255 142 / 0.55), 0 0 1.2em rgb(61 255 142 / 0.18);
  --link-glow: 0 0 0.45em rgb(255 91 216 / 0.6);
}

[data-style="writer"] {
  color-scheme: light;
  --paper: #f4eee2;
  --ink: #2b241e;
  --muted: #86786a;
  --faint: #dcd1bd;
  --accent: #8b2a1d;
  --on-accent: #fbf6ec;
  --selection: #ead5c0;
  --code-paper: #ece4d4;
  --font-text: var(--font-serif);
  --font-display: var(--font-serif);
  --font-meta: var(--font-serif);
  --text-size: clamp(1.1875rem, 1.13rem + 0.25vw, 1.3125rem);
  --leading: 1.58;
  --measure: 34rem;
  --title-size: clamp(2rem, 1.6rem + 1.8vw, 2.75rem);
  --entry-title-size: clamp(1.7rem, 1.45rem + 1.1vw, 2.2rem);
  --radius: 2px;
  --glow: none;
}

/* ----------------------------------------------------------------- reset --- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ol,
ul,
blockquote,
pre,
figure {
  margin: 0;
}

svg {
  display: block;
  width: 1.0625rem;
  height: 1.0625rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

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

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

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

body {
  display: grid;
  /* minmax(0, …): a long line of code scrolls inside its box instead of widening the page. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-size);
  line-height: var(--leading);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

.masthead,
main,
.colophon {
  width: min(100% - 2 * var(--gutter), var(--measure));
  margin-inline: auto;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-block: 1.5rem 0;
  font-family: var(--font-meta);
  font-size: 0.875rem;
  line-height: 1;
}

.brand {
  margin-right: auto;
  font-size: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand a {
  color: inherit;
  text-decoration: none;
}

.styles {
  display: flex;
  gap: 0.125rem;
  padding: 0.1875rem;
  border: 1px solid var(--faint);
  border-radius: var(--radius);
}

.styles a,
.account,
.account button {
  display: grid;
  place-items: center;
  width: 1.875rem;
  height: 1.875rem;
  border-radius: var(--radius);
  color: var(--muted);
  transition: color 0.15s, background-color 0.15s;
}

.styles a:hover,
.account:hover,
.account button:hover {
  color: var(--ink);
}

.styles a[aria-current] {
  background: var(--faint);
  color: var(--ink);
}

.account button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

main {
  padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem) 4rem;
}

.colophon {
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--faint);
  font-family: var(--font-meta);
  font-size: 0.8125rem;
  color: var(--muted);
}

.colophon a {
  color: inherit;
  text-underline-offset: 0.2em;
}

/* --------------------------------------------------------------- entries --- */

.entry > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.entry > header :is(h1, h2) {
  flex-basis: 100%;
  font-family: var(--font-display);
  font-size: var(--entry-title-size);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
  text-shadow: var(--glow);
}

.single .entry > header h1 {
  font-size: var(--title-size);
}

.entry > header a {
  color: inherit;
  text-decoration: none;
}

.entry > header a:hover {
  color: var(--accent);
}

.entry time {
  margin-top: 0.5rem;
  font-family: var(--font-meta);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.entry .edit {
  color: var(--muted);
}

.entry .edit:hover {
  color: var(--accent);
}

.entry .edit svg {
  width: 0.875rem;
  height: 0.875rem;
}

.entry + .entry {
  margin-top: 4.5rem;
}

.entry + .entry::before {
  content: "";
  display: block;
  width: 2.5rem;
  margin-bottom: 4.5rem;
  border-top: 1px solid var(--faint);
}

.empty {
  color: var(--muted);
}

/* ------------------------------------------------------------------ text --- */

.text {
  text-wrap: pretty;
}

.text > * + *,
.text li > * + *,
.text blockquote > * + * {
  margin-top: 1.15em;
}

.text :is(h2, h3, h4, h5, h6) {
  margin-top: 2em;
  font-family: var(--font-display);
  font-size: 1.15em;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
  hyphens: manual;
}

.text :is(h4, h5, h6) {
  font-size: 1em;
}

.text a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  hyphens: none;
}

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

.text :is(ul, ol) {
  padding-left: 1.4em;
}

.text li + li {
  margin-top: 0.35em;
}

.text li::marker {
  color: var(--muted);
}

.text blockquote {
  padding-left: 1.25em;
  border-left: 2px solid var(--faint);
  color: color-mix(in srgb, var(--ink) 80%, var(--muted));
}

/* No ligatures in code: `=>` must stay two characters. */
.text code {
  font-variant-ligatures: none;
  padding: 0.1em 0.3em;
  border-radius: 3px;
  background: var(--code-paper);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.text pre {
  overflow-x: auto;
  padding: 1rem 1.15rem;
  border-radius: 4px;
  background: var(--code-paper);
  font-size: 0.875rem;
  line-height: 1.6;
  hyphens: none;
  tab-size: 2;
}

.text pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.text hr {
  width: 2.5rem;
  height: 0;
  margin-block: 2.5em;
  border: 0;
  border-top: 1px solid var(--faint);
}

.text del {
  color: var(--muted);
}

/* ----------------------------------------------------------------- pager --- */

.pager {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1.5rem;
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--faint);
}

.pager a {
  color: inherit;
  text-decoration: none;
  line-height: 1.4;
}

.pager a[rel="next"] {
  text-align: right;
  grid-column: -2;
}

.pager span {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-meta);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pager a:hover {
  color: var(--accent);
}

/* ============================================================== terminal === */

[data-style="terminal"] body {
  font-variant-ligatures: none;
  background:
    radial-gradient(120% 80% at 50% 0%, #0b1a12 0%, transparent 60%),
    var(--paper);
}

/* Scanlines over everything, too faint to read as stripes, enough to feel like glass. */
[data-style="terminal"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgb(0 0 0 / 0.2) 2px 3px);
}

[data-style="terminal"] .brand {
  font-weight: 500;
  color: var(--accent);
  text-shadow: var(--glow);
}

[data-style="terminal"] .brand a::before {
  content: "~/";
  color: var(--muted);
  text-shadow: none;
}

[data-style="terminal"] .brand a::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.35em;
  vertical-align: -0.2em;
  background: var(--accent);
  box-shadow: var(--glow);
  animation: cursor 1.1s steps(1) infinite;
}

@keyframes cursor {
  50% {
    opacity: 0;
  }
}

[data-style="terminal"] .styles a[aria-current] {
  background: none;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 0.6em rgb(61 255 142 / 0.25);
}

[data-style="terminal"] .styles a[aria-current] svg {
  filter: drop-shadow(0 0 3px rgb(61 255 142 / 0.7));
}

[data-style="terminal"] .entry > header :is(h1, h2) {
  font-weight: 700;
  letter-spacing: 0;
  color: var(--accent);
}

[data-style="terminal"] .entry > header :is(h1, h2)::before {
  content: "# ";
  color: var(--muted);
  text-shadow: none;
}

[data-style="terminal"] .entry time::before {
  content: "// ";
}

/* The marks are the ones typed in the Markdown. Headings of the text sit one level below the
   entry title, on the front page two (the title there is an <h2>). */
[data-style="terminal"] :is(.single, .desk) .text h2::before,
[data-style="terminal"] .front .text h3::before {
  content: "# ";
}

[data-style="terminal"] :is(.single, .desk) .text h3::before,
[data-style="terminal"] .front .text h4::before {
  content: "## ";
}

[data-style="terminal"] :is(.single, .desk) .text h4::before,
[data-style="terminal"] .front .text h5::before {
  content: "### ";
}

[data-style="terminal"] :is(.single, .desk) .text :is(h5, h6)::before,
[data-style="terminal"] .front .text h6::before {
  content: "#### ";
}

[data-style="terminal"] .text :is(h2, h3, h4, h5, h6) {
  font-size: 1em;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--accent);
  text-shadow: var(--glow);
}

[data-style="terminal"] .text :is(h2, h3, h4, h5, h6)::before {
  color: var(--muted);
  text-shadow: none;
}

[data-style="terminal"] .text a {
  color: var(--link);
  text-decoration: none;
}

[data-style="terminal"] .text a::before {
  content: "[";
  color: var(--muted);
}

[data-style="terminal"] .text a::after {
  content: "]";
  color: var(--muted);
}

[data-style="terminal"] .text a:hover {
  text-shadow: var(--link-glow);
}

[data-style="terminal"] .text ul {
  padding-left: 2ch;
  list-style-type: "- ";
}

[data-style="terminal"] .text ol {
  padding-left: 4ch;
  list-style-type: decimal-leading-zero;
}

[data-style="terminal"] .text li::marker {
  color: var(--accent);
}

[data-style="terminal"] .text blockquote {
  border-left: 1px solid var(--accent);
  box-shadow: -1px 0 0.6em -0.2em rgb(61 255 142 / 0.6);
  color: var(--muted);
}

[data-style="terminal"] .text code {
  padding: 0;
  background: none;
  color: var(--accent);
  font-size: inherit;
}

[data-style="terminal"] .text code::before,
[data-style="terminal"] .text code::after {
  content: "`";
  color: var(--muted);
}

[data-style="terminal"] .text pre {
  border: 1px solid var(--faint);
  border-left: 2px solid var(--accent);
  border-radius: 0;
}

[data-style="terminal"] .text pre code {
  color: var(--ink);
}

[data-style="terminal"] .text pre code::before,
[data-style="terminal"] .text pre code::after {
  content: none;
}

[data-style="terminal"] .text hr {
  width: auto;
  border-top-style: dashed;
}

[data-style="terminal"] .entry + .entry::before {
  content: "EOF";
  width: auto;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--faint);
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.5;
}

[data-style="terminal"] .pager span {
  text-transform: lowercase;
}

[data-style="terminal"] .pager a[rel="prev"] span::before {
  content: "<- ";
}

[data-style="terminal"] .pager a[rel="next"] span::after {
  content: " ->";
}

[data-style="terminal"] ::selection {
  color: var(--on-accent);
  text-shadow: none;
}

/* ================================================================ writer === */

[data-style="writer"] body {
  background:
    radial-gradient(130% 90% at 50% 20%, #f8f3ea 0%, transparent 70%),
    var(--paper);
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-feature-settings: "kern", "liga", "clig";
}

[data-style="writer"] .masthead {
  font-size: 1rem;
}

[data-style="writer"] .brand {
  font-weight: 500;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.14em;
  font-size: 1.0625rem;
}

[data-style="writer"] .styles {
  border-color: transparent;
}

[data-style="writer"] .styles a[aria-current] {
  background: none;
  color: var(--accent);
}

[data-style="writer"] .entry > header {
  flex-direction: column;
  align-items: center;
  margin-bottom: 2.25rem;
  text-align: center;
}

[data-style="writer"] .entry > header :is(h1, h2) {
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.1;
}

[data-style="writer"] .entry time {
  order: -1;
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-style: italic;
  font-variant-numeric: oldstyle-nums proportional-nums;
  letter-spacing: 0.01em;
}

[data-style="writer"] .entry .edit {
  margin-top: 0.4rem;
}

/* Justified, so hyphenated: without breaks the gaps between words grow. */
[data-style="writer"] .text p {
  text-align: justify;
  hyphens: auto;
}

/* A book sets its paragraphs apart by indenting them, not by leaving a line free. */
[data-style="writer"] .text p + p {
  margin-top: 0;
  text-indent: 1.4em;
}

[data-style="writer"] .text > p:first-child::first-letter {
  float: left;
  margin: 0.02em 0.08em 0 0;
  font-size: 3.55em;
  font-weight: 500;
  line-height: 0.8;
  color: var(--accent);
}

@supports (initial-letter: 3) {
  [data-style="writer"] .text > p:first-child::first-letter {
    float: none;
    margin: 0 0.1em 0 0;
    font-size: inherit;
    line-height: inherit;
    initial-letter: 3;
  }
}

[data-style="writer"] .text > p:first-child::first-line {
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
}

[data-style="writer"] .text :is(h2, h3, h4, h5, h6) {
  margin-top: 2.2em;
  font-size: 1.2em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-align: center;
}

[data-style="writer"] .text :is(h4, h5, h6) {
  font-size: 1em;
}

[data-style="writer"] .text :is(h2, h3, h4, h5, h6) + p {
  text-indent: 0;
}

[data-style="writer"] .text a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}

[data-style="writer"] .text a:hover {
  color: var(--accent);
  text-decoration-thickness: 0.06em;
}

[data-style="writer"] .text ul {
  list-style-type: "–  ";
}

[data-style="writer"] .text ol {
  list-style-type: lower-roman;
}

[data-style="writer"] .text li p {
  text-indent: 0;
}

[data-style="writer"] .text blockquote {
  margin-inline: 1.5em;
  padding: 0;
  border: 0;
  font-style: italic;
  color: inherit;
}

[data-style="writer"] .text blockquote p {
  text-indent: 0;
  text-align: left;
}

[data-style="writer"] .text pre,
[data-style="writer"] .text code {
  background: var(--code-paper);
  font-size: 0.78em;
}

[data-style="writer"] .text pre code {
  font-size: inherit;
}

[data-style="writer"] .text hr {
  width: auto;
  height: auto;
  overflow: visible;
  border: 0;
  text-align: center;
  line-height: 1;
}

[data-style="writer"] .text hr::after {
  content: "*\2003*\2003*";
  color: var(--accent);
}

[data-style="writer"] .entry + .entry::before {
  content: "⁂";
  width: auto;
  margin-bottom: 3.5rem;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  text-align: center;
  color: var(--accent);
}

[data-style="writer"] .pager span {
  font-size: 0.875rem;
  font-variant-caps: all-small-caps;
  text-transform: none;
  letter-spacing: 0.12em;
}

[data-style="writer"] .pager a {
  font-style: italic;
}

[data-style="writer"] .colophon {
  border: 0;
  font-size: 0.9375rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.12em;
  text-align: center;
}

[data-style="writer"] .colophon::before {
  content: "⁂";
  display: block;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-variant-caps: normal;
  color: var(--accent);
}

/* ================================================================== desk === */

.desk .masthead,
.desk main,
.desk .colophon {
  width: min(100% - 2 * var(--gutter), 92rem);
}

.desk main {
  display: grid;
  gap: 2.5rem;
  padding-top: 2rem;
}

.desk label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.editor input[name="title"],
.editor textarea {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  outline: none;
}

.editor input[name="title"] {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--faint);
  font-family: var(--font-display);
  font-size: var(--entry-title-size);
  font-weight: 650;
  line-height: 1.25;
  text-shadow: var(--glow);
}

[data-style="writer"] .editor input[name="title"] {
  font-weight: 500;
}

.editor input[name="title"]:focus {
  border-bottom-color: var(--accent);
}

.editor textarea {
  flex: 1;
  min-height: 60vh;
  margin-top: 1.25rem;
  resize: vertical;
  line-height: var(--leading);
}

.editor ::placeholder {
  color: var(--muted);
  opacity: 1;
  text-shadow: none;
}

.notice {
  min-height: 1.5rem;
  font-family: var(--font-meta);
  font-size: 0.8125rem;
  color: var(--muted);
}

.notice[data-kind="error"] {
  color: var(--accent);
  font-weight: 600;
}

.actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  padding-block: 0.9rem;
  border-top: 1px solid var(--faint);
  background: var(--paper);
  font-family: var(--font-meta);
  font-size: 0.875rem;
}

.actions button,
.actions a {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.actions button:hover,
.actions a:hover {
  border-color: var(--ink);
}

.actions .primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

[data-style="terminal"] .actions .primary,
[data-style="writer"] .actions .primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

[data-style="terminal"] .actions .primary {
  box-shadow: 0 0 1em rgb(61 255 142 / 0.35);
}

.actions .quiet {
  border-color: transparent;
  color: var(--muted);
}

.actions .quiet:hover {
  border-color: transparent;
  color: var(--accent);
}

.actions .hint {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
}

@media (pointer: coarse) {
  .actions .hint {
    display: none;
  }
}

.ledger {
  order: 3;
  font-family: var(--font-meta);
  font-size: 0.875rem;
  line-height: 1.35;
}

.ledger .new {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--accent);
  text-decoration: none;
}

.ledger .new::before {
  content: "+ ";
}

.ledger ol {
  padding: 0;
  list-style: none;
}

.ledger li a {
  display: block;
  padding-block: 0.5rem;
  border-top: 1px solid var(--faint);
  color: var(--ink);
  text-decoration: none;
}

.ledger li a:hover,
.ledger a[aria-current] {
  color: var(--accent);
}

.ledger time {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.preview {
  min-width: 0;
  padding-top: 2.5rem;
  border-top: 1px solid var(--faint);
}

@media (min-width: 70rem) {
  .desk main {
    grid-template-columns: 12rem minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 3rem;
  }

  .ledger {
    order: 0;
    position: sticky;
    top: 1.5rem;
  }

  .preview {
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding: 0 0 0 3rem;
    border-top: 0;
    border-left: 1px solid var(--faint);
  }
}

/* ----------------------------------------------------------------- small --- */

@media (max-width: 30rem) {
  :root {
    --gutter: 1rem;
  }

  .masthead {
    gap: 0.5rem;
  }

  .entry + .entry {
    margin-top: 3.5rem;
  }

  .entry + .entry::before {
    margin-bottom: 3.5rem;
  }

  [data-style="writer"] .text p {
    text-align: left;
  }
}

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

@media print {
  .masthead,
  .pager,
  .colophon,
  .entry .edit,
  [data-style="terminal"] body::after {
    display: none;
  }

  html,
  body {
    background: #fff;
    color: #000;
  }

  .text a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }
}
