 

.jgx-popup {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 380ms cubic-bezier(0.22, 1, 0.36, 1);
}
.jgx-popup[hidden] { display: none; }
.jgx-popup.is-open { opacity: 1; pointer-events: auto; }

.jgx-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 17, 13, 0.32);
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
}
:root.theme-dark .jgx-popup-backdrop {
  background: rgba(6, 6, 8, 0.55);
}

.jgx-popup-card {

--jgx-nick: 150px;

--flap-rot: -13deg;
  --fold-up: calc(var(--jgx-nick) * 1.3002);
  --fold-left: calc(var(--jgx-nick) * 0.8124);
  --fold-tx: calc(var(--jgx-nick) * 0.13158);
  --fold-ty: calc(var(--jgx-nick) * 0.08221);

--sheet-stock: url(./design/paper-light.webp?v=2);
  --sheet-veil: rgb(247 247 247 / 0.35);
  --seam: rgba(20, 14, 8, 0.34);
  --seam-soft: rgba(20, 14, 8, 0.13);
  --seam-0: rgba(20, 14, 8, 0);

--lip: rgba(255, 255, 255, 0.42);
  --lip-0: rgba(255, 255, 255, 0);

--crease-lit: rgba(255, 255, 255, 0.5);
  --crease-shadow: rgba(20, 14, 8, 0.16);
  --flap-seat: rgba(0, 0, 0, 0.07);

--flap-veil: rgb(247 247 247 / 0.22);
  --flap-shade: rgba(20, 14, 8, 0.06);

--fold-shadow: rgba(20, 14, 8, 0.32);

position: relative;
  width: min(420px, 100%);
  aspect-ratio: 5 / 7;
  max-height: min(88vh, 720px);
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  filter: var(--drop-float);
  transition:
    transform 440ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 440ms cubic-bezier(0.22, 1, 0.36, 1);
}
:root.theme-dark .jgx-popup-card {
  --sheet-stock: url(./design/paper-dark.webp?v=2);
  --sheet-veil: rgb(26 27 31 / 0.25);
  --seam: rgba(216, 205, 184, 0.34);
  --seam-soft: rgba(216, 205, 184, 0.09);
  --seam-0: rgba(216, 205, 184, 0);
  --lip: rgba(216, 205, 184, 0.32);
  --lip-0: rgba(216, 205, 184, 0);
  --crease-lit: rgba(216, 205, 184, 0.36);
  --crease-shadow: rgba(0, 0, 0, 0.22);
  --flap-seat: rgba(0, 0, 0, 0.1);

--flap-veil: rgb(216 205 184 / 0.05);
  --flap-shade: rgba(0, 0, 0, 0);
  --fold-shadow: rgba(0, 0, 0, 0.55);
}
.jgx-popup.is-open .jgx-popup-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.jgx-popup-sheet {
  position: absolute;
  inset: 0;
  background-color: var(--card);
  background-image:
    linear-gradient(var(--sheet-veil), var(--sheet-veil)),
    var(--sheet-stock);
  background-size: auto, 512px 512px;
  background-repeat: repeat;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--fold-up)),
    calc(100% - var(--fold-left)) 100%,
    0 100%
  );
}

.jgx-popup-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 8px solid transparent;
  border-image-source: url(./paper-rip-frame.svg);
  border-image-slice: 1.39%;
  border-image-repeat: stretch;
}
:root.theme-dark .jgx-popup-sheet::before {
  border-image-source: url(./paper-rip-frame-dark.svg);
}

.jgx-popup-fold {

position: absolute;
  right: 0;
  bottom: 0;
  width: var(--fold-up);
  height: var(--fold-left);
  z-index: 1;
  pointer-events: none;
  transform: translate(var(--fold-tx), var(--fold-ty))
    rotate(calc(var(--flap-rot) * 2));
  transform-origin: 0 0;
  filter: var(--drop-flat);
}
.jgx-popup-flap {

position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  background-color: var(--card);
  background-image:

linear-gradient(to bottom right,
      var(--lip-0) 40%,
      var(--crease-shadow) 45%,
      var(--crease-lit) 50%,
      var(--lip-0) 57%),

linear-gradient(to right, var(--lip), var(--lip-0) 82%),

linear-gradient(to bottom, var(--lip), var(--lip-0) 82%),

linear-gradient(to bottom right, transparent 30%, var(--flap-seat)),

linear-gradient(var(--flap-shade), var(--flap-shade)),
    linear-gradient(var(--flap-veil), var(--flap-veil)),
    var(--sheet-stock);
  background-size: 100% 100%, 100% 2px, 2px 100%, 100% 100%, auto, auto, 512px 512px;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 137px 209px;
  background-repeat:
    no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat;
}

.jgx-popup-flap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 6px solid transparent;
  border-image-source: url(./paper-rip-frame.svg);
  border-image-slice: 1.39%;
  border-image-repeat: stretch;
}
:root.theme-dark .jgx-popup-flap::before {
  border-image-source: url(./paper-rip-frame-dark.svg);
}

.jgx-popup-arrow::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 90%;
  height: 3px;
  border-radius: 999px;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(8, 36, 128, 0.9) 0%,
      rgba(11, 44, 152, 0.98) 28%,
      rgba(14, 56, 184, 1) 56%,
      rgba(21, 76, 221, 0.98) 82%,
      rgba(45, 117, 247, 0.92) 100%
    );
  box-shadow:
    0 0 4px rgba(46, 126, 255, 0.2),
    0 0 9px rgba(46, 126, 255, 0.1);
  animation: jgx-arrow-line-creep 2400ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
  transition: width 140ms linear, opacity 450ms ease 260ms;
}
@keyframes jgx-arrow-line-creep {
  from { width: 0%; }
  to { width: 90%; }
}
.jgx-popup-arrow.gpu-live::after {
  animation: none;
  width: 100%;
  opacity: 0;
}
.jgx-popup-arrow {

--jgx-arrow-w: calc(var(--jgx-nick) * 0.85);

--jgx-arrow-h: calc(var(--jgx-arrow-w) / 1.196952);
  position: absolute;
  right: 0;

bottom: calc(var(--jgx-nick) * 0.52 - var(--jgx-arrow-h) / 2);
  width: var(--jgx-arrow-w);
  height: var(--jgx-arrow-h);
  z-index: 2;
  pointer-events: none;
  opacity: 0;

filter: var(--drop-float);
  transition: opacity 320ms ease;
}
.jgx-popup-arrow.gpu-live {
  opacity: 1;
}
.jgx-popup-arrow-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.jgx-popup-logo {
  position: absolute;
  top: 30px;
  left: 34px;
  z-index: 3;
  margin: 0;
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--text);
  text-shadow: var(--carve-text);
}

.jgx-popup-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 4;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(20, 14, 8, 0.12);
  border-radius: 50%;
  background: rgba(20, 14, 8, 0.045);
  color: var(--text);
  cursor: pointer;
  opacity: 0.92;
  transition: background 160ms ease, transform 140ms ease, opacity 140ms ease;
}
.jgx-popup-close:hover,
.jgx-popup-close:focus-visible {
  opacity: 1;
  background: rgba(20, 14, 8, 0.1);
  transform: scale(1.06);
}
.jgx-popup-close svg {
  width: 22px;
  height: 22px;
}
:root.theme-dark .jgx-popup-close {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}
:root.theme-dark .jgx-popup-close:hover,
:root.theme-dark .jgx-popup-close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.jgx-popup-body {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
  padding: 92px 34px calc(var(--fold-up) * 0.55 + 14px);
  text-align: left;
}
.jgx-popup-title {
  font-family: "Archivo", system-ui, sans-serif;
  font-size: clamp(1.5rem, 5.4vw, 2.05rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.005em;
  color: var(--text);
  text-shadow: var(--carve-text);
  margin: 0;
  max-width: 15ch;
}
.jgx-popup-text {
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  opacity: 0.76;
  margin: 0;
  max-width: 34ch;
}

.jgx-popup-dest {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--text);
  margin: -6px 0 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(20, 14, 8, 0.28);
}
.jgx-popup-dest[hidden] { display: none; }

.jgx-popup.is-open .jgx-popup-arrow {
  pointer-events: auto;
  cursor: pointer;
  z-index: 4;
}

.jgx-popup-arrow:focus-visible {
  outline: 3px solid rgba(20, 14, 8, 0.55);
  outline-offset: 6px;
  border-radius: 6px;
}

.jgx-popup-arrow-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .jgx-popup,
  .jgx-popup-card {
    transition: none;
  }
}

@media (max-width: 520px) {
  .jgx-popup-card {
    aspect-ratio: 4 / 6;

--jgx-nick: 112px;
  }
  .jgx-popup-body {
    padding: 82px 26px calc(var(--fold-up) * 0.55 + 12px);
  }
}
