/* ============================================================
   Indwelling Presence — site stylesheet
   A quiet, contemplative design: warm light, unhurried type.
   ============================================================ */

:root {
  --bg: #faf7f1;
  --bg-soft: #f3eee4;
  --surface: #fffdf8;
  --ink: #2b2620;
  --ink-soft: #5a5348;
  --ink-faint: #8a8172;
  --gold: #a8863d;
  --gold-deep: #8c6f2f;
  --gold-soft: rgba(168, 134, 61, 0.14);
  --line: #e6ddcc;
  --shadow: 0 10px 30px rgba(90, 74, 40, 0.08);
  --shadow-lift: 0 18px 44px rgba(90, 74, 40, 0.14);
  --radius: 14px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "EB Garamond", Georgia, serif;
  --max: 1120px;
  --measure: 44rem;
}

html[data-theme="dark"] {
  --bg: #14110c;
  --bg-soft: #1b1710;
  --surface: #1e1a13;
  --ink: #eae3d3;
  --ink-soft: #c2b8a2;
  --ink-faint: #8f8570;
  --gold: #d2ac5e;
  --gold-deep: #e0be76;
  --gold-soft: rgba(210, 172, 94, 0.12);
  --line: #332c1f;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 18px 44px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.19rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease, color 0.5s ease;
}

img { max-width: 100%; }

a { color: var(--gold-deep); text-decoration: none; transition: color 0.25s ease; }
a:hover { color: var(--gold); }

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

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 24px rgba(60,48,20,0.06); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.4rem;
  max-width: var(--max);
  margin: 0 auto;
}

.brand {
  display: flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.42rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand .flame { width: 26px; height: 26px; flex: none; }

.nav {
  display: flex; align-items: center; gap: 1.5rem;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
}
.nav a { color: var(--ink-soft); position: relative; padding: 0.2rem 0; }
.nav a::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.nav a.active { color: var(--ink); }

.support-btn, .nav .support-btn {
  display: inline-block;
  white-space: nowrap;
  padding: 0.42rem 1.25rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold-deep) !important;
  font-size: 0.98rem;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.support-btn:hover { background: var(--gold); color: #fff !important; transform: translateY(-1px); }
.support-btn::after { display: none !important; }

.theme-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft); padding: 0.3rem;
  display: flex; align-items: center;
  transition: color 0.3s ease, transform 0.4s ease;
}
.theme-toggle:hover { color: var(--gold); transform: rotate(15deg); }
.theme-toggle svg { width: 20px; height: 20px; }

.menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--ink); padding: 0.3rem; }
.menu-btn svg { width: 26px; height: 26px; }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav {
    position: fixed;
    top: 58px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.6rem 1.4rem 1.2rem;
    transform: translateY(-130%);
    transition: transform 0.35s ease;
    box-shadow: var(--shadow);
  }
  .nav.open { transform: translateY(0); }
  .nav a { padding: 0.55rem 0; font-size: 1.1rem; }
  .nav .support-btn { margin-top: 0.6rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 11rem 0 6.5rem;
  text-align: center;
  isolation: isolate;
}
.hero.inner-hero { padding: 9.5rem 0 4.5rem; }

.hero-glow {
  position: absolute;
  inset: -20% -10%;
  z-index: -2;
  background:
    radial-gradient(ellipse 55% 45% at 50% 30%, var(--gold-soft), transparent 70%),
    radial-gradient(ellipse 40% 35% at 18% 78%, rgba(168,134,61,0.08), transparent 70%),
    radial-gradient(ellipse 40% 35% at 84% 70%, rgba(168,134,61,0.07), transparent 70%);
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.045); }
}

.particles { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.particles span {
  position: absolute;
  bottom: -12px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  filter: blur(1px);
  animation: rise linear infinite;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  12%  { opacity: 0.5; }
  85%  { opacity: 0.25; }
  100% { transform: translateY(-82vh) translateX(var(--drift, 20px)); opacity: 0; }
}

.hero .kicker {
  font-size: 0.95rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 1.3rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  line-height: 1.12;
  margin: 0 auto 1.4rem;
  max-width: 20ch;
  letter-spacing: 0.01em;
}
.hero .lede {
  max-width: 42rem;
  margin: 0 auto 2.4rem;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  color: var(--ink-soft);
  font-style: italic;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  border-radius: 999px;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}
.btn-primary { background: var(--gold); color: #fff; box-shadow: 0 8px 24px rgba(168,134,61,0.35); }
.btn-primary:hover { background: var(--gold-deep); color: #fff; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(168,134,61,0.45); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink-soft); background: var(--surface); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-deep); transform: translateY(-2px); }

.verse-line {
  margin: 3.6rem auto 0;
  max-width: 36rem;
  color: var(--ink-faint);
  font-style: italic;
  font-size: 1.05rem;
}
.verse-line strong { color: var(--gold-deep); font-weight: 500; }

/* ---------- Sections ---------- */
section.block { padding: 4.6rem 0; }
section.block.tinted { background: var(--bg-soft); }

.section-head { text-align: center; max-width: 46rem; margin: 0 auto 3rem; }
.section-head .kicker {
  font-size: 0.85rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold-deep); margin-bottom: 0.8rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 600;
  margin: 0 0 0.9rem;
  line-height: 1.2;
}
.section-head p { color: var(--ink-soft); margin: 0; }

/* Series cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem;
  max-width: 62rem;
  margin: 0 auto;
}
@media (max-width: 720px) { .card-grid { grid-template-columns: 1fr; } }
.series-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.2rem 2rem 2rem;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  overflow: hidden;
}
.series-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); border-color: var(--gold); color: var(--ink); }
.series-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.series-card:hover::before { opacity: 1; }
.series-card .icon { width: 40px; height: 40px; color: var(--gold); margin-bottom: 1.1rem; }
.series-card h3 { font-family: var(--font-display); font-size: 1.65rem; font-weight: 600; margin: 0 0 0.5rem; }
.series-card .count { font-size: 0.88rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); }
.series-card p { color: var(--ink-soft); font-size: 1.05rem; margin: 0.7rem 0 1.1rem; }
.series-card .go { font-style: italic; color: var(--gold-deep); }

/* Post list */
.post-list { list-style: none; margin: 0; padding: 0; max-width: 52rem; margin-inline: auto; }
.post-list li { border-bottom: 1px solid var(--line); }
.post-list li:first-child { border-top: 1px solid var(--line); }
.post-list a {
  display: flex; align-items: baseline; gap: 1.4rem;
  padding: 1.35rem 0.9rem;
  color: var(--ink);
  transition: background-color 0.3s ease, padding-left 0.3s ease;
  border-radius: 8px;
}
.post-list a:hover { background: var(--gold-soft); padding-left: 1.4rem; }
.post-list .num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  min-width: 2.2rem;
  text-align: right;
  flex: none;
}
.post-list .t { font-family: var(--font-display); font-size: 1.32rem; font-weight: 600; line-height: 1.3; }
.post-list .d { display: block; color: var(--ink-faint); font-size: 0.98rem; font-style: italic; margin-top: 0.15rem; }

/* ---------- Article ---------- */
.article-head { text-align: center; max-width: 50rem; margin: 0 auto; }
.article-head .series-tag {
  display: inline-block;
  font-size: 0.85rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--gold-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.32rem 1.1rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
}
.article-head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.15;
  margin: 0 0 1.1rem;
}
.article-meta { color: var(--ink-faint); font-size: 1rem; font-style: italic; }
.article-meta span + span::before { content: "·"; margin: 0 0.6rem; }

.article {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3.2rem 1.4rem 1rem;
}
.article > * { margin-top: 0; }
.article p { margin: 0 0 1.35rem; }
.article h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 3rem 0 1.2rem;
  position: relative;
  padding-top: 1.6rem;
}
.article h2::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 56px; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.article h3 { font-family: var(--font-display); font-size: 1.45rem; margin: 2.2rem 0 1rem; }
.article blockquote {
  margin: 1.8rem 0;
  padding: 1.2rem 1.6rem;
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: var(--ink-soft);
}
.article blockquote p:last-child { margin-bottom: 0; }
.article ul, .article ol { margin: 0 0 1.35rem; padding-left: 1.6rem; }
.article li { margin-bottom: 0.45rem; }
.article strong { color: var(--ink); }
.article hr { border: none; border-top: 1px solid var(--line); margin: 2.6rem auto; width: 40%; }

.drop-cap > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.6em;
  float: left;
  line-height: 0.82;
  padding: 0.08em 0.12em 0 0;
  color: var(--gold);
}

/* Reading progress */
.progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  z-index: 70;
  transition: width 0.1s linear;
}

/* Prev / next */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  max-width: var(--measure);
  margin: 3rem auto 0;
  padding: 0 1.4rem;
}
.pager a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  background: var(--surface);
  color: var(--ink);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.pager a:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--shadow); }
.pager .label { display: block; font-size: 0.8rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 0.3rem; }
.pager .t { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; line-height: 1.3; }
.pager .next { text-align: right; }
.pager .spacer { border: none; background: none; box-shadow: none; }
@media (max-width: 640px) { .pager { grid-template-columns: 1fr; } .pager .next { text-align: left; } }

/* ---------- Support ---------- */
.support-block {
  max-width: 46rem;
  margin: 4rem auto 0;
  padding: 2.6rem 2.2rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.support-block::before {
  content: "";
  position: absolute; top: 0; left: 20%; right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.support-block .icon { width: 34px; height: 34px; color: var(--gold); margin-bottom: 0.7rem; }
.support-block h3 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; margin: 0 0 0.7rem; }
.support-block p { color: var(--ink-soft); margin: 0 auto 1.4rem; max-width: 34rem; font-size: 1.06rem; }
.support-block .note { font-size: 0.92rem; color: var(--ink-faint); font-style: italic; margin-top: 1rem; margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 5.5rem;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 3.4rem 0 2.4rem;
  font-size: 1rem;
  color: var(--ink-soft);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.4rem;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 600;
  margin: 0 0 0.8rem; color: var(--ink);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--gold-deep); }
.footer-verse { font-style: italic; color: var(--ink-faint); max-width: 30rem; }
.footer-bottom {
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem;
  font-size: 0.92rem;
  color: var(--ink-faint);
}

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-slow { transition-duration: 1.4s; }
.d1 { transition-delay: 0.12s; } .d2 { transition-delay: 0.24s; } .d3 { transition-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-glow, .particles span { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- Quote strip ---------- */
.quote-strip {
  text-align: center;
  padding: 4.6rem 1.4rem;
  position: relative;
}
.quote-strip blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.45;
  max-width: 44rem;
  margin: 0 auto 1rem;
  color: var(--ink);
}
.quote-strip cite { color: var(--gold-deep); font-style: normal; letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.88rem; }

/* About page prose */
.prose { max-width: var(--measure); margin: 0 auto; padding: 0 1.4rem; }
.prose h2 { font-family: var(--font-display); font-size: 1.85rem; font-weight: 600; margin: 2.6rem 0 1rem; }
.prose p { margin: 0 0 1.3rem; }
