/* ============ Daily Drive — Blog Styles ============ */
:root {
  --bg: #fdf9f3;
  --surface: #ffffff;
  --text: #2b2440;
  --muted: #6f6a80;
  --primary: #7c3aed;
  --primary-soft: #ede9fe;
  --accent: #f97316;
  --accent-soft: #ffedd5;
  --teal: #0d9488;
  --teal-soft: #ccfbf1;
  --pink: #db2777;
  --pink-soft: #fce7f3;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(43, 36, 64, 0.10);
  --shadow-sm: 0 4px 14px rgba(43, 36, 64, 0.08);
  --header-bg: rgba(253, 249, 243, 0.85);
  --border-soft: rgba(43, 36, 64, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-highlight: rgba(255, 255, 255, 0.9);
  --liquid-pill: linear-gradient(120deg, rgba(124, 58, 237, 0.14), rgba(219, 39, 119, 0.14), rgba(249, 115, 22, 0.14));
}

/* ---------- Dark mode ---------- */
[data-theme="dark"] {
  --bg: #17142a;
  --surface: #221e3d;
  --text: #f0edfa;
  --muted: #a49fc0;
  --primary: #a78bfa;
  --primary-soft: #2e2755;
  --accent: #fb923c;
  --accent-soft: #3a2a1c;
  --teal: #2dd4bf;
  --teal-soft: #143733;
  --pink: #f472b6;
  --pink-soft: #3d1e30;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(23, 20, 42, 0.85);
  --border-soft: rgba(240, 237, 250, 0.10);
}
[data-theme="dark"] {
  --glass-bg: rgba(34, 30, 61, 0.55);
  --glass-border: rgba(240, 237, 250, 0.12);
  --glass-highlight: rgba(240, 237, 250, 0.16);
  --liquid-pill: linear-gradient(120deg, rgba(167, 139, 250, 0.22), rgba(244, 114, 182, 0.20), rgba(251, 146, 60, 0.18));
}
[data-theme="dark"] .blob { opacity: 0.18; }
[data-theme="dark"] .hero-portrait { border-color: var(--surface); }
[data-theme="dark"] .newsletter button { background: #17142a; }

body { transition: background 0.3s, color 0.3s; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 96px; }

body {
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

img { max-width: 100%; height: auto; display: block; }

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

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

/* ---------- Header: liquid glass ---------- */
.site-header {
  position: sticky;
  top: 14px;
  z-index: 50;
  background: transparent;
  border-bottom: none;
  padding: 0;
  pointer-events: none; /* only the pill itself catches clicks */
}

.nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px 8px 20px;
  border-radius: 999px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 8px 32px rgba(43, 36, 64, 0.14),
    inset 0 1px 0 var(--glass-highlight);
  transition: box-shadow .3s, background .3s;
}
.nav:hover { box-shadow: 0 12px 40px rgba(43, 36, 64, 0.2), inset 0 1px 0 var(--glass-highlight); }

/* the liquid indicator blob that flows under links */
.nav-links {
  position: relative;
}
.liquid-blob {
  position: absolute;
  top: 4px;
  height: calc(100% - 8px);
  border-radius: 999px;
  background: var(--liquid-pill);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  opacity: 0;
  z-index: 0;
  transition:
    left .45s cubic-bezier(0.68, -0.35, 0.27, 1.35),
    width .45s cubic-bezier(0.68, -0.35, 0.27, 1.35),
    opacity .25s;
  pointer-events: none;
}
.nav-links.blob-on .liquid-blob { opacity: 1; }
.nav-links li.liquid-blob { position: absolute; z-index: 0; padding: 0; }

.logo {
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo:hover { text-decoration: none; }

.logo-mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  transition: transform .3s;
}
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }

.logo-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: conic-gradient(from 40deg, #f97316, #db2777, #7c3aed, #0d9488, #f97316);
  display: inline-block;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  align-items: center;
}

.nav-links li { position: relative; z-index: 1; }

.nav-links a {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 9px 15px;
  border-radius: 999px;
  display: inline-block;
  transition: color .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); text-decoration: none; }
.nav-links a.active { font-weight: 800; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -1px;
}

.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--pink), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  margin-top: 18px;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34rem;
}

.hero-actions { margin-top: 28px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.98rem;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--pink));
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border-soft);
}

.hero-art {
  display: block;
  aspect-ratio: 1;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
  transition: transform .2s;
}
a.hero-art:hover { transform: rotate(0deg) scale(1.02); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }

/* Decorative blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  z-index: -1;
}
.blob-1 { width: 340px; height: 340px; background: #fbbf24; top: -100px; left: -120px; }
.blob-2 { width: 300px; height: 300px; background: #a78bfa; bottom: -80px; right: -60px; }

/* ---------- Section headings ---------- */
.section { padding: 48px 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.section-head .see-all { font-weight: 700; font-size: 0.95rem; }

/* ---------- Post grid ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 26px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }

.card-img { aspect-ratio: 16/10; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-img img { transform: scale(1.05); }

.card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  width: fit-content;
}
.tag-life    { background: var(--accent-soft); color: var(--accent); }
.tag-travel  { background: var(--teal-soft);   color: var(--teal); }
.tag-musings { background: var(--primary-soft); color: var(--primary); }
.tag-food    { background: var(--pink-soft);   color: var(--pink); }
.tag-growth  { background: var(--teal-soft);   color: var(--teal); }
.tag-detox   { background: var(--pink-soft);   color: var(--pink); }
.tag-mindset { background: var(--primary-soft); color: var(--primary); }

.card h3 { font-size: 1.22rem; font-weight: 800; line-height: 1.35; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--primary); text-decoration: none; }

.card p.excerpt { color: var(--muted); font-size: 0.95rem; flex: 1; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.card-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }

/* ---------- Newsletter ---------- */
.newsletter {
  background: linear-gradient(120deg, var(--primary), var(--pink), var(--accent));
  border-radius: 26px;
  padding: 48px 40px;
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}
.newsletter h2 { font-size: 1.8rem; font-weight: 900; letter-spacing: -0.5px; }
.newsletter p { margin-top: 8px; opacity: 0.92; }

.newsletter form {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.newsletter input {
  padding: 13px 20px;
  border-radius: 999px;
  border: none;
  outline: none;
  font-size: 1rem;
  width: min(320px, 100%);
  font-family: inherit;
}
.newsletter button {
  padding: 13px 28px;
  border-radius: 999px;
  border: none;
  background: var(--text);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform .15s;
}
.newsletter button:hover { transform: translateY(-2px); }
.newsletter .form-note { margin-top: 14px; font-weight: 700; min-height: 1.4em; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 56px;
  padding: 36px 0;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- Article page ---------- */
.article-hero {
  padding: 56px 0 32px;
  text-align: center;
}
.article-hero .tag { margin: 0 auto 16px; }
.article-hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.2;
  max-width: 48rem;
  margin: 0 auto;
}
.article-hero .card-meta { justify-content: center; margin-top: 16px; }

.article-cover {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 24px auto 8px;
  max-width: 860px;
}

.article-body {
  max-width: 700px;
  margin: 40px auto 0;
  font-size: 1.08rem;
}
.article-body p { margin-bottom: 1.3em; }
.article-body h2 {
  font-size: 1.5rem;
  font-weight: 900;
  margin: 1.6em 0 0.6em;
  letter-spacing: -0.4px;
}
.article-body blockquote {
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  padding: 18px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--text);
}
.article-body ul { margin: 0 0 1.3em 1.4em; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  margin-top: 40px;
}

/* ---------- About page ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 48px;
  align-items: start;
  padding-top: 40px;
}
.about-photo {
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
  border: 6px solid #fff;
}
[data-theme="dark"] .about-photo { border-color: var(--surface); }
.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 15%;
}
.about-text h1 { font-size: 2.3rem; font-weight: 900; letter-spacing: -0.8px; margin-bottom: 16px; }
.about-text p { color: var(--muted); margin-bottom: 1.1em; font-size: 1.05rem; }
.fun-facts { margin-top: 24px; display: grid; gap: 12px; }
.fact {
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  display: flex;
  gap: 12px;
  align-items: center;
}
.fact span.emoji { font-size: 1.3rem; }

/* ---------- Personal site: hero portrait ---------- */
.hero-portrait {
  width: min(340px, 100%);
  aspect-ratio: 1;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
  border: 6px solid #fff;
  margin-left: auto;
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }

.hello-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 2px solid var(--border-soft);
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

/* Social links */
.social-row { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--border-soft);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text);
  transition: transform .15s, border-color .15s;
}
.social-pill:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--primary); color: var(--primary); }

/* ---------- What I do cards ---------- */
.do-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}
.do-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  border-top: 5px solid transparent;
}
.do-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.do-card:nth-child(1) { border-top-color: var(--accent); }
.do-card:nth-child(2) { border-top-color: var(--teal); }
.do-card:nth-child(3) { border-top-color: var(--pink); }
.do-card:nth-child(4) { border-top-color: var(--primary); }
.do-card .emoji { font-size: 2rem; display: block; margin-bottom: 12px; }
.do-card h3 { font-size: 1.15rem; font-weight: 900; margin-bottom: 6px; }
.do-card p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Support strip (homepage call-out) ---------- */
.support-strip {
  background: var(--surface);
  border-radius: 26px;
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  border: 2px dashed rgba(249, 115, 22, 0.45);
}
.support-strip h2 { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.4px; }
.support-strip p { color: var(--muted); margin-top: 6px; max-width: 34rem; }

.btn-coffee {
  background: linear-gradient(90deg, #f59e0b, var(--accent));
  color: #fff;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.35);
  white-space: nowrap;
}

/* ---------- Support page ---------- */
.support-hero {
  text-align: center;
  padding: 56px 0 24px;
  position: relative;
}
.support-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -1px;
}
.support-hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--pink), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.support-hero p.lead {
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 38rem;
}
.support-art {
  width: min(300px, 70%);
  margin: 32px auto 0;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}
.tier {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform .2s, box-shadow .2s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tier:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.tier.featured { border: 3px solid var(--accent); }
.tier .ribbon {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 16px;
  border-radius: 999px;
  white-space: nowrap;
}
.tier .emoji { font-size: 2.4rem; }
.tier h3 { font-size: 1.2rem; font-weight: 900; }
.tier .price { font-size: 2rem; font-weight: 900; color: var(--accent); }
.tier p { color: var(--muted); font-size: 0.93rem; flex: 1; }
.tier .btn { margin-top: 8px; }

.support-note {
  text-align: center;
  color: var(--muted);
  max-width: 34rem;
  margin: 36px auto 0;
  font-size: 0.98rem;
}

/* Thanks wall */
.thanks-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 720px;
  margin: 0 auto;
}
.thanks-chip {
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  color: var(--muted);
}
.thanks-chip b { color: var(--text); }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, background .15s, border-color .15s;
  line-height: 1;
}
.theme-toggle:hover {
  transform: rotate(15deg);
  background: var(--liquid-pill);
  border-color: var(--glass-border);
}

/* ---------- Reading progress bar ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--pink), var(--primary));
  z-index: 100;
  transition: width .1s linear;
}

/* ---------- Search + filter toolbar ---------- */
.toolbar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 28px;
}
.search-box {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--border-soft);
  border-radius: 999px;
  padding: 10px 20px;
  box-shadow: var(--shadow-sm);
}
.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  width: 100%;
}
.search-box input::placeholder { color: var(--muted); }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-tab {
  border: 2px solid var(--border-soft);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}
.filter-tab:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.filter-tab.active {
  background: linear-gradient(90deg, var(--primary), var(--pink));
  color: #fff;
  border-color: transparent;
}
.no-results {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  padding: 40px 0;
  display: none;
}

/* ---------- Related posts + share ---------- */
.post-footer-extras { max-width: 700px; margin: 40px auto 0; }
.share-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.share-row .label { font-weight: 800; color: var(--muted); margin-right: 4px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--border-soft);
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: transform .15s, border-color .15s;
}
.share-btn:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--primary); color: var(--primary); }

.related h2 { font-size: 1.4rem; font-weight: 900; margin-bottom: 18px; letter-spacing: -0.4px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.related-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  display: block;
}
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none; }
.related-card .tag { margin-bottom: 10px; }
.related-card h3 { font-size: 1.02rem; font-weight: 800; color: var(--text); line-height: 1.4; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .25s, transform .25s;
  z-index: 90;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); }

/* ---------- "Now" section ---------- */
.now-card {
  background: var(--surface);
  border-radius: 26px;
  padding: 32px 36px;
  box-shadow: var(--shadow-sm);
  border-left: 6px solid var(--teal);
}
.now-card h2 { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.4px; }
.now-card .updated { color: var(--muted); font-size: 0.85rem; font-weight: 700; margin-top: 2px; }
.now-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.now-item { display: flex; gap: 12px; align-items: flex-start; }
.now-item .emoji { font-size: 1.5rem; }
.now-item b { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.now-item span.what { font-weight: 700; }

/* ---------- Gallery ---------- */
.gallery-grid {
  columns: 3;
  column-gap: 20px;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.gallery-item img { width: 100%; }
.gallery-item .caption {
  padding: 14px 18px 16px;
  background: var(--surface);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--muted);
}
.gallery-item .caption .read-more {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary);
}
.gallery-item:hover .caption .read-more { text-decoration: underline; }
@media (max-width: 820px) { .gallery-grid { columns: 2; } }
@media (max-width: 540px) { .gallery-grid { columns: 1; } }

/* ---------- 404 ---------- */
.notfound {
  text-align: center;
  padding: 60px 0;
}
.notfound .art {
  width: min(340px, 80%);
  margin: 0 auto 28px;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}
.notfound h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 900; letter-spacing: -1.5px; }
.notfound p { color: var(--muted); font-size: 1.1rem; max-width: 30rem; margin: 12px auto 28px; }

/* ---------- About: stats row ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 28px 0 8px;
}
.stat {
  background: var(--surface);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat .num {
  font-size: 1.7rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--accent), var(--pink), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .label { font-size: 0.82rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------- About: journey timeline ---------- */
.journey { max-width: 720px; margin: 0 auto; }
.journey h2 { font-size: 1.6rem; font-weight: 900; letter-spacing: -0.5px; margin-bottom: 24px; text-align: center; }
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--pink), var(--primary));
}
.timeline-item { position: relative; padding: 0 0 26px 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--primary);
}
.timeline-item .when { font-size: 0.8rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.8px; color: var(--primary); }
.timeline-item h3 { font-size: 1.1rem; font-weight: 800; margin: 2px 0 4px; }
.timeline-item p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Payment methods (Support page) ---------- */
.pay-section { max-width: 900px; margin: 0 auto; }
.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 720px) { .pay-grid { grid-template-columns: 1fr; } }

.khqr-card {
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.khqr-head {
  background: #e21836;
  color: #fff;
  font-weight: 900;
  letter-spacing: 1px;
  text-align: center;
  padding: 12px;
  font-size: 1.05rem;
}
.khqr-body { padding: 26px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.khqr-body img {
  width: min(230px, 80%);
  border-radius: 12px;
  border: 2px solid var(--border-soft);
  background: #fff;
  padding: 8px;
}
.khqr-name { font-weight: 900; font-size: 1.05rem; }
.khqr-note { color: var(--muted); font-size: 0.88rem; }
.khqr-accounts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 280px;
}
.acct-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 2px solid var(--border-soft);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.acct-copy:hover { border-color: var(--primary); transform: translateY(-1px); }
.acct-copy .copy-ic { opacity: 0.6; }

.khqr-banks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.khqr-bank {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

.pay-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
}
.pay-link {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  font-weight: 800;
  color: var(--text);
  transition: transform .15s, box-shadow .15s, color .15s;
  border: 2px solid transparent;
}
.pay-link:hover { text-decoration: none; transform: translateX(5px); box-shadow: var(--shadow); color: var(--primary); border-color: var(--primary); }
.pay-link .emoji { font-size: 1.6rem; }
.pay-link small { display: block; color: var(--muted); font-weight: 700; font-size: 0.82rem; }

/* Custom amount tier */
.custom-amount {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
}
.custom-amount input {
  width: 90px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid var(--border-soft);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  outline: none;
}
.custom-amount input:focus { border-color: var(--accent); }
.custom-amount .currency { font-weight: 900; font-size: 1.2rem; color: var(--accent); }

/* ---------- Payment fallback dialog ---------- */
.pay-fallback-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 40, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  padding: 20px;
}
.pay-fallback-overlay.open { opacity: 1; pointer-events: auto; }
.pay-fallback-box {
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
  max-width: 440px;
  width: 100%;
  padding: 30px 28px;
  text-align: center;
}
.pay-fallback-box h3 { font-size: 1.3rem; font-weight: 900; margin-bottom: 10px; }
.pay-fallback-box p { color: var(--muted); font-size: 0.95rem; margin-bottom: 16px; }
.pay-url {
  background: var(--bg);
  border: 2px dashed var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 0.9rem;
  word-break: break-all;
  margin-bottom: 18px;
  user-select: all;
}
.pay-fallback-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pay-fallback-actions .btn { border: none; cursor: pointer; font-family: inherit; }
.pay-fallback-actions .btn-ghost { border: 2px solid var(--border-soft); }

/* ---------- Clickable extras ---------- */
button.tag { border: none; cursor: pointer; font-family: inherit; }
button.tag:hover { transform: translateY(-1px); filter: brightness(0.95); }

a.hello-badge:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.hello-badge { transition: transform .15s, border-color .15s, color .15s; }

a.hero-portrait { display: block; transition: transform .2s; }
a.hero-portrait:hover { transform: rotate(0deg) scale(1.02); }

a.do-card { display: block; color: inherit; }
a.do-card:hover { text-decoration: none; }

a.fact { transition: transform .15s, box-shadow .15s; color: inherit; }
a.fact:hover { text-decoration: none; transform: translateX(4px); box-shadow: var(--shadow); color: var(--primary); }

a.thanks-chip:hover { text-decoration: none; transform: translateY(-2px); color: var(--primary); box-shadow: var(--shadow); }
.thanks-chip { transition: transform .15s, box-shadow .15s; }

a.tag:hover { text-decoration: none; filter: brightness(0.93); }

.article-cover img, .about-photo img { cursor: zoom-in; }

/* ---------- Lightbox ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 40, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  cursor: zoom-out;
  padding: 24px;
}
.lightbox-overlay.open { opacity: 1; pointer-events: auto; }
.lightbox-overlay img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.96);
  transition: transform .25s;
}
.lightbox-overlay.open img { transform: scale(1); }

/* story panel variant */
.lightbox-overlay.has-story {
  flex-direction: column;
  gap: 0;
}
.lightbox-overlay.has-story img {
  max-height: 58vh;
  border-radius: 18px 18px 0 0;
}
.lightbox-story {
  display: none;
  background: var(--surface);
  color: var(--text);
  border-radius: 0 0 18px 18px;
  padding: 22px 28px 26px;
  max-width: min(92vw, 680px);
  width: 100%;
  cursor: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-height: 30vh;
  overflow-y: auto;
}
.lightbox-overlay.has-story .lightbox-story { display: block; }
.lightbox-story h3 { font-size: 1.15rem; font-weight: 900; margin-bottom: 6px; letter-spacing: -0.3px; }
.lightbox-story p { color: var(--muted); font-size: 0.95rem; line-height: 1.7; margin: 0; }
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }

/* ---------- Language switcher ---------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--liquid-pill);
  font-weight: 900;
  font-size: 0.82rem;
  transition: transform .15s, box-shadow .15s;
}
.nav-links a.lang-switch { color: var(--muted); padding: 8px 15px; }
.nav-links a.lang-switch:hover { color: var(--primary); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ---------- Khmer typography ---------- */
html[lang="km"] body {
  font-family: "Hanuman", "Khmer OS", "Khmer OS Siemreap", "Nunito", serif;
  line-height: 2;
}
html[lang="km"] h1, html[lang="km"] h2, html[lang="km"] h3 {
  letter-spacing: 0;
  line-height: 1.6;
}
html[lang="km"] .article-body { font-size: 1.12rem; }
html[lang="km"] .hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
html[lang="km"] .tag { letter-spacing: 0; text-transform: none; }

/* ---------- Scroll animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Featured post ---------- */
.featured-post {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--surface);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
  border: 3px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)), linear-gradient(90deg, var(--accent), var(--pink), var(--primary));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
.featured-post .fp-img { min-height: 280px; overflow: hidden; }
.featured-post .fp-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.featured-post:hover .fp-img img { transform: scale(1.04); }
.featured-post .fp-body { padding: 34px 38px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 5px 14px;
  border-radius: 999px;
}
.featured-post h3 { font-size: 1.6rem; font-weight: 900; line-height: 1.3; letter-spacing: -0.5px; }
.featured-post h3 a { color: var(--text); }
.featured-post h3 a:hover { color: var(--primary); text-decoration: none; }
.featured-post p { color: var(--muted); }
@media (max-width: 820px) { .featured-post { grid-template-columns: 1fr; } }

/* ---------- Surprise me ---------- */
.btn-surprise {
  background: var(--surface);
  border: 2px dashed var(--primary);
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.98rem;
}
.btn-surprise:hover { background: var(--primary-soft); }

/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}
.contact-form {
  background: var(--surface);
  border-radius: 22px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 16px;
}
.contact-form label { font-weight: 800; font-size: 0.9rem; }
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid var(--border-soft);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--primary); }
.contact-form textarea { min-height: 140px; resize: vertical; }
.contact-ways { display: grid; gap: 14px; }
.contact-way {
  background: var(--surface);
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 14px;
  align-items: center;
  font-weight: 700;
  color: var(--text);
  transition: transform .15s, box-shadow .15s;
}
a.contact-way:hover { text-decoration: none; transform: translateX(4px); box-shadow: var(--shadow); color: var(--primary); }
.contact-way .emoji { font-size: 1.5rem; }
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Archive page ---------- */
.archive-list { max-width: 720px; margin: 0 auto; }
.archive-month {
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin: 32px 0 12px;
}
.archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border-radius: 14px;
  padding: 16px 22px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
  color: var(--text);
  font-weight: 700;
}
a.archive-item:hover { text-decoration: none; transform: translateX(5px); box-shadow: var(--shadow); color: var(--primary); }
.archive-item .date { color: var(--muted); font-size: 0.85rem; font-weight: 700; white-space: nowrap; }

/* ---------- Skip link & focus (accessibility) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 0 0 12px 0;
  font-weight: 800;
  z-index: 500;
}
.skip-link:focus { left: 0; text-decoration: none; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Mobile navigation ---------- */
.nav-toggle { display: none !important; }

@media (max-width: 860px) {
  .site-header { top: 10px; }
  .nav {
    flex-wrap: wrap;
    border-radius: 26px;
    padding: 8px 12px;
    gap: 4px;
    justify-content: center;
  }
  .logo { font-size: 1.15rem; }
  .logo-mark { width: 40px; height: 40px; }
  .nav-links {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    padding: 2px;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links li { flex-shrink: 0; }
  .nav-links a { padding: 8px 12px; font-size: 0.9rem; white-space: nowrap; }
  .nav-links a.lang-switch { padding: 7px 12px; }
  .theme-toggle { width: 36px; height: 36px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { max-width: 420px; }
  .hero-portrait { margin-left: 0; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 360px; }
  .support-strip { padding: 30px 26px; }
}

@media (max-width: 560px) {
  .nav-links { gap: 16px; }
  .newsletter { padding: 36px 22px; }
}

/* ---------- Weekly heroes (top donator / top reader) ---------- */
.heroes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) { .heroes-grid { grid-template-columns: 1fr; } }

.hero-card {
  position: relative;
  background: var(--surface);
  border-radius: 24px;
  padding: 30px 28px 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 20px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.hero-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.hero-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
}
.hero-card.donator::before { background: linear-gradient(90deg, #f59e0b, var(--accent), var(--pink)); }
.hero-card.reader::before  { background: linear-gradient(90deg, var(--teal), var(--primary)); }

.hero-avatar {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  font-weight: 900;
  color: #fff;
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--surface);
}
.hero-card.donator .hero-avatar { background: linear-gradient(135deg, #f59e0b, var(--pink)); }
.hero-card.reader .hero-avatar  { background: linear-gradient(135deg, var(--teal), var(--primary)); }
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.hero-info { min-width: 0; }
.hero-label {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-name { font-size: 1.3rem; font-weight: 900; letter-spacing: -0.3px; margin: 2px 0; }
.hero-stat { color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.hero-badge {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 1.6rem;
  transform: rotate(12deg);
}
.heroes-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  margin-top: 16px;
}

/* ---------- History section (Khmer homepage) ---------- */
.history-card {
  background: var(--surface);
  border-radius: 26px;
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
  border-left: 6px solid var(--accent);
}
.history-card h2 { font-size: 1.6rem; font-weight: 900; letter-spacing: -0.4px; margin-bottom: 18px; }
.history-card p { color: var(--muted); margin-bottom: 1.1em; line-height: 2; }
.history-card h3 {
  font-size: 1.25rem; font-weight: 900; margin: 1.6em 0 0.6em;
  color: var(--text);
}
.history-card h4 { font-size: 1.08rem; font-weight: 800; margin: 1.3em 0 0.5em; color: var(--text); }
.history-card ul { margin: 0 0 1.2em 1.4em; color: var(--muted); line-height: 2; }
.history-card ul li { margin-bottom: 0.6em; }
.history-card details { margin-top: 8px; }
.history-card details summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--pink));
  color: #fff;
  font-weight: 800;
  transition: transform .15s, box-shadow .15s;
}
.history-card details summary::-webkit-details-marker { display: none; }
.history-card details summary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.history-card details[open] summary { display: none; }
.history-card .tobe {
  text-align: center;
  font-weight: 800;
  color: var(--primary);
  margin-top: 18px;
}
@media (max-width: 560px) { .history-card { padding: 28px 22px; } }

/* ---------- Reading images ---------- */
.reading-fig { margin: 1.6em 0; }
.reading-fig img {
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
}
.reading-fig figcaption {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 10px;
}

/* ---------- Nice text selection ---------- */
::selection { background: rgba(124, 58, 237, 0.25); }

/* ---------- Print styles ---------- */
@media print {
  .site-header, .site-footer, .back-to-top, .progress-bar, .share-row,
  .related, .newsletter, .support-strip, .post-footer-extras, .theme-toggle,
  .liquid-blob, .blob { display: none !important; }
  body { background: #fff; color: #000; }
  .article-body { max-width: 100%; font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
}

/* ---------- Prev / Next post navigation ---------- */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 34px; }
.post-nav a {
  background: var(--surface); border-radius: 16px; padding: 18px 20px;
  box-shadow: var(--shadow-sm); color: var(--text); transition: transform .15s, box-shadow .15s;
}
.post-nav a:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); }
.post-nav .dir { font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.8px; color: var(--primary); }
.post-nav .ttl { font-weight: 800; font-size: 0.98rem; margin-top: 3px; line-height: 1.4; }
.post-nav a.next { text-align: right; }
.post-nav a.empty { visibility: hidden; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } .post-nav a.next { text-align: left; } }

/* ---------- Accent color presets (Settings) ---------- */
[data-accent="ocean"] {
  --primary: #0284c7; --primary-soft: #e0f2fe;
  --accent: #0d9488;  --accent-soft: #ccfbf1;
  --pink: #6366f1;    --pink-soft: #e0e7ff;
  --teal: #0891b2;    --teal-soft: #cffafe;
}
[data-theme="dark"][data-accent="ocean"] {
  --primary: #38bdf8; --primary-soft: #16324a;
  --accent: #2dd4bf;  --accent-soft: #143733;
  --pink: #818cf8;    --pink-soft: #272a55;
  --teal: #22d3ee;    --teal-soft: #164e63;
}
[data-accent="forest"] {
  --primary: #16a34a; --primary-soft: #dcfce7;
  --accent: #ca8a04;  --accent-soft: #fef9c3;
  --pink: #059669;    --pink-soft: #d1fae5;
  --teal: #65a30d;    --teal-soft: #ecfccb;
}
[data-theme="dark"][data-accent="forest"] {
  --primary: #4ade80; --primary-soft: #14532d;
  --accent: #facc15;  --accent-soft: #423606;
  --pink: #34d399;    --pink-soft: #064e3b;
  --teal: #a3e635;    --teal-soft: #365314;
}
[data-accent="berry"] {
  --primary: #be185d; --primary-soft: #fce7f3;
  --accent: #e11d48;  --accent-soft: #ffe4e6;
  --pink: #a21caf;    --pink-soft: #fae8ff;
  --teal: #db2777;    --teal-soft: #fce7f3;
}
[data-theme="dark"][data-accent="berry"] {
  --primary: #f472b6; --primary-soft: #4a1533;
  --accent: #fb7185;  --accent-soft: #4c1d24;
  --pink: #e879f9;    --pink-soft: #46164d;
  --teal: #f472b6;    --teal-soft: #4a1533;
}
[data-accent="midnight"] {
  --primary: #4f46e5; --primary-soft: #e0e7ff;
  --accent: #7c3aed;  --accent-soft: #ede9fe;
  --pink: #2563eb;    --pink-soft: #dbeafe;
  --teal: #6d28d9;    --teal-soft: #ede9fe;
}
[data-theme="dark"][data-accent="midnight"] {
  --primary: #818cf8; --primary-soft: #272a55;
  --accent: #a78bfa;  --accent-soft: #2e2755;
  --pink: #60a5fa;    --pink-soft: #1e3a5f;
  --teal: #8b5cf6;    --teal-soft: #2e2755;
}

/* ---------- Text size (Settings) ---------- */
html[data-fontscale="small"] { font-size: 87.5%; }
html[data-fontscale="large"] { font-size: 112.5%; }

/* ---------- Reduce motion (Settings) ---------- */
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after {
  transition: none !important;
  animation: none !important;
  scroll-behavior: auto !important;
}
html[data-motion="off"] .reveal { opacity: 1; transform: none; }

/* ---------- Settings panel ---------- */
.settings-toggle {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .3s, background .15s, border-color .15s;
  line-height: 1;
}
.settings-toggle:hover {
  transform: rotate(45deg);
  background: var(--liquid-pill);
  border-color: var(--glass-border);
}

.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 40, 0.5);
  backdrop-filter: blur(4px);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.settings-overlay.open { opacity: 1; pointer-events: auto; }

.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 92vw);
  background: var(--bg);
  z-index: 260;
  box-shadow: -12px 0 40px rgba(0,0,0,0.25);
  transform: translateX(105%);
  transition: transform .35s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  padding: 26px 24px 40px;
}
.settings-panel.open { transform: translateX(0); }
.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.settings-head h2 { font-size: 1.3rem; font-weight: 900; letter-spacing: -0.3px; }
.settings-close {
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--border-soft); background: var(--surface);
  font-size: 1rem; cursor: pointer; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.settings-close:hover { border-color: var(--primary); transform: rotate(90deg); }

.settings-group { margin-bottom: 26px; }
.settings-group > .sg-label {
  font-size: 0.78rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--muted); margin-bottom: 10px;
}
.sg-options { display: flex; gap: 8px; flex-wrap: wrap; }
.sg-btn {
  padding: 9px 16px; border-radius: 999px;
  border: 2px solid var(--border-soft); background: var(--surface);
  font-family: inherit; font-weight: 800; font-size: 0.88rem;
  color: var(--muted); cursor: pointer; transition: all .15s;
}
.sg-btn:hover { border-color: var(--primary); color: var(--primary); }
.sg-btn.active {
  background: linear-gradient(90deg, var(--primary), var(--pink));
  color: #fff; border-color: transparent;
}

.swatch-row { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--surface); cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
  position: relative;
}
.swatch:hover { transform: scale(1.12); }
.swatch.active { box-shadow: 0 0 0 3px var(--primary), var(--shadow-sm); }
.swatch.active::after {
  content: "✓"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 1.1rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.sw-sunrise  { background: linear-gradient(135deg, #f97316, #db2777, #7c3aed); }
.sw-ocean    { background: linear-gradient(135deg, #0d9488, #0284c7, #6366f1); }
.sw-forest   { background: linear-gradient(135deg, #ca8a04, #16a34a, #059669); }
.sw-berry    { background: linear-gradient(135deg, #e11d48, #be185d, #a21caf); }
.sw-midnight { background: linear-gradient(135deg, #7c3aed, #4f46e5, #2563eb); }

.settings-reset {
  width: 100%; padding: 12px; border-radius: 12px;
  border: 2px solid var(--border-soft); background: transparent;
  font-family: inherit; font-weight: 800; font-size: 0.9rem;
  color: var(--muted); cursor: pointer; transition: all .15s;
}
.settings-reset:hover { border-color: #dc2626; color: #dc2626; }
.settings-note { margin-top: 14px; font-size: 0.8rem; color: var(--muted); font-weight: 600; text-align: center; }

/* ---------- Comments ---------- */
.comments-section { max-width: 700px; margin: 44px auto 0; }
