/* Public site styles.

   1. Reset (modern-normalize + the base rules the old Tailwind build shipped;
      `highlight.css` and the rich-text content styles rely on it)
   2. Tokens
   3. Blocks, BEM-style: `.block`, `.block__element`, `.block--modifier`

   Breakpoints: 640px (small) and 768px (medium), mobile first.
*/

/* ==========================================================================
   1. Reset
   ========================================================================== */

html {
  tab-size: 4;
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
}

hr {
  height: 0;
  color: inherit;
}

abbr[title] {
  -webkit-text-decoration: underline dotted;
  text-decoration: underline dotted;
}

b,
strong {
  font-weight: bolder;
}

code,
kbd,
pre,
samp {
  font-family: ui-monospace, SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
  font-size: 1em;
}

small {
  font-size: 80%;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -.25em;
}

sup {
  top: -.5em;
}

table {
  text-indent: 0;
  border-color: inherit;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

button,
select {
  text-transform: none;
}

[type=button],
[type=reset],
[type=submit],
button {
  -webkit-appearance: button;
}

legend {
  padding: 0;
}

progress {
  vertical-align: baseline;
}

summary {
  display: list-item;
}

blockquote,
dd,
dl,
figure,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
p,
pre {
  margin: 0;
}

button {
  background-color: transparent;
  background-image: none;
}

fieldset,
ol,
ul {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

html {
  font-family: Helvetica, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  line-height: 1.5;
}

body {
  font-family: inherit;
  line-height: inherit;
}

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

img {
  border-style: solid;
}

textarea {
  resize: vertical;
}

[role=button],
button {
  cursor: pointer;
}

table {
  border-collapse: collapse;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration: inherit;
}

button,
input,
optgroup,
select,
textarea {
  padding: 0;
  line-height: inherit;
  color: inherit;
}

code,
kbd,
pre,
samp {
  font-family: Menlo, Monaco, Consolas, monospace;
}

audio,
canvas,
embed,
iframe,
img,
object,
svg,
video {
  display: block;
  vertical-align: middle;
}

img,
video {
  max-width: 100%;
  height: auto;
}

[hidden] {
  display: none;
}

@font-face {
  font-family: Merriweather;
  font-weight: 300;
  font-display: swap;
  unicode-range: U+000-5ff;
  src: local(Merriweather), url(../fonts/merriweather-light.woff2) format("woff2");
}

@font-face {
  font-family: Merriweather;
  font-weight: 700;
  font-display: swap;
  unicode-range: U+000-5ff;
  src: local(Merriweather), url(../fonts/merriweather-bold.woff2) format("woff2");
}

svg {
  display: inline-block;
}

hr {
  border-top-width: 1px;
  margin: 30px 10%;
}

*,
::before,
::after {
  border-color: var(--color-line, #e5e7eb);
}

input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: #9ca3af;
}

html {
  font-size: 18px;
}

.nowrap {
  white-space: nowrap;
}

/* ==========================================================================
2. Tokens
========================================================================== */

:root {
  --font-sans: Helvetica, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: Merriweather, Georgia, Cambria, "Times New Roman", Times, serif;

  --color-ink: #1f2937;
  /* body text */
  --color-ink-soft: #7f858f;
  /* secondary text, header border */
  --color-ink-muted: #4b5563;
  /* footer, nav icons */
  --color-ink-faint: #6b7280;
  /* dates */
  --color-line: #e5e7eb;
  --color-line-strong: #9ca3af;
  --color-surface: #f3f4f6;
  --color-brand: #cd3700;
  --color-brand-dark: #991b1b;
  --color-accent: #dc2626;
  /* section headings, tags */
  --color-link: #0074e8;

  --width-page: 1280px;
  --width-text: 48rem;
}

/* ==========================================================================
3. Blocks
========================================================================== */

.link,
.post a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 0.11em;
}

.link:hover,
.post a:hover {
  text-decoration: none;
}

/* --- page --- */

.page {
  font-family: var(--font-sans);
  color: var(--color-ink);
  background-color: var(--color-surface);
  cursor: default;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page__main {
  padding-bottom: 3rem;
}

.page__container {
  width: 100%;
  max-width: var(--width-page);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.page__section {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.page__section--spaced {
  margin-top: 3rem;
  margin-bottom: 3rem;
  padding-top: 0;
  padding-bottom: 0;
}

@media (min-width: 640px) and (max-width: 899px) {
  .page {
    --intro-nav: calc(1.5rem + 32px + 8px);
    /* plus the top border */
  }
}

/* --- site-header --- */

.site-header {
  width: 100%;
  padding: 2rem 0;

  nav {
    position: relative;
    width: 100%;
    max-width: var(--width-page);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
  }

  nav a {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    color: var(--color-ink-soft);
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-style: solid;
  }
  nav a:hover {
    color: var(--color-ink);
  }
  nav a.active {
    font-weight: 700;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--color-accent);
  }
}

/* --- home --- */

.home {

  .page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: var(--width-page);
    line-height: 1.1;
  }

  .page-header .avatar {
    display: block;
    position: relative;
    width: 192px;
    height: 225px;
    border-radius: 30% 20%;
    overflow: hidden;
    text-decoration: none;
    margin: 0 auto;
  }

  .page-header .avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-position: center;
    object-fit: cover;
    opacity: 1;
    will-change: opacity;
    user-select: none;
  }

  .page-header .avatar .img-alt {
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.4s;
  }

  .page-header .avatar:is(:hover,:focus-visible) .img-alt {
    opacity: 1;
  }

  .page-header h1 {
    font-weight: 700;
    font-size: 3rem;
  }

  .page-header p {
    font-size: 1.25rem;
    color: var(--color-ink-soft);
    padding: 0 1rem;
  }

  .intro {
    padding: 0 1rem;
    text-align: center;
    font-size: 1.25rem;
    max-width: calc(var(--width-page) / 2);
    margin: 0 auto;
  }
}

/* --- page-header: centered title block (post, tag and notice pages) ----- */

.page-header {
  margin-top: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.page-header__tags {
  padding-bottom: 1rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.page-header__tag {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.11em;
  text-transform: uppercase;
}

.page-header__tag:hover {
  text-decoration: none;
}

.page-header__title {
  padding-bottom: 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 2.25rem;
  letter-spacing: -0.025em;
}

.page-header__meta {
  font-style: italic;
  font-weight: 300;
  color: var(--color-ink-faint);
}

@media (min-width: 640px) {
  .page-header__title {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
}

@media (min-width: 768px) {
  .page-header__meta {
    font-size: 1rem;
    line-height: 1.5rem;
  }
}

/* --- post-list: heading plus a dated list of posts ---------------------- */

.post-list__heading {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: 0.025em;
  color: var(--color-accent);
  text-transform: uppercase;
  border-bottom: 2px solid var(--color-line);
}

.post-list__item {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-line);
}

.post-list__date {
  width: 8rem;
  padding-bottom: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-ink-faint);
}

.post-list__link {
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 0.11em;
}

.post-list__link:hover {
  text-decoration: none;
}

.post-list__empty {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  color: var(--color-ink-faint);
}

@media (min-width: 640px) {
  .post-list__heading {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  .post-list__item {
    flex-direction: row;
  }

  .post-list__link {
    font-size: 1.25rem;
    line-height: 1.75rem;
  }
}

/* --- article: a single post page ----------------------------------------
   The rich-text body also carries `.post` (content styles, see post.css and
   highlight.css) and `.lexxy-content`. */

.article {
  font-family: var(--font-serif);
}

.article__body,
.article__comments,
.article__footer {
  max-width: var(--width-text);
  margin-left: auto;
  margin-right: auto;
}

.article__body {
  font-size: 1rem;
  line-height: 1.5rem;
}

.article__comments {
  margin-top: 2.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
  text-align: center;
}

.article__footer {
  margin-top: 2rem;
  padding-top: 1rem;
  padding-bottom: 0.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
  letter-spacing: 0.025em;
  color: var(--color-ink-soft);
  text-align: center;
  text-transform: uppercase;
  border-top: 2px solid var(--color-line-strong);
  border-bottom: 1px solid var(--color-line-strong);
}

.article__footer-on {
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: lowercase;
}

@media (min-width: 640px) {
  .article__body {
    font-size: 1.125rem;
    line-height: 1.75rem;
  }
}

@media (min-width: 768px) {
  .article__comments {
    font-size: 1.125rem;
    line-height: 1.75rem;
  }
}

/* --- author-card: avatar and bio under a post ---------------------------- */

.author-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: var(--width-text);
  margin-top: 1.5rem;
  margin-left: auto;
  margin-right: auto;
  padding-top: 0.75rem;
  padding-bottom: 2rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5rem;
}

.author-card__figure {
  margin-bottom: 1rem;
  text-align: center;
}

.author-card__avatar {
  width: 6rem;
  border-radius: 9999px;
}

.author-card__body {
  line-height: 1.375;
  text-align: center;
}

.author-card__name {
  margin-bottom: 0.75rem;
  font-weight: 700;
}

@media (min-width: 640px) {
  .author-card__figure {
    margin-right: 2rem;
    margin-left: -1rem;
  }
}

@media (min-width: 768px) {
  .author-card {
    flex-direction: row;
    font-size: 1.125rem;
    line-height: 1.75rem;
  }

  .author-card__figure,
  .author-card__body {
    text-align: left;
  }

  .author-card__body {
    line-height: 1.375;
  }

  .author-card__avatar {
    width: 8rem;
  }
}

/* --- site-footer ---------------------------------------------------------- */

.site-footer {
  margin-bottom: 4rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--color-ink-muted);
  text-align: center;
  border-top: 1px solid var(--color-line);
}

.site-footer__icons {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 20rem;
  margin: 0 auto 2rem;
}

.site-footer__icon {
  height: 2rem;
}

.site-footer__credits {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.site-footer__nowrap {
  white-space: nowrap;
}

@media (min-width: 640px) {
  .site-footer {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .site-footer__icons {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

@media (min-width: 768px) {
  .site-footer__icon {
    height: 2.5rem;
  }
}

/* --- notice: not-found and error pages ------------------------------------ */

.notice {
  margin-top: 3rem;
  margin-bottom: 3rem;
  font-family: var(--font-serif);
  text-align: center;
}

.notice__text {
  margin-bottom: 0.75rem;
  color: var(--color-ink-soft);
}