@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Noto+Serif+Devanagari:wght@400;500;600;700&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap");

:root {
  --bg: #faf7f2;
  --bg-soft: #f3eee6;
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #78716c;
  --faint: #a8a29e;
  --line: #e7e0d6;
  --accent: #9f1239;
  --accent-soft: #fce7ef;
  --measure: 38rem;
  --page: 42rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: var(--page); margin: 0 auto; padding: 0 1.25rem;
  height: 3.25rem; display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: "Noto Serif Devanagari", serif; font-weight: 600;
  font-size: 1.05rem; text-decoration: none; color: var(--accent);
}
.site-header nav { display: flex; gap: 1.25rem; }
.site-header nav a {
  font-size: 0.8125rem; color: var(--muted); text-decoration: none; font-weight: 500;
}
.site-header nav a:hover { color: var(--ink); }

.page { max-width: var(--page); margin: 0 auto; padding: 0 1.25rem 5rem; }

.page-intro { padding: 2.75rem 0 2rem; border-bottom: 1px solid var(--line); }
.eyebrow {
  margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
.page-intro h1 {
  margin: 0; font-family: "Noto Serif Devanagari", serif; font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.35rem); line-height: 1.25;
}
.lede { margin: 0.6rem 0 0; font-size: 0.95rem; color: var(--muted); }

.archive-meta {
  display: flex; justify-content: flex-end; padding: 1.25rem 0 0.5rem;
  font-size: 0.75rem; color: var(--faint); font-variant-numeric: tabular-nums;
}
.entry {
  display: grid; grid-template-columns: 2rem 1fr; gap: 0.85rem;
  padding: 1.15rem 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit; transition: background 0.15s;
}
.entry:hover {
  background: var(--bg-soft); margin: 0 -0.75rem;
  padding-left: 0.75rem; padding-right: 0.75rem; border-radius: 6px;
}
.idx {
  font-size: 0.75rem; font-weight: 500; color: var(--faint);
  font-variant-numeric: tabular-nums; padding-top: 0.2rem;
}
.entry-body time {
  display: block; font-size: 0.72rem; color: var(--faint); margin-bottom: 0.2rem;
}
.entry-body h2 {
  margin: 0 0 0.3rem; font-family: "Noto Serif Devanagari", serif;
  font-weight: 600; font-size: 1.15rem; line-height: 1.35;
}
.excerpt {
  margin: 0; font-size: 0.84rem; line-height: 1.5; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.reading-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 0 2rem; font-size: 0.78rem;
}
.crumb {
  color: var(--accent); text-decoration: none;
  font-family: "Noto Serif Devanagari", serif; font-weight: 500;
}
.pid { color: var(--faint); letter-spacing: 0.1em; font-size: 0.7rem; font-variant-numeric: tabular-nums; }

.article { max-width: var(--measure); margin: 0 auto; }
.article-head { text-align: center; margin-bottom: 2.5rem; }
.article-head time { display: block; font-size: 0.75rem; color: var(--faint); }
.article-head h1 {
  margin: 0.5rem 0 0.4rem; font-family: "Noto Serif Devanagari", serif;
  font-weight: 600; font-size: clamp(1.65rem, 4.5vw, 2.4rem); line-height: 1.3;
}
.author { margin: 0; font-size: 0.8rem; color: var(--muted); }

.prose {
  font-family: "Noto Serif Devanagari", Georgia, serif;
  font-size: 1.1rem; line-height: 2.05; letter-spacing: 0.01em;
  color: var(--ink); user-select: text; -webkit-user-select: text;
}
.prose p { margin: 0 0 1.2em; }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.prose h2, .prose h3 { font-weight: 600; line-height: 1.4; margin: 1.75em 0 0.6em; }
.prose blockquote {
  margin: 1.5em 0; padding: 0.25em 0 0.25em 1.1em;
  border-left: 2px solid var(--accent); color: var(--ink-2);
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose a {
  color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.prose a:hover { text-decoration-color: var(--accent); }
.prose img {
  display: block; max-width: 100%; height: auto; margin: 1.75em auto; border-radius: 4px;
}
.prose video, .prose audio, .prose iframe {
  display: block; max-width: 100%; width: 100%; margin: 1.5em 0; border: 0; border-radius: 4px;
}
.prose video { height: auto; }
.prose iframe { min-height: 280px; aspect-ratio: 16/9; }

.article-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line);
  font-size: 0.75rem; color: var(--faint);
}
.btn-copy {
  appearance: none; border: 1px solid var(--line); background: transparent;
  color: var(--accent); padding: 0.4rem 0.85rem; border-radius: 4px;
  font: 500 0.75rem "DM Sans", sans-serif; cursor: pointer;
}
.btn-copy:hover { background: var(--bg-soft); }
.path { font-variant-numeric: tabular-nums; }

.pager {
  display: flex; justify-content: space-between; margin-top: 1.75rem;
  padding-top: 1rem; border-top: 1px solid var(--line);
  font-family: "Noto Serif Devanagari", serif; font-size: 0.875rem; font-weight: 500;
}
.pager a { color: var(--accent); text-decoration: none; }
.pager a:hover { text-decoration: underline; }

.about { padding-top: 2.5rem; }
.about .prose h1 { font-size: 1.85rem; margin-top: 0; }

.site-footer {
  border-top: 1px solid var(--line); padding: 1.15rem 0;
  font-size: 0.72rem; color: var(--faint);
}
.site-footer .inner {
  max-width: var(--page); margin: 0 auto; padding: 0 1.25rem;
  display: flex; justify-content: space-between;
}

.word { cursor: pointer; border-radius: 2px; transition: background 0.12s; }
.word:hover, .word:focus-visible { background: var(--accent-soft); outline: none; }
.word-popup {
  position: fixed; z-index: 1000; width: min(18rem, calc(100vw - 1.5rem));
  background: #fffefb; color: var(--ink); padding: 0.85rem 1rem;
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 40px rgba(28, 25, 23, 0.12);
  font-family: "Noto Serif Devanagari", serif; font-size: 0.9rem; line-height: 1.55;
}
.word-popup .term { font-weight: 600; font-size: 1rem; color: var(--accent); margin-bottom: 0.2rem; }
.word-popup .hint { color: var(--ink-2); }
.word-popup .sources { margin-top: 0.65rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.word-popup .sources a {
  font-family: "DM Sans", sans-serif; font-size: 0.72rem;
  color: var(--accent); text-decoration: underline;
}
.word-popup.loading .hint { color: var(--muted); font-style: italic; }

@media (max-width: 640px) {
  .site-header .inner { padding: 0 1rem; height: 3rem; }
  .page { padding: 0 1rem 4rem; }
  .page-intro { padding: 2rem 0 1.5rem; }
  .page-intro h1 { font-size: 1.55rem; }
  .entry { grid-template-columns: 1.75rem 1fr; gap: 0.65rem; padding: 1rem 0; }
  .entry:hover { margin: 0; padding-left: 0; padding-right: 0; }
  .entry-body h2 { font-size: 1.05rem; }
  .reading-bar { padding: 1rem 0 1.5rem; }
  .article-head { margin-bottom: 2rem; }
  .article-head h1 { font-size: 1.55rem; }
  .prose { font-size: 1.05rem; line-height: 2; }
  .site-footer .inner { padding: 0 1rem; }
}
