:root {
  color-scheme: light;
  --paper: #ffffff;
  --paper-2: #fbf9fc;
  --ink: #2a2329;
  --muted: #7a6f77;
  --accent: #6b2d5c;
  --tint: #f5eff7;
  --line: #ece6ee;
  --gold: #b08d4a;
  --gold-soft: rgba(176, 141, 74, 0.45);
  --pearl-edge: #e3d7e8;
  /* the soft lavender / peach / sage wash that the poem posters use */
  --wash: linear-gradient(155deg, #f3ecf8 0%, #fdf1e9 52%, #edf2ea 100%);
  --shadow: 0 16px 44px rgba(107, 45, 92, 0.14);
  --soft: 0 3px 14px rgba(107, 45, 92, 0.08);
  --ui: "Cormorant Garamond", "Noto Serif Devanagari", Georgia, serif;
  --poem: "Tiro Devanagari Hindi", "Noto Serif Devanagari", Georgia, serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 1.25rem;
  line-height: 1.75;
}
/* In Hindi, the whole page is set in the same gentle serif as the poems. */
html[lang="hi"] body { font-family: var(--poem); font-size: 1.15rem; }

[hidden] { display: none !important; }

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; border-radius: 4px;
}
.skip:focus { top: 1rem; }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* The one ornament: three small pearls (moti). */
.rule, h2::after, .foot::before {
  content: "";
  display: block;
  width: 8px; height: 8px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #f3ecf5 55%, #d8c8dc);
  box-shadow:
    0 0 0 1px var(--gold-soft),
    -22px 1px 0 -1px var(--pearl-edge),
    22px 1px 0 -1px var(--pearl-edge);
}

/* Header: only the language switch */
.top {
  position: relative; z-index: 2;   /* stays above the portrait's soft glow so taps always reach it */
  display: flex; align-items: center; justify-content: flex-end;
  padding: 1.1rem 1.25rem; max-width: 64rem; margin: 0 auto;
}

.lang {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px;
  padding: 2px; background: var(--paper);
}
.lang button {
  font: inherit; font-size: 0.95rem; line-height: 1; color: var(--muted);
  background: none; border: 0; border-radius: 999px; padding: 0.5rem 0.95rem;
  min-height: 2.25rem; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--tint); color: var(--accent); }

/* Layout */
main, .foot { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; }

section { padding: 3rem 0; }

h1, h2, h3 { font-weight: 400; line-height: 1.3; margin: 0; }
h2 { font-size: 1.75rem; text-align: center; margin-bottom: 1.75rem; letter-spacing: 0.01em; color: var(--accent); }
h2::after { margin-top: 0.9rem; }

/* Hero: her portrait first, then her name. */
.hero { position: relative; isolation: isolate; text-align: center; padding: 0.5rem 0 1.5rem; }
.hero::before {
  pointer-events: none;
  content: ""; position: absolute; z-index: -1; top: -1rem; left: 50%;
  width: min(36rem, 100%); height: 24rem; transform: translateX(-50%);
  background:
    radial-gradient(closest-side at 38% 50%, rgba(220, 200, 238, 0.5), transparent),
    radial-gradient(closest-side at 64% 56%, rgba(250, 218, 196, 0.45), transparent);
  filter: blur(14px);
}
.portrait {
  display: block; margin: 0 auto 2.4rem;
  width: clamp(11rem, 44vw, 16.5rem); height: auto; aspect-ratio: 1;
  border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 8px #fff, 0 0 0 9px var(--gold-soft), var(--shadow);
}
.eyebrow { margin: 0; color: var(--muted); letter-spacing: 0.22em; text-transform: uppercase; font-size: 0.85rem; }
html[lang="hi"] .eyebrow { letter-spacing: 0.1em; text-transform: none; font-size: 1rem; }
.name {
  font-family: var(--poem); font-size: clamp(2rem, 8.5vw, 3.5rem);
  line-height: 1.3; margin: 0.4rem 0 0; color: var(--accent);
}
html[lang="en"] .name { font-family: var(--ui); font-weight: 500; letter-spacing: 0.01em; }
.hero .rule { margin-top: 2rem; }

.note { text-align: center; color: var(--muted); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero > :not(.rule) { opacity: 0; animation: rise 1s ease forwards; }
  .hero > .rule { opacity: 0; animation: rise 1s ease 0.6s forwards; }
  .hero > :nth-child(2) { animation-delay: 0.2s; }
  .hero > :nth-child(3) { animation-delay: 0.4s; }
}

/* Poem cards: a picture of the poem, or a soft page with its first lines. */
.thumb {
  display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 3px; box-shadow: var(--soft);
  transition: box-shadow 0.3s ease;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

.thumb-text {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem 1.1rem; background: var(--wash); border-color: transparent;
}
.thumb-text::before {
  content: ""; position: absolute; inset: 7px; border: 1px solid var(--gold-soft);
  border-radius: 2px; pointer-events: none;
}
.excerpt {
  display: block; max-height: 100%; overflow: hidden;
  font-family: var(--poem); font-size: 0.9rem; line-height: 1.75; color: var(--accent);
  text-align: center; white-space: pre-line;
  -webkit-mask-image: linear-gradient(#000 62%, transparent);
  mask-image: linear-gradient(#000 62%, transparent);
}

.card, .feature {
  font: inherit; color: inherit; text-align: center; cursor: pointer;
  background: none; border: 0; padding: 0; width: 100%;
  transition: transform 0.3s ease;
}
.card:hover, .feature:hover { transform: translateY(-4px); }
.card:hover .thumb, .feature:hover .thumb { box-shadow: var(--shadow); }

.card .title { display: block; padding: 0.85rem 0.25rem 0; font-family: var(--poem); font-size: 1.1rem; line-height: 1.5; }

.today { text-align: center; }
.date { margin: -0.85rem 0 2rem; color: var(--muted); font-style: italic; }
.feature { max-width: 21rem; margin: 0 auto; display: block; }
.feature .thumb { box-shadow: var(--shadow); }
.feature .excerpt { font-size: 1.12rem; }
.feature .title { display: block; padding: 1.1rem 1rem 0.2rem; font-family: var(--poem); font-size: 1.5rem; color: var(--accent); }
.feature .cta { display: block; color: var(--accent); font-size: 1rem; letter-spacing: 0.08em; }

/* Search */
.tools { max-width: 38rem; margin: 0 auto 1rem; }
.search input {
  width: 100%; font: inherit; font-size: 1.05rem; color: inherit; text-align: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.7rem 1.25rem; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.search input::placeholder { color: var(--muted); }


.status { text-align: center; color: var(--muted); font-style: italic; min-height: 1.75em; margin: 0.75rem 0 1.75rem; }

.grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
}
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 2.5rem 1.5rem; }
  .excerpt { font-size: 0.95rem; }
}

/* Books */
.books {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem 2rem;
}
.books li { width: min(44%, 13.5rem); }
.book-card { margin: 0; text-align: center; }
.book-card img {
  display: block; width: 100%; height: auto; border-radius: 3px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.book-card figcaption { padding-top: 1rem; line-height: 1.5; }
.book-title { display: block; font-family: var(--poem); font-size: 1.15rem; }
.book-author { display: block; color: var(--muted); font-size: 1rem; font-style: italic; margin-top: 0.15rem; }

/* Footer */
.foot { text-align: center; color: var(--muted); padding-bottom: 4rem; }
.foot::before { margin-bottom: 1.5rem; }
.foot p { margin: 0; font-style: italic; }

/* Poem viewer */
.viewer {
  width: min(92vw, 44rem); max-height: 92vh; overflow: auto; padding: 1.25rem 1.5rem 2.5rem;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow);
}
.viewer.text-only { background: var(--wash); border-color: var(--gold-soft); }
.viewer::backdrop { background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(6px); }
.viewer img {
  display: block; max-width: 100%; height: auto; margin: 1.25rem auto;
  border: 1px solid var(--line); border-radius: 3px; box-shadow: var(--soft);
}
.viewer h3 { font-family: var(--poem); font-size: 1.8rem; text-align: center; padding: 0 2.75rem; color: var(--accent); }
.viewer-text {
  font-family: var(--poem); font-size: 1.35rem; line-height: 2.05; text-align: center;
  white-space: pre-wrap; margin-top: 1.5rem;
}
.viewer.text-only .viewer-text { color: var(--accent); }
.viewer-credit { text-align: center; color: var(--accent); font-family: var(--poem); margin: 1.75rem 0 0; }
.viewer-credit::before {
  content: ""; display: block; width: 3rem; height: 1px; background: var(--gold-soft); margin: 0 auto 1rem;
}
.close {
  position: sticky; top: 0; float: right; z-index: 1; font: inherit; font-size: 1.5rem; line-height: 1;
  width: 2.5rem; height: 2.5rem; color: var(--muted); cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: 50%;
}
.close:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
