/* portal.css · Direction b, "Through the cartouche". One signature move on the home and nothing else.
 *
 * The hero is a wall. Scrolling opens the cartouche in that wall, behind Christopher, and the page passes
 * through it into My story. The story on the far side is the real section, not a picture of it.
 * Everything below html.px-on exists only while assets/js/portal.js is running. Without JavaScript, or under
 * prefers-reduced-motion, none of it applies and the home is the plain, complete page.
 */

/* the wrappers do nothing until the portal is on */
.px-plate { display: contents; }

:root { --px-vh: 100vh; --px-t: calc(var(--px-vh) * 1.25); }
@supports (height: 100lvh) { :root { --px-vh: 100lvh; } }
@media (max-width: 899px) { :root { --px-t: calc(var(--px-vh) * 1.05); } }

/* the track: the hero holds still for --px-t of scroll with the story waiting behind it, then both leave together */
html.px-on .px { position: relative; background: var(--lo-ground); }
html.px-on .px-door { margin-bottom: calc(-1 * (var(--px-t) + var(--px-vh))); }
html.px-on .px::after, html.px-on .px-door::after { content: ""; display: block; height: var(--px-t); }
html.px-on #top { position: sticky; top: var(--px-top, 0px); z-index: 2; min-height: var(--px-vh); background: none; }
html.px-on #story { position: sticky; top: 0; z-index: 1; min-height: var(--px-vh); transform-origin: 50% calc(var(--px-vh) / 2); }

/* the wall, as one plate that can be cut: the same layers as the hero on main, gathered so the hole goes through all of them */
html.px-on #top::before, html.px-on #top::after { display: none; }
html.px-on .px-plate { display: block; position: absolute; inset: 0; z-index: 0; background: var(--lo-ground); }
html.px-on .px-plate::before, html.px-on .px-plate::after { content: ""; position: absolute; left: 0; right: 0; z-index: 1; pointer-events: none; }
html.px-on .px-plate::before { top: 0; bottom: 0;
  background: linear-gradient(100deg, rgba(18, 12, 23, .82) 0%, rgba(18, 12, 23, .42) 48%, rgba(18, 12, 23, .12) 100%),
              radial-gradient(60% 70% at 72% 55%, rgba(201, 161, 90, .16), transparent 70%); }
html.px-on .px-plate::after { bottom: 0; height: 22vh; background: linear-gradient(to bottom, transparent, #0A040C); }
html.px-live .px-plate { will-change: clip-path; }
html.px-live .rv-cut, html.px-live .px-rim { will-change: transform, opacity; }

/* the rim, the light behind it, and the ankh at the threshold */
.px-rim { position: absolute; left: 0; top: 0; z-index: 1; width: 100%; height: var(--px-vh); overflow: visible; pointer-events: none; opacity: 0; }
.px-rim path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.px-rim .px-rim__light { stroke: none; }
.px-rim .px-rim__wide { stroke: #E8BE6C; stroke-opacity: .07; stroke-width: 26; }
.px-rim .px-rim__near { stroke: #E8BE6C; stroke-opacity: .18; stroke-width: 9; }
.px-rim .px-rim__line { stroke: #F1D58A; stroke-opacity: .95; stroke-width: 1.5; }
.px-ankh { position: absolute; left: 0; top: 0; z-index: 1; display: block; width: 44px; height: 64px; margin: -32px 0 0 -22px; color: #F1D58A; pointer-events: none; opacity: 0;
  filter: drop-shadow(0 0 10px rgba(233, 190, 110, .7)); }

@media (max-width: 899px) { .px-ankh { width: 34px; height: 50px; margin: -25px 0 0 -17px; } }

/* the far side starts dark and comes up as you arrive; portal.js holds these while the door is open */
html.px-on #story > .lo-copy, html.px-on #story > .lo-frame { animation: none; transition: none; translate: none; }

/* a deep link on a phone clears the top edge */
@media (max-width: 760px) { .px > section, .px-door > section { scroll-margin-top: 76px; } }
