/* Nirvaan — "manuscript warmth": pothi paper, lac-red grounds, gold rules, lapis accents,
   drawn from Jain illuminated manuscripts. Built for long Hindi (Devanagari) and English reading. */

:root {
  --paper: #F8F1E3;         /* pothi paper: page background */
  --paper-deep: #F0E4CB;    /* quotes, sunk panels */
  --surface: #FFFAF0;       /* cards, inputs */
  --ink: #2A211B;           /* iron-gall ink, 14:1 on paper */
  --heading: #231A14;
  --muted: #6B5A48;         /* 5.9:1 on paper */
  --rule: #E2D2B3;          /* hairlines */
  --lac: #9B2A1A;           /* manuscript red ground: masthead, footer, roundels */
  --lac-deep: #7A2112;
  --vermilion: #A8321C;     /* links and buttons, 6:1 on paper */
  --gold: #C8962C;          /* gold leaf: rules and rings only, never text */
  --gold-light: #F0D59A;    /* text on lac, 5.4:1 */
  --lapis: #1F3F75;         /* tags, notes, current day */
  --lapis-wash: #E4EAF3;
  --selection: #F3D9A8;

  --font-display: "Eczar", "Noto Serif Devanagari", Georgia, serif;
  --font-serif: "Literata", "Noto Serif Devanagari", Georgia, serif;
  --font-deva: "Noto Serif Devanagari", "Literata", "Kohinoor Devanagari", "Nirmala UI", serif;
  --font-ui: "Mukta", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 41rem;         /* ~68 characters of body text */
  --wide: 60rem;
  --radius: 6px;
}

/* ---------- Base ---------- */

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

/* Keep the hidden attribute working on elements that set their own display. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background-color: var(--paper);
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .3 0 0 0 0 .14 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--selection); }

h1, h2, h3 {
  color: var(--heading);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a {
  color: var(--vermilion);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--lac-deep); text-decoration-thickness: 2px; }

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

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

.wrap { width: min(100% - 2rem, var(--wide)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2rem, var(--measure)); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--lac);
  color: var(--paper);
  font-family: var(--font-ui);
  border-radius: 0 0 8px 8px;
}
.skip-link:focus { top: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* ---------- Devanagari ---------- */

/* Hindi, Sanskrit and Prakrit: Devanagari body font first (zero specificity, so display
   headings keep Eczar, which has Devanagari too). */
:where(:lang(hi), :lang(sa), :lang(pra)) { font-family: var(--font-deva); }
/* Letter-spacing breaks the shirorekha (the line joining the letters), so it always loses. */
:lang(hi), :lang(sa), :lang(pra) { letter-spacing: normal !important; }

/* Block elements only: a taller inline span would make its line jump. */
.prose:lang(hi),
.prose :is(p, li, blockquote, div):is(:lang(hi), :lang(sa), :lang(pra)) { line-height: 1.95; }

/* Devanagari has no true italic; emphasise with weight instead of a slanted fake. */
:lang(hi) em, :lang(hi) i, :lang(sa) em, :lang(pra) em,
blockquote:lang(hi), blockquote:lang(sa), blockquote:lang(pra) { font-style: normal; }
:lang(hi) em, :lang(hi) i { font-weight: 600; }

/* ---------- Roundel: the manuscript medallion, used as the site's one ornament ---------- */

.brand__mark,
.folio__stud,
.prose h2::before,
.invocation::before {
  content: "";
  flex: none;
  display: inline-block;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-light) 0 24%, var(--lac) 26%);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--gold);
}

/* ---------- Header & footer ---------- */

.site-header { border-bottom: 1px solid var(--rule); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--heading);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  text-decoration: none;
}
.brand__mark { width: 0.75rem; height: 0.75rem; }
.brand:hover { color: var(--lac); }

.nav {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-ui);
  font-size: 1rem;
}
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--lac); }

.site-footer {
  margin-top: 5rem;
  border-top: 4px double var(--gold);
  background: var(--lac);
  color: var(--gold-light);
  font-family: var(--font-ui);
  font-size: 0.95rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 2.25rem;
}
.site-footer p { margin: 0; }
.site-footer__motto { flex-basis: 100%; font-family: var(--font-display); font-size: 1.15rem; color: var(--paper); }
.site-footer a { color: var(--paper); }
.site-footer a:hover { color: var(--gold-light); }

/* ---------- Shared bits ---------- */

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.4;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  background: var(--lapis-wash);
  color: var(--lapis);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0;
  color: var(--lac);
  font-family: var(--font-ui);
  font-weight: 600;
}

.avatar {
  flex: none;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 4px var(--surface), 0 0 0 5px var(--lac);
}
.avatar--small { width: 2.5rem; height: 2.5rem; border-width: 2px; }
.avatar--placeholder {
  display: inline-grid;
  place-items: center;
  background: var(--paper-deep);
  color: var(--lac);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}
.avatar--small.avatar--placeholder { font-size: 0.9rem; }

.button, .chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 500 0.95rem/1.2 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
}
.button { padding: 0.6rem 1.25rem; }
.chip { padding: 0.35rem 0.85rem; }
.chip--small { padding: 0.2rem 0.7rem; font-size: 0.88rem; }
.button:hover, .chip:hover {
  border-color: var(--gold);
  color: var(--lac-deep);
  text-decoration: none;
}
.button--primary, .chip--primary { border-color: var(--vermilion); background: var(--vermilion); color: #fff; }
.button--primary:hover, .chip--primary:hover { border-color: var(--lac-deep); background: var(--lac-deep); color: #fff; }
.button:disabled { opacity: 0.6; cursor: wait; }
.chip--danger:hover { border-color: var(--lac-deep); color: var(--lac-deep); }

/* हिंदी / English switch (posts and admin pages) */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
}
.lang-switch button {
  padding: 0.4rem 0.95rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: 500 0.95rem/1.2 var(--font-ui);
  cursor: pointer;
}
.lang-switch button:hover { color: var(--lac); }
.lang-switch button[aria-pressed="true"] { background: var(--lac); color: var(--paper); }

/* ---------- Home: the folio masthead ---------- */

.folio {
  display: grid;
  grid-template-columns: 3rem 1fr 3rem;
  margin-block: 2.5rem 3rem;
  padding: 0.55rem;
  border-radius: var(--radius);
  background: var(--lac);
  box-shadow: 0 22px 44px -30px rgb(90 30 10 / 0.6);
}
.folio__margin { display: grid; place-items: center; }
.folio__stud { width: 1.35rem; height: 1.35rem; box-shadow: 0 0 0 2px var(--lac), 0 0 0 3.5px var(--gold); }

.folio__page {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 2.75rem 3rem;
  border-radius: 3px;
  background: var(--surface);
  /* the folio's double rule: gold, then red */
  box-shadow:
    inset 0 0 0 7px var(--surface),
    inset 0 0 0 8px var(--gold),
    inset 0 0 0 11px var(--surface),
    inset 0 0 0 12.5px var(--lac);
}

.folio__motto { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.75rem; margin: 0 0 0.9rem; }
.folio__motto [lang="sa"] { color: var(--lac); font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.folio__gloss { color: var(--muted); font-family: var(--font-ui); font-size: 0.95rem; }
.folio__title {
  margin: 0;
  font-size: clamp(2.6rem, 6.5vw, 4.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}
.folio__title-hi { color: var(--lac); font-size: 0.5em; font-weight: 600; white-space: nowrap; }
.folio__subtitle {
  display: block;
  margin-top: 0.55rem;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}
.folio__tagline { max-width: 32rem; margin: 1rem 0 1.1rem; color: var(--muted); font-size: 1.2rem; line-height: 1.55; }
.folio__byline { margin: 0; font-family: var(--font-ui); font-size: 1.05rem; }
.folio__byline a { color: var(--ink); font-weight: 600; text-decoration-color: var(--gold); }
.folio__byline--also { margin-top: 0.2rem; color: var(--muted); font-size: 0.98rem; }

/* The portrait sits where a pothi's string hole would be: a lotus of gold rays around it. */
.folio__roundel {
  display: block;
  width: clamp(9rem, 19vw, 12.5rem);
  aspect-ratio: 1;
  padding: 0.8rem;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--gold) 0 4deg, var(--lac) 4deg 12deg);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4.5px var(--gold);
  transition: transform 0.3s;
}
.folio__roundel:hover { transform: rotate(-4deg) scale(1.02); }
.folio__roundel img,
.folio__roundel .avatar--placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  border: 4px solid var(--surface);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1.5px var(--gold);
}

/* ---------- The Das Lakshan track: ten roundels, one per virtue ---------- */

.track { margin: 0 0 3.5rem; }
.track__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 1.1rem;
}
.track__title { margin: 0; color: var(--lac); font-size: 1.45rem; }
.track__note { margin: 0; color: var(--muted); font-family: var(--font-ui); font-size: 0.95rem; }

.track__list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* the thread through the folios */
.track__list::before {
  content: "";
  position: absolute;
  top: 1.35rem;
  left: 5%;
  right: 5%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 6px, transparent 6px 11px);
}
.track__item { position: relative; text-align: center; }
.track__link { display: grid; justify-items: center; gap: 0.2rem; padding: 0 0.1rem; color: inherit; text-decoration: none; }
.track__roundel { margin-bottom: 0.45rem; } /* room for the lit ring above the label */
.track__roundel {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.7rem;
  aspect-ratio: 1;
  border: 1.5px dashed var(--gold);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}
.track__name { color: var(--muted); font-size: 0.98rem; line-height: 1.3; }
.track__en { color: var(--muted); font-family: var(--font-ui); font-size: 0.74rem; line-height: 1.2; }

/* Written days are lit, like lamps. */
.track__item.is-written .track__roundel {
  border: 0;
  background: var(--lac);
  color: var(--gold-light);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--gold), 0 0 20px 2px rgb(222 150 50 / 0.45);
  animation: lamp 0.6s ease-out both;
  animation-delay: calc(var(--i) * 90ms);
}
.track__item.is-written .track__name { color: var(--ink); font-weight: 600; }
.track__item.is-written .track__link:hover .track__roundel { background: var(--lac-deep); transform: scale(1.06); }
.track__item.is-written .track__link:hover .track__name { color: var(--vermilion); }
.track__item.is-current .track__roundel { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5.5px var(--lapis), 0 0 20px 2px rgb(222 150 50 / 0.45); }
.track__item.is-current .track__name { color: var(--lapis); }

@keyframes lamp {
  from { opacity: 0.35; transform: scale(0.85); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--gold), 0 0 0 0 rgb(222 150 50 / 0); }
}

.track--compact { margin: 2rem 0 0; padding: 1.25rem 1.25rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.track--compact .track__title { font-size: 1.1rem; }
.track--compact .track__note { font-size: 0.88rem; }
.track--compact .track__roundel { width: 2.2rem; font-size: 0.92rem; }
.track--compact .track__list::before { top: 1.1rem; }
.track--compact .track__name { font-size: 0.85rem; }
.track--compact .track__en { display: none; }

/* ---------- Home: essays ---------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.section-head h2 { margin: 0; font-size: 1.6rem; }
.section-head__note { margin: 0; color: var(--muted); font-family: var(--font-ui); font-size: 0.95rem; }

.card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  padding: 1.6rem 1.75rem 1.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
/* double rule along the top edge, red over gold */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(var(--lac) 0 3px, transparent 3px 4px, var(--gold) 4px 5px);
}
.card:hover {
  border-color: var(--gold);
  box-shadow: 0 14px 30px -20px rgb(122 50 20 / 0.45);
  transform: translateY(-2px);
}
.card:focus-within { border-color: var(--lapis); }

.card--featured { grid-column: 1 / -1; padding: 2.1rem 2.4rem 1.8rem; }

.card__title { margin: 0.8rem 0 0.3rem; font-size: 1.45rem; line-height: 1.3; }
.card--featured .card__title { font-size: clamp(1.75rem, 4vw, 2.35rem); }
.card__title:lang(hi) { line-height: 1.45; }
.card__title a { color: var(--heading); text-decoration: none; }
.card__title a:focus-visible { outline: none; }
/* The whole card is clickable through the title link. */
.card__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card:hover .card__title a { color: var(--lac); }

.card__translation { margin: 0 0 0.6rem; color: var(--lapis); font-family: var(--font-serif); font-size: 1rem; font-style: italic; }
.card__excerpt { margin: 0; line-height: 1.65; }
.card__excerpt:lang(hi) { line-height: 1.9; }
.card--featured .card__excerpt { font-size: 1.12rem; max-width: 46rem; }

.card__foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.1rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--rule);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.92rem;
}
.card__cta { color: var(--vermilion); font-weight: 600; white-space: nowrap; }

.about { margin-top: 4.5rem; }
.about h2 { margin: 0 0 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule); font-size: 1.6rem; }
.about__authors { display: grid; gap: 2rem; }

/* ---------- Author card ---------- */

.author { display: flex; align-items: center; gap: 1.75rem; }
.author__text { min-width: 0; }
.author__name { margin: 0 0 0.3rem; color: var(--heading); font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.author__bio { margin: 0; }
.author__bio--placeholder {
  padding: 0.6rem 0.9rem;
  border: 1px dashed var(--gold);
  border-radius: var(--radius);
  background: var(--paper-deep);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.author--compact {
  gap: 1.1rem;
  margin-top: 3rem;
  padding: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.author--compact .avatar { width: 4rem; height: 4rem; }
.author--compact .avatar--placeholder { font-size: 1.25rem; }
.author--compact .author__name { font-size: 1.1rem; }
.author--compact .author__bio { font-size: 1rem; }

/* ---------- Post ---------- */

.back-link {
  display: inline-block;
  margin-top: 2.5rem;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 1rem;
  text-decoration: none;
}
.back-link:hover { color: var(--lac); }
.back-link--bottom { margin-top: 3rem; }

.post__header { padding: 1.75rem 0 1.75rem; border-bottom: 1px solid var(--rule); }
.post__title {
  margin: 1rem 0 0.75rem;
  font-size: clamp(2.2rem, 6vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.post__title:lang(hi) { line-height: 1.35; }
.post__dek { margin: 0 0 1.25rem; color: var(--muted); font-size: 1.2rem; line-height: 1.6; }
.post__dek:lang(hi) { line-height: 1.85; }
.post__byline-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; }
.post__byline { margin: 0; font-family: var(--font-ui); color: var(--muted); }
.post__cover { margin: 2rem 0 0; }
.post__cover img { display: block; width: 100%; max-height: 28rem; object-fit: cover; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--gold), 0 0 0 5px var(--surface), 0 0 0 6px var(--rule); }

/* The traditional end mark, ॥, between gold rules. */
.post__end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 3rem 0 0;
  color: var(--lac);
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1;
}
.post__end::before, .post__end::after { content: ""; flex: 0 1 5rem; height: 1px; background: var(--gold); }

/* ---------- Prose (post body) ---------- */

.prose { padding-top: 0.5rem; }
.prose > :first-child { margin-top: 1.75rem; }
.prose p { margin: 1.25em 0; }
.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin: 2.3em 0 0.5em;
  font-size: 1.55rem;
  line-height: 1.35;
}
.prose h2::before { width: 0.5em; height: 0.5em; transform: translateY(-0.1em); }
.prose h3 { margin: 1.8em 0 0.4em; font-size: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 0.4em 0; }
.prose li::marker { color: var(--lac); }
.prose strong { font-weight: 650; color: var(--heading); }

/* Opening invocation (प्रिय जन / ॐ नमः …), set apart like a manuscript's opening lines */
.prose .invocation {
  position: relative;
  margin: 2rem 0 2.25rem;
  padding: 1.6rem 1rem 1.2rem;
  border-block: 1px solid var(--rule);
  color: var(--lac);
  font-family: var(--font-display);
  font-size: 1.12em;
  line-height: 1.85;
  text-align: center;
}
.prose .invocation::before {
  position: absolute;
  top: -0.45rem;
  left: 50%;
  width: 0.9rem;
  height: 0.9rem;
  translate: -50% 0;
}

/* Quotations and verses: a text panel with a red double rule, as in the folios */
.prose blockquote {
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-left: 5px double var(--lac);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--paper-deep);
}
/* Only Latin text gets italics; Devanagari would get a fake slant. */
.prose blockquote:lang(en) { font-style: italic; }
.prose blockquote p { margin: 0.5em 0; }

/* Verses: wrap in <div class="verse" lang="pra|sa|hi"> with a Markdown quote inside. */
.prose .verse blockquote {
  font-style: normal;
  font-size: 1.15em;
  line-height: 2;
  text-align: center;
  border: 0;
  border-block: 4px double var(--gold);
  border-radius: 0;
  background: transparent;
}

.prose hr { width: 30%; margin: 3rem auto; border: 0; border-top: 2px dotted var(--gold); }

.prose figure { margin: 2rem 0; }
.prose img { display: block; margin-inline: auto; border-radius: var(--radius); }
.prose figcaption { margin-top: 0.5rem; color: var(--muted); font-family: var(--font-ui); font-size: 0.9rem; text-align: center; }

.translation-note {
  margin: 1.75rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--lapis);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--lapis-wash);
  color: var(--lapis);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ---------- Post footer: likes, share, navigation ---------- */

.post__footer {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.like, .share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  font-family: var(--font-ui);
}
.like__label, .share__label { color: var(--muted); }
.share { gap: 0.5rem; }
.share__label { margin-right: 0.5rem; }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
}
.post-nav__link {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}
.post-nav__link:hover { border-color: var(--gold); text-decoration: none; }
.post-nav__link--newer { grid-column: 2; text-align: right; }
.post-nav__label { color: var(--muted); font-family: var(--font-ui); font-size: 0.9rem; }
.post-nav__title { color: var(--heading); font-family: var(--font-display); font-weight: 600; line-height: 1.4; }

/* ---------- Comments ---------- */

.comments { margin-top: 3.5rem; }
.comments h2 { margin: 0 0 1rem; font-size: 1.45rem; }
.comments__status { margin: 0 0 1.5rem; color: var(--muted); font-family: var(--font-ui); }

.comment-list { display: grid; gap: 1rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.comment-list:empty { display: none; }
.comment {
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.comment-list--replies { margin: 1rem 0 0; }
.comment-list--replies .comment { border-left: 3px solid var(--gold); background: var(--paper); }

.comment__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
  margin: 0 0 0.35rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
}
.comment__name { color: var(--heading); font-weight: 600; }
.comment__badge {
  padding: 0 0.5rem;
  border-radius: 3px;
  background: var(--lac);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 600;
}
.comment__date { color: var(--muted); }
.comment__body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.7; }

.comment-form {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.comment-form__title { margin: 0; font-size: 1.2rem; }
.comment-form__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.comment-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.comment-form__note { color: var(--muted); font-family: var(--font-ui); font-size: 0.9rem; }
.comment-form__message { margin: 0; font-family: var(--font-ui); }
.comment-form__message:empty { display: none; }
.comment-form__message[data-tone="success"] { color: #2F6B3A; }
.comment-form__message[data-tone="error"] { color: var(--lac-deep); }

.field { display: grid; gap: 0.35rem; }
.field__label { color: var(--muted); font-family: var(--font-ui); font-size: 0.95rem; font-weight: 500; }
.field__hint { color: var(--muted); font-family: var(--font-ui); font-size: 0.9rem; line-height: 1.5; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field :is(input, textarea, select):focus { outline: 2px solid var(--lapis); outline-offset: 1px; border-color: transparent; }
.field :is(input, textarea):lang(hi) { font-family: var(--font-deva); line-height: 1.9; }
.field input[readonly] { background: var(--paper-deep); color: var(--muted); }

/* ---------- Admin ---------- */

.admin { padding-block: 2rem 1rem; }
.admin__title { margin: 0; font-size: 2rem; }
.admin__user { margin: 0.25rem 0 1.5rem; color: var(--muted); font-family: var(--font-ui); }
.admin__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.admin__tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.admin__tabs [aria-pressed="true"] { border-color: var(--lac); background: var(--lac); color: var(--paper); }
.admin__message { min-height: 1.5em; margin: 0 0 1rem; color: var(--muted); font-family: var(--font-ui); }
.admin__list { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.admin-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-family: var(--font-ui); }
.admin-nav a { color: var(--muted); text-decoration: none; }
.admin-nav a:hover, .admin-nav a[aria-current="page"] { color: var(--lac); }
.admin-nav a[aria-current="page"] { font-weight: 600; }

.admin-item { padding: 1.25rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.admin-item--author { border-left: 3px solid var(--gold); }
.admin-item__post { margin: 0 0 0.5rem; font-family: var(--font-ui); font-size: 0.95rem; }
.admin-item__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.admin-post__title { margin: 0 0 0.35rem; color: var(--heading); font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; line-height: 1.4; }
.admin-reply { display: grid; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }

.status { padding: 0 0.5rem; border-radius: 3px; font-size: 0.8rem; font-weight: 600; }
.status--live { background: #E3F0E3; color: #2F6B3A; }
.status--draft { background: var(--paper-deep); color: var(--muted); }
.status--pending { background: var(--lapis-wash); color: var(--lapis); }

/* ---------- Write a post ---------- */

.write-form { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
.field-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.field__label-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.field__hint code { font-size: 0.85em; background: var(--paper-deep); padding: 0 0.25em; border-radius: 4px; }
.write-form textarea[name="body"] { min-height: 22rem; }

.choice-group { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; border: 0; }
.choice-group legend { width: 100%; margin-bottom: 0.35rem; padding: 0; }
.choice { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-ui); font-size: 1.05rem; cursor: pointer; }
.choice input { accent-color: var(--lac); width: 1.1rem; height: 1.1rem; }

.slug-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}
.slug-input:focus-within { outline: 2px solid var(--lapis); outline-offset: 1px; }
.slug-input__prefix { display: flex; align-items: center; padding-left: 0.8rem; color: var(--muted); font-family: var(--font-ui); }
.field .slug-input input { border: 0; border-radius: 0; padding-left: 0.1rem; outline: none; }

.photo-preview { display: block; max-width: 100%; max-height: 16rem; margin: 0.25rem 0 0.5rem; border-radius: var(--radius); border: 1px solid var(--rule); }
.photo-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.photo-pick:focus-within { outline: 2px solid var(--lapis); outline-offset: 2px; }

.write-translation { padding: 1rem 1.25rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.write-translation[open] { display: grid; gap: 1rem; }
.write-translation summary { color: var(--lapis); font-family: var(--font-ui); font-weight: 600; cursor: pointer; }
.write-translation .field__hint { margin: 0; }

.write-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0;
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.write-actions .button--primary { margin-left: auto; }
.write-status { margin: 0; }
.write-danger { margin: 0; }

.write-restore {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: var(--paper-deep);
  font-family: var(--font-ui);
}
.write-restore p { margin: 0; flex: 1 1 16rem; }

.write-preview {
  margin-top: 2.5rem;
  padding: 1.5rem 1.75rem 2rem;
  border: 2px dashed var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

/* ---------- 404 ---------- */

.not-found { padding-block: 4rem 2rem; }
.not-found h1 { margin: 0.5rem 0 1rem; font-size: clamp(2rem, 6vw, 2.75rem); }

/* ---------- Page transitions ---------- */

/* Cross-fade between pages; a card's title glides into the post heading
   (matching view-transition-name). Browsers without support navigate normally. */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  .card, .card:hover, .folio__roundel, .folio__roundel:hover { transition: none; transform: none; }
  .track__item.is-written .track__roundel { animation: none; }
}

/* ---------- Small screens ---------- */

@media (max-width: 52rem) {
  .card-list { grid-template-columns: 1fr; }
}

@media (max-width: 40rem) {
  body { font-size: 1.0625rem; }

  .folio { grid-template-columns: 0.9rem 1fr 0.9rem; margin-block: 1.5rem 2.25rem; padding: 0.4rem; }
  .folio__stud { display: none; }
  .folio__page { grid-template-columns: 1fr; justify-items: center; gap: 1.25rem; padding: 2rem 1.4rem 1.75rem; text-align: center; }
  .folio__roundel { order: -1; width: 8.5rem; }
  .folio__motto { justify-content: center; }
  .folio__tagline { margin-inline: auto; font-size: 1.08rem; }

  .track__list { grid-template-columns: repeat(5, 1fr); row-gap: 1rem; }
  .track__list::before { display: none; }
  .track--compact { padding: 1rem 0.75rem 0.75rem; }

  .card, .card--featured { padding: 1.4rem 1.25rem 1.2rem; }
  .card__title { font-size: 1.3rem; }
  .card__cta { display: none; }
  .author { align-items: flex-start; }
  .author--full .avatar { width: 5rem; height: 5rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav__link--newer { grid-column: auto; }
  .field-row { grid-template-columns: 1fr; }
  .write-preview { padding: 1.25rem; }
}

@media print {
  .site-header, .site-footer, .post__footer, .post-nav, .comments, .back-link, .track { display: none; }
  body { background: #fff; }
}
