/* Shared layer over the Stitch pages. Tokens from pastel_creative_zine/DESIGN.md. */
:root {
  --pp-pink: #ff86ab;
  --pp-berry: #9f3a5e;
  --pp-wine: #781b3f;
  --pp-mint: #d2f1ec;
  --pp-ink: #304254;
  --pp-cream: #fdfbf7;
  --pp-blush: #fff0f4;
  --pp-stamp: #c2334d;
}

/* ---- arrival: two paper halves split along the tear the plane cut on the last page ---- */
html.pp-arriving::before,
html.pp-arriving::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background-color: var(--pp-blush);
  background-image: radial-gradient(rgba(159, 58, 94, 0.14) 1.2px, transparent 1.4px);
  background-size: 22px 22px;
  animation: 0.75s cubic-bezier(0.65, 0, 0.25, 1) 0.08s forwards;
  pointer-events: none;
}
html.pp-arriving::before {
  animation-name: pp-split-up;
  clip-path: polygon(0 0, 100% 0, 100% 50%, 95% 49.5%, 90% 51.4%, 85% 49%, 80% 50.5%, 75% 49.2%, 70% 51.3%, 65% 48.8%, 60% 50.9%, 55% 49.6%, 50% 51.1%, 45% 48.7%, 40% 50.6%, 35% 49.4%, 30% 51.5%, 25% 48.9%, 20% 50.8%, 15% 49.1%, 10% 51.2%, 5% 48.6%, 0% 50%);
}
html.pp-arriving::after {
  animation-name: pp-split-down;
  clip-path: polygon(0% 50%, 5% 48.6%, 10% 51.2%, 15% 49.1%, 20% 50.8%, 25% 48.9%, 30% 51.5%, 35% 49.4%, 40% 50.6%, 45% 48.7%, 50% 51.1%, 55% 49.6%, 60% 50.9%, 65% 48.8%, 70% 51.3%, 75% 49.2%, 80% 50.5%, 85% 49%, 90% 51.4%, 95% 49.5%, 100% 50%, 100% 100%, 0 100%);
}
/* runs on CSS alone, so the page can never stay covered if passport.js fails */
@keyframes pp-split-up { to { transform: translateY(-58%) rotate(-2.5deg); opacity: 0; } }
@keyframes pp-split-down { to { transform: translateY(58%) rotate(2deg); opacity: 0; } }

/* ---- departure: plane crosses the screen, the cut line drawn behind it ---- */
.pp-fly {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: all;
  cursor: progress;
}
.pp-fly svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pp-fly path {
  fill: none;
  stroke: var(--pp-wine);
  stroke-width: 2.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  vector-effect: non-scaling-stroke;
  animation: pp-cut 0.6s cubic-bezier(0.5, 0, 0.2, 1) forwards;
}
.pp-back path { animation-name: pp-cut-back; }
.pp-plane {
  position: absolute;
  top: 50%;
  left: 0;
  font-size: 44px;
  line-height: 1;
  color: var(--pp-wine);
  filter: drop-shadow(0 6px 8px rgba(120, 27, 63, 0.3));
  animation: pp-plane 0.6s cubic-bezier(0.5, 0, 0.2, 1) forwards;
}
.pp-back .pp-plane { animation-name: pp-plane-back; }
@keyframes pp-cut { to { stroke-dashoffset: 0; } }
@keyframes pp-cut-back { from { stroke-dashoffset: -1; } to { stroke-dashoffset: 0; } }
@keyframes pp-plane { from { transform: translate(-60px, -50%); } to { transform: translate(calc(100vw + 20px), -50%); } }
@keyframes pp-plane-back { from { transform: translate(calc(100vw + 20px), -50%) scaleX(-1); } to { transform: translate(-60px, -50%) scaleX(-1); } }

/* ---- visa stamp on arrival ---- */
.pp-stamp {
  position: fixed;
  top: 96px;
  right: 28px;
  z-index: 2147482000;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 12px 18px;
  border: 3px double var(--pp-stamp);
  border-radius: 14px;
  color: var(--pp-stamp);
  font: 700 11px/1.3 "Courier Prime", "Courier New", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  mix-blend-mode: multiply;
  pointer-events: none;
  animation: pp-thud 2.2s ease forwards;
}
.pp-stamp b { font: 800 22px/1 "Baloo 2", "Comfortaa", sans-serif; letter-spacing: 0.08em; }
@keyframes pp-thud {
  0% { opacity: 0; transform: scale(2.4) rotate(-14deg); }
  14% { opacity: 0.92; transform: scale(1) rotate(-8deg); }
  80% { opacity: 0.92; transform: scale(1) rotate(-8deg); }
  100% { opacity: 0; transform: scale(1) rotate(-8deg); }
}

/* ---- passport cover (check-in, once per visit) ---- */
.pp-cover-wrap {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  display: grid;
  place-items: center;
  padding: 16px;
  background-color: rgba(253, 251, 247, 0.96);
  background-image: radial-gradient(rgba(159, 58, 94, 0.12) 1.2px, transparent 1.4px);
  background-size: 22px 22px;
  perspective: 1600px;
  transition: opacity 0.5s ease 0.55s;
}
.pp-cover {
  position: relative;
  width: min(340px, 82vw);
  aspect-ratio: 5 / 7;
  display: grid;
  justify-items: center;
  align-content: space-between;
  padding: 34px 24px 26px;
  border: 0;
  border-radius: 10px 22px 22px 10px;
  background: linear-gradient(140deg, #f9c1d0, #f2a3ba 60%, #ec97b0);
  box-shadow: inset 10px 0 14px -8px rgba(120, 27, 63, 0.35), 0 30px 60px -18px rgba(120, 27, 63, 0.45);
  color: #e58aa6;
  font-family: "Comfortaa", sans-serif;
  text-align: center;
  cursor: pointer;
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(0.6, 0, 0.3, 1);
}
.pp-cover > * {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55), 0 -1px 0 rgba(120, 27, 63, 0.35);
}
.pp-cover-top { font-size: 13px; font-weight: 700; letter-spacing: 0.3em; }
.pp-cover svg { width: 46%; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.55)) drop-shadow(0 -1px 0 rgba(120, 27, 63, 0.3)); }
.pp-cover-title { font-size: 34px; font-weight: 700; letter-spacing: 0.22em; }
.pp-cover-sub { font-size: 12px; font-weight: 700; letter-spacing: 0.24em; }
.pp-cover:focus-visible { outline: 2px dashed rgba(255, 255, 255, 0.85); outline-offset: -12px; }
.pp-cover-hint {
  font: 700 13px/1 "Quicksand", sans-serif;
  color: var(--pp-wine);
  text-shadow: none;
  animation: pp-pulse 1.6s ease-in-out infinite;
}
@keyframes pp-pulse { 50% { opacity: 0.45; } }
.pp-cover-wrap.pp-opened { opacity: 0; pointer-events: none; }
.pp-cover-wrap.pp-opened .pp-cover { transform: rotateY(-160deg); }

/* ---- visitor controls: Tour / Quick Resume + CV, in the top nav (desktop) or a bottom bar (phone) ---- */
.pp-navslot, .pp-mobilebar {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 12px/1 "Quicksand", sans-serif;
  color: var(--pp-ink);
}
.pp-navslot button, .pp-navslot a, .pp-mobilebar button, .pp-mobilebar a, .pp-ownerbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.pp-seg { display: flex; padding: 2px; border-radius: 9999px; background: #f6f1ea; }
.pp-seg [aria-pressed="true"] { background: var(--pp-wine); color: #fff; }
.pp-navslot .pp-cv, .pp-mobilebar .pp-cv { background: var(--pp-pink); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.pp-cv:hover { transform: translateY(-1px); }
.pp-mobilebar { display: none; }
.pp-navslot .pp-long { display: none; } /* the Stitch top bars have no room for long labels */
.pp-toprow a, .pp-menu > * { white-space: nowrap; }
@media (max-width: 767px) {
  .pp-navslot { display: none; }
  .pp-mobilebar {
    position: fixed;
    left: 50%;
    bottom: 12px;
    z-index: 2147482400;
    display: flex;
    padding: 5px;
    transform: translateX(-50%);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #f6d3de;
    box-shadow: 0 16px 32px -6px rgba(48, 66, 84, 0.14), 0 4px 12px -2px rgba(255, 134, 171, 0.25);
  }
  .pp-mobilebar button, .pp-mobilebar a { min-height: 40px; padding: 0 12px; }
  .pp-mobilebar .pp-long { display: none; }
  body { padding-bottom: 76px; }
}

/* ---- owner toolbar: right edge, never published ---- */
.pp-ownerbar {
  position: fixed;
  right: 10px;
  top: 50%;
  z-index: 2147482400;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
  transform: translateY(-50%);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #f6d3de;
  box-shadow: 0 16px 32px -6px rgba(48, 66, 84, 0.14), 0 4px 12px -2px rgba(255, 134, 171, 0.25);
  font: 700 11px/1 "Quicksand", sans-serif;
  color: var(--pp-ink);
}
.pp-ownerbar button { flex-direction: column; gap: 3px; width: 58px; min-height: 50px; padding: 0; border-radius: 14px; }
.pp-ownerbar button b { font-size: 17px; line-height: 1; }
.pp-ownerbar button:hover { background: var(--pp-blush); }
.pp-ownerbar .pp-edit[aria-pressed="true"] { background: var(--pp-mint); color: #00504a; }
.pp-ownerbar .pp-publish { background: var(--pp-wine); color: #fff; }
.pp-ownerbar .pp-publish:hover { background: var(--pp-berry); }
.pp-ownerbar button:disabled { opacity: 0.5; cursor: progress; }
html:not(.pp-editing) .pp-reset { display: none; }
@media (max-width: 767px) { .pp-ownerbar { top: auto; bottom: 84px; transform: none; } }

/* Owner-only parts of the Stitch pages (upload prompts, add/delete buttons, empty slots).
   With Edit off you see exactly what visitors will; Publish removes them from the copy. */
html:not(.pp-editing) .pp-owner { display: none !important; }

/* ---- phone + tablet: top menu scrolls sideways inside its own row instead of widening the page ---- */
@media (max-width: 1023px) {
  .pp-toprow { flex-wrap: wrap; row-gap: 8px; min-width: 0; }
  .pp-toprow > :not(.pp-menu) { flex-shrink: 0; }
  .pp-toprow a { white-space: nowrap; }
  .pp-menu {
    order: 3;
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .pp-menu::-webkit-scrollbar { display: none; }
  .pp-menu > * { flex-shrink: 0; white-space: nowrap; }
}
/* ---- phone, check-in: counter + boarding passes first, passport and map after ---- */
@media (max-width: 1023px) {
  .pp-first { order: -1; }
  .pp-tickets { order: 1; margin: 18px 0 8px; }
  .pp-after { order: 2; }
}

.pp-toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 2147482600;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--pp-ink);
  color: #fff;
  font: 600 13px/1.4 "Quicksand", sans-serif;
  max-width: calc(100vw - 32px);
}

/* ---- live editing: dashed customs-form underline on hover, berry caret ---- */
html.pp-editing [data-pp-edit] { caret-color: var(--pp-berry); cursor: text; }
html.pp-editing [data-pp-edit]:hover, html.pp-editing [data-pp-label]:hover { outline: 1.5px dashed rgba(255, 134, 171, 0.7); outline-offset: 2px; border-radius: 4px; }
html.pp-editing [data-pp-edit]:focus { outline: 2px solid var(--pp-pink); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(255, 134, 171, 0.15); border-radius: 4px; }

/* uploads: paperclip that appears over a photo, polaroid frame after */
.pp-clip {
  position: fixed;
  z-index: 2147482300;
  padding: 6px 12px;
  border: 1.5px dashed var(--pp-pink);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--pp-wine);
  font: 700 12px/1 "Quicksand", sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 16px -4px rgba(120, 27, 63, 0.25);
}
html.pp-editing [data-pp-media] { cursor: pointer; }
.pp-fill { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.pp-uploaded { box-shadow: 0 0 0 4px #fff, 0 8px 20px -6px rgba(48, 66, 84, 0.3); }
/* certificates: the hover hint must not cover the text being edited; a scan shows whole */
#certList [class*="group-hover/cert"] { pointer-events: none; }
#certList :focus-within > [class*="group-hover/cert"] { opacity: 0 !important; }
#certList .pp-fill { object-fit: contain; background: #fff; box-shadow: none; }
.pp-certx { border: 0; background: none; color: #9f3a5e; font: 700 11px/1 "Quicksand", sans-serif; cursor: pointer; }

/* About: security hologram over the ID photo on hover */
div:has(> #avatarPreview) { position: relative; overflow: hidden; }
div:has(> #avatarPreview)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 134, 171, 0.45) 38%, rgba(149, 240, 229, 0.45) 48%, rgba(255, 236, 160, 0.45) 58%, transparent 70%);
  background-size: 250% 250%;
  background-position: 100% 0;
  mix-blend-mode: color-dodge;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, background-position 0.9s ease;
}
div:has(> #avatarPreview):hover::after { opacity: 1; background-position: 0 100%; }

/* Tools: badges tilt toward the cursor (transform set in passport.js) */
.pp-tilt { transition: transform 0.15s ease-out; transform-style: preserve-3d; will-change: transform; }

/* Contact: APPROVED stamp lands on the arrival card */
.pp-approved {
  position: absolute;
  top: 38%;
  left: 50%;
  z-index: 5;
  display: grid;
  justify-items: center;
  padding: 10px 22px;
  border: 4px double var(--pp-stamp);
  border-radius: 12px;
  color: var(--pp-stamp);
  font: 800 34px/1 "Baloo 2", "Comfortaa", sans-serif;
  letter-spacing: 0.1em;
  mix-blend-mode: multiply;
  pointer-events: none;
  animation: pp-approve 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) forwards;
}
.pp-approved small { font: 700 11px/1.6 "Courier New", monospace; letter-spacing: 0.14em; }
@keyframes pp-approve {
  from { opacity: 0; transform: translate(-50%, -50%) scale(2.2) rotate(-18deg); }
  to { opacity: 0.9; transform: translate(-50%, -50%) scale(1) rotate(-9deg); }
}

@media (prefers-reduced-motion: reduce) {
  html.pp-arriving::before, html.pp-arriving::after { display: none; }
  .pp-stamp, .pp-approved, .pp-cover-hint { animation-duration: 0.01s; }
  .pp-cover, .pp-cover-wrap { transition: none; }
}
@media print {
  .pp-navslot, .pp-mobilebar, .pp-ownerbar, .pp-stamp, .pp-clip, .pp-toast, .pp-cover-wrap { display: none !important; }
  body { padding-bottom: 0 !important; }
}

/* Experience: an uploaded company logo covers the badge; the name lines stay underneath for the tabs */
#company-logo-badge .pp-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* Projects: projects added inside a sector sit under a dashed rule; Tools: the ✕ on each sector tab */
.pp-project { position: relative; border-top: 2px dashed #f9a8d4; padding-top: 1.5rem; }
.pp-project > * + * { margin-top: 1.5rem; }
.pp-addproj { width: 100%; padding: 10px; border: 2px dashed #f9a8d4; border-radius: 16px; background: #fff; color: #881337; font: 700 12px/1.2 "Quicksand", sans-serif; cursor: pointer; }
.pp-addproj:hover { background: #fdf2f8; }
.pp-projx { position: absolute; top: 8px; right: 0; border: 0; background: none; color: #9f3a5e; font: 700 11px/1 "Quicksand", sans-serif; cursor: pointer; }
.pp-tabx { margin-left: 4px; padding: 0 4px; border-radius: 999px; opacity: .55; cursor: pointer; }
.pp-tabx:hover { opacity: 1; background: rgba(0, 0, 0, .12); }
