:root {
  --bg: #f4ebb0;
  --fg: #000000;
  --muted: #3d3028;
  --link: #445539;
  --visited: #445539;
  --border: #d8caa0;
  --code-bg: #3a3228;
  --code-fg: #f7f3e7;
}

* {
  box-sizing: border-box;
  cursor: none;
}

html {
  color-scheme: light;
  height: 100%;
}

html,
body {
  background: var(--bg);
}

body {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  color: var(--fg);
  font-family: system-ui, sans-serif;
  font-weight: normal;
  line-height: 1.6;
  font-size: 17px;
  min-height: 100%;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  margin: 0.4rem 0;
}

li {
  margin: 0.4rem 0;
}

/* Blue is reserved for genuine content links (prose, tags) — chrome like
   nav/titles gets its own neutral color further down, so blue reads
   as "this is a link into content" rather than being everywhere. */
a,
a:visited {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  padding: 2px 4px;
  display: inline-block;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

a:hover {
  background: #2f3c28;
  color: #f6f1e1;
  text-decoration: none;
  transform: scale(1.05);
}

a:active {
  transform: scale(0.98);
}

*:target {
  background: var(--border);
}

#cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  mix-blend-mode: difference;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

.garden-seed {
  position: fixed;
  width: 7px;
  height: 9px;
  background: #2a2318;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  pointer-events: none;
  z-index: 9990;
  transform: translate(-50%, -50%);
}

.garden-flower {
  position: fixed;
  bottom: 0;
  pointer-events: none;
  z-index: 9990;
  transform: translateX(-50%);
}

.garden-flower .f-stem {
  stroke-dasharray: 35;
  stroke-dashoffset: 35;
  animation: stem-grow 0.45s ease-out forwards;
}

.garden-flower .f-leaf {
  animation: leaf-appear 0.3s 0.4s ease forwards;
}

.garden-flower .f-bloom {
  transform-origin: 0px -37px;
  transform: scale(0);
  opacity: 0;
  animation: bloom-pop 0.35s 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes stem-grow {
  to { stroke-dashoffset: 0; }
}

@keyframes leaf-appear {
  to { opacity: 1; }
}

@keyframes bloom-pop {
  to { transform: scale(1); opacity: 1; }
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.site-title,
.site-title:visited,
.site-title:hover {
  color: var(--fg);
  background: transparent;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0;
  text-decoration: none;
  transform: none;
}

.site-description {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-header nav a,
.site-header nav a:visited {
  margin-left: 1rem;
  white-space: nowrap;
}

.site-footer {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--fg);
  font-size: 0.95rem;
}

.site-footer .site-colophon {
  color: var(--muted);
  font-size: 0.85rem;
}

hr {
  text-align: center;
  border: 0;
  margin: 2rem 0;
}

hr:before {
  content: "/////";
}

time {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-style: italic;
}

.featured-page {
  margin-bottom: 3rem;
}

.featured-page h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 2.1rem;
}

/* --- listings (index / archive / tag) --- */

.post-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.post-item {
  margin-bottom: 1.5rem;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.post-title-link {
  font-size: 1.2rem;
  font-weight: 600;
  flex: 1;
}

.post-date {
  color: var(--muted);
  white-space: nowrap;
}

/* Single post: date sits top-right, like a dateline on a letter. Scoped to
   a direct child of .post so it doesn't touch .post-date in listing rows,
   which stay in their existing flex layout. */
.post > .post-date {
  display: block;
  text-align: right;
}

.tag-count {
  color: var(--muted);
  font-size: 0.9rem;
}

.no-posts {
  color: var(--muted);
  font-style: italic;
}

/* --- single post --- */

.post-body {
  margin-top: 1.5rem;
}

.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
}

.post-body pre {
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.9rem;
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 4px;
}

.post-body code {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.9em;
}

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

.post-body blockquote {
  font-style: italic;
  border: thin solid var(--border);
  padding: 1rem;
  margin: 1rem 0;
}

.post-body blockquote p {
  margin: 0;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
}

.post-body th,
.post-body td {
  border: thin solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.footnote-reference a {
  text-decoration: none;
}

.footnote-reference a:hover {
  text-decoration: underline;
}

.footnote-definition {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  margin-top: 0.5rem;
  padding: 0.1rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footnote-definition:target {
  background: var(--border);
}

.footnote-definition:first-of-type {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.footnote-definition-label {
  flex-shrink: 0;
}

.footnote-definition p {
  margin: 0;
}

.tags {
  font-size: 0.9rem;
}

.taxonomy-label {
  color: var(--muted);
  margin-right: 0.4rem;
}

.tags a {
  margin-right: 0.5rem;
}

.pagination {
  margin-top: 2rem;
  text-align: center;
}
