/* The rail stays in the storefront; only the album enters the top layer. */
html { scrollbar-gutter:stable }
html.sv-lock { overflow:hidden }
.sv:not([open]) { display:none }
.sv {
  --ink:#382d33; --berry:#86244f; color:var(--ink);
  position:fixed; inset:0; margin:auto; padding:0; border:0; overflow:visible;
  width:min(460px,calc(100vw - 40px),64vh); max-width:none; max-height:none;
  background:white; border-radius:16px; box-shadow:0 16px 80px #41223922;
}
.sv::backdrop { background:rgb(255 255 255 / .94); opacity:0; transition:opacity .18s ease }
.sv.is-visible::backdrop { opacity:1 }
.sv-card {
  height:min(840px,calc(100vh - 40px)); height:min(840px,calc(100dvh - 40px));
  display:grid; grid-template-rows:auto auto minmax(0,1fr) auto;
  padding:14px; border-radius:inherit; background:white;
  opacity:0; transform:translateY(8px); transition:opacity .18s ease,transform .22s ease;
}
.sv.is-visible .sv-card { opacity:1; transform:none }
.sv-progress { display:flex; gap:2px }
.sv-progress i { flex:1; height:3px; background:#e9e1e5; overflow:hidden; border-radius:3px }
.sv-progress b { display:block; width:100%; height:100%; background:var(--berry); transform:scaleX(0); transform-origin:left }
.sv-progress .complete b { transform:scaleX(1) }
.sv-head,.sv-foot,.sv-arrows { display:flex; align-items:center }
.sv-head { padding:12px 0; gap:10px }
.sv-head h2,.sv-head small,.sv-caption { margin:0 }
.sv-cover { width:38px; height:38px; border-radius:50%; object-fit:cover }
.sv-head small { display:block; color:#71646b; font-size:11px; line-height:1.3 }
.sv-head h2 { font:600 16px/1.35 var(--sans,Arial,sans-serif); letter-spacing:0 }
.sv .sv-button {
  appearance:none; display:grid; place-items:center; flex:none; padding:0;
  width:44px; height:44px; border:1px solid #ddcfd6; border-radius:50%; background:#fff;
  color:var(--ink); cursor:pointer; transition:color .16s,border-color .16s;
}
.sv-button:focus-visible,.sv-cta:focus-visible { outline:2px solid var(--berry); outline-offset:2px }
.sv .sv-button:hover { color:var(--berry); border-color:var(--berry) }
.sv .sv-button:disabled { opacity:.38; cursor:default }
.sv-button svg { width:18px; height:18px }
.sv-close { margin-inline-start:auto }
.sv-stage { position:relative; overflow:hidden; background:white; touch-action:pan-y pinch-zoom; user-select:none; -webkit-touch-callout:none }
.sv-image,.sv-image img { position:absolute; inset:0; width:100%; height:100% }
.sv-image img { object-fit:contain; display:block; pointer-events:none }
.sv-image .sv-portrait { object-fit:cover }
@media(max-height:480px) and (orientation:landscape) { .sv-image .sv-portrait { object-fit:contain } }
.sv-feedback { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); margin:0; text-align:center; color:#66545d; font-size:14px }
.sv-foot { justify-content:space-between; gap:12px; min-height:76px; padding:12px 2px 0 }
.sv-caption { font-family:var(--serif,Georgia,serif); font-size:clamp(20px,2.4vw,28px); line-height:1.1; text-wrap:balance }
.sv-cta { display:inline-flex; align-items:center; gap:4px; margin-top:5px; color:var(--berry); font-size:13px; font-weight:650 }
.sv-cta svg { width:14px; height:14px }
.sv-arrows { gap:5px }
.sv-album { padding-bottom:80px }
.sv-album h1 { margin:.4em 0 }
.sv-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(230px,100%),1fr)); gap:28px }
.sv-album-frame { margin:0 }
.sv-album-frame img { display:block; width:100%; height:auto; aspect-ratio:4/5; object-fit:contain }
.sv-album-frame h2 { margin:12px 0 4px; font-size:26px }
.sv-album nav { margin-top:55px }
.sv-album nav a { display:inline-block; margin:3px 16px 3px 0; color:#86244f; padding:4px 0 }
@media(max-width:600px) {
  .sv { width:100%; border-radius:0 }
  .sv-card { height:100vh; height:100dvh; padding:max(9px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(9px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)) }
  .sv-head { padding:8px 0 }
  .sv-foot { min-height:70px }
}
@media (max-height:480px) and (min-width:601px) {
  .sv { width:min(540px,90vw) }
  .sv-card { padding:6px 12px; height:96dvh }
  .sv-head { padding:3px 0 }
  .sv-foot { min-height:46px; padding:3px 0 }
}
@media(prefers-reduced-motion:reduce) {
  .sv-card,.sv::backdrop { transition:none; transform:none }
  .sv-progress .current { background:#ae718d }
}

.sv [hidden] { display:none }

/* The contact card occupies the final frame of each album. */
.sv-finale { position:absolute; inset:0; overflow:auto; overscroll-behavior:contain }
.sv-ending {
  --paper:#803855; position:relative; isolation:isolate; overflow:hidden;
  display:flex; flex-direction:column; justify-content:center; gap:clamp(20px,5vh,46px);
  min-height:100%; padding:clamp(20px,3.1vw,38px); color:#fff; background:var(--paper);
}
.sv-ending.tone-mauve { --paper:#75425d }
.sv-ending.tone-plum { --paper:#554065 }
.sv-ending.tone-mulberry { --paper:#812f46 }
.sv-ending.tone-leaf { --paper:#395547 }
.sv-ending.tone-cocoa { --paper:#6a4438 }
.sv-ending::before {
  content:""; position:absolute; z-index:-1; width:62%; aspect-ratio:1; top:-11%; right:-13%;
  opacity:.09; pointer-events:none; background:currentColor;
  mask:url('/assets/favicon.svg') center/contain no-repeat;
}
.sv-ending h2 {
  color:inherit; font:400 clamp(36px,4.1vw,55px)/1.02 var(--serif,Georgia,serif);
  letter-spacing:-.045em; margin:0; text-wrap:balance; overflow-wrap:break-word;
}
.sv-ending p { max-width:40ch; margin:16px 0 22px; color:#fff; font-size:15px; line-height:1.55 }
.sv-ending .sv-collection {
  width:fit-content; max-width:100%; display:inline-flex; align-items:center; gap:12px;
  min-height:46px; padding:11px 19px; border-radius:24px; color:var(--paper); background:#fff;
  font:650 14px/1.35 var(--sans,Arial,sans-serif); text-decoration:none;
}
.sv-ending .sv-collection svg { width:17px; flex:none; transition:transform .18s ease }
.sv-ending .sv-collection:hover svg { transform:translateX(3px) }
.sv-contact { display:flex; align-items:center; flex-wrap:wrap; gap:0 20px }
.sv-contact a { display:inline-flex; align-items:center; gap:7px; min-height:44px; color:inherit; font-size:13px; font-weight:650; text-decoration:none }
.sv-contact a:hover { text-decoration:underline; text-underline-offset:4px }
.sv-contact svg { width:17px; height:17px }
.sv-ending a:focus-visible { outline:2px solid #fff; outline-offset:3px }
.sv-photo-meta[hidden] + .sv-arrows { margin-inline-start:auto }
.sv-album > .sv-ending { min-height:0; margin:48px 0 0; border-radius:12px; padding:clamp(24px,5vw,60px) }
.sv-album > .sv-ending h2 { max-width:18ch }
@media(max-height:540px) {
  .sv-finale .sv-ending { gap:4px; padding:14px 20px }
  .sv-finale h2 { font-size:28px }
  .sv-finale p { margin:5px 0 8px; font-size:13px }
}
@media(prefers-reduced-motion:reduce) { .sv-ending .sv-collection svg { transition:none } }
