/* Palette taken from the mineral pigments of Newar paubha painting */
:root {
  color-scheme: light;
  --sindur: #b3241a;        /* cinnabar ground */
  --sindur-deep: #8a1a12;
  --kaolin: #f6f0e4;        /* kaolin white */
  --kaolin-2: #ece3d1;
  --lampblack: #1c1714;
  --lapis: #25336e;
  --malachite: #4e8c76;
  --orpiment: #e8a93a;
  --gold: #d9b25f;
  --ink: #221a15;
  --ink-soft: #5d4b3f;
  --on-red: #fbefd9;
  --on-red-soft: #f0cdb9;
  --display: "Rozha One", "Tiro Devanagari Hindi", Georgia, serif;
  --text: "Tiro Devanagari Hindi", Georgia, serif;
  --gutter: clamp(16px, 4vw, 44px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--kaolin); color: var(--ink);
  font-family: var(--text); font-size: 18px; line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--orpiment); outline-offset: 3px; }
h1, h2, h3 { font-weight: 400; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
html[lang="ne"] .t-en, html:not([lang="ne"]) .t-ne { display: none !important; }

.wrap { max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.label { font-style: italic; font-size: 0.95rem; }

/* paubha border: thin bands of pigment between registers */
.border-band { height: 14px; background:
  linear-gradient(var(--gold) 0 2px, var(--lapis) 2px 6px, var(--malachite) 6px 9px, var(--orpiment) 9px 12px, var(--lampblack) 12px 14px); }

/* ---------- header ---------- */
.top { background: var(--sindur); color: var(--on-red); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; border-bottom: 2px solid var(--gold); }
.top .wrap { display: flex; align-items: center; gap: 18px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand img { width: 44px; height: 44px; object-fit: contain; background: var(--kaolin); border-radius: 50%; padding: 3px; }
.brand b { font-family: var(--display); font-weight: 400; font-size: 1.25rem; line-height: 1; display: block; }
.brand small { font-size: 0.8rem; color: var(--on-red-soft); }
.lang { font-size: 0.95rem; white-space: nowrap; }
.sections { display: flex; gap: 4px 20px; font-size: 0.98rem; white-space: nowrap; }
.sections a { color: var(--on-red-soft); text-decoration: none; padding: 4px 0 2px; border-bottom: 2px solid transparent; }
.sections a:hover { color: var(--on-red); }
.sections a[aria-current="true"] { color: var(--on-red); border-bottom-color: var(--orpiment); }
section[id], .qr-panel { scroll-margin-top: 72px; }
.qr-panel { scroll-margin-top: 96px; }
.lang button { font: inherit; color: var(--on-red-soft); background: none; border: 0; padding: 2px 4px; cursor: pointer; }
.lang button[aria-pressed="true"] { color: var(--on-red); text-decoration: underline; text-decoration-color: var(--orpiment); text-underline-offset: 5px; text-decoration-thickness: 2px; }

/* ---------- Nepali text: Noto Serif Devanagari ---------- */
:root :lang(ne) { font-family: "Noto Serif Devanagari", "Tiro Devanagari Hindi", serif; }
:root :is(h1, h2, h3, dt, b, .num):lang(ne) { font-weight: 700; }
:root .facts .num:lang(ne), :root .steps li:lang(ne)::before { font-family: "Noto Serif Devanagari", serif; font-weight: 700; }
/* Noto has no italic, so text that is italic in English stands upright in Nepali */
:root :is(.sub, .label, figcaption, .intro, .account dt, .video p, .lamp-key, .why, .steps span):lang(ne) { font-style: normal; }
:root [lang="en"] { font-family: var(--text); }   /* the English-only QR box keeps its fonts */
.btn {
  display: inline-block; font: inherit; font-size: 1rem; text-decoration: none; cursor: pointer;
  padding: 9px 20px 7px; border-radius: 2px; border: 2px solid var(--lampblack);
  background: var(--orpiment); color: var(--lampblack);
}
.btn:hover { background: #f2b94f; }
.btn-line { background: transparent; color: inherit; border-color: currentColor; }
.btn-line:hover { background: rgba(255,255,255,.08); }

/* ---------- hero: the painting ---------- */
.hero { color: var(--on-red); background: var(--sindur); position: relative; isolation: isolate; overflow: hidden; }
/* a night photograph under a deep red wash, so the text stays easy to read */
.hero::before, .hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.hero::before { z-index: -2; background: url("assets/photos/kartik-nach-1.webp") center 38% / cover; transition: transform 2.6s cubic-bezier(.2, .7, .2, 1); }
.hero::after { z-index: -1; background: linear-gradient(100deg, rgba(122, 22, 15, .95) 0%, rgba(160, 32, 23, .88) 48%, rgba(110, 18, 12, .82) 100%); transition: opacity 1.1s ease; }
.hero .wrap > * { transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.hero .wrap > .shrine { transition-delay: .25s; }
.hero .wrap > .hero-text { transition-delay: .45s; }
.hero .wrap > .qr-panel { transition-delay: .7s; }
/* opening moment: the photograph alone, then the words and the donate box arrive */
html.opening .hero::after { opacity: .12; }
html.opening .hero::before { transform: scale(1.06); }
html.opening .hero .wrap > * { opacity: 0; transform: translateY(16px); }
.hero .wrap {
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 330px;
  gap: clamp(24px, 3.5vw, 48px); align-items: start;
  padding-block: clamp(32px, 5vw, 64px) clamp(40px, 6vw, 72px);
}
.shrine {
  border: 2px solid var(--gold); border-radius: 125px 125px 2px 2px; padding: 10px;
  background: var(--sindur-deep);
}
.shrine img { border-radius: 115px 115px 0 0; width: 100%; height: auto; background: var(--lampblack); }
.shrine figcaption { font-size: 0.82rem; font-style: italic; color: var(--on-red-soft); text-align: center; padding-top: 8px; line-height: 1.4; }
.hero h1 { font-family: var(--display); font-size: clamp(3.6rem, 7.5vw, 6.4rem); line-height: 1.05; color: #fff4dd; }
.hero .sub { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-style: italic; margin-top: 6px; color: var(--orpiment); }
.hero .lede { margin-top: 22px; max-width: 32em; }
.hero .lede + .lede { margin-top: 14px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero .btn-line { color: var(--on-red); }

.qr-panel { background: var(--kaolin); color: var(--ink); padding: 20px 20px 18px; border: 2px solid var(--gold); outline: 6px solid var(--lampblack); }
.qr-panel h2 { font-family: var(--display); font-size: 1.7rem; }
.qr-panel .hint { font-size: 0.92rem; color: var(--ink-soft); margin-top: 2px; line-height: 1.4; }
.qr-panel .qr { background: #fff; padding: 10px; margin-top: 14px; border: 1px solid var(--kaolin-2); }
.qr-panel .qr img { width: 100%; height: auto; image-rendering: pixelated; }
.payee { margin-top: 12px; font-size: 0.95rem; line-height: 1.35; }
.payee b { display: block; letter-spacing: 0.02em; }
.payee span { color: var(--ink-soft); font-size: 0.88rem; }
.qr-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 0.92rem; }
.qr-links a, .qr-links button { font: inherit; color: var(--sindur); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* bank transfer, shown under the QR */
.qr-bank { margin-top: 14px; border-top: 1px solid var(--kaolin-2); padding-top: 10px; font-size: 0.92rem; }
.qr-bank-head { color: var(--sindur); font-weight: 600; }
.qr-bank dl { margin: 8px 0 0; display: grid; gap: 6px; }
.qr-bank dl div { display: grid; grid-template-columns: 6.6em minmax(0, 1fr); gap: 8px; }
.qr-bank dt { color: var(--ink-soft); font-size: 0.85rem; }
.qr-bank dd { margin: 0; line-height: 1.35; }
.qr-bank .copy { color: var(--sindur); }

/* ---------- lamps: the night register ---------- */
.night {
  background: linear-gradient(rgba(28, 23, 20, .86), rgba(28, 23, 20, .95) 55%), url("assets/photos/IMG_6105.webp") center 30% / cover, var(--lampblack);
  color: #eadfcb; padding-block: clamp(56px, 8vw, 104px);
}
.night h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); color: #fff4dd; max-width: 16em; }
.night .intro { max-width: 36em; margin-top: 16px; color: #cbbba3; }
.lamps { display: grid; grid-template-columns: repeat(27, minmax(0, 1fr)); gap: 4px; margin-top: 44px; align-items: end; }
.lamp svg { width: 100%; height: auto; overflow: visible; }
.lamp .bowl { fill: #4a3b30; }
.lamp.lit .bowl { fill: var(--gold); }
.lamp .flame { display: none; transform-origin: 32px 30px; transform-box: view-box; }
.lamps.glow .lamp .flame { transition: opacity .6s ease var(--d, 0s); }
.lamps.glow .lamp .bowl { transition: fill .6s ease var(--d, 0s); }
/* the twelve lamps light one after another when the section comes into view */
html.motion .lamps:not(.glow) .lamp.lit .flame { opacity: 0; }
html.motion .lamps:not(.glow) .lamp.lit .bowl { fill: #4a3b30; }
.lamp.lit .flame { display: inline; }
/* the flame sways from its wick, its bright core licks upward, and the glow around it breathes */
.lamp .fire, .lamp .core, .lamp .halo { transform-box: view-box; transform-origin: 32px 29px; }
.lamp.lit .fire { animation: sway var(--sway, 1.6s) ease-in-out var(--off, 0s) infinite alternate; }
.lamp.lit .core { animation: lick var(--lick, .6s) ease-in-out var(--off, 0s) infinite alternate; }
.lamp.lit .halo { transform-origin: 32px 19px; animation: breathe calc(var(--sway, 1.6s) * 1.3) ease-in-out var(--off, 0s) infinite alternate; }
@keyframes sway {
  0%   { transform: rotate(-5deg) scale(.96, 1.04) skewX(3deg); }
  30%  { transform: rotate(3deg) scale(1.04, .92) skewX(-2deg); }
  55%  { transform: rotate(-2deg) scale(.94, 1.14) skewX(4deg); }
  80%  { transform: rotate(5deg) scale(1.02, .98) skewX(-4deg); }
  100% { transform: rotate(-1deg) scale(.97, 1.1) skewX(1deg); }
}
@keyframes lick { 0% { transform: scale(.85, .9); opacity: .8; } 100% { transform: scale(1.08, 1.18); opacity: 1; } }
@keyframes breathe { 0% { transform: scale(.85); opacity: .55; } 100% { transform: scale(1.12); opacity: 1; } }
@keyframes glimmer { 0%, 100% { opacity: 1; } 50% { opacity: .78; } }
.lamp-scale { display: grid; grid-template-columns: 12fr 15fr; gap: 4px; margin-top: 10px; font-size: 0.95rem; }
.lamp-scale div { border-top: 2px solid var(--orpiment); padding-top: 6px; color: var(--orpiment); }
.lamp-scale div + div { border-color: #5a4a3e; color: #a8977f; }

/* ---------- story ---------- */
.story { background: var(--kaolin-2); padding-block: clamp(56px, 8vw, 104px); }
.story .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); }
.story h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); color: var(--sindur); }
.story .col p + p { margin-top: 16px; }
.story .col > h2 + p { margin-top: 20px; }
.story .wrap + .wrap { display: block; margin-top: clamp(48px, 6vw, 80px); }

/* ---------- watch ---------- */
.watch { background: var(--kaolin-2); padding-block: clamp(56px, 8vw, 96px); }
.watch h2 { font-size: clamp(2rem, 4.6vw, 3rem); color: var(--lapis); }
.videos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 32px; }
.video { text-decoration: none; display: grid; gap: 10px; align-content: start; }
.video .thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--lampblack); max-width: 100%; }
.video .thumb img { width: 100%; height: 100%; object-fit: cover; }
.video .thumb img { transition: transform .5s cubic-bezier(.2,.7,.2,1), filter .3s ease; }
.video .thumb::after {
  content: "▶"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 54px; height: 38px; border-radius: 2px; display: grid; place-items: center; padding-left: 3px;
  color: #fff; background: rgba(28, 23, 20, .78); font-size: 1rem; transition: transform .2s ease, background .2s ease;
}
.video:hover .thumb img { transform: scale(1.04); filter: brightness(1.08); }
.video:hover .thumb::after { transform: translate(-50%, -50%) scale(1.06); background: var(--sindur); }
.player .stage { width: min(94vw, 1100px, calc(78vh * 16 / 9)); }
.player .frame { aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--gold); }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px; flex-wrap: wrap; margin-top: 12px; color: #eadfcb; font-size: 0.98rem; }
.player .meta a { color: var(--orpiment); white-space: nowrap; }
.video h3 { font-size: 1.02rem; line-height: 1.4; }
.video:hover h3 { text-decoration: underline; }
.video p { font-size: 0.88rem; color: var(--ink-soft); font-style: italic; }

/* ---------- gallery: a night mosaic ---------- */
.gallery-sec { --gap: 12px; background: var(--lampblack); color: #eadfcb; padding-block: clamp(56px, 8vw, 104px); }
.gallery-sec h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); color: #fff4dd; }
.gallery-sec .intro { color: #cbbba3; margin-top: 12px; max-width: 36em; }
.gallery {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-top: 40px;
  /* one row is ~0.72 of a column, so a 1x2 cell fits a 2:3 portrait and a 2x2 cell fits a 3:2 landscape */
  grid-auto-rows: calc((min(100vw, 1180px) - 2 * var(--gutter) - 3 * var(--gap)) / 4 * 0.72);
}
.gallery button { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; overflow: hidden; background: #2a221c; cursor: zoom-in; }
.gallery .p { grid-row: span 2; }
.gallery .w { grid-column: span 2; grid-row: span 2; }
.gallery .f { grid-column: span 2; grid-row: span 4; outline: 2px solid var(--gold); outline-offset: 5px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .3s ease; }
.gallery button::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(217, 178, 95, 0); transition: box-shadow .3s ease; pointer-events: none; }
.gallery button:hover img { transform: scale(1.045); filter: brightness(1.08); }
.gallery button:hover::after { box-shadow: inset 0 0 0 2px rgba(217, 178, 95, .85); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(20, 15, 12, .94); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: min(94vw, 1600px); max-height: 86vh; width: auto; height: auto; }
.lightbox .lb-btn, .reader .lb-btn { position: fixed; font: inherit; font-size: 1rem; color: #fff4dd; background: rgba(28, 23, 20, .7); border: 1px solid var(--gold); padding: 8px 14px; cursor: pointer; }
.lightbox .lb-close { top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; }
.lb-btn.lb-close { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.lb-btn.lb-close:hover { background: var(--sindur); }
.lb-close svg { display: block; }
.lightbox .lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-cap { position: fixed; bottom: calc(40px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); width: min(90vw, 720px); text-align: center; color: #eadfcb; font-size: 0.95rem; line-height: 1.45; margin: 0; }
.lightbox .lb-cap b.unk { font-family: var(--text); font-style: italic; color: #8f8170; }
.lightbox .lb-cap b { font-family: var(--display); font-weight: 400; color: var(--orpiment); margin-right: 8px; }
.lightbox .lb-cap:empty { display: none; }
.lightbox.has-cap img { max-height: 74vh; margin-bottom: 8vh; }
.lightbox .lb-count { position: fixed; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); color: #cbbba3; font-size: 0.9rem; }

/* ---------- donors' register ---------- */
.register { background: var(--sindur); color: var(--on-red); padding-block: clamp(56px, 8vw, 104px); }
.register .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); }
.register h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); color: #fff4dd; }
.register .why { margin-top: 18px; max-width: 34em; }
.steps { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 16px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.steps li::before { content: counter(s); font-family: var(--display); font-size: 1.5rem; color: var(--orpiment); line-height: 1.2; }
html[lang="ne"] .steps li::before { content: counter(s, devanagari); }
.register figure { margin: 0 0 28px; }
.register figure img { width: 100%; height: auto; border: 2px solid var(--gold); }
.register figcaption { font-size: 0.88rem; font-style: italic; color: var(--on-red-soft); margin-top: 8px; }
.uses { margin: 0; padding: 0; list-style: none; border-top: 1px solid rgba(251, 239, 217, .4); }
.uses li { padding: 14px 0; border-bottom: 1px solid rgba(251, 239, 217, .4); }
.uses b { font-weight: 400; font-family: var(--display); font-size: 1.2rem; color: #fff4dd; display: block; }
.uses span { color: var(--on-red-soft); font-size: 0.95rem; }
.account { margin-top: 28px; font-size: 0.95rem; display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; }
.account dt { color: var(--on-red-soft); font-style: italic; }
.account dd { margin: 0; overflow-wrap: anywhere; }
.pay-head { margin-top: 28px; font-family: var(--display); font-size: 1.15rem; color: #fff4dd; }
.pay-head + .pay-head { margin-top: 0; }
.pay-head + .account, .pay-head + .pay-head + .account { margin-top: 10px; }
.acct-no { letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.copy { font: inherit; font-size: 0.85rem; color: var(--orpiment); background: none; border: 0; text-decoration: underline; cursor: pointer; margin-left: 8px; padding: 0; }
.register .btn { margin-top: 28px; }


/* ---------- tradition ---------- */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px clamp(24px, 3vw, 44px); margin: 24px 0 0; }
.facts > div { border-top: 2px solid var(--lapis); padding-top: 12px; }
.facts dt { font-family: var(--display); font-size: 1.3rem; color: var(--sindur); line-height: 1.25; }
.facts dd { margin: 8px 0 0; font-size: 0.98rem; }
.facts .num { font-family: var(--display); color: var(--lapis); }

/* ---------- shared ---------- */
.kicker { font-size: 0.92rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sindur); }
.programme .kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }   /* the countdown badge lines up with the heading when it wraps */
.programme .kicker .countdown { margin: 0; }
html[lang="ne"] .programme .kicker { margin-bottom: 16px; }   /* Devanagari vowel marks rise above the heading line and would touch the badge */

/* ---------- programme 2083 ---------- */
.programme { padding-block: clamp(56px, 8vw, 104px); }
.programme h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); color: var(--sindur); margin-top: 4px; }
/* countdown as a ticket stub: the number in a dark block with a lamp flame, a dotted tear line, then the label in red */
.countdown {
  display: inline-flex; align-items: stretch; margin: 4px 0 4px 12px; vertical-align: middle;
  font-size: 1rem; line-height: 1.2; color: #fff4dd; border-radius: 2px; overflow: hidden;
  box-shadow: 0 1px 0 var(--sindur-deep);
}
.countdown > span { display: flex; align-items: center; gap: 7px; }
.cd-num { background: var(--lampblack); padding: 4px 10px 2px 9px; font-family: var(--display); font-size: 1.4rem; line-height: 1; letter-spacing: 0; text-transform: none; }
.cd-label { background: var(--sindur); padding: 5px 12px 3px; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; }
.cd-num + .cd-label { border-left: 2px dotted rgba(255, 244, 221, .55); }
.cd-label:only-child { padding-left: 10px; }
/* the same flame as the lamps in the night section */
.countdown > :first-child::before {
  content: ""; flex: none; width: 9px; height: 14px; margin-top: -3px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='22 1 20 31'%3E%3Cpath d='M32 2 C37.8 13.5 40.8 21.5 36.9 27.7 C34.9 30.9 29.1 30.9 27.1 27.7 C23.2 21.5 26.2 13.5 32 2 Z' fill='%23e8a93a'/%3E%3Cpath d='M32 12 C34.9 18 36.2 22.6 34.2 26.2 C33.2 27.9 30.8 27.9 29.8 26.2 C27.8 22.6 29.1 18 32 12 Z' fill='%23fff1c7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.countdown[hidden] { display: none; }
.info-strip { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); border-bottom: 1px solid #d6c9b1; }
.info-strip li { padding: 14px 18px 16px 0; }
.info-strip li + li { padding-left: 18px; border-left: 1px solid #d6c9b1; }
.info-strip b { display: block; font-family: var(--display); font-weight: 400; color: var(--lapis); font-size: 1.05rem; }
.info-strip span { display: block; line-height: 1.45; }
.info-strip a { display: inline-block; margin-top: 4px; font-size: 0.92rem; color: var(--sindur); }
.nights { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 6), auto); grid-auto-flow: column; gap: 12px 24px; }
.nights li { display: grid; }   /* a card fills its row, so the two columns line up */
.nights button {
  width: 100%; display: grid; grid-template-columns: 34px 104px 96px minmax(0, 1fr) 14px; grid-template-areas: "n date img what go";
  align-items: center; gap: 14px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: #fffaf0; border: 1px solid #e2d6bf; padding: 10px 14px 10px 8px;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.nights button:hover { border-color: var(--gold); box-shadow: 0 6px 18px rgba(60, 30, 10, .10); transform: translateY(-1px); }
.nights .n { grid-area: n; font-family: var(--display); font-size: 1.5rem; color: var(--sindur); text-align: center; }
.nights .date { grid-area: date; }
.nights .date b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.08rem; line-height: 1.2; }
.nights small { display: block; color: var(--ink-soft); font-size: 0.86rem; line-height: 1.35; }
.nights img { grid-area: img; width: 96px; height: 64px; object-fit: cover; }
.nights .what { grid-area: what; }
.nights .what b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.15rem; line-height: 1.25; color: var(--lapis); }
.nights .go { grid-area: go; color: var(--sindur); font-size: 1.4rem; line-height: 1; }
.nights li.is-past button { opacity: .5; }
.nights li.is-tonight button { border: 2px solid var(--sindur); background: #fff1dc; }
/* Madhavanal: one row for its four nights, with each night's part listed */
.nights li.multi { grid-column: 1 / -1; grid-row: 1; }   /* full width across the top; nights 5–12 sit below in two columns */
.nights li.multi .n { font-size: 1.1rem; white-space: nowrap; }
.nights .parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed #e2d6bf; }
.nights .part { display: block; font-size: 0.84rem; line-height: 1.45; color: var(--ink-soft); }
.nights .part > span { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); gap: 0 6px; }   /* date column, then the part; long names wrap under the name, not the date */
.nights .part i { font-style: normal; color: var(--sindur); }
.nights .part.done { opacity: .5; }
.nights .part.is-now { color: var(--ink); font-weight: 700; }
.tonight { display: inline-block; margin-bottom: 3px; background: var(--sindur); color: #fff4dd; font-size: 0.75rem; padding: 1px 8px 0; letter-spacing: 0.06em; text-transform: uppercase; }
.note { margin-top: 18px; font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- history ---------- */
.story h2 { margin-top: 4px; }
.poster-link {
  margin-top: 28px; width: 100%; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; align-items: center;
  text-align: left; font: inherit; cursor: pointer; padding: 0; overflow: hidden;
  background: var(--lampblack); color: #eadfcb; border: 1px solid var(--lampblack); transition: border-color .2s ease;
}
.poster-link img { width: 170px; height: 112px; object-fit: cover; transition: filter .3s ease; }
.poster-link b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: #fff4dd; }
.poster-link small { display: block; font-size: 0.88rem; color: #cbbba3; padding-right: 14px; line-height: 1.4; }
.poster-link:hover { border-color: var(--gold); }
.poster-link:hover img { filter: brightness(1.12); }
.tl-head, .facts-head { font-family: var(--display); font-weight: 400; color: var(--lapis); }
.tl-head { font-size: 1.4rem; margin-bottom: 20px; }
.facts-head { font-size: clamp(1.5rem, 3vw, 2rem); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--gold), var(--sindur)); }
.timeline li { position: relative; padding-bottom: 18px; }
.timeline li::before { content: ""; position: absolute; left: -27px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--kaolin-2); border: 3px solid var(--gold); }
.timeline li.loss::before { border-color: #c0573f; }
.timeline li.now::before { background: var(--sindur); border-color: var(--sindur); box-shadow: 0 0 0 4px rgba(179, 36, 26, .2); }
.timeline .when { display: block; font-family: var(--display); font-size: 1.02rem; color: var(--sindur); }
.timeline li.loss .when { color: #a2402c; }
.timeline p { font-size: 0.97rem; margin-top: 2px; }

/* old photographs: a dark album page of white-bordered prints. Each row shares one height and every photo keeps its own shape (--r is its width / height) */
.archive-panel { background: var(--lampblack); color: #eadfcb; padding: clamp(24px, 4vw, 48px); border-top: 3px solid var(--sindur); }
.archive-panel .kicker { color: #a8977f; }
.archive-head { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 3.2vw, 2.3rem); color: #fff4dd; margin-top: 4px; }
.archive-intro { color: #cbbba3; font-size: 0.97rem; margin-top: 8px; max-width: 42em; }
.archive { display: grid; gap: 30px; margin-top: 28px; }
.archive-row { display: flex; gap: 18px; }
.archive figure { margin: 0; flex: var(--r, 1) 1 0; min-width: 0; }   /* width in proportion to shape, so the row shares one height */
.archive button { display: block; width: 100%; padding: 0; border: 6px solid #ece5d6; background: #ece5d6; box-shadow: 0 2px 4px rgba(0, 0, 0, .35); cursor: zoom-in; overflow: hidden; }
.archive img { width: 100%; height: auto; transition: opacity .2s ease; }
.archive button:hover img { opacity: .88; }
.archive-sub { font-family: var(--text); font-weight: 400; font-style: italic; font-size: 0.9rem; color: #a8977f; margin-top: 10px; padding-top: 18px; border-top: 1px solid #3a302a; }
.archive-undated { gap: 12px; margin-top: -16px; }
.archive-undated button { border-width: 4px; }
.archive-undated figcaption { display: none; }   /* the label above says it once; the viewer still shows it */
.archive figcaption { margin-top: 10px; font-size: 0.86rem; line-height: 1.45; color: #cbbba3; }
.archive figcaption b { display: block; font-family: var(--display); font-weight: 400; font-size: 0.98rem; color: #f3e8d2; }
.archive figcaption b.unk { font-family: var(--text); font-style: italic; font-size: 0.82rem; color: #8f8170; }

/* ---------- the stories ---------- */
.stories { background: var(--lampblack); color: #eadfcb; padding-block: clamp(56px, 8vw, 104px); }
.stories h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); color: #fff4dd; }
.stories .intro { color: #cbbba3; margin-top: 12px; max-width: 40em; }
.story-group { margin-top: clamp(40px, 5vw, 64px); }
.group-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px 40px; align-items: end; border-bottom: 1px solid #3a302a; padding-bottom: 14px; }
.group-head h3 { font-family: var(--display); font-weight: 400; font-size: clamp(1.35rem, 2.6vw, 1.8rem); color: var(--orpiment); }
.group-head p { color: #cbbba3; font-size: 0.95rem; }
.story-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.story-group:last-child .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.story-card {
  display: flex; flex-direction: column; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 0; overflow: hidden;
  background: #251e1a; border: 1px solid #3a302a; transition: border-color .2s ease, transform .25s ease;
}
.story-card img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.story-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.story-card:hover img { transform: scale(1.04); }
/* the body fills the card so the date tag sits at the bottom, level across a row */
.sc-body { display: flex; flex-direction: column; flex: 1; width: 100%; padding: 12px 14px 16px; }
.sc-body b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: #fff4dd; line-height: 1.25; }
.sc-body b i { font-style: normal; color: var(--orpiment); margin-right: 6px; }
.sc-body small { display: block; margin: 6px 0 10px; color: #cbbba3; font-size: 0.9rem; line-height: 1.45; }
.sc-body em { display: inline-block; align-self: flex-start; margin-top: auto; font-style: normal; font-size: 0.8rem; color: var(--lampblack); background: var(--orpiment); padding: 2px 8px 0; }

/* story reader */
.reader { border: 0; padding: 0; width: min(1120px, 96vw); max-width: 96vw; max-height: 92vh; background: var(--kaolin); color: var(--ink); overflow: hidden; }
.reader::backdrop { background: rgba(20, 15, 12, .88); }
.reader-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-height: 92vh; }
.reader-text { padding: clamp(24px, 4vw, 44px); overflow: auto; max-height: 92vh; }
.reader-text h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); color: var(--sindur); margin-top: 4px; }
#reader-body p { margin-top: 14px; }
.reader-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 16px; border-top: 1px solid #d6c9b1; }
.reader-nav button { font: inherit; background: none; border: 0; color: var(--lapis); cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; font-size: 0.95rem; line-height: 1.4; }
.reader-nav button[hidden] { display: none; }
#reader-prev { text-align: left; max-width: 48%; }
#reader-next { text-align: right; max-width: 48%; margin-left: auto; }
.reader-poster { background: var(--lampblack); display: flex; flex-direction: column; align-items: center; overflow: auto; max-height: 92vh; text-decoration: none; color: var(--orpiment); font-size: 0.92rem; padding-bottom: 14px; }
.reader-poster img { width: 100%; height: auto; display: block; }
.reader-poster > span { margin-top: 10px; text-decoration: underline; text-underline-offset: 3px; }
.reader .lb-close { position: absolute; top: 12px; right: 28px; }
/* while a story, photo or video is open, the page behind stays still */
html.modal-open, html:has(dialog[open]) { overflow: hidden; }
.reader, .reader-text, .reader-poster { overscroll-behavior: contain; }

/* ---------- tonight bar (festival nights only) ---------- */
.tonight-bar { background: var(--lampblack); color: #fff4dd; border-top: 1px solid var(--gold); font-size: 0.92rem; }
.tonight-bar .tb { max-width: 1180px; margin-inline: auto; padding: 7px var(--gutter); display: flex; align-items: center; gap: 10px 14px; }
.tonight-bar .tb-live { flex: none; display: inline-flex; align-items: center; gap: 7px; color: var(--orpiment); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; }
.tonight-bar .tb-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ff6b4a; box-shadow: 0 0 0 0 rgba(255, 107, 74, .6); animation: pulse 2s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(255, 107, 74, 0) } 100% { box-shadow: 0 0 0 0 rgba(255, 107, 74, 0) } }
.tonight-bar .tb-what { flex: 1; min-width: 0; line-height: 1.35; }
.tonight-bar .tb-what b { font-weight: 400; font-family: var(--display); font-size: 1.06em; letter-spacing: 0.01em; }
.tonight-bar .tb-read { flex: none; font: inherit; font-size: 0.85rem; cursor: pointer; background: var(--orpiment); color: var(--lampblack); border: 0; padding: 4px 12px 3px; }
.tonight-bar .tb-close { flex: none; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; background: none; border: 0; color: #cbbba3; cursor: pointer; }
.tonight-bar .tb-close:hover { color: #fff4dd; }

/* ---------- gallery: "see all" on phones ---------- */
.more-photos { display: none; color: #fff4dd; margin-top: 18px; }

/* ---------- gentle reveal while scrolling (only when JS runs and motion is welcome) ---------- */
html.motion .reveal { opacity: 0; }   /* script.js fades each one up as it scrolls into view */

footer { background: var(--lampblack); color: #cbbba3; padding-block: 36px 110px; font-size: 0.92rem; }
footer .wrap { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 24px 40px; }
.social { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.social a { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.social a span:not(.sr) { text-decoration: underline; text-decoration-color: rgba(234, 223, 203, .35); text-underline-offset: 3px; }
.social a:hover { color: #fff4dd; }
.social a:hover span { text-decoration-color: currentColor; }
.social svg { flex: none; color: var(--orpiment); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
footer b { color: #fff4dd; font-weight: 400; font-family: var(--display); font-size: 1.25rem; display: block; margin-bottom: 4px; }
footer .f-head { font-family: var(--display); font-size: 1rem; color: var(--orpiment); margin-bottom: 4px; }
footer .f-note { grid-column: 1 / -1; border-top: 1px solid #3a302a; padding-top: 18px; font-size: 0.86rem; color: #a8977f; }
footer a { color: #eadfcb; }
.trust { margin-top: 28px; padding: 16px 18px; border: 1px solid rgba(251, 239, 217, .45); font-size: 0.93rem; background: rgba(138, 26, 18, .35); }
.trust-head { font-family: var(--display); font-size: 1.15rem; color: #fff4dd; }
.trust ul { margin: 8px 0 12px; padding: 0; list-style: none; display: grid; gap: 3px; color: var(--on-red-soft); }
.trust li::before { content: "✓"; color: var(--orpiment); margin-right: 8px; }
.trust a { color: #fff4dd; }

/* back-to-top button: appears once you have scrolled past the first screen */
.to-top {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 31;
  width: 46px; height: 46px; border-radius: 2px; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: var(--lampblack); color: #fff4dd; border: 0; box-shadow: 0 2px 6px rgba(28, 23, 20, .3);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .3s ease, transform .3s ease, background .2s ease;
}
.to-top[hidden] { display: none; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--sindur); }
.to-top:focus-visible { outline: 3px solid var(--orpiment); outline-offset: 3px; }
.donate-bar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--lampblack); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 2px solid var(--gold); }
.donate-bar .btn { display: block; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--lampblack); color: #fff4dd; padding: 8px 16px; font-size: 0.92rem; z-index: 40; border: 1px solid var(--gold); }

.lamp-key { display: none; margin-top: 18px; font-size: 0.95rem; color: #cbbba3; }
.lamp-key i { color: var(--orpiment); font-style: normal; }

@media (max-width: 1060px) {
  .story-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero .wrap { grid-template-columns: minmax(0, 1fr) 320px; }
  .shrine { display: none; }
}
@media (max-width: 1000px) {
  .top .wrap { flex-wrap: wrap; row-gap: 4px; }
  .sections { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; gap: 28px; padding-bottom: 2px; justify-content: safe center; }
  .sections::-webkit-scrollbar { display: none; }
  section[id] { scroll-margin-top: 104px; }
  .qr-panel { scroll-margin-top: 124px; }
}
/* tablets and narrow laptops: the two programme columns are too slim for the wide row, so each card stacks date over title */
@media (max-width: 1100px) {
  .nights button { grid-template-columns: 30px minmax(0, 1fr) 88px; grid-template-areas: "n date img" "n what img"; gap: 2px 14px; padding: 10px 12px 10px 8px; }
  .nights img { width: 88px; height: 72px; }
  .nights .go { display: none; }
}
@media (max-width: 900px) {
  .nights { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
  .nights li.multi { grid-row: auto; }
}
@media (max-width: 820px) {
  .info-strip { grid-template-columns: 1fr; }
  .info-strip li { padding: 12px 0; }
  .info-strip li + li { padding-left: 0; border-left: 0; border-top: 1px solid #d6c9b1; }
  .group-head { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reader { overflow: auto; }
  .reader-inner { display: block; max-height: none; }
  .reader-text, .reader-poster { max-height: none; overflow: visible; }
  .reader-text { padding-top: 56px; }
  .reader .lb-close { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); }
  footer .wrap { grid-template-columns: 1fr 1fr; }
  footer .f-col:first-child { grid-column: 1 / -1; }
  .hero .wrap { display: flex; flex-direction: column; align-items: stretch; }
  .archive { display: flex; flex-wrap: wrap; gap: 24px 14px; }
  .archive-row { display: contents; }
  .archive-sub { flex-basis: 100%; }
  .archive-undated figure { flex-basis: calc(var(--r, 1) * 100px); }
  .archive figure { flex: var(--r, 1) 1 calc(var(--r, 1) * 130px); max-width: calc(var(--r, 1) * 240px); }
  .hero-text { display: contents; }
  .hero-text > * { order: 1; }
  .hero h1, .hero .sub { order: 0; }
  .qr-panel { order: 0; width: min(100%, 380px); margin: 6px auto 8px; }
  .story .wrap, .register .wrap { grid-template-columns: 1fr; }
  .videos, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lamps { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 10px 8px; }
  .lamp-scale { display: none; }
  .lamp-key { display: block; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .brand small, .top .btn { display: none; }
  .sections { justify-content: space-between; gap: 10px; font-size: 0.9rem; }
  .donate-bar { display: block; }
  .to-top { right: 14px; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); width: 44px; height: 44px; }   /* sits above the Donate by QR bar */
}
@media (max-width: 600px) {
  .gallery:not(.show-all) > button:nth-child(n+9) { display: none; }
  .more-photos { display: inline-block; }
  .gallery.show-all + .more-photos { display: none; }
  .tonight-bar .tb { gap: 8px; padding-block: 5px; font-size: 0.88rem; }
  .tonight-bar .tb-extra { display: none; }
  .tonight-bar .tb-what { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tonight-bar .tb-close { width: 24px; margin-right: -4px; }
  .reader { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; }
  .nights button { grid-template-columns: 28px minmax(0, 1fr) 76px; grid-template-areas: "n date img" "n what img"; gap: 2px 12px; padding: 10px; }
  .nights img { width: 76px; height: 76px; }
  .nights .go { display: none; }
  .nights li.multi .n { font-size: 0.95rem; }
  .nights .part > span { grid-template-columns: 3.9em minmax(0, 1fr); }
  .nights .parts { grid-template-columns: 1fr; }
  .story-group:last-child .story-grid { grid-template-columns: 1fr; }
  .poster-link { grid-template-columns: 110px minmax(0, 1fr); }
  .poster-link img { width: 110px; height: 96px; }
  .gallery-sec { --gap: 8px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense;
    grid-auto-rows: calc((100vw - 2 * var(--gutter) - var(--gap)) / 2 * 0.72); }
  .gallery .f { grid-row: span 4; outline-offset: 3px; }
}
@media (max-width: 460px) {
  .archive figure { flex-basis: max(calc(var(--r, 1) * 100px), 40%); }   /* never more than two prints to a row */
  .archive-undated figure { flex-basis: max(calc(var(--r, 1) * 70px), 28%); }   /* the small undated prints go three to a row */
  .archive button { border-width: 4px; }
  .archive figcaption { font-size: 0.8rem; }
  .archive-panel { padding: 22px 16px; margin-inline: calc(var(--gutter) * -1); }
  .story-grid { grid-template-columns: 1fr; }
  .story-card { flex-direction: row; }
  .story-card img { flex: 0 0 116px; width: 116px; aspect-ratio: auto; align-self: stretch; height: auto; min-height: 116px; }
  footer .wrap { grid-template-columns: 1fr; }
  .videos, .facts { grid-template-columns: 1fr; }
}
/* small phones: keep all six menu links and the language switch on screen */
@media (max-width: 400px) {
  .sections { gap: 6px; font-size: 0.84rem; }
}
@media (max-width: 340px) {
  .sections { font-size: 0.76rem; gap: 2px; }
  .brand { gap: 8px; }
  .brand b { font-size: 1.1rem; }
  .lang { font-size: 0.85rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gallery img { transition: none; }
  .lamp.lit .fire, .lamp.lit .core, .lamp.lit .halo { animation: none; }
  .lamp.lit .fire { animation: glimmer 2.4s ease-in-out var(--off, 0s) infinite; }   /* a gentle glimmer, no movement */
  .tonight-bar .tb-live::before { animation: none; }
  .to-top { transition: none; }
  .story-card, .story-card img, .archive img, .nights button, .poster-link img { transition: none; }
  .video .thumb img, .video .thumb::after { transition: none; }
}
