/* P_Zenos gate: the transition between Jamzey St. and P_Zenos (loaded on every page) */
:root {
  --pz-abyss: #03141A;
  --pz-deep: #072A31;
  --pz-sea: #0D6B78;
  --pz-teal: #1FB3C4;
  --pz-foam: #D4F6F6;
  --pz-gold: #E4B35C;
  --pz-gold-hi: #F7D995;
  --pz-gold-lo: #A8772C;
  --pz-ease: cubic-bezier(.72, 0, .22, 1);
}

/* ---------- emblem (compass) ---------- */
.pz-emblem { width: 96px; height: 96px; overflow: visible; color: var(--pz-gold); }
.pz-emblem .pz-ring, .pz-emblem .pz-ring2 { fill: none; stroke: currentColor; }
.pz-emblem .pz-ring { stroke-width: 2.4; stroke-dasharray: 290; }
.pz-emblem .pz-ring2 { stroke-width: 1; stroke-dasharray: 2 4; opacity: .7; }
.pz-emblem .pz-ticks line { stroke: currentColor; stroke-width: 1.4; opacity: .85; }
.pz-emblem .pz-star { transform-origin: 50px 50px; transform-box: view-box; }
.pz-emblem .pz-star path { fill: currentColor; }
.pz-emblem .pz-star .pz-star2 { fill: var(--pz-gold-hi); opacity: .75; }
.pz-emblem .pz-hub { fill: var(--pz-abyss); stroke: currentColor; stroke-width: 1.6; }

/* ---------- wordmark ---------- */
.pz-word {
  display: inline-flex; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; line-height: 1;
  font-size: clamp(44px, 9vw, 104px); padding-left: .22em;
}
.pz-word span {
  display: inline-block;
  background: linear-gradient(180deg, var(--pz-gold-hi) 10%, var(--pz-gold) 55%, var(--pz-gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .45));
}
.pz-slogan {
  margin: 0; color: var(--pz-gold-hi); font-weight: 700; letter-spacing: .34em; text-transform: uppercase;
  font-size: clamp(13px, 2vw, 21px); text-align: center; padding-left: .34em; text-shadow: 0 2px 14px rgba(0, 0, 0, .5);
}

/* ---------- the gate ---------- */
.pz-gate { position: fixed; inset: 0; z-index: 1000; pointer-events: none; overflow: hidden; }
.pz-gate.full, .pz-gate.intro, .pz-gate.rise { pointer-events: all; }
.pz-water {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 70% at 30% 0%, rgba(31, 179, 196, .45), transparent 60%),
    radial-gradient(90% 60% at 80% 20%, rgba(13, 107, 120, .6), transparent 70%),
    linear-gradient(180deg, var(--pz-sea) 0%, var(--pz-deep) 45%, var(--pz-abyss) 100%);
}
.pz-water::before, .pz-water::after {   /* sunlight shafts reaching down through the water */
  content: ""; position: absolute; inset: -10% -30%; mix-blend-mode: screen; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 40%, transparent 78%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 40%, transparent 78%);
}
.pz-water::before {
  background: repeating-linear-gradient(104deg, transparent 0 70px, rgba(212, 246, 246, .09) 95px, transparent 130px 210px);
  animation: pz-rays 9s ease-in-out infinite alternate;
}
.pz-water::after {
  background: repeating-linear-gradient(98deg, transparent 0 120px, rgba(212, 246, 246, .06) 150px, transparent 185px 300px);
  animation: pz-rays 13s -4s ease-in-out infinite alternate-reverse;
}
.pz-wave { position: absolute; left: 0; bottom: calc(100% - 1px); width: 200%; height: 70px; fill: var(--pz-sea); animation: pz-wave 2.4s linear infinite; }
.pz-wave.back { height: 90px; opacity: .45; animation-duration: 3.6s; animation-direction: reverse; }
.pz-bubbles i {
  position: absolute; bottom: -30px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%;
  border: 1.5px solid rgba(212, 246, 246, .7); background: rgba(212, 246, 246, .12);
  opacity: 0; animation: pz-bubble var(--d) var(--w) ease-in infinite;
}
.pz-gate-core {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 22px; text-align: center;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
.pz-gate-core .pz-emblem { width: clamp(84px, 12vw, 128px); height: auto; }

/* states
   rise  : water floods in over the departing page, then the title assembles
   full  : everything in place (the first frame of pzenos.html when arriving from the gate)
   intro : a direct visit to pzenos.html: water already up, title assembles
   drain : water falls away to reveal the page                                        */
.pz-gate.rise .pz-water { animation: pz-rise 1s .18s var(--pz-ease) both; }
.pz-gate.rise .pz-bubbles i { animation-delay: calc(var(--w) + .5s); }
.pz-gate.rise, .pz-gate.intro { --base: .95s; }
.pz-gate.intro { --base: .15s; }
.pz-gate.rise .pz-ring, .pz-gate.intro .pz-ring { animation: pz-draw 1s var(--base) var(--pz-ease) both; }
.pz-gate.rise .pz-ring2, .pz-gate.rise .pz-ticks, .pz-gate.intro .pz-ring2, .pz-gate.intro .pz-ticks { animation: pz-fade .6s calc(var(--base) + .3s) both; }
.pz-gate.rise .pz-star, .pz-gate.intro .pz-star { animation: pz-spin 1.3s calc(var(--base) + .1s) cubic-bezier(.2, .9, .25, 1.15) both; }
.pz-gate.rise .pz-hub, .pz-gate.intro .pz-hub { animation: pz-fade .3s calc(var(--base) + .5s) both; }
.pz-gate.rise .pz-word span, .pz-gate.intro .pz-word span { animation: pz-letter .7s calc(var(--base) + .25s + var(--i) * 70ms) var(--pz-ease) both; }
.pz-gate.rise .pz-slogan, .pz-gate.intro .pz-slogan { animation: pz-slogan .8s calc(var(--base) + .7s) var(--pz-ease) both; }
.pz-gate.drain .pz-water { animation: pz-drain 1.05s .2s var(--pz-ease) both; }
.pz-gate.drain .pz-gate-core { animation: pz-away .7s var(--pz-ease) both; }
.pz-gate.drain .pz-bubbles { opacity: 0; transition: opacity .3s; }
.pz-gate.drain .pz-star { animation: pz-spin-out .8s var(--pz-ease) both; }

@keyframes pz-rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes pz-drain { from { transform: none; } to { transform: translateY(105%); } }
@keyframes pz-wave { to { transform: translateX(-50%); } }
@keyframes pz-rays { from { transform: translateX(-4%) skewX(-3deg); opacity: .7; } to { transform: translateX(4%) skewX(3deg); opacity: 1; } }
@keyframes pz-bubble {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  15% { opacity: .9; }
  50% { transform: translate(14px, -50vh) scale(1); }
  100% { transform: translate(-8px, -105vh) scale(1.2); opacity: 0; }
}
@keyframes pz-draw { from { stroke-dashoffset: 290; } to { stroke-dashoffset: 0; } }
@keyframes pz-fade { from { opacity: 0; } }
@keyframes pz-spin { from { transform: rotate(-540deg) scale(0); } to { transform: none; } }
@keyframes pz-spin-out { to { transform: rotate(180deg) scale(1.6); opacity: 0; } }
@keyframes pz-letter { from { opacity: 0; transform: translateY(45%) scale(.9); filter: blur(10px); } }
@keyframes pz-slogan { from { opacity: 0; letter-spacing: .9em; filter: blur(6px); } }
@keyframes pz-away { to { opacity: 0; transform: scale(1.12); filter: blur(10px); } }

/* ---------- the departing Jamzey St. page ---------- */
.pz-leaving body { overflow: hidden; }
.pz-leaving main, .pz-leaving footer {
  transition: transform 1.1s var(--pz-ease), filter 1.1s var(--pz-ease), opacity 1.1s;
  transform: scale(.93) translateY(2%); filter: blur(5px) brightness(.55) saturate(.3); opacity: .8;
}
.pz-leaving .blocks-left { transition: transform .9s var(--pz-ease), opacity .9s; transform: translate(-130%, 30%) rotate(-28deg); opacity: 0; }
.pz-leaving .blocks-right { transition: transform .9s var(--pz-ease), opacity .9s; transform: translate(130%, 30%) rotate(28deg); opacity: 0; }
.pz-leaving .grid-canvas { transition: opacity .6s; opacity: 0; }
.pz-leaving .top { transition: background-color .9s, border-color .9s, color .9s; background: var(--pz-abyss); border-color: rgba(228, 179, 92, .3); color: var(--pz-gold); }
.pz-leaving .top .brand img { animation: jz-mark-out .9s var(--pz-ease) both; }
.pz-leaving .top .brand { color: var(--pz-gold); letter-spacing: .14em; transition: letter-spacing .9s var(--pz-ease), color .6s; }
.pz-leaving .nav > *, .pz-leaving .theme-toggle { transition: opacity .4s, transform .5s var(--pz-ease); opacity: 0; transform: translateY(-12px); }
.pz-leaving .nav > :nth-child(2) { transition-delay: .05s; } .pz-leaving .nav > :nth-child(3) { transition-delay: .1s; }
.pz-leaving .nav > :nth-child(4) { transition-delay: .15s; } .pz-leaving .nav > :nth-child(5) { transition-delay: .2s; }
.pz-leaving .nav > :nth-child(6) { transition-delay: .25s; } .pz-leaving .theme-toggle { transition-delay: .3s; }
@keyframes jz-mark-out { to { transform: rotateY(720deg) scale(0); opacity: 0; } }

/* ---------- back to Jamzey St.: cream curtain ---------- */
.jz-gate {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center; justify-items: center; gap: 18px;
  --jz-bg: #E9E7DA; --jz-ink: #161514;
  --jz-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='55.43' height='32'%3E%3Cpath d='M0 0L27.71 16L55.43 0M0 32L27.71 16L55.43 32' stroke='%23161514' stroke-opacity='.07' stroke-width='1' fill='none'/%3E%3C/svg%3E");
  background: var(--jz-grid), var(--jz-bg); color: var(--jz-ink);
  font: 800 clamp(30px, 5vw, 54px)/1 Inter, "Segoe UI", system-ui, sans-serif; letter-spacing: -.02em;
  animation: jz-up .95s var(--pz-ease) both;
}
.jz-gate img { width: 76px; height: auto; animation: jz-mark-in 1s .45s cubic-bezier(.2, .9, .25, 1.2) both; }
.jz-gate span { animation: pz-letter .6s calc(.6s + var(--i) * 45ms) var(--pz-ease) both; display: inline-block; white-space: pre; }
.jz-gate.dark {
  --jz-bg: #141312; --jz-ink: #F1EEE3;
  --jz-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='55.43' height='32'%3E%3Cpath d='M0 0L27.71 16L55.43 0M0 32L27.71 16L55.43 32' stroke='%23F1EEE3' stroke-opacity='.06' stroke-width='1' fill='none'/%3E%3C/svg%3E");
}
.pz-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes jz-up { from { transform: translateY(100%); } }
@keyframes jz-mark-in { from { transform: rotateY(-540deg) scale(0); opacity: 0; } }

/* arriving on Jamzey St. from P_Zenos: the curtain is up at first paint, then lifts away */
html.jz-arrive body::before, html.jz-arrive body::after { position: fixed; left: 0; right: 0; z-index: 1000; pointer-events: none; }
html.jz-arrive body::before {
  content: ""; top: 0; height: 100vh;
  background: url("../img/mark.webp") center calc(50% - 34px) / 76px auto no-repeat, var(--grid), var(--bg);
}
html.jz-arrive body::after {
  content: "Jamzey St."; top: calc(50% + 28px); text-align: center; color: var(--ink);
  font: 800 clamp(30px, 5vw, 54px)/1 Inter, "Segoe UI", system-ui, sans-serif; letter-spacing: -.02em;
}
html.jz-reveal body::before { transition: transform 1s var(--pz-ease); transform: translateY(-100%); }
html.jz-reveal body::after { transition: opacity .35s, transform .6s var(--pz-ease); opacity: 0; transform: translateY(-40px); }
html.jz-reveal .brand img { animation: jz-mark-in 1s .35s cubic-bezier(.2, .9, .25, 1.2) both; }
html.jz-reveal .blocks-left { animation: jz-block-l 1.1s .35s var(--pz-ease) both; }
html.jz-reveal .blocks-right { animation: jz-block-r 1.1s .35s var(--pz-ease) both; }
html.jz-reveal main > :first-child .wrap { animation: jz-rise-in .9s .45s var(--pz-ease) both; }
@keyframes jz-block-l { from { transform: translate(-120%, 30%) rotate(-24deg); opacity: 0; } }
@keyframes jz-block-r { from { transform: translate(120%, 30%) rotate(24deg); opacity: 0; } }
@keyframes jz-rise-in { from { transform: translateY(40px); opacity: 0; } }

/* ---------- P_Zenos entry points on Jamzey St. pages ---------- */
.nav .nav-pz {
  position: relative; color: var(--pz-gold-lo); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 13px;
  padding: 6px 12px 6px 26px; border-radius: 999px; background: var(--pz-abyss); color: var(--pz-gold);
}
.nav .nav-pz:hover { color: var(--pz-gold-hi); }
.nav .nav-pz::before {
  content: ""; position: absolute; left: 11px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: var(--pz-teal); box-shadow: 0 0 0 0 rgba(31, 179, 196, .7); animation: pz-ping 2.2s infinite;
}
@keyframes pz-ping { 70% { box-shadow: 0 0 0 8px rgba(31, 179, 196, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 179, 196, 0); } }

.pz-portal { padding-top: 0; }
.pz-portal-link {
  position: relative; display: grid; place-items: center; min-height: clamp(360px, 46vw, 520px); overflow: hidden; isolation: isolate;
  border-radius: var(--radius, 14px); border: 2px solid var(--pz-gold); text-decoration: none; color: #fff;
  box-shadow: 10px 10px 0 var(--pz-abyss); background: var(--pz-abyss);
}
.pz-portal-bg, .pz-portal-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.pz-portal-bg img { transition: transform 1.6s var(--pz-ease), filter .8s; filter: saturate(1.05) brightness(.72); }
.pz-portal-link::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(70% 80% at 50% 50%, rgba(3, 20, 26, .2), rgba(3, 20, 26, .85)), linear-gradient(0deg, rgba(3, 20, 26, .85), transparent 55%);
}
.pz-portal-in { display: grid; justify-items: center; gap: 14px; padding: 40px 20px; text-align: center; }
.pz-portal-in .pz-emblem { width: 74px; height: 74px; transition: transform 1.2s cubic-bezier(.2, .9, .25, 1.15); }
.pz-portal-kicker { font-size: 13px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--pz-teal); }
.pz-portal-in .pz-word { font-size: clamp(40px, 8vw, 92px); }
.pz-portal-cta {
  margin-top: 10px; padding: 13px 26px; border-radius: 999px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 14px;
  color: var(--pz-abyss); background: linear-gradient(180deg, var(--pz-gold-hi), var(--pz-gold));
  box-shadow: 0 8px 30px rgba(228, 179, 92, .35); transition: transform .3s, box-shadow .3s;
}
.pz-portal-link:hover .pz-portal-bg img { transform: scale(1.07); filter: saturate(1.15) brightness(.82); }
.pz-portal-link:hover .pz-emblem { transform: rotate(180deg); }
.pz-portal-link:hover .pz-portal-cta { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(228, 179, 92, .5); }
.pz-portal-link:focus-visible { outline: 3px solid var(--pz-gold); outline-offset: 4px; }

@media (max-width: 720px) {
  .pz-portal-link { box-shadow: 5px 5px 0 var(--pz-abyss); }
  .nav .nav-pz { align-self: flex-start; margin: 8px 0 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .pz-gate, .jz-gate, html.jz-arrive body::before, html.jz-arrive body::after { display: none !important; }
  .nav .nav-pz::before, .pz-bubbles i, .pz-wave, .pz-water::before, .pz-water::after { animation: none; }
}
