:root {
  --bg: #f8f7f3;
  --bg-elevated: #f1eeea;
  --text: #1a2818;
  --text-dim: #607058;
  --accent: #8c3050;
  --status-on: #5a7d4f;
  --status-off: #8c3050;
  --border: #e2dcd4;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

.wrap { max-width: 680px; margin: 0 auto; padding: 56px 24px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 56px;
  flex-wrap: wrap;
  gap: 12px;
}

header h1 {
  font-family: 'Source Serif 4', serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

header .pronunciation {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.3rem;
}

nav {
  padding-top: 0.4rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

nav a:hover, nav a.active { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin-bottom: 1rem; }

h2 {
  font-family: 'Source Serif 4', serif;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 1.75rem 0 0.6rem;
  position: relative;
  clear: left;
}

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

h3 {
  font-family: 'Source Serif 4', serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.4rem 0 0.5rem;
  position: relative;
}

.intro {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.intro > div { min-width: 0; }
.intro p:last-child { margin-bottom: 0; }

.photo {
  flex-shrink: 0;
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
}

/* shared components: chips, tags, cards -- reused across blog/tag/homelab pages */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  padding: 4px 10px; border-radius: 4px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-dim);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-on { background: var(--status-on); }
.dot-off { background: var(--status-off); }

.meta { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-dim); }

.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--accent);
  text-decoration: none;
}
.tag::before { content: "#"; }
.tag:hover { text-decoration: underline; }

.card {
  border-top: 1px solid var(--border);
  padding: 22px 0;
}
.card h3 { margin: 0 0 6px; font-family: 'Source Serif 4', serif; font-size: 20px; font-weight: 600; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0 0 8px; color: var(--text-dim); font-size: 15px; }
.card p:last-child { margin-bottom: 0; }
.card .tags { margin-top: 6px; }

footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  header { flex-direction: column; gap: 0.5rem; }
  nav { padding-top: 0; flex-wrap: wrap; }
  .intro { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .gallery-frame { height: 340px; }
}

.heading-anchor {
  position: absolute;
  left: -0.9em;
  top: 0;
  visibility: hidden;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: normal;
  font-size: 1em;
}
h1:hover .heading-anchor,
h2:hover .heading-anchor,
h3:hover .heading-anchor { visibility: visible; }

/* Quarto's automatic title-block is only present so `listing:` can read
   title/date metadata -- the visible header is our own hand-rolled one. */
#title-block-header { display: none; }

/* Quarto listing: restyle to match .tag-pill / .card vibe */
.quarto-listing { max-width: 680px; margin: 0 auto; padding: 0 24px 56px; }
#quarto-listing-default .quarto-listing-category-title { display: none; }
.quarto-listing-categories {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 32px;
  list-style: none;
  padding: 0;
}
.quarto-listing-categories .category {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-dim); padding: 5px 12px; border-radius: 999px;
  cursor: pointer;
}
.quarto-listing-categories .category.category-selected,
.quarto-listing-categories .category:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--bg-elevated);
}
.quarto-listing-category-title { display: none; }

/* Quarto listing JS toggles this Bootstrap utility class directly;
   we don't load Bootstrap, so it needs its own definition. */
.d-none { display: none !important; }

.quarto-grid-item, .quarto-post {
  border-top: 1px solid var(--border);
  padding: 22px 0;
}
.listing-title { font-family: 'Source Serif 4', serif; font-size: 20px; font-weight: 600; }
.listing-title a { color: var(--text); }
.listing-title a:hover { color: var(--accent); }
.listing-date { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-dim); }
.listing-description { color: var(--text-dim); font-size: 15px; }

/* image gallery -- used by misc/places */
.gallery-frame {
  display: flex;
  justify-content: center;
}
.gallery-frame img {
  max-width: 100%;
  max-height: 640px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.gallery-caption {
  margin-top: 6px;
  text-align: center;
}
.gallery-location {
  margin: 0;
  font-family: 'Source Serif 4', serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--text);
}
.gallery-note {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--text-dim);
}
.gallery-credit {
  margin: 6px 0 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
}
.gallery-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
}
.gallery-btn:hover { border-color: var(--accent); color: var(--accent); }
.gallery-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  min-width: 46px;
  text-align: center;
}
