/* revajiadeloye.org: Rubric and Ribbon.
   One family for the look (EB Garamond), one for legibility (Atkinson Hyperlegible Next),
   one ornament (the gilt cross), one signature (the ribbon). Nothing moves on load except the ribbon. */

/* ---------- Tokens ---------- */
:root {
  --vellum: #F4EFE4;
  --vellum-light: #FBF8F1;
  --vellum-deep: #E9E1D0;
  --navy: #16203A;
  --navy-deep: #0E1528;
  --ink: #1D2230;
  --ink-soft: #4F5566;
  --hairline: #D5CAB4;
  --gilt: #BE9B55;
  --gilt-ink: #7A5B24;
  --rubric: #9B2A20;
  --mark: #E8D6A6;
  --focus: #1E5FD6;
  --focus-on-navy: #8FB3FF;
  --on-navy: #F4EFE4;
  --on-navy-soft: #B9B4A8;
  --slip-edge: #A99D86;

  --page: var(--vellum);
  --panel: var(--vellum-light);
  --wash: var(--vellum-deep);
  --text: var(--ink);
  --soft: var(--ink-soft);

  --s-green: #2E5A3C;
  --s-purple: #4E2C63;
  --s-red: #A3201F;
  --s-white: #F7F3EA;
  --s-gold: #BE9B55;
  --s-rose: #B0697D;
  --season: var(--s-green);
  --season-edge: rgb(0 0 0 / .14);

  --serif: 'EB Garamond', Garamond, 'Times New Roman', serif;
  --sans: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, sans-serif;

  --t-ui: 1rem;
  --t-small: 1.1875rem;
  --t-body: clamp(1.1875rem, 1.1rem + .35vw, 1.3125rem);
  --t-lead: clamp(1.3125rem, 1.2rem + .4vw, 1.5rem);
  --t-h3: clamp(1.5rem, 1.35rem + .5vw, 1.75rem);
  --t-h2: clamp(1.875rem, 1.6rem + 1vw, 2.5rem);
  --t-epigraph: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --t-title: clamp(2.5rem, 1.7rem + 3vw, 4.25rem);
  --t-name: clamp(3rem, 1.9rem + 4.4vw, 5.5rem);

  --lh: 1.6;
  --para: .9em;
  --measure: 62ch;
  --tx-measure: 64ch;
  --gutter: clamp(1rem, .5rem + 2.5vw, 3rem);
  --frame: 70rem;
  --section: clamp(4rem, 2.5rem + 5vw, 7rem);
  --head-h: 60px;

  --d-fast: 150ms;
  --d-swap: 280ms;
  --d-panel: 200ms;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* Reading comfort: page settings */
:root { color-scheme: light; }
:root[data-page="white"] { --page: #FFFFFF; --panel: #FBF8F1; }
:root[data-page="cream"] { --page: #F6EDCF; --panel: #FBF6E4; --wash: #EBDFBE; }
:root[data-page="night"] {
  --page: #111A2E; --panel: #17223A; --wash: #1E2A45; --text: #E8E1D1; --soft: #ADB3C0;
  --rubric: #E39182; --gilt-ink: #D4B676; --mark: #3A3420; --hairline: #34405C; --focus: #8FB3FF;
  --s-green: #5E9470; --s-purple: #9A78B4; --s-red: #D0584E; --s-rose: #D58FA2; --s-gold: #D4B676;
  --slip-edge: #4A5672;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-page]) {
    --page: #111A2E; --panel: #17223A; --wash: #1E2A45; --text: #E8E1D1; --soft: #ADB3C0;
    --rubric: #E39182; --gilt-ink: #D4B676; --mark: #3A3420; --hairline: #34405C; --focus: #8FB3FF;
    --s-green: #5E9470; --s-purple: #9A78B4; --s-red: #D0584E; --s-rose: #D58FA2; --s-gold: #D4B676;
    --slip-edge: #4A5672;
    color-scheme: dark;
  }
}
:root[data-size="larger"] { font-size: 115%; }
:root[data-size="largest"] { font-size: 130%; }
:root[data-size="very-large"] { font-size: 150%; }
:root[data-spacing="roomy"] { --lh: 1.85; --para: 2em; --measure: 56ch; --tx-measure: 56ch; }
:root[data-spacing="roomy"] body { letter-spacing: .03em; word-spacing: .1em; }
:root[data-letters="plain"] { --serif: var(--sans); }

[data-season="green"] { --season: var(--s-green); }
[data-season="purple"] { --season: var(--s-purple); }
[data-season="red"] { --season: var(--s-red); }
[data-season="rose"] { --season: var(--s-rose); }
[data-season="gold"] { --season: var(--s-gold); }
[data-season="white"] { --season: var(--s-white); --season-edge: var(--gilt-ink); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--t-body);
  line-height: var(--lh);
  font-variant-numeric: lining-nums;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
/* Paper grain, on Vellum only */
:root:not([data-page]) body::before,
:root[data-page="vellum"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .03;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { :root:not([data-page]) body::before { display: none; } }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
p { margin: 0 0 var(--para); }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; text-wrap: balance; }
h2 { font-size: var(--t-h2); margin-bottom: 1.5rem; }
h3 { font-size: var(--t-h3); }
ul, ol { margin: 0; padding: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
mark { background: var(--mark); color: inherit; padding: 0 .05em; }
blockquote { margin: 0; }
cite { font-style: normal; }

a { color: inherit; text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; transition: text-decoration-thickness var(--d-fast); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.masthead :focus-visible, .colophon :focus-visible, .film-mat :focus-visible, .phone-bar :focus-visible { outline-color: var(--focus-on-navy); }
.masthead .comfort :focus-visible, .masthead .comfort .seg input:focus-visible + span { outline-color: var(--focus); }
/* Keep focused items clear of the sticky header and the phone bar (WCAG 2.4.11) */
html { scroll-padding-top: calc(var(--head-h) + 1rem); }
html.has-phone-bar { scroll-padding-bottom: 4.5rem; }
.text-btn[hidden] { display: none; }

.visually-hidden {
  position: absolute !important; 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: 100; background: var(--panel); color: var(--text); padding: .75rem 1rem; font-family: var(--sans); font-size: var(--t-ui); }
.skip:focus { top: 1rem; }

.ui { font-family: var(--sans); font-size: var(--t-ui); line-height: 1.5; }
.soft { color: var(--soft); }
.rubric { font-family: var(--serif); font-style: italic; font-size: var(--t-small); color: var(--rubric); }
:root[data-letters="plain"] .rubric { font-style: normal; }

/* ---------- Layout ---------- */
.frame { max-width: var(--frame); margin-inline: auto; padding-inline: var(--gutter); }
.column { max-width: var(--measure); margin-inline: auto; }
.section { margin-top: var(--section); }
.lead-in { margin-top: 2rem; }
.tool-head + .lead-in { margin-top: 2.5rem; }
main { display: block; padding-bottom: var(--section); }

/* ---------- Ornaments ---------- */
.cross { width: 14px; height: 22px; fill: none; stroke: var(--gilt); stroke-width: 1.25; stroke-linecap: square; flex: none; }
.cross-lg { width: 26px; height: 40px; margin: 2.5rem auto 0; }
.rule-gilt {
  display: block; width: 96px; height: 5.75px; border: 0; margin: 1.5rem auto;
  background:
    linear-gradient(var(--gilt), var(--gilt)) top / 100% 2px no-repeat,
    linear-gradient(var(--gilt), var(--gilt)) bottom / 100% .75px no-repeat;
}
.chain {
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(26mm - 1px), rgb(29 34 48 / .02) calc(26mm - 1px) 26mm);
}

/* ---------- Buttons ---------- */
.text-btn {
  display: inline-flex; align-items: center; min-height: 44px;
  background: none; border: 0; padding: .25rem 0;
  font-family: var(--sans); font-size: var(--t-ui); line-height: 1.3; text-align: left;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em;
}
.text-btn:hover { text-decoration-thickness: 2px; }
.text-btn[aria-pressed="true"] { font-weight: 600; text-decoration-thickness: 2px; }
.btn-solid {
  display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1.25rem;
  background: var(--navy); color: var(--vellum); border: 0; border-radius: 2px;
  font-family: var(--sans); font-size: var(--t-ui); text-decoration: none;
}
.btn-solid:hover { background: var(--navy-deep); }
.actions { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; align-items: center; }

/* ---------- Masthead ---------- */
.masthead { position: sticky; top: 0; z-index: 50; background: var(--navy); color: var(--on-navy); transition: background-color var(--d-fast); }
.masthead.is-scrolled { background: var(--navy-deep); }
.masthead-row { display: flex; align-items: center; gap: 28px; height: var(--head-h); }
.wordmark { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-size: 1.375rem; line-height: 1; white-space: nowrap; }
.wordmark i { font-weight: 400; }
.wordmark b { font-weight: 500; }
.nav { margin-left: auto; }
.nav ul { list-style: none; display: flex; gap: 28px; }
.nav a { font-weight: 500; font-size: var(--t-small); text-decoration: none; padding-block: .5rem; white-space: nowrap; }
.nav a:hover { text-decoration: underline; text-decoration-color: var(--on-navy-soft); text-decoration-thickness: 1px; text-underline-offset: .35em; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gilt); text-decoration-thickness: 1px; text-underline-offset: .35em; }
.head-tools { display: flex; gap: .6rem; }
.head-btn {
  min-height: 44px; padding: .3rem .8rem; border: 1px solid rgb(244 239 228 / .5); border-radius: 2px;
  background: none; color: var(--on-navy); font-family: var(--sans); font-size: var(--t-ui); white-space: nowrap;
}
.head-btn:hover { border-color: var(--on-navy); }
.head-btn[aria-expanded="true"] { background: var(--on-navy); color: var(--navy); }
.head-btn .short { display: none; }
.menu-btn { display: none; }

/* Reading comfort: a push-down disclosure inside the masthead */
.comfort { background: var(--panel); color: var(--text); border-bottom: 1px solid var(--hairline); max-height: calc(100svh - var(--head-h)); overflow: auto; }
.comfort[hidden] { display: none; }
.comfort-inner { padding-block: 1.5rem 1.75rem; }
.comfort h2 { font-size: var(--t-h3); margin: 0 0 .25rem; }
.comfort .sample { font-size: var(--t-lead); font-style: italic; margin: 0 0 1.25rem; max-width: 40ch; }
.comfort .sample cite { display: block; font-family: var(--sans); font-style: normal; font-size: var(--t-ui); color: var(--soft); margin-top: .25rem; }
.comfort-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.25rem 2.5rem; }
.comfort fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.comfort legend { font-family: var(--sans); font-size: var(--t-ui); font-weight: 600; padding: 0; margin-bottom: .4rem; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; min-height: 44px; padding: .35rem .8rem;
  border: 1px solid var(--soft); border-radius: 2px; font-family: var(--sans); font-size: var(--t-ui);
}
.seg input:checked + span { background: var(--text); color: var(--page); border-color: var(--text); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.comfort-foot { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0 2rem; align-items: center; }

/* Menu sheet (below 1100px) */
.sheet { position: fixed; inset: 0; z-index: 70; background: var(--page); color: var(--text); overflow: auto; animation: sheet-in var(--d-panel) ease-out; }
@keyframes sheet-in { from { opacity: 0; } }
.sheet[hidden] { display: none; }
.sheet-top { display: flex; justify-content: flex-end; height: var(--head-h); align-items: center; }
.sheet ul { list-style: none; max-width: 30rem; margin: 1rem auto 0; }
.sheet li + li { margin-top: 1.25rem; }
.sheet ul a { display: inline-block; padding-block: .2rem; font-size: 1.75rem; line-height: 1.2; text-decoration: none; }
.sheet-foot { max-width: 30rem; margin: 2rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--hairline); }
.sheet-foot a { font-size: var(--t-lead); }
.sheet-sunday { display: flex; gap: .9rem; align-items: flex-start; margin-top: 1.25rem; font-size: var(--t-body); }
.sheet-sunday .swatch { width: 6px; height: 32px; flex: none; margin-top: .2rem; }
.sheet a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gilt-ink); text-decoration-thickness: 1px; text-underline-offset: .3em; }

/* ---------- The ribbon ---------- */
.ribbon {
  --len: 64px;
  position: fixed; top: var(--head-h); right: 17px; z-index: 45;
  width: 44px; height: var(--len); display: flex; justify-content: center;
  text-decoration: none;
  filter: drop-shadow(0 2px 3px rgb(14 21 40 / .18));
  transition: height 300ms var(--ease), transform var(--d-fast);
}
.page-home .ribbon { --len: 96px; }
.ribbon.is-short { height: 20px; }
.ribbon::before { content: ""; position: absolute; top: 0; left: 0; width: 44px; height: max(44px, 100%); }
.ribbon-pending .ribbon-silk { transform: scaleY(0); }
.ribbon.slip-dismissed .ribbon-slip { opacity: 0 !important; visibility: hidden !important; }
.ribbon-silk {
  width: 14px; height: 100%;
  background:
    linear-gradient(90deg, var(--season-edge) 0 1px, transparent 1px calc(50% - 1.5px), rgb(255 255 255 / .08) calc(50% - 1.5px) calc(50% + 1.5px), transparent calc(50% + 1.5px) calc(100% - 1px), var(--season-edge) calc(100% - 1px)),
    var(--season);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 7px), 0 100%);
  transform-origin: top;
}
.ribbon.is-unfurling .ribbon-silk { animation: unfurl 700ms var(--ease) both; }
@keyframes unfurl { from { transform: scaleY(0); } }
.ribbon:hover, .ribbon:focus-visible { transform: translateY(8px); }
.ribbon:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ribbon-slip {
  position: absolute; right: calc(100% + .25rem); top: .5rem; width: max-content; max-width: 17rem;
  background: var(--panel); color: var(--text); border: 1px solid var(--slip-edge); padding: .6rem .9rem;
  opacity: 0; visibility: hidden; transition: opacity var(--d-fast), visibility var(--d-fast);
}
.ribbon-slip i { display: block; font-size: var(--t-small); line-height: 1.3; }
.ribbon-slip span { display: block; font-family: var(--sans); font-size: var(--t-ui); color: var(--soft); margin-top: .2rem; }
@media (hover: hover) {
  .ribbon:hover .ribbon-slip, .ribbon:focus-visible .ribbon-slip { opacity: 1; visibility: visible; }
}

/* ---------- Plates ---------- */
.plate { margin: 0; }
.plate .paper {
  background: var(--vellum-light); padding: 10px; border: 1px solid var(--hairline);
  box-shadow: 0 1px 2px rgb(22 32 58 / .08), 0 10px 24px -14px rgb(22 32 58 / .28);
}
.plate figcaption { font-family: var(--sans); font-size: var(--t-ui); line-height: 1.45; color: var(--soft); margin-top: .85rem; max-width: 40ch; }

/* ---------- Home: title page ---------- */
.title-page { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; min-height: min(46rem, calc(100svh - var(--head-h))); padding-block: clamp(2rem, 4vw, 3.5rem); }
.title-block { text-align: center; margin-inline: auto; padding-block: 1rem; }
.title-block > :where(:not(h1)) { max-width: 36ch; margin-inline: auto; }
.title-block .revd { display: block; font-style: italic; font-size: var(--t-lead); }
.title-block h1 { font-size: var(--t-name); letter-spacing: -.01em; line-height: 1.02; margin-top: .2rem; white-space: nowrap; }
.title-block .role { margin: 0; font-size: var(--t-lead); }
.title-block .role + .role { font-size: var(--t-body); color: var(--soft); margin-top: .35rem; }
.epigraph { margin: 2.25rem auto 0; max-width: 30ch; }
.epigraph p { font-style: italic; font-size: var(--t-epigraph); line-height: 1.3; margin: 0; }
.epigraph a { text-decoration-color: var(--hairline); }
.epigraph a:hover { text-decoration-color: currentColor; }
.epigraph footer { font-family: var(--sans); font-size: var(--t-ui); color: var(--gilt-ink); margin-top: .75rem; }
.title-page .plate { max-width: 30rem; justify-self: end; width: 100%; }

/* ---------- Home: This Sunday sentence ---------- */
.sunday-line {
  max-width: 66ch; margin-inline: auto; border-block: 1px solid var(--hairline); padding: 1.25rem 0;
  display: grid; grid-template-columns: 6px 1fr; gap: 0 1.25rem; align-items: center;
}
.sunday-line .bar { width: 6px; height: 40px; background: var(--season); box-shadow: inset 0 0 0 1px var(--season-edge); grid-row: span 2; }
.sunday-line p { font-style: italic; font-size: var(--t-lead); line-height: 1.4; margin: 0; }
.sunday-line p.link { font-style: normal; font-size: var(--t-body); margin-top: .35rem; }

/* ---------- Abbey sermon list ---------- */
.abbey { list-style: none; }
.abbey > li + li { border-top: 1px solid var(--hairline); margin-top: 2.5rem; padding-top: 2.5rem; }
.abbey h3, .abbey h4 { font-size: var(--t-h3); font-weight: 500; }
.abbey h3 a, .abbey h4 a { text-decoration-color: var(--hairline); }
.abbey h3 a:hover, .abbey h4 a:hover { text-decoration-color: currentColor; }
.abbey .line { font-style: italic; font-size: var(--t-lead); line-height: 1.4; margin: .5rem 0 .6rem; max-width: 52ch; }
.abbey .line a { text-decoration: none; }
.abbey .line a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.abbey .meta { font-family: var(--sans); font-size: var(--t-ui); line-height: 1.5; color: var(--soft); margin: 0; }
.abbey .found { font-size: var(--t-body); margin: .9rem 0 0; }
.abbey .found a { font-family: var(--sans); font-size: var(--t-ui); margin-left: .35rem; white-space: nowrap; }
.more { margin-top: 2.5rem; }

/* ---------- Word picker ---------- */
.feelings { font-size: var(--t-lead); line-height: 2; margin: 1rem 0 0; }
.feelings button {
  background: none; border: 0; padding: .3em 0; min-height: 44px;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--soft);
}
.feelings button:hover { text-decoration-color: currentColor; }
.feelings button[aria-pressed="true"] { font-weight: 600; text-decoration-thickness: 2px; text-decoration-color: currentColor; }
.word-result:empty { display: none; }
.word-result { margin-top: 2.25rem; padding-top: 2rem; border-top: 1px solid var(--hairline); }
.word-result :is(h2, h3) { font-style: italic; margin-bottom: 1rem; }
.word-result :is(h2, h3):focus { outline: none; }
.word-result :is(h2, h3):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.word-result .scripture { font-style: italic; color: var(--rubric); margin-top: 1rem; }
.word-result .actions { margin-top: 1.25rem; }
.word-result .safe { font-family: var(--sans); font-size: var(--t-ui); margin-top: 1.25rem; }
.word-body { transition: opacity var(--d-swap); }
.word-body.is-swapping { opacity: 0; }

/* ---------- Inner page heads ---------- */
.page-head { padding-top: clamp(2.5rem, 6vw, 5rem); }
.page-head h1 { font-style: italic; font-size: var(--t-title); line-height: 1.05; }
.page-head .standfirst { max-width: 52ch; margin-top: 1rem; }
.tool-head { text-align: center; padding-top: clamp(2.5rem, 6vw, 5rem); }
.tool-head h1 { font-style: italic; font-size: var(--t-title); line-height: 1.05; }
.tool-head .rule-gilt { margin-block: 1.25rem; }
.tool-head .rubric { margin: 0; }
.tool-head .standfirst { max-width: 46ch; margin: .5rem auto 0; }
:root[data-letters="plain"] h1 { font-style: normal !important; }

/* ---------- Sermons page ---------- */
.find { margin-top: 2.5rem; }
.find label { display: block; font-family: var(--sans); font-size: var(--t-ui); font-weight: 600; margin-bottom: .4rem; }
.field {
  width: 100%; min-height: 48px; padding: .55rem .8rem; border: 1px solid var(--soft); border-radius: 2px;
  background: var(--panel); color: var(--text); font-family: var(--sans); font-size: var(--t-ui);
}
.find .hint { font-family: var(--sans); font-size: var(--t-ui); color: var(--soft); margin-top: .4rem; }
.year { margin-top: 3.5rem; }
.year > h2 { font-size: var(--t-h2); margin: 0; }
.year > .rule-gilt { margin: .9rem 0 0; }
.group { margin-top: 2.5rem; }
.group > h3 { font-style: italic; font-size: var(--t-h3); }
.season-rule { display: block; width: 48px; height: 3px; background: var(--season); box-shadow: inset 0 0 0 1px var(--season-edge); margin: .6rem 0 2rem; }
.status { font-family: var(--sans); font-size: var(--t-ui); color: var(--soft); margin-top: 1.5rem; min-height: 1.5em; }

/* ---------- Sermon page ---------- */
.back { font-family: var(--sans); font-size: var(--t-ui); padding-top: 1.25rem; margin: 0; }
.sermon-head { text-align: center; padding-top: clamp(1.5rem, 4vw, 3rem); }
.sermon-head h1 { font-style: italic; font-size: var(--t-title); line-height: 1.05; max-width: 20ch; margin-inline: auto; }
.sermon-head .occasion { max-width: 46ch; margin: 0 auto; }
.sermon-head .preacher { margin: .35rem 0 0; }
.sermon-head .readings { margin: .35rem 0 0; color: var(--soft); }
.sermon-head .strap { margin: 1.75rem auto 0; max-width: 34ch; }
.sermon-head .strap p { font-style: italic; font-size: var(--t-epigraph); line-height: 1.3; margin: 0; }
.sermon-head .strap footer { font-family: var(--sans); font-size: var(--t-ui); color: var(--gilt-ink); margin-top: .6rem; }

.film { max-width: 960px; margin: 3rem auto 0; }
.film-mat { background: var(--navy-deep); padding: clamp(8px, 1.4vw, 16px); }
.film-frame { position: relative; aspect-ratio: 16 / 9; box-shadow: inset 0 0 0 1px var(--gilt); }
.film-frame video { width: 100%; height: 100%; background: #000; }
.film-frame video[hidden] { display: none; }
.film-card {
  position: absolute; inset: 1px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: var(--on-navy); background: var(--navy-deep); padding: 1.5rem;
}
.film-card[hidden] { display: none; }
.film-card .t { font-style: italic; font-size: clamp(1.5rem, 1rem + 2.4vw, 2.75rem); line-height: 1.1; margin: 0; }
.film-card .o { font-size: var(--t-small); color: var(--on-navy-soft); margin: .5rem 0 0; max-width: 36ch; }
.film-card .cross { margin-top: 1.25rem; }
.btn-play {
  margin-top: 1.5rem; min-height: 44px; padding: .55rem 1.2rem; border: 1px solid var(--gilt); border-radius: 2px;
  background: transparent; color: var(--on-navy); font-family: var(--sans); font-size: var(--t-ui);
}
.btn-play:hover { background: rgb(190 155 85 / .16); }
.film.is-audio .film-frame { aspect-ratio: auto; display: flex; flex-direction: column; }
.film.is-audio .film-card { position: relative; inset: auto; min-height: 14rem; }
.film.is-audio video { height: 54px; background: var(--navy-deep); }
.film-controls { display: flex; flex-wrap: wrap; gap: 0 1.75rem; margin-top: .5rem; }
.film-placeholder { display: none; aspect-ratio: 16 / 9; background: var(--wash); }
.dock-bar { display: none; }
.film.is-docked .film-placeholder { display: block; aspect-ratio: auto; height: var(--plate-h, auto); }
.film.is-docked .film-mat { position: fixed; right: 1rem; bottom: 1rem; width: 320px; z-index: 46; padding: 6px; box-shadow: 0 12px 30px -10px rgb(14 21 40 / .6); }
.film.is-docked .film-card { display: none; }
.film.is-docked .dock-bar { display: flex; gap: 0 1rem; flex-wrap: wrap; align-items: center; padding: .15rem .35rem 0; color: var(--on-navy); }
.dock-bar .text-btn { min-height: 44px; color: var(--on-navy); }
.dock-bar .time, .phone-bar .time { font-family: var(--sans); font-size: var(--t-ui); font-variant-numeric: tabular-nums; color: var(--on-navy-soft); }

.phone-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; background: var(--navy); color: var(--on-navy);
  display: flex; align-items: center; gap: 0 .9rem; padding: .25rem var(--gutter) calc(.25rem + env(safe-area-inset-bottom));
}
.phone-bar[hidden] { display: none; }
.phone-bar .text-btn { color: var(--on-navy); }
.phone-bar .chapter { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: italic; font-size: var(--t-ui); }

.reader { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 0 3rem; margin-top: 4rem; align-items: start; }
.aside { position: sticky; top: calc(var(--head-h) + 1.5rem); max-height: calc(100svh - var(--head-h) - 3rem); overflow: auto; padding: 3px .25rem 1rem 3px; font-family: var(--sans); font-size: var(--t-ui); line-height: 1.45; }
.aside h2 { font-family: var(--sans); font-size: var(--t-ui); font-weight: 600; margin: 1.75rem 0 .5rem; }
.aside h2:first-child { margin-top: 0; }
.aside label { display: block; font-weight: 600; margin-bottom: .4rem; }
.aside .field { min-height: 44px; }
.aside .count { color: var(--soft); margin: .4rem 0 0; min-height: 1.5em; }
.aside .actions { gap: 0 1.25rem; }
.aside-toggle { display: none; }
.contents { list-style: none; }
.contents button { display: grid; grid-template-columns: 1fr auto; gap: .75rem; width: 100%; min-height: 44px; padding: .35rem 0; text-align: left; background: none; border: 0; font-family: var(--serif); font-size: var(--t-ui); line-height: 1.35; }
.contents button span:first-child { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--hairline); }
.contents button:hover span:first-child { text-decoration-color: currentColor; }
.contents .at { font-family: var(--sans); font-variant-numeric: tabular-nums; color: var(--gilt-ink); }
.contents [aria-current="true"] span:first-child { font-weight: 600; text-decoration-color: currentColor; }
.switch { display: flex !important; align-items: center; gap: .6rem; min-height: 44px; cursor: pointer; font-weight: 400 !important; }
.switch input { appearance: none; -webkit-appearance: none; width: 2.6rem; height: 1.5rem; border: 1px solid var(--soft); border-radius: 1rem; position: relative; margin: 0; background: var(--panel); cursor: pointer; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.5rem - 6px); height: calc(1.5rem - 6px); border-radius: 50%; background: var(--soft); transition: transform var(--d-fast); }
.switch input:checked { background: var(--text); border-color: var(--text); }
.switch input:checked::after { transform: translateX(1.1rem); background: var(--page); }
.back-to[hidden] { display: none; }

.transcript { max-width: calc(4.5rem + var(--tx-measure)); }
.tx-hint, .tx-note { font-family: var(--sans); font-size: var(--t-ui); color: var(--soft); margin: 0 0 1.5rem 4.5rem; }
.tx-row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); position: relative; }
.tx-row + .tx-row { margin-top: var(--para); }
.tx-row h3 { grid-column: 2; font-style: italic; font-size: var(--t-h3); margin: 2.25rem 0 .1rem; }
.tx-time {
  align-self: start; justify-self: start; min-height: 44px; margin-top: -.5rem; padding: 0 .5rem 0 0; background: none; border: 0;
  font-family: var(--sans); font-size: var(--t-ui); color: var(--gilt-ink); font-variant-numeric: tabular-nums lining-nums;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; text-decoration-color: transparent;
}
.tx-time:hover { text-decoration-color: currentColor; }
/* Press and hold on a time opens the share slip, not the phone's own callout. */
button.tx-time { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.tx-row.is-spoken .tx-time { color: var(--text); font-weight: 600; text-decoration-color: currentColor; text-decoration-thickness: 2px; }
.tx-row { scroll-margin-top: calc(var(--head-h) + 18vh); }
.tx-row h3 { scroll-margin-top: calc(var(--head-h) + 1.5rem); }
#transcript mark { box-shadow: inset 0 -2px 0 var(--gilt-ink); }
#transcript mark.is-hit { background: var(--text); color: var(--page); box-shadow: none; }
span.tx-time { min-height: 0; margin-top: .25rem; }
.tx-p { margin: 0; padding: .1rem .5rem; margin-inline: -.5rem; border-radius: 2px; transition: background-color 400ms; }
.tx-row.is-spoken .tx-p { background: var(--wash); }
.tx-row.is-spoken::before {
  content: ""; position: absolute; left: calc(4.5rem - 1.2rem); top: .4rem; width: 6px; height: 28px;
  background: var(--season); box-shadow: inset 0 0 0 1px var(--season-edge);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 3px), 0 100%);
}
.tx-p.is-sought { animation: sought 1.2s var(--ease); }
@keyframes sought { from { background: var(--mark); } }
.versal::first-letter { float: left; font-size: 3.4em; line-height: .8; margin: .06em .08em 0 0; color: var(--rubric); font-weight: 500; }
.tail { margin: 2.5rem 0 0 4.5rem; }
.tail .cross-lg { margin: 0; }

.share-slip {
  position: absolute; z-index: 30; background: var(--panel); border: 1px solid var(--slip-edge);
  padding: 0 .9rem; display: flex; gap: 0 1.25rem; box-shadow: 0 8px 20px -12px rgb(22 32 58 / .45);
}
.share-slip[hidden] { display: none; }

.after { margin: var(--section) 0 0 4.5rem; max-width: var(--measure); }
.after > h2 { margin-bottom: .75rem; }
.after h3 { font-size: var(--t-h3); margin: 2.25rem 0 .75rem; }
.after .label { font-family: var(--sans); font-size: var(--t-ui); color: var(--soft); margin-bottom: 1.25rem; }
.lines { list-style: none; }
.lines li + li { margin-top: 1.25rem; }
.lines q { font-style: italic; }
.lines .text-btn { min-height: 0; margin-left: .35rem; display: inline; }
.guide { margin-top: var(--section); }
.guide > .rubric { margin-bottom: 1rem; }
.questions { list-style: none; }
.questions li { padding-block: 1.5rem; }
.questions li + li { border-top: 1px solid var(--hairline); }
.questions li:first-child { padding-top: .5rem; }
.prayer { font-style: italic; }
.print-only { display: none; }

/* ---------- Tool pages ---------- */
.word-page .word-result .word-body { font-size: var(--t-lead); max-width: 52ch; }
.word-page .word-result :is(h2, h3) { text-align: center; font-size: var(--t-h2); }
.pray-controls { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: end; margin-top: 2.5rem; }
.pray-controls .select { font-family: var(--sans); font-size: var(--t-ui); font-weight: 600; display: grid; gap: .4rem; min-width: 0; max-width: 100%; flex: 0 1 26rem; }
.pray-controls select { width: 100%; max-width: 100%; text-overflow: ellipsis; min-height: 48px; padding: .4rem .7rem; border: 1px solid var(--soft); border-radius: 2px; background: var(--panel); color: var(--text); font-family: var(--sans); font-size: var(--t-ui); font-weight: 400; }
.pray-controls .switch { font-family: var(--sans); font-size: var(--t-ui); }
.settle { margin-top: 2.5rem; }
.movement { margin-top: 3rem; }
.movement h2 { font-size: var(--t-h2); margin-bottom: .25rem; }
.movement h2:focus { outline: none; }
.movement > .rubric { margin-bottom: 1.25rem; }
.passage { font-size: var(--t-lead); line-height: 1.55; max-width: 40ch; }
.passage sup { font-family: var(--sans); font-size: .6em; color: var(--soft); vertical-align: .55em; margin-right: .15em; }
.passage-ref { font-family: var(--sans); font-size: var(--t-ui); color: var(--soft); margin-top: .5rem; }
.kept { margin-top: 1.5rem; max-width: 30rem; }
.kept label { display: block; font-family: var(--sans); font-size: var(--t-ui); font-weight: 600; margin-bottom: .4rem; }
.kept .hint { font-family: var(--sans); font-size: var(--t-ui); color: var(--soft); margin-top: .35rem; }
.pray-line q { font-style: italic; font-size: var(--t-lead); }
.pray-line .ui { margin-top: .5rem; }
.silence-line { height: 1px; background: var(--gilt); transform-origin: left; transform: scaleX(0); margin-top: .5rem; max-width: 30rem; }
.silence-line.is-running { transform: scaleX(1); transition: transform 60s linear; }
.one-at-a-time .movement:not(.is-current) { display: none; }
.passage-recall { display: none; }
.one-at-a-time .passage-recall { display: block; font-size: var(--t-body); color: var(--soft); margin-bottom: 1.25rem; }
.one-at-a-time .movement.is-current { animation: part-in var(--d-swap) ease-out; }
@keyframes part-in { from { opacity: 0; } }
.step-nav { display: none; gap: 0 2rem; margin-top: 2rem; }
.one-at-a-time .step-nav { display: flex; }
.end-link { margin-top: 3rem; text-align: center; }

.sunday-band { position: relative; background: var(--wash); padding: clamp(3rem, 7vw, 5.5rem) calc(var(--gutter) + 3rem); text-align: center; overflow: hidden; }
.sunday-band::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 32px; width: 14px; background: var(--season);
  box-shadow: inset 1px 0 var(--season-edge), inset -1px 0 var(--season-edge);
}
.sunday-band .date { font-size: var(--t-lead); margin: 0; }
.sunday-band h1 { font-style: italic; font-size: var(--t-title); line-height: 1.05; margin: .35rem 0 .5rem; }
.sunday-band .sub { font-size: var(--t-lead); margin: 0; }
.sunday-band .colour { margin: .9rem 0 0; }
.coming { list-style: none; }
.coming li { display: grid; grid-template-columns: 14rem 1fr auto; gap: .25rem 1.5rem; align-items: center; padding-block: 1rem; }
.coming li + li { border-top: 1px solid var(--hairline); }
.coming .d { font-family: var(--sans); font-size: var(--t-ui); color: var(--soft); }
.coming .c { display: flex; align-items: center; gap: .6rem; font-family: var(--sans); font-size: var(--t-ui); }
.swatch { display: inline-block; width: 6px; height: 28px; background: var(--season); box-shadow: inset 0 0 0 1px var(--season-edge); }
.links-list { list-style: none; }
.links-list li + li { margin-top: .5rem; }

/* About and plain pages */
.prose h2 { font-size: var(--t-h2); margin: 3.5rem 0 1rem; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: .4rem; }
.record { margin: 0; }
.record div { padding-block: 1rem; }
.record div + div { border-top: 1px solid var(--hairline); }
.record dt { font-weight: 500; }
.record dd { margin: 0; color: var(--soft); }

/* ---------- Colophon ---------- */
.colophon { background: var(--navy); color: var(--on-navy); padding: 4rem var(--gutter) 3.5rem; }
.colophon-inner { max-width: var(--measure); margin-inline: auto; }
.colophon .cross { margin-bottom: 1.25rem; }
.colophon .name { font-size: var(--t-h3); margin-bottom: .35rem; }
.colophon .name i { font-weight: 400; }
.colophon p { margin-bottom: .9rem; }
.colophon .small { font-family: var(--sans); font-size: var(--t-ui); color: var(--on-navy-soft); }
.colophon .small a { color: var(--on-navy); }
.colophon .foot-links { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin-top: 1.75rem; }
.colophon .foot-links .text-btn { color: var(--on-navy); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 80; transform: translate(-50%, 1rem);
  background: var(--navy); color: var(--on-navy); padding: .7rem 1.1rem; border-radius: 2px;
  font-family: var(--sans); font-size: var(--t-ui); opacity: 0; transition: opacity var(--d-fast), transform var(--d-fast); pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1099.98px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .head-tools { margin-left: auto; }
  .reader { grid-template-columns: 1fr; margin-top: 2rem; }
  .aside { position: static; max-height: none; overflow: visible; padding: 3px 3px 0; margin-bottom: 2rem; border-block: 1px solid var(--hairline); }
  .aside-toggle { display: inline-flex; }
  .aside-inner[hidden] { display: none; }
  .aside-inner { padding-bottom: 1.25rem; }
}
@media (min-width: 1100px) {
  .aside-inner[hidden] { display: block; }
}
@media (max-width: 1099.98px) and (min-width: 760px) {
  .title-page { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 759.98px) {
  :root { --head-h: 52px; }
  .masthead-row { gap: 12px; }
  .wordmark { font-size: 1.2rem; }
  .wordmark i { display: none; }
  .head-btn .long { display: none; }
  .head-btn .short { display: inline; }
  .ribbon { --len: 48px; right: 0; }
  .page-home .ribbon { --len: 48px; }
  .ribbon-silk { width: 12px; }
  .title-page { grid-template-columns: 1fr; min-height: 0; }
  .title-page .plate { order: 2; justify-self: stretch; max-width: none; }
  .title-block h1 { font-size: 3rem; white-space: normal; }
  .sermon-head h1, .tool-head h1, .page-head h1, .sunday-band h1 { font-size: 2.5rem; }
  .film { margin-top: 2rem; margin-inline: calc(var(--gutter) * -1); }
  .film-mat { padding: 0; }
  .film-controls { padding-inline: var(--gutter); }
  .tx-row { grid-template-columns: minmax(0, 1fr); }
  .tx-row h3 { grid-column: 1; }
  .tx-time { margin: 0; min-height: 44px; }
  span.tx-time { margin: 0 0 .2rem; }
  .tx-row.is-spoken::before { left: calc(var(--gutter) * -1 + 4px); top: 2.6rem; }
  .tx-hint, .tx-note, .tail, .after { margin-left: 0; }
  .coming li { grid-template-columns: 1fr; }
  .sunday-band { padding-inline: var(--gutter); padding-right: calc(var(--gutter) + 2rem); }
  .sunday-band::after { width: 8px; right: 16px; }
  .abbey h3, .abbey h4 { font-size: 1.5rem; }
  body.has-phone-bar { padding-bottom: 4rem; }
}
@media (max-width: 380px) {
  .head-btn { padding-inline: .55rem; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}
:root[data-motion="still"] *, :root[data-motion="still"] *::before, :root[data-motion="still"] *::after {
  animation-duration: 0s !important; transition-duration: 0s !important;
}

/* ---------- Print: the home group guide on A4 ---------- */
@media print {
  @page { size: A4; margin: 18mm 18mm 20mm; @bottom-center { content: counter(page); font-family: 'EB Garamond', serif; font-size: 10pt; font-variant-numeric: oldstyle-nums; } }
  :root, :root[data-page], :root:not([data-page]) { --page: #fff; --panel: #fff; --wash: #fff; --text: #000; --soft: #333; --rubric: #9B2A20; --gilt-ink: #7A5B24; --hairline: #bbb; --mark: #E8D6A6; color-scheme: light; }
  html { font-size: 11.5pt; }
  body { font-size: 11.5pt; line-height: 1.45; background: #fff; color: #000; }
  body::before { display: none !important; }
  .masthead, .ribbon, .colophon, .skip, .film, .aside, .transcript, .back, .no-print, .share-slip, .phone-bar, .toast, .comfort, .sheet, .lines-wrap { display: none !important; }
  .reader { display: block; margin: 0; }
  .sermon-head { padding: 0; }
  .sermon-head h1 { font-size: 20pt; }
  .sermon-head .strap, .sermon-head .rule-gilt, .sermon-head .cross-lg { display: none; }
  .sermon-head p { font-size: 11pt; margin: .1rem 0 0; }
  .after { margin: 6mm 0 0; max-width: none; }
  .notes { display: none; }
  .guide { margin-top: 6mm; }
  .questions li { break-inside: avoid; padding-block: 3mm 0; border: 0 !important; }
  .questions li::after { content: ""; display: block; height: 30mm; background: repeating-linear-gradient(transparent 0 9.5mm, #bbb 9.5mm 10mm); }
  .print-only { display: block; }
  .print-link { display: flex; align-items: center; gap: 5mm; margin-top: 8mm; break-inside: avoid; }
  .print-link .qr { width: 26mm; height: 26mm; flex: none; }
  .print-link p { margin: 0; font-size: 9.5pt; overflow-wrap: anywhere; }
  .ui .text-btn { display: none; }
  a { text-decoration: none; }
  h2, h3 { break-after: avoid; }
  main { padding: 0; }
}
