/* The portrait (portrait-burst.js): the face as a mosaic of 210 pictures that streams forward into the journey. */

.pb-host, .nv-after, .pb-credits {
    --pb-ground: #0d0c0b;
    --pb-cream: #f3ece0;
    --pb-copper: #d98a4e;
    --pb-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, Menlo, monospace;
    --pb-sans: 'Geist', 'Helvetica Neue', Arial, sans-serif;
}

/* The face sits over the journey's stage (hero-nv.js) on the same scroll track; portrait-burst.js sets the track's
   height and the point where the journey starts. Until its first frame the canvas is the dark ground itself. */
.pb-scene {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    background: var(--pb-ground);
}
.pb-scene.is-painted { background: transparent; }
.pb-host .pb-cue { z-index: 5; }
.pb-host.pb-moving .pb-cue { opacity: 0; }
.pb-host .pb-credits-btn { z-index: 6; transition: opacity 0.4s ease; }
.pb-host.pb-past .pb-credits-btn, .pb-host.pb-gone .pb-credits-btn { opacity: 0; pointer-events: none; }
html.pb-static .pb-host .pb-scene, html.pb-static .pb-host .pb-cue, html.pb-static .pb-host .pb-credits-btn { display: none; }
@media (prefers-reduced-motion: reduce) {
    .pb-host { margin-bottom: 0; }
    .pb-host .pb-scene, .pb-host .pb-credits-btn { transition: opacity 0.8s ease; }
    .pb-host.pb-off .pb-scene, .pb-host.pb-off .pb-cue, .pb-host.pb-off .pb-credits-btn { opacity: 0; pointer-events: none; }
}
.pb-track, .pb-stage { display: none; }   /* (the earlier stand-alone stage; not used) */
.pb-flash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: screen;
    background: radial-gradient(60% 60% at var(--pb-fx, 50%) var(--pb-fy, 50%), rgba(255, 214, 160, 0.95) 0%, rgba(217, 138, 78, 0.55) 30%, rgba(13, 12, 11, 0) 72%);
}
.pb-cue {
    position: absolute;
    left: 50%;
    bottom: clamp(18px, 4vh, 36px);
    margin: 0;
    transform: translateX(-50%);
    font: 500 11px/1 var(--pb-mono);
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(243, 236, 224, 0.5);
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.pb-cue::after {
    content: '';
    display: block;
    width: 1px;
    height: 26px;
    margin: 10px auto 0;
    background: linear-gradient(rgba(243, 236, 224, 0.55), rgba(243, 236, 224, 0));
    animation: pb-cue 2.4s ease-in-out infinite;
    transform-origin: top;
}
@keyframes pb-cue { 0% { transform: scaleY(0); } 45% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.pb-track.is-moving .pb-cue { opacity: 0; }

/* caption of the hovered card: title · author · year */
.pb-cap {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 3;
    margin: 0;
    max-width: min(360px, 70vw);
    padding: 7px 10px 6px;
    font: 500 11.5px/1.4 var(--pb-mono);
    letter-spacing: 0.04em;
    color: var(--pb-cream);
    background: rgba(13, 12, 11, 0.82);
    border: 1px solid rgba(217, 138, 78, 0.55);
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.pb-cap.is-on { opacity: 1; }
.pb-cap b { font-weight: 500; color: #ffd8b0; }
.pb-track.is-hover { cursor: pointer; }

.pb-credits-btn {
    position: absolute;
    z-index: 4;
    right: clamp(16px, 2.2vw, 36px);
    bottom: clamp(18px, 4vh, 36px);
    margin: 0;
    padding: 7px 11px 6px;
    font: 500 11px/1 var(--pb-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(243, 236, 224, 0.62);
    background: rgba(13, 12, 11, 0.6);
    border: 1px solid rgba(243, 236, 224, 0.2);
    border-radius: 999px;
    cursor: pointer;
    transition: opacity 0.4s ease, border-color 0.2s ease, color 0.2s ease;
}
.pb-credits-btn:hover { border-color: var(--pb-copper); color: var(--pb-cream); }
.pb-credits-btn:focus-visible { outline: 2px solid var(--pb-copper); outline-offset: 2px; }
.pb-track.is-final .pb-credits-btn { opacity: 0; pointer-events: none; }

.pb-credits {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(820px, calc(100vw - 24px));
    height: fit-content;
    max-height: min(86vh, 900px);
    padding: 0;
    color: var(--pb-cream);
    background: #151311;
    border: 1px solid rgba(243, 236, 224, 0.16);
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    font-family: var(--pb-sans);
}
.pb-credits::backdrop { background: rgba(0, 0, 0, 0.6); }
.pb-credits-in { max-height: min(86vh, 900px); overflow: auto; padding: 0 clamp(18px, 3vw, 36px) 32px; overscroll-behavior: contain; }
.pb-credits-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 22px 0 14px; background: #151311; border-bottom: 1px solid rgba(243, 236, 224, 0.14); }
.pb-credits h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.pb-credits-x { font: 500 12px/1 var(--pb-mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 12px;
    color: var(--pb-cream); background: transparent; border: 1px solid rgba(243, 236, 224, 0.3); border-radius: 999px; cursor: pointer; }
.pb-credits-x:focus-visible { outline: 2px solid var(--pb-copper); outline-offset: 2px; }
.pb-credits-note { margin: 16px 0 8px; max-width: 62ch; font-size: 15px; line-height: 1.5; color: rgba(243, 236, 224, 0.7); }
.pb-credits h3 { margin: 26px 0 8px; font: 500 13px/1.3 var(--pb-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--pb-copper); }
.pb-credits ol { margin: 0; padding-left: 1.8em; font-size: 14px; line-height: 1.5; }
.pb-credits li { margin-bottom: 6px; }
.pb-credits .pb-cr-t { font-weight: 600; }
.pb-credits a { color: #ffd8b0; }

/* footer list of every picture (Wikimedia Commons attribution) */
html:not([data-hv]) .nv-after {
    position: relative;
    z-index: 2;
    padding: 28px clamp(16px, 4vw, 48px);
    background: #0c0c0e;
    color: rgba(250, 249, 240, 0.55);
    font-family: var(--pb-mono);
}
html:not([data-hv]) .nv-credits-list { max-width: 60rem; font-size: 12px; line-height: 1.6; }
html:not([data-hv]) .nv-credits-list summary { cursor: pointer; font-weight: 500; }
html:not([data-hv]) .nv-credits-list ol { margin: 16px 0 0; padding-left: 2.5em; columns: 2 22rem; column-gap: 40px; }
html:not([data-hv]) .nv-credits-list li { break-inside: avoid; margin-bottom: 4px; }
html:not([data-hv]) .nv-credits-list a { color: rgba(250, 249, 240, 0.8); }

@media (max-width: 699px) {
    .pb-credits-btn { right: 10px; top: 68px; bottom: auto; font-size: 10.5px; padding: 6px 9px 5px; }
    .pb-cap { max-width: calc(100vw - 32px); }
}

/* no WebGL: the stage is skipped, the hero is the first screen */
html.pb-static .pb-track { height: auto !important; margin-bottom: 0; }
html.pb-static .pb-stage { position: static; height: auto; background: transparent; padding: 76px 16px 0; }
html.pb-static .pb-scene, html.pb-static .pb-light, html.pb-static .pb-flash, html.pb-static .pb-cue, html.pb-static .pb-cap { display: none; }
html.pb-static .pb-credits-btn { position: static; display: block; margin-left: auto; }

/* ?d=0 "made of this": the return. The journey's words leave before its last frame is taken; once the portrait has
   that frame on screen the stage underneath steps aside, so the hero (held in place under it) is there when the
   dark lifts. */
.pb-host.pb-ret0 .nv-story, .pb-host.pb-ret0 .nv-note, .pb-host.pb-ret0 .nv-dossier { opacity: 0 !important; }
.pb-host.pb-bld .nv-story, .pb-host.pb-bld .nv-note, .pb-host.pb-bld .nv-dossier { opacity: 0 !important; }
.pb-host.pb-ret0 .nv-con-labs, .pb-host.pb-bld .nv-con-labs { opacity: 0 !important; }
.pb-host.pb-ret .nv-stage, .pb-host.pb-done .nv-stage { background: transparent !important; }
.pb-host.pb-ret .nv-stage > :not(.pb-scene):not(.pb-say) { visibility: hidden; }
.pb-host.pb-done .nv-stage { visibility: hidden; }

/* ?d=0: three lines in the corridor (portrait-burst.js SAY) — two on the way in, one on the way back; never over the face.
   Opacity is set per frame from the scroll; the type is the journey's, centred, light on the dark. */
.pb-say {
    position: absolute; left: 50%; top: 50%; z-index: 5;
    width: min(760px, calc(100vw - 32px)); transform: translate(-50%, -50%);
    margin: 0; text-align: center; pointer-events: none; opacity: 0;
    color: var(--pb-cream);
    text-shadow: 0 1px 14px rgba(10, 9, 8, 0.8);
    padding: 14px 18px;
    background: radial-gradient(closest-side, rgba(10, 9, 8, 0.5), rgba(10, 9, 8, 0.28) 62%, rgba(10, 9, 8, 0));
}
.pb-say[hidden] { display: none; }
.pb-say-q {
    display: block;
    max-width: 28ch; margin: 0 auto;
    font-family: var(--pb-sans); font-style: normal; font-weight: 500;
    font-size: clamp(2.125rem, 2.9vw, 2.625rem); line-height: 1.15; letter-spacing: -0.012em; text-wrap: balance;
}
.pb-say-by {
    display: block; margin-top: 16px;
    font: 400 12px/1.3 var(--pb-mono); letter-spacing: 0.06em; color: rgba(243, 236, 224, 0.72);
}
@media (max-width: 700px) {
    .pb-say-q { font-size: 24px; }
    .pb-say-by { font-size: 11px; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .pb-say { display: none; } }

/* the hand-off (portrait-burst.js): while the mosaic face lies on the hero's portrait and turns into it, the portrait
   itself is held back; the face's last frame is the portrait, and they swap in one frame */
html.pb-hand #hero .hero-portrait { visibility: hidden; }

/* The two ways in (portrait-cta.js), either side of the opening face: Technical on the left, Artistic on the right,
   centred on the face (portrait-burst.js writes the face's box as --pb-fl/fr/ft/fb/fcy). On a phone: above and below. */
.pb-ways { position: absolute; inset: 0; z-index: 7; pointer-events: none; opacity: 0; animation: pb-ways-in 1s ease 0.9s forwards; transition: opacity 0.45s ease; }
@keyframes pb-ways-in { to { opacity: 1; } }
.pb-host.pb-moving .pb-ways, .pb-host.pb-gone .pb-ways, html.pb-static .pb-ways, .pb-ways.is-leaving { opacity: 0 !important; animation: none; }
.pb-host.pb-moving .pb-way, .pb-host.pb-gone .pb-way, .pb-ways.is-leaving .pb-way { pointer-events: none; }
.pb-way {
    --pb-acc: #f3ece0;
    position: absolute;
    top: var(--pb-fcy, 50%);
    display: flex; flex-direction: column; gap: 9px;
    max-width: 260px;
    padding: 14px 4px;
    color: var(--pb-cream);
    text-decoration: none;
    pointer-events: auto;
    transform: translateY(-50%);
    -webkit-tap-highlight-color: transparent;
}
.pb-way--tech { --pb-acc: #6dff9a; right: calc(100% - var(--pb-fl, 30%) + clamp(28px, 3vw, 56px)); left: auto; align-items: flex-end; text-align: right; }
.pb-way--art { --pb-acc: #e0a074; left: calc(100% - var(--pb-fr, 30%) + clamp(28px, 3vw, 56px)); align-items: flex-start; text-align: left; }
.pb-way-t {
    font: 400 17px/1.15 var(--pb-sans);
    letter-spacing: -0.005em;
    white-space: nowrap;
}
.pb-way-d { color: rgba(243, 236, 224, 0.42); margin: 0 0.15em; }
.pb-way-a { display: inline-block; color: var(--pb-acc); transition: transform 0.35s cubic-bezier(.2, .7, .2, 1); }
.pb-way-s {
    font: 400 11px/1 var(--pb-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(243, 236, 224, 0.5);
    white-space: nowrap;
    transition: color 0.3s ease;
}
/* a hairline that reaches toward the face */
.pb-way::after {
    content: '';
    position: absolute; top: 50%;
    width: 22px; height: 1px;
    background: rgba(243, 236, 224, 0.35);
    transition: width 0.4s cubic-bezier(.2, .7, .2, 1), background 0.3s ease;
}
.pb-way--tech::after { left: calc(100% + 10px); }
.pb-way--art::after { right: calc(100% + 10px); }
.pb-way:hover .pb-way-s, .pb-way:focus-visible .pb-way-s { color: var(--pb-acc); }
.pb-way:hover::after, .pb-way:focus-visible::after { width: 44px; background: var(--pb-acc); }
.pb-way--tech:hover .pb-way-a, .pb-way--tech:focus-visible .pb-way-a { transform: translateX(5px); }
.pb-way--art:hover .pb-way-a, .pb-way--art:focus-visible .pb-way-a { transform: translateX(-5px); }
.pb-way:focus-visible { outline: 1px solid var(--pb-acc); outline-offset: 4px; border-radius: 2px; }
@media (max-width: 699px) {
    .pb-way { left: 50% !important; right: auto !important; top: auto; align-items: center !important; text-align: center !important; transform: translateX(-50%); padding: 8px 12px; gap: 7px; max-width: none; }
    .pb-way--tech { bottom: calc(100% - var(--pb-ft, 30%) + 22px); }
    .pb-way--art { top: calc(100% - var(--pb-fb, 30%) + 22px); }
    .pb-way::after { display: none; }
    .pb-way-t { font-size: 16px; }
    .pb-way-s { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .pb-ways { animation-duration: 0.01s; animation-delay: 0s; } }

/* the curtain of a way out: a canvas over the page while the face turns and the section is brought in */
.pb-curtain { position: fixed; inset: 0; z-index: 100000; width: 100vw; height: 100vh; pointer-events: none; }
