:root {
  --bg: #f7f1e8;
  --paper: #fffaf2;
  --text: #2e2823;
  --muted: #857a6f;
  --accent: #b4532a;
  --rule: #e6dccd;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1a17;
    --paper: #24201c;
    --text: #ece3d6;
    --muted: #a3978a;
    --accent: #e08a5f;
    --rule: #3a332c;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 20px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

.page {
  max-width: 700px;
  margin: 0 auto;
  padding: 4.5rem 1.4rem 4rem;
}

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

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

/* Header */

/* Home page: rendered from content/home.md as h1, tagline, links, then sections */

.home > h1 {
  font-size: 2.6rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
}

.home > .tagline {
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.home > .links {
  margin: 0.8rem 0 0;
  font-size: 0.95rem;
}

.home > .links:not(:has(+ .links, + .tagline)) {
  margin-bottom: 2.4rem;
}

.home > h2 {
  margin-top: 3rem;
}

.error {
  color: var(--muted);
  font-style: italic;
  margin-top: 2rem;
}

.back {
  font-size: 0.95rem;
  text-decoration: none;
}

/* Sections */

section {
  margin-top: 3rem;
}

h2 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

p {
  margin: 0 0 1rem;
}

/* Writings list */

.posts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.posts li {
  display: flex;
  gap: 1.2rem;
  align-items: baseline;
  padding: 0.45rem 0;
}

.posts time {
  flex: 0 0 6.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.posts a {
  color: var(--text);
  text-decoration: none;
}

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

.more {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.95rem;
}

/* Single post */

.post-body {
  font-size: 1.05rem;
}

.post-body > h1:first-child {
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 2rem 0 0.4rem;
}

.post-body > h1:first-child + p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 2.2rem;
}

.post-body h2 {
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  border: 0;
  padding: 0;
  margin: 2.2rem 0 0.6rem;
}

.post-body blockquote {
  margin: 1.5rem 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

/* Steak night popup */

.modal {
  width: min(440px, calc(100% - 2rem));
  padding: 1.8rem 1.6rem 1.4rem;
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--paper);
  color: var(--text);
}

.modal::backdrop {
  background: rgba(30, 22, 15, 0.25);
}

.hp {
  position: absolute;
  left: -9999px;
}

.modal-close:focus:not(:focus-visible) {
  outline: none;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-text h2 {
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  border: 0;
  padding: 0;
  margin: 0 0 0.5rem;
}

.modal-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.4rem 0 0.3rem;
}

.modal-row {
  display: flex;
  gap: 0.5rem;
}

.modal-form input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--muted);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.modal-form input:focus {
  outline: none;
  border-color: var(--text);
}

.modal-form button[type="submit"] {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--text);
  color: var(--paper);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.modal-form button[type="submit"]:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.modal-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: default;
}

.modal-status {
  min-height: 1.4em;
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
@media (max-width: 520px) {
  html {
    font-size: 18px;
  }

  .page {
    padding-top: 3rem;
  }

  .posts li {
    flex-direction: column;
    gap: 0;
  }

  .posts time {
    flex: none;
  }
}
