/* =========================================================
   LuNay — chapter page
   Soft paper palette in light mode, dusk palette in dark mode.
   ========================================================= */

:root {
  --reading-size: 19px;
  --gutter: clamp(16px, 4vw, 28px);

  /* Latin fonts first (for "LuNay", numbers, URLs); Burmese glyphs fall through to the Myanmar fonts */
  --font-display: "Cormorant Garamond", "Noto Serif Myanmar", "Myanmar Text", Georgia, serif;
  --font-body: "Lora", "Noto Serif Myanmar", "Myanmar Text", Georgia, serif;
  --font-ui: "DM Sans", "Noto Sans Myanmar", "Myanmar Text", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Light — warm paper, blush, lavender, sage */
  --bg: #f8f3ed;
  --bg-elev: #fffcf8;
  --surface: #f1e9e3;
  --text: #3a3442;
  --text-soft: #5b5464;
  --muted: #857d8e;
  --border: #e8ded6;

  --rose: #a35f72;
  --rose-soft: #f3e0e3;
  --lavender: #7166a8;
  --lavender-soft: #e9e5f5;
  --sage: #5f7d5b;
  --sage-soft: #e1eadc;
  --peach-soft: #f8e5d8;

  --selection: #efd2da;
  --shadow: 0 1px 2px rgba(90, 60, 75, .05), 0 12px 32px -16px rgba(90, 60, 75, .22);

  /* Cover illustration */
  --sky-top: #e6e0f3;
  --sky-mid: #f3e1e6;
  --sky-bottom: #fbece2;
  --moon: #fffaf3;
  --cloud: #ffffff;
  --cloud-opacity: .75;
  --hill-far: #ddd2e8;
  --hill-near: #cbbfdc;
  --roof: #a99bbd;
  --rain: #9488bd;
  --window: #f7d2a6;

  --thumb: #fffcf8;

  /* Home window illustration */
  --frame: #fffaf4;
  --sill: #ece1d8;
  --candle: #f1d9be;
  --flame: #f2a85f;
  --book-a: #dba7b3;
  --book-b: #b6acd9;
  --book-c: #a9c1a4;
  --inkpot: #5a5270;
  --quill: #ffffff;
  --star-opacity: .5;
  --glass-opacity: .14;

  color-scheme: light;
}

[data-theme="dark"] {
  /* Dark — dusk plum, moonlight, muted petals */
  --bg: #1b1922;
  --bg-elev: #23202b;
  --surface: #2a2633;
  --text: #ece6ef;
  --text-soft: #cbc3d2;
  --muted: #9b93a6;
  --border: #37313f;

  --rose: #e8adbb;
  --rose-soft: #3a2a33;
  --lavender: #bfb4ea;
  --lavender-soft: #2e2940;
  --sage: #aac6a5;
  --sage-soft: #26302a;
  --peach-soft: #3a2d2a;

  --selection: #4c3545;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 36px -16px rgba(0, 0, 0, .7);

  --sky-top: #1f1c30;
  --sky-mid: #2a2540;
  --sky-bottom: #3a2e48;
  --moon: #f5ead0;
  --cloud: #3d3655;
  --cloud-opacity: .85;
  --hill-far: #2c2741;
  --hill-near: #231f35;
  --roof: #16131d;
  --rain: #7d72a8;
  --window: #f3c98b;

  --thumb: #3f3953;

  --frame: #3a3448;
  --sill: #322c3c;
  --candle: #e7d9c3;
  --flame: #f6b867;
  --book-a: #94606f;
  --book-b: #685e92;
  --book-c: #607b5c;
  --inkpot: #0f0d15;
  --quill: #ddd4ea;
  --star-opacity: .9;
  --glass-opacity: .04;

  color-scheme: dark;
}

[data-theme="paper"] {
  /* Paper — warm sepia page and brown ink, made for long reading */
  --bg: #f4ecd9;
  --bg-elev: #f9f3e5;
  --surface: #ece2cc;
  --text: #42362b;
  --text-soft: #5a4b3d;
  --muted: #7a6754;
  --border: #e2d5bc;

  --rose: #9a5640;
  --rose-soft: #efdcc6;
  --lavender: #7b5d4c;
  --lavender-soft: #ebdfc9;
  --sage: #66703f;
  --sage-soft: #e5e2c6;
  --peach-soft: #f1e1c6;

  --selection: #ead3ae;
  --shadow: 0 1px 2px rgba(90, 65, 35, .06), 0 12px 32px -16px rgba(90, 65, 35, .26);

  --sky-top: #efe3cb;
  --sky-mid: #f2e1cc;
  --sky-bottom: #f5e8d3;
  --moon: #fffaf0;
  --cloud: #fffaf0;
  --cloud-opacity: .7;
  --hill-far: #e3d3b8;
  --hill-near: #d5c3a2;
  --roof: #b8a283;
  --rain: #a99372;
  --window: #f0c48d;

  --thumb: #fffaf0;

  --frame: #fbf5e8;
  --sill: #e6d8bd;
  --candle: #ecd0ab;
  --flame: #e2954d;
  --book-a: #c99079;
  --book-b: #b39b7d;
  --book-c: #a5a87f;
  --inkpot: #4a3b2e;
  --quill: #fffaf0;
  --star-opacity: .4;
  --glass-opacity: .12;

  color-scheme: light;
}

/* A faint paper grain under the Paper theme */
[data-theme="paper"] body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .3 0 0 0 0 .16 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 90px;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }

::selection { background: var(--selection); color: var(--text); }
svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { color: var(--text); }

:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--text); color: var(--bg);
  text-decoration: none; font-weight: 600;
  transform: translateY(-150%);
  transition: transform .2s;
}
.skip-link:focus { transform: none; }

/* Smooth color fade only while the theme is switching */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition:
    background-color .45s ease, color .45s ease, border-color .45s ease,
    fill .45s ease, stroke .45s ease, stop-color .45s ease, box-shadow .45s ease,
    transform .45s cubic-bezier(.65, .05, .25, 1.2), opacity .3s ease !important;
}

.wrap  { width: min(100% - var(--gutter) * 2, 680px); margin-inline: auto; }
.wide  { width: min(100% - var(--gutter) * 2, 1040px); margin-inline: auto; }
.section { margin-top: 96px; }

/* Soft watercolor wash behind the top of the page */
.wash {
  position: absolute; inset: 0 0 auto 0; height: 820px;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(55% 50% at 12% 0%, var(--rose-soft) 0%, transparent 70%),
    radial-gradient(45% 45% at 92% 6%, var(--lavender-soft) 0%, transparent 70%),
    radial-gradient(40% 35% at 55% 34%, var(--peach-soft) 0%, transparent 72%);
  opacity: .9;
}
main, .site-footer { position: relative; z-index: 1; }

/* ---------- Reading progress ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 50; pointer-events: none;
}
.progress__bar {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--lavender));
  transform-origin: 0 50%;
  transform: scaleX(0);
  border-radius: 0 3px 3px 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background-color .3s ease;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--border);
}

.site-header__inner {
  width: min(100% - var(--gutter) * 2, 1040px);
  margin-inline: auto;
  padding: 14px 0;
  display: flex; align-items: center; gap: 20px;
}

.brand {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text);
}
.brand__moon { width: 20px; height: 20px; fill: var(--rose); transform: rotate(-12deg); }
.brand__name {
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: 1.8rem; line-height: 1; letter-spacing: .01em;
}

.site-nav { display: flex; gap: 2px; }
.site-nav a {
  text-decoration: none; font-size: .92rem; font-weight: 500;
  color: var(--text-soft); padding: 7px 13px; border-radius: 999px;
  transition: background-color .2s, color .2s;
}
.site-nav a:hover { background: var(--surface); color: var(--text); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.pill-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 15px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-elev); cursor: pointer;
  font-size: .88rem; font-weight: 500; color: var(--text-soft);
  transition: color .2s, border-color .2s;
}
.pill-btn:hover { color: var(--text); border-color: color-mix(in srgb, var(--lavender) 45%, var(--border)); }
.pill-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }

/* ---------- Theme switch (Light / Paper / Dark) ---------- */
.theme-switch {
  position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center;
  height: 38px; padding: 3px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface);
}
.theme-switch__thumb {
  position: absolute; top: 3px; left: 3px;
  width: 32px; height: 30px; border-radius: 999px;
  background: var(--thumb);
  box-shadow: 0 1px 4px rgba(60, 40, 50, .2);
  transition: transform .35s cubic-bezier(.65, .05, .25, 1.1);
}
[data-theme="paper"] .theme-switch__thumb { transform: translateX(32px); }
[data-theme="dark"] .theme-switch__thumb { transform: translateX(64px); }
.theme-switch button {
  position: relative; z-index: 1;
  width: 32px; height: 30px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); cursor: pointer;
  transition: color .2s;
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-checked="true"] { color: var(--rose); }
.theme-switch svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* Reading-theme swatches next to the text size buttons */
.swatches {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 8px; padding-left: 14px;
  border-left: 1px solid var(--border);
}
.swatch {
  width: 28px; height: 28px; padding: 0;
  border-radius: 50%; border: 1px solid rgba(60, 40, 30, .2);
  cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
.swatch:hover { transform: scale(1.08); }
.swatch--light { background: #fffcf8; }
.swatch--paper { background: #efe1c3; }
.swatch--dark { background: #2a2633; border-color: rgba(255, 255, 255, .14); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--rose); }

/* ---------- Chapter header ---------- */
.chapter-head {
  width: min(100% - var(--gutter) * 2, 780px);
  margin-inline: auto;
  padding: 64px 0 40px;
  text-align: center;
}
.series-tag {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
  font-size: .76rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rose); background: var(--rose-soft);
  padding: 7px 15px; border-radius: 999px;
}
.series-tag__book { opacity: .7; font-weight: 500; }
.series-tag:hover { background: color-mix(in srgb, var(--rose-soft) 70%, var(--rose) 12%); }

.chapter-num {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 1.4rem; color: var(--lavender);
  margin: 30px 0 2px;
}
.chapter-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 1; letter-spacing: -.012em;
  margin: 0;
  text-wrap: balance;
}
.chapter-dek {
  font-family: var(--font-body); font-style: italic;
  font-size: 1.12rem; line-height: 1.6; color: var(--text-soft);
  max-width: 36ch; margin: 20px auto 0;
  text-wrap: balance;
}
.chapter-meta {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 8px 12px; margin-top: 28px;
  font-size: .87rem; color: var(--muted);
}
.dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; }
.author-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text-soft); font-weight: 500; }

.avatar {
  display: grid; place-items: center; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--rose-soft), var(--lavender-soft));
  color: var(--rose);
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  line-height: 1;
}
.avatar--sm { width: 28px; height: 28px; font-size: 1.05rem; }
.avatar--md { width: 40px; height: 40px; font-size: 1.3rem; }
.avatar--lg { width: 78px; height: 78px; }
.avatar--lg svg { width: 34px; height: 34px; fill: var(--rose); transform: rotate(-12deg); }
.avatar--sage  { background: var(--sage-soft); color: var(--sage); }
.avatar--lav   { background: var(--lavender-soft); color: var(--lavender); }
.avatar--peach { background: var(--peach-soft); color: var(--rose); }

/* ---------- Chapter cover image (uploaded per chapter) ---------- */
.cover {
  width: min(100% - var(--gutter) * 2, 900px);
  margin: 0 auto;
  aspect-ratio: 2 / 1;
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Soften uploaded images to sit well in each theme */
[data-theme="dark"] :is(.cover, .story-cover, .feature-card__art) img { filter: brightness(.88) saturate(.92); }
[data-theme="paper"] :is(.cover, .story-cover, .feature-card__art) img { filter: sepia(.12) saturate(.95); }

/* Illustration colors (the home page window drawing) */
.sky-a { stop-color: var(--sky-top); }
.sky-b { stop-color: var(--sky-mid); }
.sky-c { stop-color: var(--sky-bottom); }
.glow-in  { stop-color: var(--moon); stop-opacity: .55; }
.glow-out { stop-color: var(--moon); stop-opacity: 0; }
.lamp-in  { stop-color: var(--window); stop-opacity: .75; }
.lamp-out { stop-color: var(--window); stop-opacity: 0; }
.c-moon { fill: var(--moon); }
.c-cloud { fill: var(--cloud); opacity: var(--cloud-opacity); }
.c-hill-far { fill: var(--hill-far); }
.c-hill-near { fill: var(--hill-near); }
.c-roof { fill: var(--roof); }
.c-window rect { fill: var(--window); }
.c-window .dim { opacity: .45; }
.c-window .bright { filter: drop-shadow(0 0 4px var(--window)); }
.rain-line { stroke: var(--rain); stroke-width: 1.3; stroke-linecap: round; opacity: .6; }

@media (prefers-reduced-motion: no-preference) {
  .rain-sheet { animation: rain 1.5s linear infinite; }
}
@keyframes rain {
  to { transform: translate(-40px, 120px); }
}

/* ---------- Reading tools ---------- */
.reading-tools {
  display: flex; align-items: center; gap: 8px;
  margin-top: 36px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  font-size: .85rem; color: var(--muted);
}
.reading-tools__label { margin-right: 4px; }
.spacer { flex: 1; }

.tool-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-elev);
  cursor: pointer; color: var(--text-soft);
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1;
  transition: border-color .2s, color .2s, opacity .2s;
}
.tool-btn--lg { font-size: 1.25rem; }
.tool-btn sub { font-family: var(--font-ui); font-size: .62em; vertical-align: baseline; margin-left: 1px; }
.tool-btn:hover:not(:disabled) { color: var(--text); border-color: color-mix(in srgb, var(--lavender) 45%, var(--border)); }
.tool-btn:disabled { opacity: .4; cursor: default; }

.like-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 15px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-elev); cursor: pointer;
  color: var(--text-soft); font-size: .88rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color .2s, background-color .2s, border-color .2s;
}
.like-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.like-btn:hover { color: var(--rose); }
.like-btn[aria-pressed="true"] { color: var(--rose); background: var(--rose-soft); border-color: transparent; }
.like-btn[aria-pressed="true"] svg { fill: currentColor; }
.like-btn.pop svg { animation: pop .45s ease; }
@keyframes pop {
  0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); }
}

/* ---------- "Previously" recap ---------- */
.recap {
  margin-top: 22px;
  border-radius: 16px;
  background: var(--surface);
}
.recap summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  cursor: pointer; list-style: none;
  font-size: .88rem; font-weight: 600; color: var(--text-soft);
}
.recap summary::-webkit-details-marker { display: none; }
.recap summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.recap[open] summary svg { transform: rotate(180deg); }
.recap p {
  margin: 0; padding: 0 18px 18px;
  font-family: var(--font-body); font-style: italic;
  color: var(--text-soft); line-height: 1.7;
}

/* ---------- Story text ---------- */
.prose {
  margin-top: 40px;
  font-family: var(--font-body);
  font-size: var(--reading-size);
  line-height: 1.85;
  color: var(--text);
}
.prose p { margin: 0 0 1.3em; }
.prose em { font-style: italic; }

.dropcap::first-letter {
  float: left;
  font-family: var(--font-display); font-weight: 500;
  font-size: 4.6em; line-height: .78;
  margin: .08em .1em 0 0;
  color: var(--rose);
}

.prose .letter {
  position: relative;
  margin: 1.7em 0;
  padding: 1.05em 1.3em 1.05em 1.45em;
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 1.24em; line-height: 1.5;
  color: var(--text-soft);
  background: var(--peach-soft);
  border-radius: 6px 18px 18px 6px;
  border-left: 3px solid var(--rose);
}

.pull-quote, .prose blockquote {
  margin: 2.4em 0;
  padding: 1.3em 0 1.4em;
  border-block: 1px solid var(--border);
  text-align: center;
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 1.65em; line-height: 1.3;
  color: var(--lavender);
  text-wrap: balance;
}
.pull-quote::before, .prose blockquote::before {
  content: "\201C";
  display: block;
  font-size: 2em; line-height: .5; height: .35em;
  color: var(--rose); opacity: .55;
}
.pull-quote p, .prose blockquote p { margin: 0 !important; }

/* Formatting written in the studio */
.prose h3 {
  margin: 2em 0 .7em;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.22em; line-height: 1.6;
}
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.5em; }
.prose li { margin-bottom: .35em; padding-left: .2em; }
.prose li::marker { color: var(--rose); }
.prose .center { text-align: center; }
.prose u { text-decoration-thickness: 1px; text-underline-offset: .4em; }
.prose a {
  color: var(--lavender);
  text-decoration-thickness: 1px; text-underline-offset: .35em;
  text-decoration-color: color-mix(in srgb, var(--lavender) 45%, transparent);
}
.prose a:hover { text-decoration-color: currentColor; }

.scene-break {
  display: flex; justify-content: center; gap: 14px;
  margin: 2.6em 0;
}
.scene-break span { width: 6px; height: 6px; border-radius: 50%; }
.scene-break span:nth-child(1) { background: var(--rose); }
.scene-break span:nth-child(2) { background: var(--lavender); }
.scene-break span:nth-child(3) { background: var(--sage); }

.prose .chapter-end {
  display: flex; align-items: center; gap: 16px;
  margin: 3em 0 0;
  font-family: var(--font-ui); font-size: .74rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
}
.chapter-end::before, .chapter-end::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* ---------- After the chapter ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; padding: 0; list-style: none; }
.tag {
  display: inline-block;
  font-size: .8rem; font-weight: 500; text-decoration: none;
  padding: 5px 13px; border-radius: 999px;
  background: var(--surface); color: var(--text-soft);
  transition: background-color .2s, color .2s;
}
.tag:hover { background: var(--lavender-soft); color: var(--lavender); }

.author-note {
  margin-top: 40px;
  padding: 26px 28px;
  border-radius: 22px;
  background: linear-gradient(140deg, var(--lavender-soft), var(--rose-soft));
}
.author-note__label {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px;
  font-size: .74rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--lavender);
}
.author-note__label svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.author-note p { margin: 0; font-family: var(--font-body); color: var(--text-soft); line-height: 1.75; }
.author-note .sig {
  margin-top: 10px;
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: 1.5rem; color: var(--rose);
}

.chapter-pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 36px;
}
.pager-card {
  display: flex; flex-direction: column;
  padding: 18px 20px;
  border-radius: 18px; border: 1px solid var(--border);
  background: var(--bg-elev);
  text-decoration: none;
  transition: transform .25s ease, border-color .25s, box-shadow .25s;
}
a.pager-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--rose) 35%, var(--border));
  box-shadow: var(--shadow);
}
.pager-card--next { text-align: right; }
.pager-card__dir { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--rose); }
.pager-card__num { margin-top: 8px; font-size: .84rem; color: var(--muted); }
.pager-card__title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 500; line-height: 1.2; color: var(--text); }
.pager-card.is-upcoming { background: transparent; border-style: dashed; }
.pager-card--next:only-child { grid-column: 2; }
.pager-card.is-upcoming .pager-card__dir { color: var(--muted); }
.pager-card.is-upcoming .pager-card__title { color: var(--text-soft); font-style: italic; }

.all-chapters {
  display: block; margin: 18px auto 0;
  padding: 8px 14px; border: 0; background: none; cursor: pointer;
  font-size: .9rem; font-weight: 600; color: var(--lavender);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--lavender) 40%, transparent);
}
.all-chapters:hover { text-decoration-color: currentColor; }

/* ---------- About + newsletter ---------- */
.duo {
  width: min(100% - var(--gutter) * 2, 1040px);
  margin-inline: auto;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px;
}
.card {
  padding: 32px;
  border-radius: 26px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
.eyebrow {
  margin: 0 0 6px;
  font-size: .72rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted);
}
.about-card { display: flex; gap: 22px; align-items: flex-start; }
.about-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: 2.3rem; line-height: 1;
}
.about-card p:not(.eyebrow) { margin: 0; color: var(--text-soft); }
.stats { display: flex; flex-wrap: wrap; gap: 28px; margin: 22px 0 0; }
.stat { display: flex; flex-direction: column-reverse; }
.stat dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.9rem; line-height: 1; color: var(--text); }
.stat dt { margin-top: 4px; font-size: .78rem; color: var(--muted); }

.newsletter {
  background: linear-gradient(150deg, var(--sage-soft), var(--lavender-soft));
  border-color: transparent;
}
.newsletter .eyebrow { color: var(--sage); }
.newsletter h2 {
  margin: 0 0 8px;
  font-family: var(--font-display); font-weight: 500;
  font-size: 2rem; line-height: 1.1;
  text-wrap: balance;
}
.newsletter p:not(.eyebrow):not(.form-note) { margin: 0; color: var(--text-soft); }
.subscribe { display: flex; gap: 8px; margin-top: 22px; }

.subscribe input,
.comment-form input,
.comment-form textarea {
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text);
  font: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.subscribe input, .comment-form input { flex: 1; height: 46px; padding: 0 18px; border-radius: 999px; }
.subscribe input::placeholder,
.comment-form input::placeholder,
.comment-form textarea::placeholder { color: var(--muted); }
.subscribe input:focus,
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--lavender);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lavender) 18%, transparent);
}
.subscribe input.is-invalid { border-color: var(--rose); }

.btn {
  height: 46px; padding: 0 22px;
  border: 0; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background-color .2s, transform .15s;
}
.btn:hover { background: var(--rose); }
.btn:active { transform: scale(.97); }

.form-note { margin: 12px 0 0; min-height: 1.4em; font-size: .88rem; color: var(--sage); font-weight: 500; }
.form-note.is-error { color: var(--rose); }

/* ---------- Section titles ---------- */
.section-title {
  display: flex; align-items: baseline; gap: 12px;
  margin: 0 0 24px;
  font-family: var(--font-display); font-weight: 500;
  font-size: 2.1rem; line-height: 1.1;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- More stories ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 4px;
}
.text-link { font-size: .9rem; font-weight: 600; color: var(--rose); text-decoration: none; white-space: nowrap; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.story-card {
  display: flex; flex-direction: column;
  text-decoration: none;
  border-radius: 24px; border: 1px solid var(--border);
  background: var(--bg-elev);
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease;
}
.story-card:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--rose) 30%, var(--border)); }

.story-cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface);
}
.story-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.story-card__title {
  margin: 8px 0 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.45rem; line-height: 1.15;
  color: var(--text);
}
.story-card__title + p { margin-top: 6px; }
.story-card__body { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 18px 20px 22px; }
.story-card__body p { margin: 8px 0 0; font-size: .95rem; color: var(--text-soft); line-height: 1.6; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: .76rem; font-weight: 700; letter-spacing: .02em; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--done { color: var(--sage); }
.status--ongoing { color: var(--rose); }
.status--short { color: var(--lavender); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 120px; border-top: 1px solid var(--border); }
.site-footer__inner {
  width: min(100% - var(--gutter) * 2, 1040px);
  margin-inline: auto;
  padding: 40px 0 52px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 20px 40px;
  font-size: .88rem; color: var(--muted);
}
.brand--footer .brand__name { font-size: 1.6rem; }
.footer-tagline { margin: 6px 0 0; font-family: var(--font-body); font-style: italic; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-links a { text-decoration: none; color: var(--text-soft); font-weight: 500; }
.footer-links a:hover { color: var(--rose); }
.copyright { margin: 0; flex-basis: 100%; font-size: .8rem; }

/* ---------- Chapter drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(32, 24, 40, .34);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .35s ease, visibility .35s;
}
.drawer-backdrop.is-open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(410px, 100%);
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 60px -30px rgba(40, 20, 50, .45);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .45s cubic-bezier(.22, .8, .24, 1), visibility .45s;
}
.drawer.is-open { transform: none; visibility: visible; }

.drawer__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 26px 24px 14px;
}
.drawer__head h2 {
  margin: 0;
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 1.9rem; line-height: 1.05;
}
.icon-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border);
  background: transparent; cursor: pointer; color: var(--text-soft);
  transition: background-color .2s, color .2s;
}
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.drawer__meta {
  padding: 0 24px 20px;
  border-bottom: 1px solid var(--border);
  font-size: .84rem; color: var(--muted);
}
.meter { height: 6px; margin-top: 10px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--rose), var(--lavender)); }

.toc {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  list-style: none; margin: 0; padding: 12px 12px 28px;
}
.toc a, .toc__row {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px;
  padding: 11px 12px; border-radius: 14px;
  text-decoration: none; color: var(--text-soft);
  transition: background-color .2s, color .2s;
}
.toc a:hover { background: var(--surface); color: var(--text); }
.toc__num { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--muted); font-variant-numeric: lining-nums; }
.toc__title { font-family: var(--font-body); font-size: .97rem; line-height: 1.35; }
.toc__state { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sage); }
.toc .is-current a { background: var(--rose-soft); color: var(--text); }
.toc .is-current .toc__num, .toc .is-current .toc__state { color: var(--rose); }
.toc .is-locked .toc__row { margin-top: 4px; border: 1px dashed var(--border); color: var(--muted); }
.toc .is-locked .toc__title { font-style: italic; }
.toc .is-locked .toc__state { color: var(--muted); }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text-soft);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, color .2s;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--rose); }
.to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .duo { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .site-nav { display: none; }
  .chapter-head { padding-top: 44px; }
  .cover { border-radius: 18px; aspect-ratio: 16 / 10; }
  .section { margin-top: 72px; }
  .card { padding: 26px 22px; }
}
@media (max-width: 520px) {
  .chapter-pager { grid-template-columns: 1fr; }
  .pager-card--next { text-align: left; }
  .about-card { flex-direction: column; gap: 16px; }
  .subscribe, .comment-form__row { flex-direction: column; }
  .subscribe input, .comment-form input { flex: none; }
  .reading-tools__label { display: none; }
  .author-note { padding: 22px 20px; }
  .to-top { right: 14px; bottom: 14px; }
}
@media (max-width: 480px) {
  .pill-btn { width: 38px; padding: 0; justify-content: center; }
  .pill-btn__label { display: none; }
}

/* ---------- Language switch (မြန်မာ / EN) ---------- */
.locale-switch {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 2px;
  height: 38px; padding: 3px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface);
}
.locale-switch button {
  height: 30px; padding: 0 11px;
  border: 0; border-radius: 999px; background: transparent;
  font-family: var(--font-ui); font-size: .82rem; font-weight: 600; line-height: 1;
  color: var(--muted); cursor: pointer;
  transition: color .2s, background-color .2s, box-shadow .2s;
}
.locale-switch button:hover { color: var(--text); }
.locale-switch button[aria-checked="true"] {
  background: var(--thumb); color: var(--rose);
  box-shadow: 0 1px 4px rgba(60, 40, 50, .2);
}
.locale-switch--menu { display: none; } /* the copy inside the menu shows only on phones */

/* ---------- Mobile menu (both pages) ---------- */
.menu-btn { display: none; background: var(--bg-elev); }
@media (max-width: 960px) {
  .site-nav { display: none; }
  .menu-btn { display: grid; }
  .site-header.menu-open .site-nav {
    position: absolute; top: calc(100% - 4px); right: var(--gutter);
    display: flex; flex-direction: column; gap: 2px;
    min-width: 210px; padding: 8px;
    border-radius: 18px; border: 1px solid var(--border);
    background: var(--bg-elev); box-shadow: var(--shadow);
    animation: rise .25s ease;
  }
  .site-header.menu-open .site-nav a { padding: 11px 14px; border-radius: 12px; font-size: .95rem; }
}
@media (max-width: 600px) {
  .header-actions .locale-switch { display: none; }
  .site-header.menu-open .locale-switch--menu { display: inline-flex; align-self: flex-start; margin: 6px 8px 4px; }
}

/* =========================================================
   Home page
   ========================================================= */

/* ---------- Hero ---------- */
.hero {
  width: min(100% - var(--gutter) * 2, 1100px);
  margin-inline: auto;
  padding: 48px 0 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
}
.hero__kicker {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0; padding: 6px 14px 6px 11px;
  border-radius: 999px;
  background: var(--sage-soft); color: var(--sage);
  font-size: .8rem; font-weight: 600;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: pulse 2.4s ease-out infinite; }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sage) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 9px transparent; }
}
.hero h1 {
  margin: 22px 0 0;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.9rem, 6.4vw, 5.2rem);
  line-height: .98; letter-spacing: -.018em;
  text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--rose); }
.hero__intro {
  margin: 24px 0 0; max-width: 46ch;
  font-family: var(--font-body); font-size: 1.1rem; line-height: 1.75;
  color: var(--text-soft);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn--lg {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 26px;
  text-decoration: none; font-size: .97rem;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.btn:hover svg { transform: translateX(3px); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--bg-elev); color: var(--text); border-color: color-mix(in srgb, var(--lavender) 45%, var(--border)); }

.continue {
  display: flex; align-items: center; gap: 14px;
  max-width: 440px; margin-top: 24px;
  padding: 12px 18px 12px 12px;
  border-radius: 18px; border: 1px solid var(--border);
  background: var(--bg-elev); box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .25s ease, border-color .25s;
}
.continue[hidden] { display: none; }
.continue:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--rose) 35%, var(--border)); }
.continue__icon {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 13px; background: var(--rose-soft); color: var(--rose);
}
.continue__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.continue__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.continue__label {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.continue__title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.continue .meter { height: 4px; margin-top: 6px; }
.continue__pct { font-size: .82rem; font-weight: 700; color: var(--rose); font-variant-numeric: tabular-nums; }

.hero__stats {
  display: flex; flex-wrap: wrap; gap: 6px 24px;
  margin: 30px 0 0; padding: 0; list-style: none;
  font-size: .88rem; color: var(--muted);
}
.hero__stats strong { margin-right: 3px; font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: var(--text); }

/* Window illustration */
.hero__art { position: relative; justify-self: center; width: min(100%, 430px); }
.window-art { width: 100%; height: auto; filter: drop-shadow(0 28px 36px rgba(110, 70, 95, .16)); }
[data-theme="dark"] .window-art { filter: drop-shadow(0 28px 40px rgba(0, 0, 0, .5)); }
.w-star { fill: var(--moon); opacity: var(--star-opacity); }
.w-glass { fill: #fff; opacity: var(--glass-opacity); }
.w-frame { fill: none; stroke: var(--frame); stroke-width: 12; stroke-linejoin: round; }
.w-mullion { fill: none; stroke: var(--frame); stroke-width: 7; }
.w-sill { fill: var(--sill); }
.w-sill--under { opacity: .6; }
.flame-in  { stop-color: var(--flame); stop-opacity: .5; }
.flame-out { stop-color: var(--flame); stop-opacity: 0; }
.w-candle { fill: var(--candle); }
.w-wick { stroke: var(--inkpot); stroke-width: 1.6; stroke-linecap: round; }
.w-flame { fill: var(--flame); transform-box: fill-box; transform-origin: 50% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .w-flame { animation: flicker 3s ease-in-out infinite; }
}
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0); }
  25% { transform: scale(.94, 1.06) rotate(-3deg); }
  50% { transform: scale(1.04, .95) rotate(2deg); }
  75% { transform: scale(.97, 1.04) rotate(-1deg); }
}
.w-book-a { fill: var(--book-a); }
.w-book-b { fill: var(--book-b); }
.w-book-c { fill: var(--book-c); }
.w-book-line { stroke: var(--bg-elev); stroke-width: 1.2; opacity: .5; }
.w-ink { fill: var(--inkpot); }
.w-ink-shine { fill: #fff; opacity: .18; }
.w-quill { fill: var(--quill); }
.w-quill-spine { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-linecap: round; }

.hero-note {
  position: absolute; left: -26px; bottom: 92px;
  display: flex; flex-direction: column;
  width: 196px; padding: 14px 16px 16px;
  border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg-elev); box-shadow: var(--shadow);
  text-decoration: none;
  transform: rotate(-5deg);
}
.hero-note__stamp {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 36px;
  display: grid; place-items: center;
  border-radius: 3px; background: var(--rose-soft);
  outline: 2px dashed color-mix(in srgb, var(--rose) 40%, transparent);
  outline-offset: -5px;
}
.hero-note__stamp svg { width: 13px; height: 13px; fill: var(--rose); }
.hero-note__label { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--rose); }
.hero-note__title { margin-top: 6px; font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.45rem; line-height: 1.05; color: var(--text); }
.hero-note__sub { margin-top: 3px; font-size: .84rem; color: var(--text-soft); }

/* ---------- Latest chapter ---------- */
.feature-card {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  border-radius: 28px; border: 1px solid var(--border);
  background: var(--bg-elev);
  overflow: hidden; text-decoration: none;
  transition: transform .3s ease, box-shadow .3s ease;
}
.feature-card:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--rose) 30%, var(--border)); }
.feature-card__art { position: relative; min-height: 320px; }
.feature-card__art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.feature-card__body { display: flex; flex-direction: column; padding: clamp(24px, 4vw, 40px); }
.feature-card__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0; font-size: .82rem; font-weight: 600; color: var(--muted);
}
.badge-new {
  padding: 3px 9px; border-radius: 999px;
  font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--bg); background: var(--rose);
}
.feature-card h3 {
  margin: 14px 0 0;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.02;
}
.feature-card__excerpt { margin: 16px 0 0; font-family: var(--font-body); font-style: italic; line-height: 1.75; color: var(--text-soft); }
.feature-card__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: auto 0 0; padding-top: 26px;
  font-size: .85rem; color: var(--muted);
}
.read-link { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--rose); }
.read-link svg, .post__meta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.feature-card:hover .read-link svg, .post__link:hover .post__meta svg { transform: translateX(4px); }

/* ---------- Stories shelf ---------- */
.story-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.story-card__foot {
  display: flex; align-items: center; gap: 12px;
  width: 100%; margin-top: auto; padding-top: 16px;
  font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.story-card__foot .meter { flex: 1; height: 5px; margin-top: 0; }
.meter--done span { background: var(--sage); }
.meter--short span { background: var(--lavender); }

/* ---------- Recent chapters feed ---------- */
.feed-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px 24px;
}
.feed-head .section-title { margin-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 15px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text-soft);
  font-size: .84rem; font-weight: 500; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--lavender) 45%, var(--border)); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.series-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; }
.series-dot--monsoon { background: var(--lavender); }
.series-dot--moths { background: var(--rose); }
.series-dot--gods { background: var(--sage); }
.series-dot--lavender { background: var(--lavender); }
.series-dot--rose { background: var(--rose); }
.series-dot--sage { background: var(--sage); }

.feed { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--border); }
.post { border-bottom: 1px solid var(--border); }
.post[hidden] { display: none; }
.post.is-entering { animation: rise .4s ease; }
.post__link {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 24px;
  margin: 4px -14px; padding: 20px 14px;
  border-radius: 18px;
  text-decoration: none;
  transition: background-color .2s;
}
.post__link:hover { background: var(--surface); }
.post__date { display: flex; flex-direction: column; align-items: center; }
.post__day { font-family: var(--font-display); font-weight: 600; font-size: 2.2rem; line-height: 1; color: var(--text); }
.post__mon { margin-top: 3px; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.post__body { display: flex; flex-direction: column; min-width: 0; }
.post__series { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.post__title {
  margin-top: 4px;
  font-family: var(--font-display); font-weight: 500; font-size: 1.65rem; line-height: 1.15;
  color: var(--text); transition: color .2s;
}
.post__link:hover .post__title { color: var(--rose); }
.post__excerpt { margin-top: 6px; font-size: .95rem; line-height: 1.6; color: var(--text-soft); }
.post__meta { display: inline-flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* ---------- Quote band ---------- */
.quote-band {
  position: relative; overflow: hidden;
  padding: clamp(64px, 10vw, 110px) var(--gutter);
  text-align: center;
  background: linear-gradient(135deg, var(--rose-soft), var(--lavender-soft) 55%, var(--sage-soft));
}
.quote-band::before, .quote-band::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.quote-band::before {
  width: 360px; height: 360px; top: -150px; left: -100px;
  background: radial-gradient(circle, color-mix(in srgb, var(--bg-elev) 60%, transparent), transparent 70%);
}
.quote-band::after {
  width: 280px; height: 280px; bottom: -130px; right: -70px;
  background: radial-gradient(circle, color-mix(in srgb, var(--bg-elev) 50%, transparent), transparent 70%);
}
.quote-band figure { position: relative; margin: 0; }
.quote-band blockquote {
  margin: 0 auto; max-width: 20ch;
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: clamp(2rem, 5.4vw, 3.6rem); line-height: 1.1;
  color: var(--text);
  text-wrap: balance;
}
.quote-band blockquote::before {
  content: "\201C";
  display: block; height: .45em;
  font-size: 1.6em; line-height: .9;
  color: var(--rose); opacity: .6;
}
.quote-band figcaption { margin-top: 24px; font-size: .88rem; color: var(--text-soft); }
.quote-band cite { font-family: var(--font-body); font-style: italic; }

/* ---------- About ---------- */
.about {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  align-items: center; gap: clamp(32px, 6vw, 72px);
}
.portrait {
  position: relative; justify-self: center;
  width: min(100%, 340px); aspect-ratio: 4 / 5;
  display: grid; place-items: center;
  border-radius: 999px 999px 30px 30px;
  border: 10px solid var(--frame);
  background: linear-gradient(170deg, var(--sky-top), var(--sky-mid) 55%, var(--sky-bottom));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.portrait__moon {
  width: 40%;
  fill: var(--rose);
  transform: rotate(-14deg);
  filter: drop-shadow(0 0 28px color-mix(in srgb, var(--rose) 50%, transparent));
}
.portrait__sig {
  position: absolute; left: 0; right: 0; bottom: 24px;
  text-align: center;
  font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 2.1rem;
  color: var(--text);
}
.portrait__star {
  position: absolute; left: var(--x); top: var(--y);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--moon); box-shadow: 0 0 8px var(--moon);
  opacity: .85;
}
@media (prefers-reduced-motion: no-preference) {
  .portrait__star { animation: twinkle 3.2s ease-in-out var(--d) infinite; }
}
@keyframes twinkle {
  0%, 100% { opacity: .85; transform: scale(1); }
  50% { opacity: .25; transform: scale(.6); }
}
.about__text h2 {
  margin: 0;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.3rem, 4.6vw, 3.4rem); line-height: 1.05;
}
.about__text > p:not(.eyebrow) {
  margin: 18px 0 0; max-width: 56ch;
  font-family: var(--font-body); font-size: 1.05rem; line-height: 1.8;
  color: var(--text-soft);
}
.facts {
  display: flex; flex-wrap: wrap; gap: 12px 26px;
  margin: 28px 0 0; padding: 0; list-style: none;
  font-size: .92rem; font-weight: 500; color: var(--text-soft);
}
.facts li { display: inline-flex; align-items: center; gap: 10px; }
.facts__icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.facts__icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.facts__icon--lav  { background: var(--lavender-soft); color: var(--lavender); }
.facts__icon--sage { background: var(--sage-soft); color: var(--sage); }
.facts__icon--rose { background: var(--rose-soft); color: var(--rose); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }

/* ---------- Newsletter (wide) ---------- */
.newsletter--wide {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center; gap: 24px 40px;
  padding: clamp(28px, 5vw, 48px);
}
.newsletter--wide h2 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); }
.newsletter--wide .subscribe { margin-top: 0; }

/* ---------- Home responsive ---------- */
@media (max-width: 1000px) {
  .story-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 32px; }
  .hero__art { width: min(100%, 380px); }
  .feature-card { grid-template-columns: minmax(0, 1fr); }
  .feature-card__art { min-height: 220px; }
  .about { grid-template-columns: minmax(0, 1fr); }
  .portrait { width: min(100%, 280px); }
  .newsletter--wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .story-grid--four { grid-template-columns: minmax(0, 1fr); }
  .story-grid--four .story-cover { aspect-ratio: 2 / 1; }
  .post__link { grid-template-columns: 46px minmax(0, 1fr); gap: 16px; }
  .post__meta { display: none; }
  .post__title { font-size: 1.4rem; }
  .post__day { font-size: 1.9rem; }
  .hero-note { left: -6px; bottom: 72px; width: 170px; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* =========================================================
   Support: buy LuNay a cup of tea
   ========================================================= */
.tea-cta {
  margin-top: 36px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 18px 20px;
  padding: 22px 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--peach-soft), var(--rose-soft));
}
.tea-cta__cup, .tea-head__cup {
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg-elev); color: var(--rose);
  box-shadow: var(--shadow);
}
.tea-cta__cup { width: 60px; height: 60px; }
.tea-cta__cup svg, .tea-head__cup svg {
  width: 30px; height: 30px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.tea-cta h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.6; }
.tea-cta p { margin: 2px 0 0; font-size: .93rem; line-height: 1.85; color: var(--text-soft); }
.tea-cta .tea-cta__wallets { margin-top: 4px; font-size: .78rem; color: var(--muted); }
.btn--tea { display: inline-flex; align-items: center; gap: 8px; }
.btn--tea svg, .tea-sent svg, .tea-actions svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.btn--tea:hover svg { transform: none; }

/* ---------- Pop-up ---------- */
.tea-dialog {
  width: min(460px, 100% - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0; border-radius: 26px;
  background: var(--bg-elev); color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(30, 20, 40, .5);
  overflow: auto; overscroll-behavior: contain;
}
.tea-dialog::backdrop {
  background: rgba(32, 24, 40, .45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
@media (prefers-reduced-motion: no-preference) {
  .tea-dialog[open] { animation: rise .3s ease; }
}
.tea-dialog__inner { position: relative; padding: 28px 22px 22px; }
.tea-close { position: absolute; top: 14px; right: 14px; }
.tea-view[hidden] { display: none; }

.tea-head { text-align: center; padding: 0 20px; }
.tea-head__cup { width: 54px; height: 54px; margin: 0 auto 8px; background: var(--peach-soft); box-shadow: none; }
.tea-head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.55; text-wrap: balance; }
.tea-cta h2, .tea-thanks h2 { text-wrap: balance; }
.tea-head p { margin: 6px 0 0; font-size: .92rem; line-height: 1.85; color: var(--text-soft); }

.tea-label { margin: 20px 0 8px; font-size: .82rem; font-weight: 600; color: var(--muted); }

.tea-tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  padding: 4px; border-radius: 14px; background: var(--surface);
}
.tea-tabs button {
  height: 36px; padding: 0 4px;
  border: 0; border-radius: 10px; background: transparent;
  font-family: var(--font-ui); font-size: .82rem; font-weight: 600;
  color: var(--muted); white-space: nowrap; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.tea-tabs button:hover { color: var(--text); }
.tea-tabs button[aria-selected="true"] { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 3px rgba(60, 40, 50, .18); }

.tea-panel {
  margin-top: 14px;
  display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; gap: 16px;
}
.tea-qr {
  padding: 10px; border-radius: 18px;
  background: #fff; /* QR codes need a white background to scan, even in dark mode */
  border: 1px solid var(--border);
}
.tea-qr img { display: block; width: 100%; height: auto; }
.tea-account { margin: 0; display: grid; gap: 8px; }
.tea-account dt { font-size: .78rem; color: var(--muted); }
.tea-account dd { margin: 0; font-size: 1rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.tea-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tea-actions .pill-btn { height: 34px; padding: 0 12px; font-size: .8rem; text-decoration: none; }

.tea-steps {
  margin: 18px 0 0; padding: 14px 16px 14px 2.1em;
  border-radius: 16px; background: var(--surface);
  font-size: .88rem; line-height: 1.85; color: var(--text-soft);
}
[data-locale="my"] .tea-steps { list-style-type: myanmar; }
.tea-steps li + li { margin-top: 4px; }

.tea-sent { width: 100%; margin-top: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

.tea-thanks { text-align: center; padding: 18px 12px 4px; }
.tea-thanks__heart {
  display: grid; place-items: center;
  width: 72px; height: 72px; margin: 0 auto 14px;
  border-radius: 50%; background: var(--rose-soft); color: var(--rose);
}
.tea-thanks__heart svg { width: 34px; height: 34px; fill: currentColor; }
.tea-thanks h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; line-height: 1.55; }
.tea-thanks p { margin: 8px auto 0; max-width: 32em; font-size: .95rem; line-height: 1.9; color: var(--text-soft); }
.tea-thanks .btn { margin-top: 20px; }

@media (max-width: 600px) {
  .tea-cta { grid-template-columns: auto minmax(0, 1fr); padding: 20px; }
  .btn--tea { grid-column: 1 / -1; justify-content: center; width: 100%; }
}
@media (max-width: 440px) {
  .tea-panel { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .tea-qr { width: min(220px, 100%); }
  .tea-actions { justify-content: center; }
  .tea-dialog__inner { padding: 26px 16px 18px; }
}

/* =========================================================
   Burmese typography
   Myanmar script stacks marks above and below each letter, has no
   capitals or italics, and needs roomier lines than Latin text.
   ========================================================= */
html { font-synthesis: none; } /* never fake italics on Burmese glyphs */
body { line-height: 1.85; overflow-wrap: break-word; }

/* Reading */
.prose { line-height: 2.15; }
.prose p { margin-bottom: 1.15em; }
.prose .letter { font-size: 1.05em; line-height: 2; }
.pull-quote { font-size: 1.3em; line-height: 1.8; }
.prose .chapter-end { font-size: .9rem; }
.recap p, .author-note p, .comment__body { line-height: 2; }

/* Headings: smaller and taller than the Latin versions */
.chapter-num { font-size: 1.15rem; margin-top: 26px; }
.chapter-title { font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.55; }
.chapter-dek { max-width: 560px; font-size: 1.05rem; line-height: 2; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.55; }
.hero h1 em { font-style: normal; white-space: nowrap; }
/* Keep a short Burmese phrase on one line (useful in headings) */
.nw { white-space: nowrap; }
.hero__intro { line-height: 2.05; }
.section-title { font-size: 1.7rem; line-height: 1.55; }
.feature-card h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.55; }
.feature-card__excerpt { line-height: 2.05; }
.story-card__title { font-size: 1.2rem; line-height: 1.65; }
.story-card__body p { line-height: 1.9; }
.post__title { font-size: 1.3rem; line-height: 1.65; }
.post__excerpt { line-height: 1.9; }
.post__day { line-height: 1.2; }
.pager-card__title { font-size: 1.1rem; line-height: 1.7; }
.quote-band blockquote { max-width: 720px; font-size: clamp(1.5rem, 3.8vw, 2.3rem); line-height: 1.7; }
.about__text h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.5; }
.about__text > p:not(.eyebrow) { line-height: 2.05; }
.newsletter h2 { font-size: 1.55rem; line-height: 1.6; }
.newsletter--wide h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.drawer__head h2 { line-height: 1.45; }
.toc__title { line-height: 1.75; }
.hero-note__title { font-size: 1.25rem; line-height: 1.5; }
.continue__title { font-size: 1rem; line-height: 1.8; }

/* Labels: no tracking or capitals in Burmese, and big enough to read */
.eyebrow, .series-tag, .pager-card__dir, .author-note__label, .prose .chapter-end, .badge-new,
.badge-author, .continue__label, .hero-note__label, .post__mon, .toc__state, .status, .stat dt, .count {
  letter-spacing: 0;
  text-transform: none;
}
.eyebrow, .continue__label, .hero-note__label, .toc__state, .post__mon, .badge-author, .badge-new { font-size: .8rem; }
.series-tag { font-size: .85rem; }
.pager-card__dir, .author-note__label { font-size: .84rem; }
.status { font-size: .8rem; }
.post__link { grid-template-columns: 72px minmax(0, 1fr) auto; }
/* English interface labels get back their small-caps Latin styling */
.eyebrow:lang(en), .pager-card__dir:lang(en), .prose .chapter-end:lang(en), .badge-new:lang(en),
.badge-author:lang(en), .hero-note__label:lang(en), .post__mon:lang(en), .toc__state:lang(en) {
  letter-spacing: .12em; text-transform: uppercase; font-size: .72rem;
}

.tool-btn { white-space: nowrap; font-size: .95rem; }
.tool-btn--lg { font-size: 1.12rem; }

/* ---------- Header fit on small phones ---------- */
@media (max-width: 520px) {
  .swatches { margin-left: 4px; padding-left: 10px; gap: 6px; }
}
@media (max-width: 480px) {
  .header-actions { gap: 8px; }
  .theme-switch button, .theme-switch__thumb { width: 30px; }
  [data-theme="paper"] .theme-switch__thumb { transform: translateX(30px); }
  [data-theme="dark"] .theme-switch__thumb { transform: translateX(60px); }
}
@media (max-width: 400px) {
  .site-header__inner { gap: 12px; }
  .brand__name { font-size: 1.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Pages filled from data/ (render.js) ---------- */
[hidden] { display: none !important; }
.feature-card--no-art { grid-template-columns: 1fr; }

.chapter-missing { padding: 80px 0 40px; text-align: center; }
.chapter-missing .chapter-dek { margin-inline: auto; }
.chapter-missing .btn { margin-top: 26px; }

/* A studio preview of an unpublished chapter */
.preview-banner {
  position: sticky; top: 0; z-index: 60;
  padding: 9px var(--gutter);
  text-align: center; font-size: .88rem; font-weight: 600;
  background: var(--lavender); color: var(--bg);
}
.preview-banner ~ .site-header { top: 41px; }

@media (max-width: 720px) {
  .pager-card--next:only-child { grid-column: auto; }
}
