/* matt-is-coding-again — shared styles
   Fraunces (display), Source Serif 4 (body), JetBrains Mono (accents). */

:root {
  --ink: #1a1714;
  --ink-soft: #4a443d;
  --ink-faint: #8a8175;
  --paper: #faf8f3;
  --paper-edge: #efe9dd;
  --rule: #e3dccd;
  --accent: #9a3b24;
  --max: 38rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.7;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Masthead ---- */

.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 3.5rem 0 1.75rem;
}

.masthead a.brand {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.masthead h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
}

.masthead .tagline {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0.9rem 0 0;
}

.masthead .blurb {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 1.25rem 0 0;
  max-width: 32rem;
}

/* ---- Entry list ---- */

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

.entry {
  border-bottom: 1px solid var(--rule);
  padding: 2rem 0;
}

.entry a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.entry a:hover .entry-title,
.entry a:focus-visible .entry-title {
  color: var(--accent);
}

.entry-meta {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  margin: 0 0 0.6rem;
}

.entry-meta .num {
  color: var(--accent);
}

.entry-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 550;
  font-size: 1.6rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
  transition: color 0.15s ease;
}

.entry-summary {
  color: var(--ink-soft);
  font-size: 1.02rem;
  margin: 0;
}

/* ---- Post ---- */

.post {
  padding: 3.5rem 0 1rem;
}

.post .back {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
}

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

.post-header {
  margin: 2.5rem 0 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.post-meta {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.post-meta .num {
  color: var(--accent);
}

.post-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0;
}

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

.post-body > :first-child {
  margin-top: 0;
}

.post-body p {
  margin: 0 0 1.4rem;
}

.post-body h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 1rem;
}

.post-body h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 0.06em;
}

.post-body blockquote {
  margin: 1.6rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--rule);
  color: var(--ink-soft);
  font-style: italic;
}

.post-body code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.86em;
  background: var(--paper-edge);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.post-body pre {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  background: var(--ink);
  color: #f3ede1;
  padding: 1.1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.6rem 0;
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.post-body figure {
  margin: 1.6rem 0;
}

.post-body figure img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.post-body figure figcaption {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.6rem;
}

.post-body table.ledger {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
}

.post-body table.ledger th,
.post-body table.ledger td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.post-body table.ledger th {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--ink-faint);
}

.post-body table.ledger td:not(:first-child),
.post-body table.ledger th:not(:first-child) {
  text-align: right;
}

.post-body table.ledger tr:last-child td {
  border-bottom: none;
  font-weight: 700;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.post-body ul,
.post-body ol {
  margin: 0 0 1.4rem;
  padding-left: 1.4rem;
}

.post-body li {
  margin: 0 0 0.5rem;
}

/* ---- Footer ---- */

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding: 2rem 0 4rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece6da;
    --ink-soft: #b3ab9c;
    --ink-faint: #807868;
    --paper: #16140f;
    --paper-edge: #211e17;
    --rule: #2c281f;
    --accent: #e08a5f;
  }
  .post-body pre {
    background: #0c0b08;
  }
}
