/* ─────────────────────────────────────────────────────────────
   trashpanda — EDITORIAL direction.
   Newsreader serif for display + long-form body, Inter for UI,
   JetBrains Mono for metadata. Warm paper background, deep plum
   accent, warm amber secondary. "Quiet confidence" — reads like
   a literary journal.
   All tokens at the top; everything else descends from them.
   ───────────────────────────────────────────────────────────── */

:root {
  /* Colour */
  --paper:      #f7f4ee;
  --paper-warm: #efe9dc;
  --ink:        #1c1915;
  --muted:      #77716a;
  --rule:       #d8d2c6;
  --plum:       #6b2a5f;
  --amber:      #a8631a;

  /* Type */
  --display: "Newsreader", "Iowan Old Style", "Georgia", serif;
  --body:    "Inter", system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Measure */
  --content-width: 720px;
  --page-gutter:   40px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { max-width: 100%; display: block; }

/* Page */
html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

/* The outer page container. Stretches to the viewport; inner content
   is centered within a max-width. Previously the `.page` itself was
   max-width:1080px which could collide with parent theme CSS — now
   the constraint lives on an inner wrapper so the header bar can go
   edge-to-edge if needed. */
.page {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  display: block;
  width: 100%;
  padding-top: 56px;
}
.site-header__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  gap: 20px;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.site-header__logo {
  color: var(--plum);
  flex-shrink: 0;
}
.site-header__wordmark {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}
.site-header__wordmark .tld { color: var(--plum); }

.site-header__path {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}

/* Nav row */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding: 14px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition: color .12s, border-color .12s;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--plum);
}

.site-header__rule {
  height: 1px;
  background: var(--rule);
  margin-top: 14px;
}

/* ── Main ─────────────────────────────────────────────────── */
main.page-main {
  padding: 36px 0 0;
  flex: 1 0 auto;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  margin-top: 48px;
  padding: 18px 0 32px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.site-footer .page {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.site-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.site-footer a:hover { color: var(--ink); }

/* ── Homepage ────────────────────────────────────────────── */
.featured {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}
.featured__title {
  font-family: var(--display);
  font-size: 54px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
.featured__title a { color: var(--ink); text-decoration: none; }
.featured__title a:hover { color: var(--plum); }
.featured__excerpt {
  font-family: var(--display);
  font-size: 20px;
  color: var(--muted);
  margin: 18px 0 0;
  line-height: 1.5;
  font-weight: 400;
  text-wrap: pretty;
}
.featured__cta {
  display: inline-block;
  margin-top: 22px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  color: var(--plum);
  text-decoration: none;
  border-bottom: 1.5px solid var(--plum);
  padding-bottom: 2px;
}
.featured__aside {
  border-left: 1px solid var(--rule);
  padding-left: 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.archive {
  padding-top: 32px;
}
.archive__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}
.archive__heading {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.archive__since {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.archive__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}
.archive__item {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 28px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.archive__date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--plum);
  letter-spacing: 0.02em;
}
.archive__link {
  font-family: var(--display);
  font-size: 18px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
}
.archive__link:hover { color: var(--plum); }

/* ── Post ────────────────────────────────────────────────── */
.post {
  max-width: var(--content-width);
  width: 100%;
}
.post__back {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  margin-bottom: 24px;
}
.post__back:hover { color: var(--plum); }

.post__kicker {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.post__title {
  font-family: var(--display);
  font-size: 52px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}
.post__rule {
  width: 80px;
  height: 2px;
  background: var(--plum);
  margin: 28px 0 32px;
}

.post__nav {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.post__nav a {
  color: var(--plum);
  text-decoration: none;
}
.post__nav a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Prose (serif body for essays) ───────────────────────── */
.prose {
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.6;
  color: var(--ink);
}
.prose p { margin: 0 0 1.1em; }
.prose > p:first-child { margin-top: 0; }

/* Drop cap on the first paragraph of a post */
.prose--post > p:first-of-type::first-letter {
  font-family: var(--display);
  font-size: 56px;
  line-height: 0.9;
  font-weight: 600;
  color: var(--plum);
  float: left;
  padding-right: 10px;
  padding-top: 6px;
}

.prose a {
  color: var(--plum);
  text-decoration: none;
  border-bottom: 1px solid var(--plum);
}
.prose a:hover { background: var(--paper-warm); }

.prose h2 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 1.6em 0 0.5em;
}
.prose h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  margin: 1.4em 0 0.4em;
}

.prose code {
  font-family: var(--mono);
  font-size: 15px;
  background: var(--paper-warm);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ink);
}

.prose pre {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  background: var(--paper-warm);
  color: var(--ink);
  padding: 18px 20px;
  margin: 1.2em 0;
  overflow-x: auto;
  border-left: 3px solid var(--plum);
}
.prose pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

.prose sup {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--plum);
  line-height: 0;
  vertical-align: super;
}
.prose sup a { border: none; color: inherit; }

.prose img {
  margin: 1.2em 0;
  border: 1px solid var(--rule);
}

.prose ul, .prose ol {
  padding-left: 1.2em;
  margin: 0 0 1.1em;
}
.prose li { margin-bottom: 0.3em; }

.post__footnotes {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}
.post__footnotes ol { padding-left: 1.2em; margin: 0; }
.post__footnotes li { margin-bottom: 0.5em; }
.post__footnotes a { color: var(--plum); }

/* ── Utility pages (about, projects, etc.) ──────────────── */
.page-body h1 {
  font-family: var(--display);
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 24px;
}
.page-body h1 em,
.page-body h1 i {
  color: var(--plum);
  font-style: italic;
}
.page-body h2 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 1.6em 0 0.4em;
}
.page-body__kicker {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.page-body__rule {
  width: 60px;
  height: 2px;
  background: var(--plum);
  margin: 4px 0 28px;
}

/* Contact card used on the About page */
.contact-card {
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--paper-warm);
  border-left: 3px solid var(--plum);
  font-family: var(--body);
  font-size: 15px;
}
.contact-card__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.contact-card__rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-card__rows .val { color: var(--plum); }

/* Projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 40px;
  margin-top: 40px;
}
.project-card {
  border-top: 2px solid var(--ink);
  padding-top: 14px;
}
.project-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 12px;
}
.project-card__name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.project-card__tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.project-card__link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--plum);
  margin-bottom: 10px;
}
.project-card__blurb {
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --page-gutter: 28px; }
  .featured {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .featured__aside {
    border-left: none;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 16px;
  }
  .featured__title { font-size: 42px; }
  .post__title { font-size: 40px; }
  .page-body h1 { font-size: 36px; }
  .projects-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  :root { --page-gutter: 22px; }
  html { font-size: 16px; }
  .site-header { padding-top: 32px; }
  .site-header__inner { flex-direction: column; align-items: flex-start; }
  .site-header__path { max-width: 100%; }
  .site-nav { gap: 16px; font-size: 11px; }
  .featured__title { font-size: 34px; }
  .featured__excerpt { font-size: 17px; }
  .post__title { font-size: 32px; }
  .prose { font-size: 18px; }
  .archive__item { grid-template-columns: 84px 1fr; gap: 16px; }
  .site-footer .page { flex-direction: column; gap: 6px; }
}
