/* ============ v22: carved doors on springs, and touch feedback ============ */
/* Loaded after doc.css. The doors are a drawn, panelled pair (see #doorLeaf in index.html). Their motion is a damped spring in main.js:
   they can be interrupted at any moment, keep their speed, soft-close into the frame, and follow a finger dragged across the arch. */
/* Each leaf is a little taller than the arch (plain lacquer above and below the drawing), so when its far edge
   recedes in perspective no paper shows under or over it. */
.hero-stage .door { top: -7%; bottom: -7%; width: 50%; border: 0; box-shadow: none; overflow: hidden;
  background: linear-gradient(180deg, #3A1723 0%, #2B1119 50%, #1D0B11 100%);
  transform: perspective(1500px) rotateY(92deg); will-change: transform; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.hero-stage .door-r { width: calc(50% + 1px); transform: perspective(1500px) rotateY(-92deg); }
.hero-stage .door::before, .hero-stage .door::after { content: none; }
.hero-stage .door svg { position: absolute; left: 0; top: 6.14%; width: 100%; height: 87.72%; display: block; }
.hero-stage .door-r svg { transform: scaleX(-1); }
/* a door turning away from the light falls into shade */
.door-shade { position: absolute; inset: 0; background: #0B0407; opacity: .7; pointer-events: none; will-change: opacity; }
/* the room behind dims as the doors come together, so the last gap is a warm glow, never a white line */
.door-veil { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; will-change: opacity;
  background: radial-gradient(60% 75% at 50% 55%, #2A1219 0%, #150A0E 70%, #0B0407 100%); }
#arch { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#arch img { -webkit-user-drag: none; pointer-events: none; }
@media (pointer: fine) { #arch { cursor: grab; } #arch.is-held { cursor: grabbing; } }

/* Touch feedback: things you press give a little, at once, and spring back when you let go */
.btn, .occ, .wa-float, .tab { -webkit-tap-highlight-color: transparent; }
.btn { transition: color .35s var(--ease), border-color .35s, transform .5s cubic-bezier(.3, 1.45, .5, 1); }
.btn:active { transform: scale(.965); transition: color .35s var(--ease), border-color .35s, transform .09s ease-out; }
.occ { transition: color .3s, transform .5s cubic-bezier(.3, 1.45, .5, 1); transform-origin: 0 100%; }
.occ:active { transform: scale(.97); transition: color .3s, transform .09s ease-out; }
.wa-float:active { transform: scale(.92); transition: transform .09s ease-out; }

/* ============ v23: the hero painting sits whole inside the arch, with one fine gold line ============ */
/* No cream band or second hairline over the picture. The picture is set a little smaller on its own paper,
   so the arch never cuts into the painted scene, and its edges melt into the paper. */
.hero-stage .arch-clip::after { content: none; }
.hero-stage .arch-clip { background: #FBF7EE; }
.hero-stage .comic-layer { background: #FBE4C7; }
.hero-stage .hero-img { inset: auto; left: 5%; bottom: 0; top: auto; width: 90%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 50%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 6%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 6%, #000 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.hero-stage .arch-line-out { display: none; }

/* ============ v24: the nine chapters. Whole paintings without cream bands, and a browser-driven glide on Android ============ */
/* Same principle as the hero: no band or hairline over the picture, one gold line, the painting set whole on its own paper. */
.chap-art .arch-clip, .chap-art .arch-clip.has-img { box-shadow: none; background: #FBE2C3; }
.chap-art .arch-clip.has-img::before { content: none; }
.chap-art .slot-img { inset: auto; left: 5%; bottom: 0; top: auto; width: 90%; height: auto; aspect-ratio: 2 / 3; object-position: 50% 50%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 6%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 6%, #000 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.chap-art .arch-clip.has-img .chap-deva, .weddings .chap-art .arch-clip.has-img .chap-deva {
  background: linear-gradient(to top, rgba(251,226,195,.97) 0%, rgba(251,226,195,.9) 45%, rgba(251,226,195,0) 100%); }

/* Android (class added by main.js only where the browser supports it): scroll-driven animations.
   Progress runs from the section's top reaching the top of the screen to its bottom reaching the bottom.
   Chapter i (0 to 8) is centred at i/8 of that, and is lit for 1.15 steps either side. */
.strip-css { view-timeline: --wed block; }
.strip-css #strip { animation: wedSlide linear both; animation-timeline: --wed; animation-range: contain 0% contain 100%; will-change: transform; }
.strip-css .strip-progress span { animation: wedBar linear both; animation-timeline: --wed; animation-range: contain 0% contain 100%; }
.strip-css .chap-art { animation: wedLit ease-in-out both; }
.strip-css .chap-art::before { animation: wedGlow ease-in-out both; }
.strip-css .chap h3, .strip-css .chap p { animation: wedText ease-in-out both; }
.strip-css .chap-art, .strip-css .chap-art::before, .strip-css .chap h3, .strip-css .chap p {
  animation-timeline: --wed; animation-range: contain calc((var(--i) - 1.15) * 12.5%) contain calc((var(--i) + 1.15) * 12.5%); }
.strip-css .chap-art .arch-clip::after { display: none; }
.strip-css .chap-art .arch-line path { opacity: .9; }
@keyframes wedSlide { from { transform: translate3d(var(--x0, 0px), 0, 0); } to { transform: translate3d(var(--x1, 0px), 0, 0); } }
@keyframes wedBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes wedLit { 0%, 100% { transform: scale(.86) translateZ(0); opacity: .5; } 50% { transform: scale(1) translateZ(0); opacity: 1; } }
@keyframes wedGlow { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes wedText { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }

/* ============ v25: Android fit, and the Atelier sits lower ============ */
/* Parts that slide in from the side were making the page a little wider than the screen until they arrived.
   Android then zooms the whole page out to fit, which pushes the top bar past the right edge. Clip the page's width. */
html { overflow-x: clip; }
/* The Atelier cards rest a little lower under the top bar on phones and tablets. */
@media (max-width: 960px) {
  .svc:nth-child(1) { top: 106px; } .svc:nth-child(2) { top: 118px; } .svc:nth-child(3) { top: 130px; } .svc:nth-child(4) { top: 142px; }
}
/* The small paintings on the Atelier cards: whole, on their own paper, no cream band (as in the hero and chapters). */
.svc-art .arch-clip:has(.slot-img)::after { content: none; }
.svc-art .arch-clip:has(.slot-img) { background: #FBE4C7; }
.svc-art .slot-img { inset: auto; left: 5%; bottom: 0; top: auto; width: 90%; height: auto; aspect-ratio: 2 / 3;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 6%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 6%, #000 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
