/* Moribund — living portraits (one page per character, driven by portrait.js + characters.js)
   The portrait and the act are film, so they stay dark in both themes.
   Per character, the page sets the ambient image (inline background-image on .pt-ambient)
   and --pt-focus (object-position of the layers) on .pt-portrait. */
.pt-hero, .pt-act, .pt-end {
  --text: #f2f2f0; --silver: #c8c8c6; --muted: #a3a3a0;
  --line: rgba(242, 242, 240, .14); --line-strong: rgba(242, 242, 240, .34);
  position: relative; background: #000; color: var(--text);
}

/* ---------- Hero: the depth portrait ---------- */
.pt-page main { padding-top: 0; }   /* the portrait runs up under the header, like the home opening */
.pt-hero { height: 100vh; height: 100svh; min-height: 520px; overflow: hidden; isolation: isolate; }
.pt-ambient {                      /* wide screens: the ring's own light spills past the frame */
  position: absolute; inset: -12%; z-index: 0; display: none;
  background-position: 50% 8%; background-size: auto 150%; background-repeat: no-repeat;
  filter: blur(46px) brightness(.55); opacity: .7;
}
.pt-portrait {
  position: absolute; z-index: 1; top: 0; left: 50%; height: 100%; aspect-ratio: 9 / 16; max-width: 100%;
  transform: translateX(-50%); overflow: hidden; isolation: isolate;
}
.pt-layer { position: absolute; inset: -3%; will-change: transform; }
.pt-layer img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--pt-focus, 50% 30%); user-select: none; -webkit-user-drag: none; }
.pt-back { z-index: 1; }
.pt-figure { z-index: 2; }
.pt-dust { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; }
.pt-light {
  position: absolute; z-index: 4; left: 0; top: 0; width: 76%; aspect-ratio: 1; margin: -38% 0 0 -38%;
  border-radius: 50%; pointer-events: none; mix-blend-mode: overlay; opacity: 0; will-change: transform, opacity;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .62), rgba(255, 255, 255, .22) 42%, rgba(255, 255, 255, 0));
}
.pt-hero::after {                  /* floor scrim under the credits */
  content: ""; position: absolute; inset: auto 0 0; height: 58%; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .92), rgba(0, 0, 0, .62) 40%, rgba(0, 0, 0, 0));
}
@media (min-aspect-ratio: 3 / 5) {
  .pt-ambient { display: block; }
  .pt-portrait { top: calc(var(--header-h) * .6); }   /* keep the ring clear of the header bar */
  .pt-portrait { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
}

.pt-titles {
  position: absolute; z-index: 5; left: 0; right: 0; bottom: calc(clamp(26px, 6svh, 64px) + env(safe-area-inset-bottom, 0px));
  padding: 0 var(--gutter); text-align: center; will-change: opacity;
}
.pt-eyebrow { margin: 0; color: var(--silver); text-transform: uppercase; letter-spacing: .3em; padding-left: .3em; font-size: .78rem; }
.pt-name {
  margin: .38em auto .78em; max-width: 14em; font-family: var(--sub); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2rem, 8.4vw, 4.6rem); line-height: 1.08; letter-spacing: .16em; padding-left: .16em;
  color: #f4f4f2; text-wrap: balance; text-shadow: 0 2px 30px rgba(0, 0, 0, .85);
}
.pt-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
@media (min-width: 700px) { .pt-actions { flex-direction: row; justify-content: center; gap: 34px; } }

/* ---------- Buttons: magnetic credit cards ---------- */
.pt-magnet { display: inline-block; will-change: transform; }
.pt-btn { position: relative; overflow: hidden; min-width: min(20rem, 84vw); }
.pt-btn-label { display: inline-block; will-change: transform; }
.pt-btn::after {                   /* press glow, from where the finger or cursor went down */
  content: ""; position: absolute; left: var(--gx, 50%); top: var(--gy, 50%); width: 260%; aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(.2); border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(242, 242, 240, .34), rgba(242, 242, 240, .08) 55%, rgba(242, 242, 240, 0));
}
.pt-btn.is-press::after { animation: pt-press .7s cubic-bezier(.22, 1, .36, 1) forwards; }
@keyframes pt-press { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.2); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
.pt-btn:focus-visible { outline: 1px solid var(--text); outline-offset: 5px; background: rgba(242, 242, 240, .08); }
.pt-link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 2px 4px; }
.pt-link:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }
html[data-theme="light"] .pt-hero .btn.primary, html[data-theme="light"] .pt-end .btn.primary { background: rgba(0, 0, 0, .35); border-color: rgba(242, 242, 240, .9); color: var(--text); }
@media (hover: hover) and (pointer: fine) {
  html[data-theme="light"] .pt-hero .btn:hover, html[data-theme="light"] .pt-end .btn:hover { background: rgba(242, 242, 240, .08); border-color: var(--text); }
}

/* ---------- Act II: the character's clip, scrubbed by scroll ---------- */
.pt-act { height: 300vh; height: 300lvh; }
.pt-act-stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; }
.pt-act-stage img, .pt-seq { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pt-seq { opacity: 0; transition: opacity .5s ease; }
.pt-seq.ready { opacity: 1; }
.pt-act-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, #000, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 66%, rgba(0, 0, 0, .85));
}
.pt-act-credit {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(10svh + env(safe-area-inset-bottom, 0px)); margin: 0;
  text-align: center; text-transform: uppercase; letter-spacing: .3em; padding-left: .3em; color: var(--text); opacity: 0;
}
html:not(.pt-js) .pt-act-credit { opacity: 1; }

.pt-end { display: grid; place-items: center; padding: clamp(80px, 16svh, 180px) var(--gutter) clamp(90px, 18svh, 200px); }

/* ---------- Reduced motion: a still portrait, everything usable ---------- */
@media (prefers-reduced-motion: reduce) {
  .pt-layer, .pt-light, .pt-magnet, .pt-btn-label { will-change: auto; }
  .pt-dust { display: none; }
  .pt-btn.is-press::after { animation: none; }
  .pt-seq { transition: none; }
}

/* ---------- More characters: previous / all / next ---------- */
.pt-end { gap: clamp(56px, 10svh, 96px); }
.pt-more {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "prev next" "all all"; gap: 18px 14px;
  width: min(100%, 56rem); padding-top: 28px; border-top: 1px solid var(--line);
}
.pt-prev { grid-area: prev; } .pt-next { grid-area: next; } .pt-all { grid-area: all; justify-self: center; }
.pt-step {
  display: flex; align-items: center; gap: 14px; min-height: 44px; color: var(--text); text-decoration: none;
}
.pt-next { flex-direction: row-reverse; text-align: right; }
.pt-step img {
  flex: none; width: clamp(54px, 13vw, 76px); aspect-ratio: 9 / 16; height: auto; object-fit: cover;
  border: 1px solid var(--line); filter: brightness(.82); transition: filter .4s ease, border-color .4s ease;
}
.pt-step-text { display: grid; gap: 6px; min-width: 0; }
.pt-step-dir { color: var(--muted); font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; }
.pt-step-name { font-family: var(--sub); text-transform: uppercase; letter-spacing: .14em; font-size: clamp(.86rem, 3.4vw, 1.05rem); line-height: 1.3; }
.pt-all { display: inline-flex; align-items: center; min-height: 44px; }
.pt-step:focus-visible, .pt-all:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }
@media (hover: hover) and (pointer: fine) {
  .pt-step:hover img { filter: brightness(1); border-color: var(--line-strong); }
}
@media (min-width: 760px) {
  .pt-more { grid-template-columns: 1fr auto 1fr; grid-template-areas: "prev all next"; align-items: center; }
}
@media (prefers-reduced-motion: reduce) { .pt-step img { transition: none; } }
