/* ---- Variables ---- */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1c1a;
  --text-muted: #5c5c58;
  --accent: #3a6b63;
  --accent-hover: #2c524c;
  --border: #e5e3df;
  --max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --surface: #1e1f23;
    --text: #edece8;
    --text-muted: #a7a6a1;
    --accent: #7fc4b6;
    --accent-hover: #9edac9;
    --border: #2c2d31;
  }
}

/* ---- Reset ---- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

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

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

img {
  max-width: 100%;
}

.poem-image {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 32px rgba(28, 28, 26, 0.12);
}

.poem-text {
  align-items: center;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text);
  font-style: italic;
}

.poem-title {
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 1rem;
  color: var(--text);
}

@media (max-width: 760px) {
  .poem-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .poem-text p {
    font-size: 1rem;
    line-height: 1.7;
  }
}

/* ---- Layout ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.site-title:hover {
  text-decoration: none;
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
  text-decoration: none;
}

main#content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  min-height: 60vh;
  transition: opacity 150ms ease-in;
}

main#content.htmx-swapping {
  opacity: 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---- Sections ---- */
h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
}

.tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0 0 1.5rem;
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.button.secondary:hover {
  background: var(--accent);
  color: #fff;
}

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

.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:first-child {
  border-top: 1px solid var(--border);
}

.post-title {
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.post-meta {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.post-excerpt {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
}

/* ---- Single post ---- */
.post-header {
  margin-bottom: 1.5rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ---- Follow ---- */
.follow-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.follow-list a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.follow-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.follow-list svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: currentColor;
}

/* ---- Sutras ---- */
.sutra-theme:first-child h2 {
  margin-top: 0;
}

.sutra-body {
  font-size: 1.05rem;
  line-height: 1.85;
}

.sutra-body p {
  margin: 0 0 1.1rem;
}

.sutra-body p:last-child {
  margin-bottom: 0;
}

.sutra-attribution {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

.sutra-attribution p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.sutra-author-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

/* ---- Books ---- */
.book-body {
  font-size: 1.05rem;
  line-height: 1.85;
}

.book-body p {
  margin: 0 0 1.1rem;
}

.book-body p:last-child {
  margin-bottom: 0;
}

.post-gif {
  display: block;
  width: 100%;
  max-width: 700px;
  margin: 1.5rem auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}