/* Minimal personal blog — black / white, Inter */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #f5f0e8;
  --text: #1a1a1a;
  --muted: #767676;
  --rule: #d5cfc4;
  --link: #1a1a1a;
  --link-hover: #444444;
  --max: 40rem;
  --space: 1.5rem;
}

[data-theme="dark"] {
  --bg: #0d0d0d;
  --text: #e8e8e8;
  --muted: #888888;
  --rule: #2e2e2e;
  --link: #e8e8e8;
  --link-hover: #aaaaaa;
}

[data-theme="dark"] .post .body code,
[data-theme="dark"] main code {
  background: #1e1e1e;
  color: #e0e0e0;
}

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

html {
  font-size: 106%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 1.5rem) 4rem;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  font-synthesis: none;
}

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

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}

.hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 1.25rem 0 1.5rem;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

section {
  margin-top: 2.25rem;
}

section:first-of-type {
  margin-top: 0.5rem;
}

h2 {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.85rem;
}

.post-list,
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  margin: 0.35rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  column-gap: 0.6rem;
  align-items: baseline;
}

/* Items with only a span (e.g. NOW section) span both columns */
.post-list li > span:only-child {
  grid-column: 1 / -1;
}

.link-list li {
  margin: 0.35rem 0;
  padding: 0;
}

.post-date,
.meta {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.post-list a,
.link-list a {
  text-decoration: none;
  font-weight: 500;
  overflow-wrap: break-word;
  min-width: 0;
}

.post-list a:hover,
.link-list a:hover {
  text-decoration: underline;
  text-decoration-color: currentColor;
}

/* See more link */
.see-more {
  display: block;
  text-align: right;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.see-more:hover {
  color: var(--link-hover);
}

/* About page */
.about-header {
  margin-bottom: 2rem;
  overflow: hidden;
}

.about-text h1 {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.about-text p {
  margin: 0;
  line-height: 1.65;
}

.about-avatar {
  float: right;
  width: 305px;
  height: 305px;
  object-fit: cover;
  border-radius: 4px;
  margin: 0 0 1rem 1.5rem;
}

@media (max-width: 480px) {
  body {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .post h1 {
    font-size: 1.35rem;
  }

  .post-date,
  .meta {
    overflow: hidden;
  }

  .about-avatar {
    float: none;
    display: block;
    width: 100%;
    height: auto;
    margin: 0 0 1.25rem 0;
  }
}

/* Reading time */
.reading-time {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Back to top */
.back-to-top {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  margin-top: 2.5rem;
}

.back-to-top:hover {
  color: var(--link-hover);
}

/* Post page */
article.post {
  max-width: var(--max);
  margin: 0 auto;
}

.post-back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.post-back:hover {
  color: var(--link-hover);
}

.post h1 {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.post time {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.post .body p {
  margin: 0 0 1rem;
}

.post .body h2 {
  font-size: 1.1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}

.post .body code,
main code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #e8e2d8;
  color: #1a1a1a;
  padding: 0.1em 0.35em;
  border-radius: 0.2rem;
}

footer.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.65rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

footer.site-footer p {
  margin: 0;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

footer.site-footer a {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 0.2em;
}

footer.site-footer a:hover {
  color: var(--link-hover);
}

footer.site-footer code {
  font-size: inherit;
  color: inherit;
  background: transparent;
  padding: 0;
}

.colophon p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
