@font-face {
  font-family: 'EB Garamond';
  src: url('/blog-assets/eb-garamond-latin-wght-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  /* Keep the first visible layout when the preloaded font arrives late. */
  font-display: optional;
}

@font-face {
  font-family: 'EB Garamond';
  src: url('/blog-assets/eb-garamond-latin-wght-italic.woff2') format('woff2');
  font-style: italic;
  font-weight: 400 800;
  font-display: optional;
}

/* The public blog uses the same paper, ink and rules as the Sharp landing page. */
:root {
  --paper: #f6f6f6;
  --raised: #fff;
  --ink: #363532;
  --muted: #565550;
  --rule: #696660;
  --rule-strong: #51504c;
  --line: #d4d3cf;
  --serif: 'EB Garamond', Georgia, serif;
  --sans: system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
  background: var(--paper);
  color: var(--ink);
}

:root[data-tone='dark'] {
  --paper: #242522;
  --raised: #30312d;
  --ink: #f2efe8;
  --muted: #c5c4b9;
  --rule: #a0a295;
  --rule-strong: #bcbdaf;
  --line: #53564e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--serif); font-size: 1.25rem; }
a { color: inherit; text-underline-offset: .2em; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link { position: absolute; top: .5rem; left: .5rem; padding: .5rem; background: var(--raised); z-index: 1; }
.skip-link:not(:focus) { clip-path: inset(50%); }
main { padding: 0 var(--gutter); }
main:focus { outline: none; }

.masthead { border-bottom: 1px solid var(--rule); }
.masthead-inner {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 3.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: .6rem var(--gutter);
}
.wordmark {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
}
.masthead-actions {
  position: absolute;
  right: var(--gutter);
  display: flex;
  align-items: center;
  gap: clamp(.6rem, 2.5vw, 1.25rem);
}
.blog-tone-choice:not([hidden]) {
  display: inline-flex;
  flex-shrink: 0;
}
.blog-tone-choice button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.blog-tone-choice button:hover { background: var(--raised); color: var(--ink); }
.blog-tone-choice button[aria-pressed='true'] { color: var(--ink); box-shadow: inset 0 -1px var(--rule-strong); }
.blog-tone-choice button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.app-link, .subscribe, .post-meta, .back-link, .blog-footer a {
  font-family: var(--sans);
  font-size: .75rem;
}
.app-link, .blog-footer a { text-decoration: none; }
.app-link:hover, .blog-footer a:hover { text-decoration: underline; }

.archive, .article { margin: 0 auto; }
.archive { max-width: 57rem; }
.archive-overview { max-width: 70rem; }
.archive-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.1rem 2rem;
  padding: clamp(2rem, 7vw, 4.25rem) 0 1.75rem;
  border-bottom: 2px solid var(--rule);
}
h1, h2, h3, h4, h5 { line-height: 1.04; }
h1 {
  font-size: clamp(2.65rem, 7vw, 4.75rem);
  letter-spacing: -.045em;
  margin: 0;
  text-wrap: balance;
}
.archive-heading p, .article-heading > p { margin: .5rem 0 0; line-height: 1.25; color: var(--muted); }
.subscribe {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.75rem;
  padding: .5rem .8rem;
  border: 1px solid var(--rule);
  background: var(--raised);
  text-decoration: none;
  white-space: nowrap;
}
.subscribe:hover { border-color: var(--ink); text-decoration: underline; }

.archive-actions {
  display: flex;
  justify-content: end;
  padding: 1.25rem 0 1rem;
}
.archive-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4.2vw, 3.75rem);
}
.archive-columns > section, .article {
  border: 1px solid var(--rule);
  border-top: 4px solid var(--rule-strong);
  background: var(--raised);
}
.archive-columns > section {
  min-width: 0;
  padding: .6rem clamp(.75rem, 1.6vw, 1.4rem) 0;
}
.archive-section-title {
  margin: 0;
  border-bottom: 2px solid var(--rule);
  font-size: clamp(2.25rem, 3.6vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -.035em;
}
.archive-section-title a {
  display: block;
  padding: .15em 0 .25em;
  text-decoration: none;
}
.archive-section-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { border-bottom: 1px solid var(--line); }
.post-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  text-decoration: none;
}
.post-title { margin: .32rem 0 0; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.post-row:hover .post-title { text-decoration: underline; text-decoration-thickness: 1px; }
.archive-columns .post-title { font-size: clamp(1.48rem, 2.15vw, 1.95rem); }
.archive-columns .post-row { gap: clamp(.4rem, 1vw, .9rem); }
.archive-columns .post-list li:last-child { border-bottom: 0; }
.post-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .55rem; color: var(--muted); margin: 0; }
.post-description { margin: .32rem 0 0; line-height: 1.27; color: var(--muted); }
.post-arrow { flex: none; font-family: var(--sans); color: var(--muted); }

.article {
  max-width: 60rem;
  margin-top: clamp(1.25rem, 5vw, 3.75rem);
  padding: clamp(1rem, 4vw, 3rem);
}
.article-heading { padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }
.article-heading h1 { margin: .7rem 0 .5rem; }
.article-heading > p { font-size: clamp(1.3rem, 2.6vw, 1.65rem); }
.article-body {
  padding-top: .65rem;
  font-size: clamp(1.25rem, 2.8vw, 1.4rem);
  line-height: 1.53;
  overflow-wrap: anywhere;
}
.article-body :is(h2, h3, h4, h5) { margin: 1.55em 0 .5em; }
.article-body h2 { font-size: 1.55em; }
.article-body h3 { font-size: 1.3em; }
.article-body :is(p, ul, ol, pre, blockquote, figure) { margin: .95em 0; }
.article-body :is(ul, ol) { padding-inline-start: 1.4em; }
.article-body li > p { margin: .25em 0; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.7em 0; }
.article-body blockquote {
  border-inline-start: 2px solid var(--rule);
  padding-inline-start: 1em;
  color: var(--muted);
}
.article-body img { display: block; max-width: 100%; height: auto; margin-inline: auto; }
.blog-image { display: block; }
.article-body figcaption { color: var(--muted); text-align: center; font-size: .84em; margin-top: .45em; }
.article-body :is(.footnote, .blog-embed, .twitter-embed) {
  border-top: 1px solid var(--line);
  padding-top: .6em;
  font-size: .9em;
}
.footnote { display: flex; gap: .7em; }
.footnote-content > :first-child { margin-top: 0; }
.footnote-anchor { font-size: .72em; vertical-align: super; }
.back-link { display: inline-flex; gap: .5rem; align-items: center; min-height: 2.75rem; margin-top: 1.5rem; }

.article-newsletter { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.article-newsletter h2 { margin: 0 0 1rem; font-size: clamp(1.85rem, 4vw, 2.5rem); }
.newsletter { max-width: 35rem; margin: clamp(2rem, 7vw, 5rem) auto; }
.newsletter h1 { font-size: clamp(2.45rem, 6vw, 3.9rem); text-wrap: initial; }
.newsletter > p { color: var(--muted); line-height: 1.4; }
.newsletter-form {
  display: grid;
  justify-items: start;
  gap: .65rem;
  padding-top: 1rem;
  border-top: 2px solid var(--rule);
}
.newsletter-form :is(input, .newsletter-note) { font-family: var(--sans); font-size: .875rem; }
.newsletter-fields { display: grid; justify-items: start; gap: .65rem; width: 100%; }
.newsletter-form--inline { max-width: 33rem; padding-top: 0; border-top: 0; }
.newsletter-form--inline .newsletter-fields { grid-template-columns: minmax(0, 1fr) auto; }
.newsletter-form input[type='email'] {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: .6rem .75rem;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--raised);
  color: var(--ink);
  font-size: 1rem;
}
.newsletter-form input[type='email']::placeholder { color: var(--muted); opacity: 1; }
.newsletter-form input[type='email']:focus { outline: 2px solid var(--ink); outline-offset: -2px; }
.newsletter-form .subscribe { color: var(--raised); background: var(--ink); cursor: pointer; }
.newsletter-form button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.newsletter-note { margin: .35rem 0 0; color: var(--muted); line-height: 1.5; }

.blog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 72rem;
  margin: 3rem auto 0;
  padding: 1rem var(--gutter);
  border-top: 1px solid var(--rule);
}
.blog-footer > span { font-weight: 700; }
.blog-footer > div { display: flex; align-items: center; gap: 1.15rem; }
.blog-footer a { display: inline-flex; align-items: center; min-height: 2.75rem; }

@media (min-width: 48rem) {
  .archive-columns > section {
    display: flex;
    flex-direction: column;
    max-height: 40rem;
  }

  .archive-section-title { flex: none; }
  .archive-columns .post-list {
    min-height: 0;
    overflow-y: auto;
    scrollbar-color: var(--rule) transparent;
  }
  .archive-columns .post-row:focus-visible { outline-offset: -2px; }
}

@media (max-width: 47.99rem) {
  .archive-columns { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}

@media (max-width: 480px) {
  .masthead-inner { justify-content: space-between; gap: .75rem; }
  .masthead-actions { position: static; }
  .post-arrow { align-self: center; }
}

@media (max-width: 360px) {
  .masthead-inner { gap: .5rem; }
  .wordmark { font-size: 1.4rem; }
}
