/* Luke Advent
   Lapis night, bone paper, vermilion rubrics and lamplit gold.
   Display type is the Fell types (17th-century English), reading type is Alegreya. */

@font-face { font-family: "Fell"; src: url(fonts/IMFellEnglish-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Fell"; font-style: italic; src: url(fonts/IMFellEnglish-italic.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Fell SC"; src: url(fonts/IMFellEnglishSC-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Alegreya"; src: url(fonts/Alegreya-normal.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Alegreya"; font-style: italic; src: url(fonts/Alegreya-italic.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --night: #0c1440;
  --lapis: #1a2a7c;
  --lapis-2: #2d45a8;
  --ink: #221d2e;
  --ink-2: #4a4152;
  --bone: #f4ecdb;
  --bone-2: #e9dcc0;
  --bone-3: #dccaa6;
  --gold: #e9b85a;
  --lamp: #ffd27a;
  --red: #c4351a;
  --red-2: #a3260f;
  --muted: #776c5d;
  --read-size: 19px;
  --cw: min(94vw, calc((100svh - 175px) * .5263), 500px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bone) url(grain.png);
  background-blend-mode: multiply;
  font: 17px/1.55 "Alegreya", Georgia, serif;
  -webkit-font-smoothing: antialiased;
  animation: arrive .6s ease-out both;
}
@keyframes arrive { from { opacity: 0; } }
body::before { /* tone the grain down: it's applied at full strength via multiply otherwise */
  content: ""; position: fixed; inset: 0; z-index: -1; background: rgba(244, 236, 219, .9); pointer-events: none;
}
a { color: inherit; }
h1, h2, h3 { font-family: "Fell", Georgia, serif; font-weight: 400; line-height: 1.1; margin: 0; }
h2 { font-style: italic; font-size: 1.65rem; margin-bottom: .5rem; }
h2::first-letter { color: var(--red); }
p { margin: 0 0 .9em; }
.small { font-size: .88rem; }
.muted { color: var(--muted); }
.red { color: var(--red); }
.kicker {
  font-family: "Fell SC", Georgia, serif; letter-spacing: .14em; text-transform: lowercase;
  font-size: .95rem; margin: 0 0 .35rem;
}
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 1.02rem/1 "Fell SC", Georgia, serif; letter-spacing: .07em; text-transform: lowercase;
  padding: .82em 1.3em .78em; border-radius: 3px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform .12s, filter .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-ink { background: var(--ink); color: var(--bone); }
.btn-red { background: var(--red); color: #fff7ea; box-shadow: inset 0 -2px 0 var(--red-2); }
.btn-ghost { background: transparent; border-color: rgba(34, 29, 46, .35); color: var(--ink); }
.btn:hover { filter: brightness(1.08); }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.stack { display: grid; gap: .8rem; margin-top: 1rem; }
label { display: grid; gap: .3rem; font: .95rem "Fell SC", Georgia, serif; letter-spacing: .06em; text-transform: lowercase; color: var(--ink-2); }
label.inline { display: inline-flex; align-items: center; gap: .6rem; text-transform: none; letter-spacing: 0; font: 1rem "Alegreya", serif; color: var(--ink); }
input {
  font: 1.05rem "Alegreya", Georgia, serif; color: var(--ink);
  background: #fffaf0; border: 1px solid var(--bone-3); border-bottom: 2px solid var(--ink-2);
  border-radius: 3px 3px 0 0; padding: .65em .75em; width: 100%;
}
input[type=time] { width: auto; padding: .45em .6em; }
input:focus { outline: none; border-bottom-color: var(--red); background: #fff; }

/* ---------- panels (printed card stock with a hairline frame) ---------- */
.panel {
  position: relative; max-width: 34rem; margin: 1.4rem auto; padding: 1.6rem 1.5rem 1.4rem;
  background: #fbf5e8; border-radius: 2px;
  box-shadow: 0 1px 1px rgba(60, 40, 10, .08), 0 12px 30px -16px rgba(60, 40, 10, .35);
}
.panel::before {
  content: ""; position: absolute; inset: 6px; border: 1px solid rgba(34, 29, 46, .16);
  pointer-events: none; border-radius: 1px;
}
main { padding: 0 1rem; }

/* ---------- home: the night band ---------- */
.night {
  position: relative; color: var(--bone); text-align: center; padding-bottom: 2.2rem;
  background: radial-gradient(120% 70% at 50% 0%, #1d2e86 0%, var(--night) 62%) var(--night);
}
.night::after { /* deckled paper edge where the night meets the page */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 18px;
  background: var(--bone);
  -webkit-mask: radial-gradient(9px 10px at 9px 0, transparent 98%, #000) -9px 0 / 18px 18px repeat-x;
  mask: radial-gradient(9px 10px at 9px 0, transparent 98%, #000) -9px 0 / 18px 18px repeat-x;
}
.masthead { padding: max(env(safe-area-inset-top), 14px) 1rem 6px; }
.masthead .kicker { color: var(--gold); margin-bottom: 0; font-size: .85rem; }
.wordmark { font-size: 2.6rem; letter-spacing: .01em; line-height: 1; margin: .05em 0 .1em; }
.w-luke { font-style: italic; }
.w-advent { font-family: "Fell SC", serif; font-size: .62em; letter-spacing: .12em; color: var(--lamp); vertical-align: .18em; }
.strap { font-style: italic; font-size: .95rem; color: rgba(244, 236, 219, .68); margin: 0; line-height: 1.35; }
.strap br { display: none; }
@media (min-width: 40rem) {
  .wordmark { font-size: 3.6rem; }
  :root { --cw: min(94vw, calc((100svh - 250px) * .5263), 500px); }
  .strap br { display: inline; }
}

/* ---------- the calendar card ---------- */
.stage { perspective: 1300px; padding: 12px 0 0; overflow: hidden; }
.scene {
  position: relative; height: calc(var(--cw) * 1.9); overflow: hidden;
  background: linear-gradient(#0a1038, #1a2a7c 40%, #3550b4 62%, #060a2a 88%);
}
/* The art is a 3200x760 strip; the phone calendar is its middle 400 units, so it is
   always centred and the town and hills carry on to the edges of any screen. */
.scene-inner {
  position: absolute; top: 0; left: 50%; height: 100%; aspect-ratio: 3200 / 760;
  transform: translateX(-50%); font-size: calc(var(--cw) * .043);
  -webkit-user-select: none; user-select: none;
}
.scene::after { /* a soft dusk at the far edges keeps the eye on the calendar */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(6, 10, 42, .5), transparent 22%, transparent 78%, rgba(6, 10, 42, .5));
}
.layer {
  position: absolute; inset: -2.5%;
  transform: translate3d(calc(var(--tx, 0) * var(--d) * 1px), calc(var(--ty, 0) * var(--d) * 1px + var(--sy, 0) * var(--d) * -.035px), 0);
  transition: transform .5s cubic-bezier(.2, .8, .3, 1);
}
.layer-sky { --d: -3; }
.layer-hills { --d: 1; }
.layer-town { --d: 4; }
.layer-stable { --d: 7; }
.layer-front { --d: 11; }
.layer-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.layer-hills .layer-art, .layer-town .layer-art, .layer-stable .layer-art, .layer-front .layer-art {
  filter: drop-shadow(0 -1px 0 rgba(150, 170, 255, .22)) drop-shadow(0 -4px 9px rgba(2, 4, 24, .7));
}
.grain {
  position: absolute; inset: 0; pointer-events: none; background: url(grain.png);
  mix-blend-mode: overlay; opacity: .22;
}
.twinkle { animation: twinkle 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.twinkle.t1 { animation-delay: -1.3s; animation-duration: 5s; }
.twinkle.t2 { animation-delay: -2.6s; animation-duration: 3.4s; }
@keyframes twinkle { 50% { opacity: .25; transform: scale(.6); } }
.bigstar { transform-box: fill-box; transform-origin: center; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); filter: brightness(1.12); } }
.leak { animation: flicker 5s infinite; }
@keyframes flicker { 0%, 100% { opacity: .85; } 40% { opacity: .7; } 45% { opacity: .9; } 70% { opacity: .78; } }

/* doors: the art layers sit on top of each other and must never swallow a tap */
.layer, .layer-art { pointer-events: none; }
.door { pointer-events: auto; touch-action: manipulation; }
.door::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; } /* a little extra to aim at */
/* On phones the doors are drawn 40% larger than the windows in the art; 1.4 is
   the most the layout allows before neighbours touch (tools/scene.py). */
@media (max-width: 640px) {
  .door:not(.xmas) { scale: 1.4; }
  .door .num { font-size: 1.08em; }
}
.door {
  --flap: #23338c; --edge: rgba(246, 210, 124, .55);
  position: absolute; padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
  perspective: 260px; font: inherit; color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.layer-town .door { --flap: #22328a; }
.layer-stable .door { --flap: #18245f; }
.layer-front .door { --flap: #111845; }
.layer-sky .door { --flap: #20307f; }
.door.round, .door.round .flap, .door.round .door-in { border-radius: 50%; }
.door.arch, .door.arch .flap, .door.arch .door-in { border-radius: 50% 50% 7% 7% / 32% 32% 4% 4%; }
.door.rect, .door.rect .flap, .door.rect .door-in { border-radius: 8%; }
.door.xmas, .door.xmas .door-in { border-radius: 50% 50% 0 0 / 36% 36% 0 0; }
.door-in {
  position: absolute; inset: 0; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 62%, #fff5cf 0, #ffd27a 38%, #e39a33 100%);
  box-shadow: inset 0 2px 5px rgba(90, 40, 0, .55);
}
.in-num {
  font: italic 1em/1 "Fell", serif; color: #6b3511; opacity: 0; transition: opacity .4s .5s;
}
.flap {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--flap);
  background-image: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(0, 0, 0, .12));
  border: 1px dashed var(--edge);
  transform-origin: 0 50%;
  transition: transform .95s cubic-bezier(.25, 1.35, .45, 1), background-color .6s;
  backface-visibility: visible;
}
.num {
  font: 1em/1 "Fell", serif; color: #f8ebcb; text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
  transition: opacity .3s;
}
.door.round .num { font-size: 1.05em; }
.door.locked .num { opacity: .5; }
.door.today .flap {
  --edge: #ffe09a;
  border-style: solid;
  animation: beckon 2.2s ease-in-out infinite;
}
@keyframes beckon {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 214, 120, .0), 0 0 6px 1px rgba(255, 214, 120, .55); }
  50% { box-shadow: 0 0 0 3px rgba(255, 214, 120, .18), 0 0 18px 5px rgba(255, 214, 120, .8); }
}
.door.open .flap { transform: rotateY(-112deg); background-color: #0c133f; border-color: transparent; }
.door.open .num { opacity: 0; }
.door.read .in-num { opacity: .85; }
.door.read .door-in::after {
  content: ""; position: absolute; right: 10%; bottom: 10%; width: 22%; aspect-ratio: 1; border-radius: 50%;
  background: var(--red); box-shadow: 0 1px 0 rgba(0, 0, 0, .3);
}
.door.round.read .door-in::after { right: 18%; bottom: 14%; }
.door.shake { animation: shake .45s; }
@keyframes shake { 20% { transform: translateX(-3px) rotate(-2deg); } 40% { transform: translateX(3px) rotate(2deg); } 60% { transform: translateX(-2px); } 80% { transform: translateX(1px); } }

/* the stable doors, kept shut until Christmas */
.door.xmas .flap { border: 0; background: #3b2412; background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, .25) 0 1px, transparent 1px 22%); }
.door.xmas .flap.left { right: 50%; border-radius: 100% 0 0 0 / 72% 0 0 0; transform-origin: 0 50%; }
.door.xmas .flap.right { left: 50%; border-radius: 0 100% 0 0 / 0 72% 0 0; transform-origin: 100% 50%; }
.door.xmas .num { position: absolute; right: -.35em; top: 40%; font-size: .9em; color: #f3d9a4; z-index: 2; }
.door.xmas.open .flap.left { transform: rotateY(-115deg); }
.door.xmas.open .flap.right { transform: rotateY(115deg); }
.nativity { width: 100%; height: 100%; display: block; }

/* zooming through a door */
.scene-inner.zoom { transition: transform .85s cubic-bezier(.65, 0, .35, 1); transform: translateX(-50%) scale(9); }
.scene-inner.zoom .layer { transition: none; }
.veil { position: fixed; inset: 0; background: var(--bone); opacity: 0; pointer-events: none; z-index: 50; transition: opacity .35s .5s; }
.leaving .veil { opacity: 1; }

.hint { min-height: 1.6em; margin: .65rem 1rem 0; font: italic 1.05rem "Fell", serif; color: rgba(244, 236, 219, .8); }
.hint b { color: var(--lamp); font-weight: 400; }

/* ---------- tally ---------- */
.tally { margin-top: 2.4rem !important; }
.tally-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.tally-count { font: 1.25rem "Fell", serif; margin: 0; }
.tally-count b { font-weight: 400; font-size: 2.6rem; color: var(--red); vertical-align: -.08em; }
.streak { margin: .3rem 0 0; font-style: italic; color: var(--ink-2); }
.streak:empty { display: none; }
.btn-sm { font-size: .9rem; padding: .55em .95em .5em; }
.ticket {
  font: 1rem/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0;
  background: var(--bone); border: 1px dashed rgba(34, 29, 46, .3); border-radius: 3px;
  padding: .9rem 1rem; margin: 1rem 0; white-space: pre-wrap; overflow-x: auto;
}

/* ---------- groups on the home page ---------- */
.my-groups:empty { display: none; }
.my-groups { display: grid; gap: .5rem; margin: 1rem 0 1.2rem; }
.my-groups a {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .8rem 1rem; text-decoration: none; background: var(--bone); border-radius: 3px;
  border-left: 3px solid var(--red);
}
.my-groups a span { font: 1.2rem "Fell", serif; }
.my-groups a small { color: var(--muted); white-space: nowrap; }
.together.has-groups #new-group { display: none; }
.together .start-another { margin-top: .3rem; }

/* ---------- contents (a book's table of contents) ---------- */
.contents { max-width: 34rem; margin: 3rem auto 2rem; }
.contents h2 { text-align: center; margin-bottom: 1.2rem; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: grid; grid-template-columns: 3.6rem auto 1fr auto; align-items: baseline; gap: .5rem;
  padding: .42rem 0; text-decoration: none; border-bottom: 1px solid rgba(34, 29, 46, .07);
}
.toc-day { font: .9rem "Fell SC", serif; color: var(--red); letter-spacing: .04em; text-transform: lowercase; }
.toc-title { font-size: 1.05rem; }
.toc-lead { border-bottom: 1.5px dotted rgba(34, 29, 46, .3); transform: translateY(-.3em); min-width: 1rem; }
.toc-ref { font: italic .95rem "Fell", serif; color: var(--ink-2); }
.toc li.done .toc-title { text-decoration: line-through; text-decoration-color: rgba(196, 53, 26, .55); text-decoration-thickness: 1.5px; }
.toc li.done .toc-ref::after { content: " ✓"; color: var(--red); font-style: normal; }
.toc li.is-today a { background: linear-gradient(90deg, rgba(233, 184, 90, .22), transparent); }

.prose { max-width: 34rem; margin: 2.5rem auto; }
.prose p { font-size: 1.05rem; }

.foot { text-align: center; padding: 2rem 1.2rem calc(2.5rem + env(safe-area-inset-bottom)); border-top: 1px solid rgba(34, 29, 46, .1); max-width: 40rem; margin: 2rem auto 0; }
.foot p { margin: .3rem 0; }
.foot a { font-family: "Fell", serif; font-style: italic; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, calc(100% + 4rem)); visibility: hidden; max-width: min(92vw, 26rem); width: max-content;
  background: var(--ink); color: var(--bone); padding: .8rem 1.2rem; border-radius: 3px;
  font: italic 1.02rem/1.35 "Fell", serif; text-align: center;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .5);
  transition: transform .45s cubic-bezier(.2, 1.3, .4, 1), visibility 0s .45s;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
.toast a { color: var(--lamp); }

/* ---------- reader ---------- */
.reader, .groupview { max-width: 38rem; margin: 0 auto; padding: 0 1.25rem; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: max(env(safe-area-inset-top), .6rem) 0 .6rem; margin: 0 -1.25rem; padding-left: 1rem; padding-right: 1rem;
  background: rgba(244, 236, 219, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(34, 29, 46, .08);
}
.back { display: inline-flex; align-items: center; gap: .2rem; text-decoration: none; font: italic 1.05rem "Fell", serif; }
.back svg { width: 1.1rem; height: 1.1rem; }
.topbar-day { font: .9rem "Fell SC", serif; letter-spacing: .12em; text-transform: lowercase; color: var(--muted); }
.aa { justify-self: end; background: none; border: 1px solid rgba(34, 29, 46, .25); border-radius: 3px; font: 1rem "Fell", serif; padding: .2rem .55rem; cursor: pointer; color: var(--ink); }
.aa-panel { position: sticky; top: 3.2rem; z-index: 19; display: flex; justify-content: flex-end; gap: .4rem; padding: .4rem 0; }
.aa-panel button { font: 1.1rem "Fell", serif; background: var(--ink); color: var(--bone); border: 0; border-radius: 3px; padding: .35rem .8rem; cursor: pointer; }

.chapter-head { text-align: center; padding: 2.4rem 0 1.2rem; }
.chapter-head h1 { font-size: 3.4rem; line-height: .95; }
.ch-book { font-style: italic; }
.ch-num { color: var(--red); }
.ch-title { font: italic 1.45rem "Fell", serif; margin: .35rem 0 1rem; }
.ch-summary { max-width: 30rem; margin: 0 auto .7rem; color: var(--ink-2); }
.ch-meta { font: .85rem "Fell SC", serif; letter-spacing: .1em; text-transform: lowercase; color: var(--muted); }

.tools { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .9rem 0 .4rem; border-top: 1px solid rgba(34, 29, 46, .12); }
.tr-switch { display: inline-flex; border: 1px solid rgba(34, 29, 46, .3); border-radius: 3px; overflow: hidden; }
.tr-switch a { font: .98rem "Fell SC", serif; letter-spacing: .08em; padding: .45rem .8rem; text-decoration: none; color: var(--ink-2); }
.tr-switch a + a { border-left: 1px solid rgba(34, 29, 46, .2); }
.tr-switch a[aria-checked=true] { background: var(--ink); color: var(--bone); }
.listen { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 1px solid rgba(34, 29, 46, .3); border-radius: 999px; padding: .4rem .9rem .4rem .7rem; font: italic 1rem "Fell", serif; color: var(--ink); cursor: pointer; }
.listen svg { width: 1.05rem; height: 1.05rem; }
.listen .ic-pause, .listen.playing .ic-play { display: none; }
.listen.playing .ic-pause { display: inline; }
.listen.playing { background: var(--ink); color: var(--bone); }
.more-versions { margin: .3rem 0 1rem; }
.more-versions summary { cursor: pointer; font: italic .98rem "Fell", serif; color: var(--ink-2); padding: .3rem 0; }
.more-versions ul { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .3rem .8rem; }
.more-versions a { text-decoration: none; display: flex; gap: .5rem; align-items: baseline; padding: .25rem 0; }
.more-versions a span { font-size: .88rem; color: var(--muted); }

.scripture { margin: 1.4rem 0 .6rem; transition: opacity .25s; }
.scripture.swapping { opacity: .15; }
.scripture p {
  font-size: var(--read-size); line-height: 1.68; margin: 0 0 .95em;
  hyphens: auto; -webkit-hyphens: auto; text-wrap: pretty;
  border-radius: 3px; transition: background .4s, box-shadow .4s;
}
.scripture sup {
  font: .62em/0 "Fell SC", serif; color: var(--red); vertical-align: .55em; margin: 0 .18em 0 .05em; letter-spacing: .02em;
}
.scripture p:first-child .v:first-child sup { display: none; }
.scripture p:first-child::first-letter {
  float: left; font: 4.35em/.78 "Fell", serif; color: var(--red);
  margin: .07em .09em 0 -.02em; padding-top: .04em;
}
.scripture .key { background: linear-gradient(transparent 60%, rgba(233, 184, 90, .38) 60%, rgba(233, 184, 90, .38) 92%, transparent 92%); }
.scripture p.speaking { background: rgba(233, 184, 90, .14); box-shadow: -.6rem 0 0 rgba(233, 184, 90, .14), .6rem 0 0 rgba(233, 184, 90, .14); }
.scripture i { font-style: italic; color: var(--ink-2); }
.tr-note { border-top: 1px solid rgba(34, 29, 46, .1); padding-top: .7rem; }

/* follow-along: the verse being read gets a faint wash, the word being said a lamplit one */
.scripture .w { border-radius: 3px; transition: background-color .18s, box-shadow .18s, color .18s; cursor: pointer; }
.scripture .v.reading { background: rgba(233, 184, 90, .1); box-shadow: 0 0 0 2px rgba(233, 184, 90, .1); border-radius: 3px; }
.scripture .w.now { background: rgba(233, 184, 90, .55); box-shadow: 0 0 0 2px rgba(233, 184, 90, .55); color: #2a1a05; }
.scripture.following .v:not(.reading) { color: rgba(34, 29, 46, .62); transition: color .4s; }
/* in the drama, each voice lights its words in its own colour */
.scripture .w[data-who] { text-decoration: underline 1px rgba(196, 53, 26, .0); }
.scripture.following .v.reading .w[data-who] { color: #4a2a14; }
.scripture .w.now[data-who="angel"], .scripture .w.now[data-who="host"] { background: rgba(140, 170, 255, .45); box-shadow: 0 0 0 2px rgba(140, 170, 255, .45), 0 0 14px rgba(140, 170, 255, .6); color: #10163a; }
.scripture .w.now[data-who="simeon"] { background: rgba(196, 120, 60, .42); box-shadow: 0 0 0 2px rgba(196, 120, 60, .42); }
.scripture .w.now[data-who="mary"] { background: rgba(110, 140, 220, .38); box-shadow: 0 0 0 2px rgba(110, 140, 220, .38); }
.scripture .w.now[data-who="jesus"] { background: rgba(255, 236, 170, .85); box-shadow: 0 0 0 2px rgba(255, 236, 170, .85), 0 0 12px rgba(233, 184, 90, .7); }
.scripture .w.now[data-who="shepherd"] { background: rgba(140, 160, 90, .45); box-shadow: 0 0 0 2px rgba(140, 160, 90, .45); }
.scripture .w.now[data-who="zechariah"] { background: rgba(150, 110, 70, .42); box-shadow: 0 0 0 2px rgba(150, 110, 70, .42); }
.scripture .w.now[data-who="elizabeth"] { background: rgba(190, 120, 150, .38); box-shadow: 0 0 0 2px rgba(190, 120, 150, .38); }
.scripture .w.now[data-who="john"] { background: rgba(200, 140, 60, .5); box-shadow: 0 0 0 2px rgba(200, 140, 60, .5); }
.scripture .w.now[data-who="people"], .scripture .w.now[data-who="taxman"], .scripture .w.now[data-who="soldier"] { background: rgba(120, 120, 130, .35); box-shadow: 0 0 0 2px rgba(120, 120, 130, .35); }
.scripture .w.now[data-who="god"] { background: rgba(255, 240, 200, .9); box-shadow: 0 0 0 2px rgba(255, 240, 200, .9), 0 0 16px rgba(255, 220, 140, .8); }
.scripture .w.now[data-who="jesus_man"] { background: rgba(255, 236, 170, .85); box-shadow: 0 0 0 2px rgba(255, 236, 170, .85), 0 0 12px rgba(233, 184, 90, .7); }
.scripture .w.now[data-who="devil"], .scripture .w.now[data-who="demon"], .scripture .w.now[data-who="demons"] { background: rgba(70, 60, 80, .35); box-shadow: 0 0 0 2px rgba(70, 60, 80, .35); }
.scripture .w.now[data-who="peter"], .scripture .w.now[data-who="disciple"], .scripture .w.now[data-who="cleopas"] { background: rgba(170, 120, 80, .42); box-shadow: 0 0 0 2px rgba(170, 120, 80, .42); }
.scripture .w.now[data-who="pharisee"], .scripture .w.now[data-who="priest"] { background: rgba(110, 130, 110, .4); box-shadow: 0 0 0 2px rgba(110, 130, 110, .4); }
.scripture .w.now[data-who="pilate"], .scripture .w.now[data-who="centurion"] { background: rgba(160, 60, 50, .32); box-shadow: 0 0 0 2px rgba(160, 60, 50, .32); }
.scripture .w.now[data-who="woman"] { background: rgba(190, 120, 150, .38); box-shadow: 0 0 0 2px rgba(190, 120, 150, .38); }
.scripture .w.now[data-who="man"], .scripture .w.now[data-who="zacchaeus"], .scripture .w.now[data-who="elder"], .scripture .w.now[data-who="criminal1"], .scripture .w.now[data-who="criminal2"] { background: rgba(140, 120, 100, .38); box-shadow: 0 0 0 2px rgba(140, 120, 100, .38); }
.player[data-who="angel"] .pl-title span, .player[data-who="host"] .pl-title span { color: #b8c8ff; opacity: 1; }
#pl-who { transition: color .3s; }
.listen .ld { display: none; }
.listen.loading .ld { display: inline; }

.player {
  position: fixed; left: 50%; bottom: calc(.8rem + env(safe-area-inset-bottom)); z-index: 40;
  transform: translateX(-50%); width: min(36rem, calc(100vw - 1.2rem));
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .7rem;
  padding: .6rem .75rem .55rem .6rem; border-radius: 10px;
  background: rgba(34, 29, 46, .96); color: var(--bone);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: rise .35s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes rise { from { transform: translate(-50%, 130%); } }
.player button { background: none; border: 0; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pl-toggle { width: 2.9rem; height: 2.9rem; border-radius: 50%; background: var(--lamp) !important; color: var(--ink) !important; display: grid; place-items: center; }
.pl-toggle svg { width: 1.25rem; height: 1.25rem; }
.player .ic-pause, .player.playing .ic-play { display: none; }
.player.playing .ic-pause { display: inline; }
.pl-mid { min-width: 0; }
.pl-title { font: italic 1rem/1.1 "Fell", serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-title span { font: .8rem "Fell SC", serif; letter-spacing: .08em; text-transform: lowercase; opacity: .65; margin-left: .3rem; font-style: normal; }
.pl-seek { width: 100%; margin: .35rem 0 .1rem; padding: 0; border: 0; background: none; accent-color: var(--lamp); height: 1.1rem; }
.pl-times { display: flex; justify-content: space-between; font: .75rem ui-monospace, monospace; opacity: .6; }
.pl-speed { font: .95rem "Fell", serif; min-width: 2.6rem; padding: .3rem .4rem; border: 1px solid rgba(244, 236, 219, .3) !important; border-radius: 999px; }
.pl-close { width: 2rem; height: 2rem; display: grid; place-items: center; opacity: .7; }
.pl-close svg { width: 1rem; height: 1rem; }
body.has-player .foot { padding-bottom: 7rem; }

.ponder { text-align: center; margin: 2.6rem 0 1rem; }
.fleuron { font-size: 1.8rem; color: var(--red); margin-bottom: 1rem; }
.keyverse { margin: 0 auto 2rem; max-width: 30rem; }
.keyverse p { font: italic 1.5rem/1.35 "Fell", serif; margin-bottom: .4rem; }
.keyverse cite { font: .9rem "Fell SC", serif; letter-spacing: .12em; font-style: normal; color: var(--red); text-transform: lowercase; }
.ponder h2 { font-size: 1.3rem; }
.question { font-size: 1.12rem; max-width: 28rem; margin: 0 auto; }

.seal-wrap { text-align: center; margin: 2.4rem 0 2rem; padding: 2rem 1rem 1.4rem; border-top: 1px solid rgba(34, 29, 46, .12); border-bottom: 1px solid rgba(34, 29, 46, .12); }
.seal { background: none; border: 0; padding: 0; cursor: pointer; display: inline-grid; justify-items: center; gap: .7rem; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.seal-wax {
  position: relative; width: 7.2rem; height: 7.2rem; display: grid; place-items: center;
  color: var(--bone-3); transition: color .3s, transform .3s;
  filter: drop-shadow(0 3px 4px rgba(60, 30, 10, .25));
}
.seal-wax svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.seal-wax b { position: relative; font: 2.4rem "Fell", serif; font-weight: 400; color: rgba(34, 29, 46, .45); }
.seal:hover .seal-wax { transform: rotate(-4deg) scale(1.03); }
.seal-label { font: italic 1.35rem "Fell", serif; }
.seal.done .seal-wax { color: var(--red); animation: stamp .55s cubic-bezier(.3, 1.6, .5, 1); }
.seal.done .seal-wax b { color: #ffe9d2; text-shadow: 0 -1px 0 rgba(0, 0, 0, .3); }
.seal:disabled { cursor: default; }
.seal:disabled .seal-wax { transform: none; }
@keyframes stamp { 0% { transform: scale(1.5) rotate(-14deg); opacity: .2; } 60% { transform: scale(.92) rotate(3deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.after { margin-top: 1.3rem; display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0 1rem; }
.pager a { text-decoration: none; font: italic 1.05rem/1.25 "Fell", serif; }
.pager small { display: block; font: .8rem "Fell SC", serif; letter-spacing: .1em; color: var(--muted); font-style: normal; text-transform: lowercase; margin-bottom: .15rem; }
.pager .next { text-align: right; grid-column: 2; }

/* ---------- group ---------- */
.group-head { text-align: center; padding: 2.2rem 0 .6rem; }
.group-head h1 { font-size: 2.5rem; font-style: italic; overflow-wrap: anywhere; }
.groupview .panel { margin: 1.2rem 0; }
.ledger { margin: 1.6rem 0; }
.lrow { padding: .85rem 0 .9rem; border-bottom: 1px solid rgba(34, 29, 46, .1); }
.lrow-head { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .45rem; }
.lname { font: 1.25rem "Fell", serif; overflow-wrap: anywhere; }
.lrow.you .lname::after { content: " (you)"; font: italic .9rem "Alegreya", serif; color: var(--muted); }
.lcount { margin-left: auto; font: .95rem "Fell SC", serif; letter-spacing: .06em; color: var(--ink-2); white-space: nowrap; }
.lcount b { color: var(--red); font-weight: 400; font-size: 1.2rem; }
.cells { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.cells i { aspect-ratio: 3 / 4; border-radius: 2px; background: var(--bone-2); }
.cells i.r { background: radial-gradient(circle at 50% 60%, #fff0c0, #f2b544 70%, #d98a2b); box-shadow: inset 0 -1px 0 rgba(120, 60, 0, .3); }
.cells i.m { background: transparent; box-shadow: inset 0 0 0 1px rgba(196, 53, 26, .35); }
.cells i.t { outline: 1.5px solid var(--ink); outline-offset: 1px; }
.nudge {
  margin-left: .2rem; background: none; border: 1px solid rgba(34, 29, 46, .25); border-radius: 999px;
  font: italic .85rem "Fell", serif; padding: .15rem .65rem; cursor: pointer; color: var(--ink-2);
}
.nudge:disabled { opacity: .5; cursor: default; }
.feed-wrap h2 { font-size: 1.35rem; }
.feed { list-style: none; padding: 0; margin: .4rem 0 0; }
.feed li { padding: .45rem 0; border-bottom: 1px dotted rgba(34, 29, 46, .15); display: flex; gap: .6rem; justify-content: space-between; }
.feed time { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.feed:empty::before { content: "Nobody has opened a door yet. Be the first."; font-style: italic; color: var(--muted); }
.leave-wrap { text-align: center; margin: 2rem 0; }

.lost { max-width: 30rem; margin: 0 auto; padding: 5rem 1.25rem 2rem; text-align: center; }
.lost h1 { font-size: 2.6rem; font-style: italic; margin-bottom: 1rem; }

/* ---------- things that move in the scene ---------- */
.sway, .lantern, .flame, .ear, .tail, .glow, .smoke, .shoot, .spark, .graze { transform-box: fill-box; }
.sway { transform-origin: 50% 45%; }
.lantern { transform-origin: 50% 0; }
.flame, .ear { transform-origin: 50% 100%; }
.tail { transform-origin: 50% 0; }
.glow, .smoke { transform-origin: 50% 50%; }
.shoot { transform-origin: 0 50%; }
.cloud { animation: drift 200s linear infinite; }
@keyframes drift { from { transform: translateX(-500px); } to { transform: translateX(3600px); } }
.shoot { opacity: 0; animation: shoot 24s linear infinite; }
@keyframes shoot {
  0%, 90% { opacity: 0; transform: rotate(var(--a)) translateX(0); }
  91% { opacity: 1; }
  95%, 100% { opacity: 0; transform: rotate(var(--a)) translateX(360px); }
}
/* the Magi ride in from the east along the far ridge, towards the star, then fade and begin again */
.caravan { animation: caravan 160s linear infinite; animation-delay: -50s; }
@keyframes caravan {
  0% { transform: translateX(3260px); opacity: 0; }
  5% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translateX(1760px); opacity: 0; }
}
.caravan .bob { animation: bob .55s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-1.4px); } }
.caravan .legs-a { animation: step .55s ease-in-out infinite alternate; }
.caravan .legs-b { animation: step .55s ease-in-out infinite alternate-reverse; }
@keyframes step { from { transform: translateX(-1.6px); } to { transform: translateX(1.6px); } }
.flick { animation: winflick 7s infinite; }
@keyframes winflick { 0%, 46%, 100% { opacity: .55; } 49% { opacity: .18; } 52% { opacity: .65; } 78% { opacity: .38; } }
.smoke { opacity: 0; animation: smoke 6.4s linear infinite; }
@keyframes smoke { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: .16; } 100% { opacity: 0; transform: translate(22px, -100px) scale(2.6); } }
.sway { animation: sway 7s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
.lantern { animation: lantern 3.6s ease-in-out infinite alternate; }
@keyframes lantern { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.ear, .tail { animation: twitch 9s infinite; }
.tail { animation-delay: -4s; animation-duration: 7s; }
@keyframes twitch { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(-14deg); } 95% { transform: rotate(9deg); } }
.flame { animation: flame .8s ease-in-out infinite alternate; }
@keyframes flame { from { transform: scaleY(.8) skewX(-4deg); } to { transform: scaleY(1.14) skewX(4deg); } }
.glow { animation: glow 1.7s ease-in-out infinite alternate; }
@keyframes glow { to { opacity: .7; transform: scale(.93); } }
.spark { opacity: 0; animation: spark 3.6s linear infinite; }
@keyframes spark { 0% { opacity: 0; transform: translate(0, 0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), -160px); } }
.graze { animation: graze 6s ease-in-out infinite; }
.graze.g2 { animation-delay: -2s; }
.graze.g3 { animation-delay: -4s; animation-duration: 8s; }
@keyframes graze { 0%, 55%, 100% { transform: translateY(0); } 65%, 88% { transform: translateY(2.5px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- install bar (phones only, shown by app.js) ---------- */
.installbar {
  position: fixed; left: 50%; bottom: calc(.8rem + env(safe-area-inset-bottom)); z-index: 50;
  width: min(30rem, calc(100vw - 1.2rem)); transform: translate(-50%, calc(100% + 3rem));
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .7rem;
  padding: .7rem .6rem .7rem .7rem; border-radius: 12px;
  background: rgba(12, 20, 64, .97); color: var(--bone);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 210, 122, .18);
  transition: transform .5s cubic-bezier(.2, 1.2, .4, 1);
}
.installbar.show { transform: translate(-50%, 0); }
.installbar img { width: 44px; height: 44px; border-radius: 10px; display: block; }
.ib-text { min-width: 0; font-size: .92rem; line-height: 1.3; }
.ib-text b { display: block; font: italic 1.05rem/1.2 "Fell", serif; color: var(--lamp); font-weight: 400; }
.ib-sub, .ib-steps { display: block; opacity: .88; margin-top: .15rem; }
.ib-steps b { display: inline; font: inherit; color: var(--bone); font-weight: 700; }
.ib-share svg { width: 1.05em; height: 1.05em; vertical-align: -.15em; }
.ib-go { padding: .7em 1em .66em; }
.ib-x { background: none; border: 0; color: inherit; opacity: .7; padding: .4rem; cursor: pointer; display: grid; place-items: center; }
.ib-x svg { width: 1.1rem; height: 1.1rem; }
.installbar.steps { grid-template-columns: auto 1fr auto; }
@media (prefers-reduced-motion: reduce) { .installbar { transition: none; } }

/* ---------- reminders ---------- */
.notify .row { margin-top: .2rem; }
.cal-alt { margin: 1rem 0 0; }
.nudge-me { margin: 1.2rem auto 0; max-width: 26rem; text-align: center; }
.nudge-me .row { justify-content: center; }
.nudge-me p:last-child { margin: .7rem 0 0; }
