/* Catholic World Network concept, v4: a film in beats. Flat colour only; no gradients anywhere. */
:root {
  --burgundy: #7B2D3B;
  --gold: #C9A84C;
  --cream: #FAF7F2;
  --ink: #1A1A1A;
  --ink-2: #5C544E;
  --night: #141213;
  --black: #0B0A0A;
  --white: #FFFFFF;
  --gutter: 7vw;
  --vh: 100vh;
  --sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
@supports (height: 100svh) { :root { --vh: 100svh; } }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--burgundy); }
body { margin: 0; background: var(--burgundy); color: var(--white); font-family: var(--sans); font-size: 19px; line-height: 1.45; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; }
img { display: block; max-width: 100%; }
p, h1, h2, figure, blockquote { margin: 0; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.gp, .dot { color: var(--gold); }

.skip { position: fixed; left: 16px; top: -80px; z-index: 50; padding: 12px 18px; border-radius: 10px; background: var(--white); color: var(--burgundy); font-weight: 700; text-decoration: none; }
.skip:focus { top: 16px; outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- Layers ---------- */
.bg { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: -2; background: var(--burgundy); }
.bg-cut { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.dots { position: fixed; left: 0; top: 0; width: 100vw; height: var(--vh); z-index: 0; pointer-events: none; display: none; }
.beat .dots { display: block; }
main { position: relative; z-index: 1; }

/* ---------- Scenes ---------- */
.scene { position: relative; }
.stage { position: relative; height: var(--vh); min-height: 560px; overflow: hidden; }
.anchor { position: absolute; left: 0; width: 1px; height: 1px; }
.dark { color: var(--white); }
.light { color: var(--ink); }

/* Document mode (no JS, or reduced motion): flat scenes one after another, every one complete. */
html:not(.beat) #hero { background: #7B2D3B; }
html:not(.beat) #world, html:not(.beat) #rosary, html:not(.beat) #pray, html:not(.beat) #church, html:not(.beat) #mass, html:not(.beat) #morning { background: #141213; }
html:not(.beat) #verse, html:not(.beat) #together { background: #FAF7F2; }
html:not(.beat) #ai { background: #FFFFFF; }
html:not(.beat) #art { background: #0B0A0A; }
html:not(.beat) #close { background: #7B2D3B; }
html:not(.beat) .still { display: none; }
html:not(.beat) .stage { min-height: 760px; }
html:not(.beat) #rosary .stage { min-height: 880px; }
.static-dots { position: absolute; left: 0; top: 0; pointer-events: none; }

/* Beat mode: each scene is one screen (two for the two-step scenes); its stage stays put while the dots move. */
.beat body { background: transparent; }
.beat .scene { height: var(--vh); }
.beat .scene[data-steps="2"] { height: calc(var(--vh) * 2); }
.beat .stage { position: -webkit-sticky; position: sticky; top: 0; min-height: 0; }
/* Touch devices: the browser's own scrolling, snapped to one beat per swipe. Nothing intercepts touch. */
html.snap { scroll-snap-type: y mandatory; }
html.snap .scene, html.snap .anchor { scroll-snap-align: start; scroll-snap-stop: always; }

/* ---------- Type ---------- */
.wordmark { font-weight: 700; font-size: 21px; line-height: 1.2; letter-spacing: -0.012em; color: var(--white); }
.display { font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; }
.eyebrow { font-size: 16px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 24px; }
.dark .eyebrow { color: rgba(255,255,255,0.74); }
.light .eyebrow { color: var(--burgundy); }
.title { font-weight: 600; font-size: clamp(44px, 5.4vw, 94px); line-height: 1.0; letter-spacing: -0.036em; }
.sub { margin-top: 26px; font-size: clamp(19px, 1.6vw, 25px); line-height: 1.45; max-width: 24em; }
.light .sub { color: var(--ink-2); }
.m { display: block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.mi { display: block; }

/* ---------- Enter / leave (beat mode only) ---------- */
.beat [data-in] { opacity: 0; transform: translate3d(0, 26px, 0); transition: opacity .26s ease, transform .3s ease; }
.beat [data-in="mask"] { opacity: 0; transform: translate3d(0, 108%, 0); transition: transform .3s cubic-bezier(.5,0,.75,0), opacity .2s ease; }
.beat [data-in="zoom"] { transform: scale(1.35); transform-origin: 0 60%; }
.beat [data-in="phone"] { transform: translate(0, 40%) rotate(-4deg) scale(.92); transition: opacity .3s ease, transform .4s ease; }
.beat [data-in="none"] { opacity: 1; transform: none; }
.beat [data-in="type"] { transform: none; transition: opacity .2s ease; }
.beat [data-in="type"].in { transition: opacity .55s ease var(--d, 0s); }
.beat [data-in].in { opacity: 1; transform: none; transition: opacity .7s ease var(--d, 0s), transform 1.05s cubic-bezier(.16,1,.3,1) var(--d, 0s); }
.beat [data-in="mask"].in { transition: transform 1.0s cubic-bezier(.16,1,.3,1) var(--d, 0s), opacity .25s ease var(--d, 0s); }
.beat [data-in="zoom"].in { transition: opacity .9s ease var(--d, 0s), transform 1.3s cubic-bezier(.16,1,.3,1) var(--d, 0s); }
.beat [data-in="phone"].in { transition: opacity .5s ease var(--d, 0s), transform 1.35s cubic-bezier(.2,1.18,.36,1) var(--d, 0s); }

/* ---------- Always there: a quiet way to the website ---------- */
.site-link { position: fixed; top: 22px; right: 26px; z-index: 30; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,0.55); background: #141213; color: #fff; font-size: 17px; font-weight: 600; text-decoration: none; transition: color .3s ease, border-color .3s ease, background-color .2s ease, opacity .3s ease; }
.site-link:hover { border-color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.site-link:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
html[data-tone="light"] .site-link { color: var(--burgundy); border-color: rgba(123,45,59,0.5); background: #FAF7F2; }
html[data-beat="hero"] .site-link, html[data-beat="close"] .site-link, html:not(.beat) .site-link { background: #7B2D3B; }
html[data-beat="ai"] .site-link { background: #FFFFFF; }
html[data-tone="light"] .site-link:hover { border-color: var(--burgundy); }
html[data-beat="close"] .site-link { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
html[data-beat="art"] .site-link { opacity: 0; pointer-events: none; visibility: hidden; }
html:not(.beat) .site-link { position: absolute; }

/* ---------- 1. Opening ---------- */
#hero .wordmark { position: absolute; top: 40px; left: var(--gutter); }
.hero-copy { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-52%); max-width: 50vw; }
#hero h1 { font-size: clamp(56px, 8.2vw, 142px); }
.hero-sub { margin-top: 28px; max-width: 24em; font-size: clamp(19px, 1.55vw, 24px); line-height: 1.4; color: rgba(255,255,255,0.92); }
.cue { position: absolute; left: var(--gutter); bottom: 34px; display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.76); }
.cue i { width: 1px; height: 34px; background: rgba(255,255,255,0.6); }
html:not(.beat) .cue { display: none; }

/* ---------- 2. The world at night ---------- */
.lede-big { position: absolute; left: 0; right: 0; top: 8.5vh; text-align: center; font-weight: 600; font-size: clamp(44px, 6vw, 104px); line-height: 1.0; letter-spacing: -0.04em; padding: 0 24px; }

/* ---------- 3-4. Rosary ---------- */
.prayer-wrap { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-46%); width: 50vw; }
.prayer { font-size: clamp(28px, 2.9vw, 50px); line-height: 1.24; letter-spacing: -0.016em; font-weight: 600; }
.half { display: block; }
.beat .prayer { position: relative; height: 6.3em; }
.beat .half { position: absolute; left: 0; right: 0; top: 0; }
html:not(.beat) .half.h2 { margin-top: 0.4em; }

/* ---------- 5. Pray ---------- */
.pray-text { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-50%); }
.phone-slot { position: absolute; top: 50%; width: 0; height: 0; display: flex; align-items: center; justify-content: center; }
.phone-slot .phone { flex: none; }
.pray-phone { left: 55vw; }
.pray-phone .phone { --ph: min(76vh, 760px); }
.beat .screen.swap img.first { opacity: 0; transition: opacity 1s ease; }
.pbr { display: none; }

/* ---------- 6. Church ---------- */
.church-text { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-46%); }
.number { font-weight: 600; font-size: clamp(88px, 10.6vw, 184px); line-height: 0.92; letter-spacing: -0.045em; margin-bottom: 14px; }
#church .title { font-size: clamp(40px, 4.4vw, 76px); }

/* ---------- 7. Find Mass ---------- */
.mass-text { position: absolute; left: var(--gutter); top: 13vh; max-width: 48vw; }
#mass .title { font-size: clamp(40px, 4.6vw, 80px); }
.mass-phone { left: 75vw; }
.mass-phone .phone { --ph: min(76vh, 760px); }

/* ---------- 8. Every morning ---------- */
.morning-text { position: absolute; left: var(--gutter); top: 13vh; }
#morning .title { font-size: clamp(44px, 5.8vw, 100px); }
.morning-phone { left: 74vw; top: 50%; }
.morning-phone .phone { --ph: min(76vh, 760px); }
html.snap .home-img.ok, html:not(.beat) .home-img { transform: translateY(-42%); }
html.beat:not(.snap) .home-img { transition: transform 7s cubic-bezier(.45,0,.2,1) 2.4s; }
html.beat:not(.snap) .phone.in .home-img.ok { transform: translateY(-38%); }
.screen-off { display: none; position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 1; background: #0E0D0D; transform-origin: 50% 100%; transition: transform .9s cubic-bezier(.7,0,.2,1) 1.3s; }
html.beat:not(.snap) .screen-off { display: block; }
html.beat:not(.snap) .phone.in .screen-off { transform: scaleY(0); }

/* ---------- 9-10. The verse ---------- */
.verse { position: absolute; left: 0; right: 0; top: 9vh; text-align: center; padding: 0 24px; }
.verse-text { font-weight: 600; font-size: clamp(32px, 3.5vw, 60px); line-height: 1.12; letter-spacing: -0.03em; color: var(--ink); }
.verse figcaption { margin-top: 22px; font-size: 16px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--burgundy); }

/* ---------- 11. Together ---------- */
.tog-text { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-50%); max-width: 38vw; }
.card-slot { position: absolute; }
.duo-a { left: 46vw; top: 19%; }
.duo-b { left: 66vw; top: 54%; }
.card { width: min(31vw, 52vh, 520px); border-radius: 22px; overflow: hidden; background: #FAFAFA; box-shadow: 0 0 0 1px #E4DBD2, 0 18px 40px -22px rgba(60,30,30,0.35); }
.duo-b .card { width: min(29vw, 48vh, 480px); }
.card img { width: 100%; height: auto; }

/* ---------- 12. AskCatholicAI ---------- */
#ai { color: var(--ink); }
.ai-wrap { position: absolute; left: 50vw; right: var(--gutter); top: 50%; transform: translateY(-50%); }
.ai-title { font-size: clamp(46px, 5.2vw, 92px); line-height: 0.98; }
.askbox {
  margin-top: 40px; width: 100%; min-height: 88px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 0 12px 0 28px; border-radius: 999px; background: var(--white); border: 1px solid #CFC6BD; color: var(--ink); text-decoration: none; transition: border-color .2s ease;
}
.askbox:hover { border-color: var(--burgundy); }
.askq { font-size: clamp(19px, 1.7vw, 27px); color: var(--ink); white-space: nowrap; overflow: hidden; min-width: 0; }
.caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 3px; vertical-align: -0.16em; background: var(--burgundy); animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.go { flex: none; height: 64px; padding: 0 22px 0 26px; border-radius: 999px; background: var(--burgundy); color: #fff; display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; }
.go svg { transform: rotate(90deg); }
.ai-free { margin-top: 18px; }
.free-link { display: inline-flex; align-items: center; gap: 4px; min-height: 48px; padding: 0 2px; font-size: clamp(19px, 1.5vw, 23px); font-weight: 600; color: var(--burgundy); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: rgba(123,45,59,0.4); }
.free-link:hover { text-decoration-color: var(--burgundy); }
.free-link:focus-visible, .askbox:focus-visible { outline: 3px solid var(--burgundy); outline-offset: 4px; }

/* ---------- 14. The painting ---------- */
.art-frame { position: absolute; left: 0; right: 0; top: 17vh; bottom: 10vh; overflow: hidden; }
.art-img { position: absolute; max-width: none; }
html:not(.beat) .art-img { left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.beat .art-img { opacity: 0; transition: opacity .35s ease; }
.beat .art-img.show { opacity: 1; transition: opacity 1.2s ease; }
.art-line { position: absolute; left: 0; right: 0; top: 0; height: 17vh; display: flex; align-items: center; justify-content: center; gap: 0 0.26em; text-align: center; padding: 0 24px; font-weight: 600; font-size: clamp(30px, 3.9vw, 66px); line-height: 1.04; letter-spacing: -0.03em; }
.art-caption { position: absolute; left: 0; right: 0; bottom: 0; height: 10vh; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 17px; line-height: 1.4; color: rgba(255,255,255,0.76); text-align: center; padding: 0 24px; }
.art-caption span { color: #fff; font-weight: 600; font-size: 18px; }
.art-caption span::after { content: ''; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); margin-left: 14px; vertical-align: middle; }

/* ---------- 15. Close ---------- */
.close-copy { position: absolute; left: 56vw; right: var(--gutter); top: 0; bottom: 96px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.close-title { font-size: clamp(48px, 6.8vw, 122px); outline: none; }
.close-lead { margin-top: 30px; font-size: 22px; line-height: 1.35; color: #fff; }
.actions { margin-top: 16px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 62px; padding: 0 34px; border-radius: 999px; background: var(--white); color: var(--burgundy); font-size: 20px; font-weight: 600; text-decoration: none; transition: background-color .2s ease; }
.button:hover { background: var(--cream); }
.button:focus-visible, .footer a:focus-visible, .beats a:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.quiet { margin-top: 22px; font-size: 18px; color: rgba(255,255,255,0.8); }
.footer { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0; height: 88px; border-top: 1px solid rgba(255,255,255,0.18); display: flex; justify-content: space-between; align-items: center; gap: 24px; font-size: 18px; }
.footer .wordmark.small { font-size: 19px; }
.footer a { color: rgba(255,255,255,0.88); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.4); padding: 10px 0 2px; }
.footer a:hover { color: #fff; border-color: #fff; }

/* ---------- The phone, drawn: near-black body, flat side band, one crisp highlight line ---------- */
.phone {
  --ph: min(80vh, 800px);
  position: relative; height: var(--ph); width: calc(var(--ph) * 0.4794);
  padding: calc(var(--ph) * 0.0165); border-radius: calc(var(--ph) * 0.078);
  background: #0E0D0D; box-shadow: inset 0 0 0 1.5px #4A4343, 6px 0 0 -1px #2A2626;
  transform-origin: 50% 60%;
}
.phone::before { content: ''; position: absolute; left: calc(var(--ph) * 0.085); right: calc(var(--ph) * 0.085); top: 0; height: 1px; background: rgba(255,255,255,0.5); border-radius: 1px; }
.phone::after { content: ''; position: absolute; right: -4px; top: 21%; width: 3px; height: 9%; background: #2A2626; border-radius: 0 3px 3px 0; }
/* The app screen: a plain picture, top-aligned, fully shown by default; the frame clips it. Cream until the picture arrives. */
.screen { position: relative; width: 100%; height: 100%; border-radius: calc(var(--ph) * 0.062); overflow: hidden; background: #FAF7F2; isolation: isolate; -webkit-mask-image: linear-gradient(#000, #000); }
.screen img { position: absolute; top: 0; left: 0; width: 100%; height: auto; max-width: none; }
html.imgwait .screen img.app { opacity: 0; transition: opacity .45s ease; }
html.imgwait .screen img.app.ok { opacity: 1; }
html.imgwait .card img.app { opacity: 0; transition: opacity .45s ease; }
html.imgwait .card img.app.ok { opacity: 1; }
.card { min-height: 60px; }
html.imgwait .beat .screen.swap img.first.ok, html.imgwait .screen.swap img.first.ok { opacity: 0; }
.screen::after { content: ''; position: absolute; left: 50%; top: calc(var(--ph) * 0.013); width: 31%; height: calc(var(--ph) * 0.036); margin-left: -15.5%; border-radius: 999px; background: #0E0D0D; z-index: 2; }

/* ---------- Beat indicator: thin marks on the right; each one is a link to its scene ---------- */
.beats { display: none; }
.beat .beats { display: flex; position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 20; flex-direction: column; align-items: center; }
.beats a { display: flex; align-items: center; justify-content: center; width: 28px; height: 22px; }
.beats a i { display: block; width: 4px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.42); transition: height .5s cubic-bezier(.16,1,.3,1), background-color .4s ease; }
.beats a[aria-current="step"] i { height: 18px; background: var(--gold); }
.beats a:hover i { background: rgba(255,255,255,0.85); }
html[data-tone="light"] .beats a i { background: rgba(123,45,59,0.32); }
html[data-tone="light"] .beats a[aria-current="step"] i { background: var(--gold); }
html[data-tone="light"] .beats a:hover i { background: var(--burgundy); }

/* ---------- Phones: each beat re-composed for a tall narrow screen ---------- */
@media (max-width: 819px) {
  :root { --gutter: 24px; }
  body { font-size: 18px; }
  .beat .stage, html:not(.beat) .stage { min-height: 0; }
  html:not(.beat) .stage { height: auto; min-height: 100vh; }
  html:not(.beat) #rosary .stage { min-height: 980px; }
  .eyebrow { font-size: 16px; letter-spacing: 0.14em; margin-bottom: 10px; }
  .title { font-size: clamp(32px, 9.6vw, 44px); }
  .sub { margin: 12px auto 0; font-size: 18px; max-width: 20em; }

  #hero .wordmark { left: 0; right: 0; text-align: center; top: 66px; font-size: 20px; }
  html[data-beat="art"] .site-link { opacity: 0; pointer-events: none; visibility: hidden; }
  .site-link { top: 14px; right: 14px; min-height: 44px; padding: 0 15px; font-size: 16px; }
  .hero-copy { left: 0; right: 0; top: auto; bottom: 80px; transform: none; max-width: none; text-align: center; padding: 0 20px; }
  .hero-sub { margin: 18px auto 0; font-size: 18px; max-width: 21em; }
  #hero h1 { font-size: clamp(46px, 14vw, 66px); }
  .cue { left: 50%; transform: translateX(-50%); bottom: 14px; flex-direction: column; gap: 4px; font-size: 16px; letter-spacing: 0.14em; }
  .cue i { height: 18px; }

  .lede-big { top: 76px; font-size: clamp(38px, 11.4vw, 54px); padding: 0 16px; }

  .prayer-wrap { left: 22px; right: 22px; width: auto; top: auto; bottom: 6%; transform: none; text-align: center; }
  .prayer { font-size: clamp(20px, 5.5vw, 26px); line-height: 1.3; }
  .beat .prayer { height: 7.9em; }

  .pray-text { left: 0; right: 0; top: 76px; transform: none; text-align: center; }
  .pray-phone { left: 50%; top: auto; bottom: 0; align-items: flex-end; }
  .pray-phone .phone { --ph: calc(var(--vh) * 0.62); margin-bottom: 16px; }

  .church-text { left: 0; right: 0; top: auto; bottom: 6%; transform: none; text-align: center; }
  .number { font-size: clamp(64px, 21vw, 96px); margin-bottom: 6px; }
  #church .title { font-size: clamp(30px, 8.6vw, 40px); }
  .beat [data-in="zoom"] { transform-origin: 50% 60%; }

  .mass-text { left: 0; right: 0; top: 76px; max-width: none; text-align: center; padding: 0 16px; }
  #mass .title { font-size: clamp(30px, 8.8vw, 40px); }
  .mass-phone { left: 50%; top: auto; bottom: 0; align-items: flex-end; }
  .mass-phone .phone { --ph: calc(var(--vh) * 0.62); margin-bottom: 16px; }

  .morning-text { left: 0; right: 0; top: 76px; text-align: center; }
  #morning .title { font-size: clamp(36px, 10.6vw, 48px); }
  .morning-phone { left: 50%; top: auto; bottom: 0; align-items: flex-end; }
  .morning-phone .phone { --ph: calc(var(--vh) * 0.5); margin-bottom: 16px; }

  .verse { top: 76px; padding: 0 18px; }
  .verse-text { font-size: clamp(27px, 8.2vw, 38px); line-height: 1.14; }
  .pbr { display: inline; }
  .verse figcaption { font-size: 16px; margin-top: 14px; letter-spacing: 0.16em; }

  .tog-text { left: 0; right: 0; top: 76px; transform: none; max-width: none; text-align: center; padding: 0 16px; }
  .card { border-radius: 16px; width: calc(100vw - 48px); }
  .duo-a { left: 24px; top: 300px; }
  .duo-b { left: 48px; top: 520px; }
  .duo-b .card { width: calc(100vw - 72px); }

  .ai-wrap { left: 20px; right: 20px; top: auto; bottom: 5%; transform: none; text-align: center; display: flex; flex-direction: column; align-items: center; }
  .ai-title { font-size: clamp(40px, 12vw, 54px); }
  .askbox { margin-top: 26px; min-height: 72px; padding: 0 8px 0 20px; }
  .askq { font-size: 18px; white-space: normal; line-height: 1.3; padding: 10px 0; text-align: left; }
  .go { height: 54px; padding: 0 16px 0 18px; font-size: 18px; gap: 4px; }
  .go svg { width: 20px; height: 20px; }
  .free-link { font-size: 18px; }

  .art-line { flex-direction: column; gap: 0; height: 21%; font-size: clamp(28px, 8vw, 36px); }
  .art-frame { top: 21%; bottom: 14%; }
  .art-caption { height: 14%; display: block; padding: 14px 20px 0; font-size: 16px; line-height: 1.35; }
  .art-caption span { display: block; font-size: 17px; }
  .art-caption span::after { display: none; }

  .close-lead { margin-top: 22px; font-size: 19px; }
  .close-copy { left: 0; right: 0; top: auto; bottom: 92px; align-items: center; text-align: center; padding: 0 16px; }
  .close-title { font-size: clamp(46px, 14vw, 64px); }
  .actions { margin-top: 12px; }
  .button { min-height: 58px; padding: 0 26px; font-size: 19px; }
  .quiet { margin-top: 14px; font-size: 17px; }
  .footer { left: 20px; right: 20px; height: 72px; font-size: 16px; }
  .footer .wordmark.small { font-size: 16px; }

  .beat .beats { display: none; }
}
@media (max-width: 819px) and (max-height: 700px) {
  .prayer { font-size: 19px; }
  .footer { height: 64px; }
  .close-copy { bottom: 72px; }
}

/* Narrow phones: the footer keeps the name only (the button above goes to the same website) */
@media (max-width: 400px) {
  .footer { justify-content: center; }
  .footer a { display: none; }
  .footer .wordmark.small { font-size: 17px; }
}
/* Touch devices of any width: no scene marks (the page's own scrolling shows where you are) */
html.snap .beats { display: none !important; }
/* Tablets held upright: the phone layout, set larger */
@media (min-width: 600px) and (max-width: 819px) {
  .title { font-size: 60px; }
  #hero h1 { font-size: 100px; }
  .hero-sub { font-size: 22px; }
  .lede-big { font-size: 76px; }
  .prayer { font-size: 30px; }
  .number { font-size: 130px; }
  #church .title, #mass .title { font-size: 54px; }
  #morning .title { font-size: 64px; }
  .verse-text { font-size: 50px; }
  .sub { font-size: 23px; }
  .ai-wrap { left: 12%; right: 12%; }
  .ai-title { font-size: 72px; }
  .askq { font-size: 21px; }
  .art-line { font-size: 46px; }
  .close-title { font-size: 92px; }
  .close-lead { font-size: 22px; }
  .eyebrow { font-size: 17px; }
}
/* Phones turned sideways (and other short, wide windows): everything a little smaller so nothing is cut */
@media (min-width: 820px) and (max-height: 520px) {
  .site-link { top: 12px; right: 16px; }
  #hero .wordmark { top: 20px; }
  #hero h1 { font-size: 54px; }
  .hero-sub { margin-top: 14px; font-size: 17px; }
  .cue { display: none; }
  .title, #mass .title, #morning .title { font-size: 40px; }
  .lede-big { font-size: 46px; top: 22px; }
  .prayer { font-size: 22px; }
  .number { font-size: 76px; }
  #church .title { font-size: 34px; }
  .eyebrow { margin-bottom: 10px; }
  .verse { top: 22px; }
  .verse-text { font-size: 30px; }
  .sub { margin-top: 12px; font-size: 18px; }
  .ai-title { font-size: 40px; }
  .askbox { margin-top: 18px; min-height: 64px; }
  .go { height: 50px; }
  .close-title { font-size: 46px; }
  .close-copy { bottom: 58px; }
  .close-lead { margin-top: 14px; font-size: 18px; }
  .button { min-height: 50px; }
  .quiet { margin-top: 10px; }
  .footer { height: 56px; }
  .pray-phone .phone, .mass-phone .phone, .morning-phone .phone { --ph: 128vh; }
  .pray-phone, .mass-phone, .morning-phone { top: calc(18px + 64vh); }
  .card { width: min(30vw, 72vh); }
  .duo-b .card { width: min(27vw, 64vh); }
  .duo-a { top: 16%; }
  .mass-text, .morning-text { top: 18%; }
  .mass-phone, .morning-phone { left: 64vw; }
  .askq { white-space: normal; line-height: 1.25; }
}

/* =====================================================================================================
   PHONES AND TABLETS ("flow"): a plain web page. The document itself scrolls; no snapping (unless ?snap=1,
   gentle proximity only); every scene is an ordinary block that grows with its content; nothing is fixed
   except the small website button. The dots are a still picture inside each scene.
   ===================================================================================================== */
html.flow { overflow-x: hidden; overflow-x: clip; scroll-snap-type: none; background: #7B2D3B; }
html.flow body { overflow: visible; background: #7B2D3B; }
html.flow .bg, html.flow .dots, html.flow .beats, html.flow .anchor { display: none; }
html.flow .scene { height: auto; }
html.flow .stage {
  position: relative; height: auto; min-height: 100vh; min-height: 100svh; overflow: hidden; overflow: clip;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 76px 20px 28px; padding-top: max(76px, calc(env(safe-area-inset-top) + 64px));
}
html.flow #rosary .stage { min-height: 100vh; min-height: 100svh; }
html.flow .stage > *:not(.static-dots) {
  position: relative; z-index: 1; left: auto; right: auto; top: auto; bottom: auto; transform: none;
  width: 100%; max-width: 720px; margin-left: auto; margin-right: auto;
}
html.flow .static-dots { position: absolute; left: 0; top: 0; z-index: 0; opacity: 0; transition: opacity .9s ease; }
html.flow .seen .static-dots, html.flow.flow-all .static-dots { opacity: 1; }
/* room for the dots: above the words (opening, rosary, churches, AskCatholicAI, ending) or below them (world, verse) */
html.flow #hero .stage::before, html.flow #rosary .stage::before, html.flow #church .stage::before, html.flow #ai .stage::before, html.flow #close .stage::before { content: ''; display: block; flex: 1 0 240px; }
html.flow #world .stage::after, html.flow #verse .stage::after { content: ''; display: block; flex: 1 0 280px; }
html.flow #hero .wordmark { order: -1; margin-top: 0; min-height: 0; display: block; }
html.flow .hero-copy { padding: 0; }
html.flow .cue { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 22px; font-size: 16px; }
html.flow .lede-big { padding: 0; }
html.flow .prayer-wrap { padding-top: 16px; }
html.flow .prayer { height: auto; }
html.flow .half { position: static; }
html.flow .verse { padding: 0; }
html.flow .tog-text, html.flow .mass-text, html.flow .morning-text, html.flow .pray-text, html.flow .church-text, html.flow .ai-wrap, html.flow .close-copy { padding: 0; }
html.flow .ai-wrap { display: flex; flex-direction: column; align-items: center; }
html.flow .close-copy { display: flex; flex-direction: column; align-items: center; }
/* the app pictures: the phone drawn nearly screen-wide, its lower part cut off: a close-up of the top of the screen */
html.flow .phone-slot { display: block; height: auto; flex: 1 1 0px; min-height: calc(var(--ph, 700px) * 0.56); max-height: calc(var(--ph, 700px) * 0.92); overflow: hidden; margin-top: 24px; }
html.flow #world .stage { padding-left: 12px; padding-right: 12px; }
html.flow .phone-slot .phone { margin: 0 auto; }
html.flow .morning-phone { margin-top: max(96px, 15vh); }
/* pray for each other: the two close-ups, the reply tucked a little to the right */
html.flow .duo { max-width: 560px; margin-top: 46px; }
html.flow .card-slot { position: relative; left: auto; top: auto; }
html.flow .duo-a .card { width: 100%; }
html.flow .duo-b { display: flex; justify-content: flex-end; margin-top: -22px; }
html.flow .duo-b .card { width: 92%; }
/* the painting: words, picture, caption, one under the other */
html.flow #art .stage { padding-left: 0; padding-right: 0; justify-content: center; }
html.flow .art-line { order: 0; height: auto; display: block; padding: 0 20px 20px; max-width: none; }
html.flow .art-line .m { display: inline-block; }
html.flow .art-frame { order: 1; height: 62vh; height: min(62svh, 125vw); max-width: none; overflow: hidden; }
html.flow .art-caption { order: 2; height: auto; display: block; padding: 16px 20px 0; max-width: none; }
html.flow .art-caption span { display: block; }
html.flow .art-caption span::after { display: none; }
/* ending */
html.flow #close .stage { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
html.flow .footer { height: 64px; margin-top: 30px; padding: 0; }
/* the small website button: fixed top right, clear of the notch, never moved by the toolbar */
html.flow .site-link { position: fixed; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); background: #141213; }
html.flow[data-tone="light"] .site-link { background: #FAF7F2; }
html.flow[data-beat="ai"] .site-link { background: #FFFFFF; }
html.flow[data-beat="hero"] .site-link, html.flow:not([data-beat]) .site-link { background: #7B2D3B; }
/* reveals: once, when the scene comes near; never fade out */
html.flow [data-in] { opacity: 0; transform: translate3d(0, 16px, 0); transition: opacity .7s ease calc(var(--d, 0s) * 0.45), transform .9s cubic-bezier(.16,1,.3,1) calc(var(--d, 0s) * 0.45); }
html.flow [data-in].in, html.flow.flow-all [data-in], html.flow #hero [data-in], html.flow [data-in="none"] { opacity: 1; transform: none; }
html.flow #hero [data-in] { transition: none; }
@media (min-width: 820px) {
  html.flow .stage { padding-left: 40px; padding-right: 40px; }
  html.flow .phone-slot { margin-top: 32px; }
}

/* ---------- The name, larger and always present ---------- */
#hero .hero-copy .wordmark { position: static; order: 0; display: block; min-height: 0; margin: 0 0 30px; font-size: clamp(34px, 2.8vw, 44px); line-height: 1.1; letter-spacing: -0.02em; text-align: inherit; }
.close-mark { font-size: clamp(34px, 2.8vw, 44px); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 26px; color: #fff; }
.brand { position: fixed; z-index: 31; top: 22px; left: 26px; margin: 0; min-height: 44px; display: flex; align-items: center; gap: 0 .26em; font-weight: 700; font-size: 24px; line-height: 1.05; letter-spacing: -0.015em; color: #fff; transition: opacity .3s ease, color .3s ease, visibility 0s; }
html[data-tone="light"] .brand { color: var(--ink); }
html[data-beat="hero"] .brand, html[data-beat="close"] .brand, html[data-beat="art"] .brand, html:not([data-beat]) .brand { opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
.topbar { display: none; }
.footer { justify-content: center; }
@media (max-width: 819px) {
  #hero .hero-copy .wordmark { font-size: min(30px, 7.6vw); margin-bottom: 18px; }
  .close-mark { font-size: min(30px, 7.6vw); margin-bottom: 16px; }
  .brand { top: 14px; left: 16px; font-size: 21px; }
}
@media (max-width: 429px) { .brand { flex-direction: column; align-items: flex-start; justify-content: center; font-size: 20px; } }
@media (max-width: 400px) { .footer a { display: inline-block; } }
@media (min-width: 820px) and (max-height: 520px) {
  #hero .hero-copy .wordmark { font-size: 26px; margin-bottom: 10px; }
  .close-mark { font-size: 24px; margin-bottom: 8px; }
  .brand { top: 12px; left: 16px; font-size: 20px; }
  .verse, .lede-big { top: 62px; }
}
/* phones and tablets: a calm bar behind the name and the website button, in the colour of the scene on screen */
html.flow .topbar { display: block; position: fixed; left: 0; right: 0; top: 0; height: 68px; height: calc(68px + env(safe-area-inset-top)); z-index: 29; background: #141213; pointer-events: none; transition: opacity .3s ease, background-color .3s ease, visibility 0s; }
html.flow[data-tone="light"] .topbar { background: #FAF7F2; }
html.flow[data-beat="ai"] .topbar { background: #FFFFFF; }
html.flow[data-beat="hero"] .topbar, html.flow[data-beat="close"] .topbar, html.flow[data-beat="art"] .topbar, html.flow:not([data-beat]) .topbar { opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
html.flow .brand { top: max(12px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); }

@media (max-height: 520px) and (orientation: landscape) { html.flow .duo { max-width: min(560px, 120vh); } }

/* =====================================================================================================
   PHONES AND TABLETS ("pager"): the film, one swipe = one scene. The page itself never scrolls (so the
   browser bars never move); the script moves the scenes with the finger. Height = the small viewport.
   ===================================================================================================== */
html.pager, html.pager body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.pager body { position: relative; }
html.pager main { position: fixed; left: 0; top: 0; width: 100%; height: var(--vh); overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.pager .scene, html.pager .scene[data-steps="2"] { position: absolute; left: 0; top: 0; width: 100%; height: var(--vh); transform: translate3d(0, 150%, 0); will-change: transform; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
html.pager #hero { transform: none; }
html.pager .stage { position: relative; top: auto; height: var(--vh); }
html.pager [data-in]:not(.half) { opacity: 1 !important; transform: none !important; transition: none !important; }
html.pager .half { transition: none !important; }
html.pager .half { will-change: transform, opacity; }
html.pager .half.h2 { opacity: 0; }
html.pager .beats { display: none; }
html.pager .screen-off { display: none !important; }
html.pager .home-img.ok { transform: translateY(-42%) !important; transition: none !important; }
html.pager .art-img { transition: opacity .6s ease; }
html.pager .askbox, html.pager .button, html.pager .free-link, html.pager .footer a { -webkit-user-select: none; user-select: none; }
/* the same calm bar as the plain page, behind the name and the website button */
html.pager .topbar { display: block; position: fixed; left: 0; right: 0; top: 0; height: 68px; height: calc(68px + env(safe-area-inset-top)); z-index: 29; background: #141213; pointer-events: none; transition: opacity .3s ease, background-color .3s ease, visibility 0s; }
html.pager[data-tone="light"] .topbar { background: #FAF7F2; }
html.pager[data-beat="ai"] .topbar { background: #FFFFFF; }
html.pager[data-beat="hero"] .topbar, html.pager[data-beat="close"] .topbar, html.pager[data-beat="art"] .topbar, html.pager:not([data-beat]) .topbar { opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
html.pager .brand { top: max(12px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); }
html.pager .site-link { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
/* a quiet progress mark on the right edge */
.pmark { position: fixed; right: 5px; top: 50%; width: 3px; height: 104px; margin-top: -52px; border-radius: 2px; background: rgba(255,255,255,0.22); z-index: 28; pointer-events: none; overflow: hidden; transition: background-color .3s ease; }
.pmark i { position: absolute; left: 0; top: 0; width: 100%; border-radius: 2px; background: var(--gold); will-change: transform; }
html[data-tone="light"] .pmark { background: rgba(123,45,59,0.2); }
/* the first scene says how to move on, until the first swipe */
html.pager .cue { display: flex; transition: opacity .4s ease; }
html.pager .cue i { animation: cue-bob 1.8s ease-in-out infinite; }
@keyframes cue-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
html.pager.swiped .cue { opacity: 0 !important; }
/* the smallest phones (320x568, 360x640): every scene fits one screen */
@media (max-width: 819px) and (max-height: 600px) {
  html.pager .title { font-size: clamp(28px, 8.6vw, 36px); }
  html.pager #hero h1 { font-size: clamp(40px, 12.4vw, 54px); }
  html.pager .hero-sub { font-size: 16px; margin-top: 10px; }
  html.pager #hero .hero-copy .wordmark { font-size: min(26px, 7.4vw); margin-bottom: 10px; }
  html.pager .hero-copy { bottom: 64px; }
  html.pager .lede-big { font-size: clamp(32px, 10vw, 44px); }
  html.pager .prayer { font-size: 17px; line-height: 1.26; }
  html.pager .verse-text { font-size: clamp(24px, 7.4vw, 30px); }
  html.pager .number { font-size: clamp(56px, 18vw, 76px); }
  html.pager #church .title, html.pager #mass .title { font-size: clamp(26px, 8vw, 34px); }
  html.pager #morning .title { font-size: clamp(30px, 9vw, 40px); }
  html.pager .ai-title { font-size: clamp(32px, 10vw, 44px); }
  html.pager .askbox { min-height: 62px; margin-top: 16px; }
  html.pager .close-title { font-size: clamp(38px, 12vw, 52px); }
  html.pager .close-mark { font-size: min(24px, 7vw); margin-bottom: 8px; }
  html.pager .close-lead { margin-top: 12px; font-size: 17px; }
  html.pager .button { min-height: 50px; }
  html.pager .quiet { margin-top: 8px; font-size: 16px; }
  html.pager .footer { height: 52px; }
  html.pager .close-copy { bottom: 56px; }
  html.pager .art-line { font-size: clamp(24px, 7.4vw, 32px); }
  html.pager .sub { font-size: 16px; margin-top: 8px; }
  html.pager .eyebrow { margin-bottom: 6px; }
}
