/* Edge portals — clickable/swipeable rails linking to sibling apps in the ecosystem
   (FatCatPomodoro now, SquatAlarm later on the left). GPU-accelerated transforms only
   (translate3d, opacity) so this stays smooth on mobile Safari without a carousel library.
   Glass-panel treatment (blur + inset highlight + ambient glow) matches the nav bar's
   backdrop-filter language rather than sitting on top as a flat sticker. */

.edge-portal {
  position: fixed;
  top: 50%;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px 13px;
  background: linear-gradient(160deg, rgba(255, 170, 96, 0.94), rgba(180, 88, 24, 0.96));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #1c1206;
  text-decoration: none;
  font-family: var(--mono), monospace;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
  box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255,255,255,0.45), inset 0 -1px 0 rgba(0,0,0,0.12);
  cursor: pointer;
  touch-action: pan-y;
  will-change: transform;
  overflow: hidden;
  transition: transform .45s cubic-bezier(.16,.8,.24,1), padding .45s ease, box-shadow .45s ease;
}

/* ambient glow blob that blooms on hover, instead of a static flat shadow */
.edge-portal::after {
  content: '';
  position: absolute;
  inset: -60% -80%;
  background: radial-gradient(circle, rgba(255, 165, 80, 0.45), transparent 68%);
  z-index: -1;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.edge-portal:hover::after,
.edge-portal.dragging::after { opacity: 1; }

.edge-portal-icon { writing-mode: horizontal-tb; width: 19px; height: 19px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25)); }
.edge-portal-label { writing-mode: vertical-rl; text-shadow: 0 1px 1px rgba(0,0,0,0.2); }

.edge-portal-right {
  right: 0;
  border-radius: 18px 0 0 18px;
  border-right: none;
  transform: translate3d(0, -50%, 0);
}
.edge-portal-right:hover,
.edge-portal-right.dragging {
  transform: translate3d(-10px, -50%, 0);
  padding-right: 20px;
}

.edge-portal-left {
  left: 0;
  border-radius: 0 18px 18px 0;
  border-left: none;
  transform: translate3d(0, -50%, 0);
}
.edge-portal-left:hover,
.edge-portal-left.dragging {
  transform: translate3d(10px, -50%, 0);
  padding-left: 20px;
}

/* Full-screen transition: bridges JARVI's near-black/white identity into FatCatPomodoro's
   orange rather than cutting straight to a flat brand color — a soft "handoff" between
   the two apps in the ecosystem, plus a white light-sweep nodding to JARVI's own accent. */
#edge-portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow: hidden;
  background: linear-gradient(115deg, #050505 0%, #120a05 22%, #4a2a0c 55%, #f5872e 100%);
  background-size: 240% 240%;
  background-position: 100% 50%;
  transform: translate3d(100%, 0, 0);
  transition: transform .55s cubic-bezier(.16,.8,.24,1), background-position .75s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  will-change: transform, background-position;
}
#edge-portal-overlay.from-left {
  background: linear-gradient(245deg, #050505 0%, #120a05 22%, #4a2a0c 55%, #f5872e 100%);
  transform: translate3d(-100%, 0, 0);
}
#edge-portal-overlay.active {
  transform: translate3d(0, 0, 0);
  background-position: 0% 50%;
}

/* white light-sweep streak — the "mix" between JARVI white and FatCat orange */
#edge-portal-overlay::before {
  content: '';
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 60%;
  left: -70%;
  background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,0.22) 50%, transparent 65%);
  transition: left .8s ease .05s;
}
#edge-portal-overlay.active::before { left: 110%; }

.edge-portal-teaser {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff2e4;
  font-family: var(--mono), monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 13px;
  opacity: 0;
  transition: opacity .35s ease .2s;
}
#edge-portal-overlay.active .edge-portal-teaser { opacity: 1; }
.edge-portal-teaser-icon { width: 30px; height: 30px; filter: drop-shadow(0 2px 6px rgba(245,135,46,0.6)); }

@media (max-width: 640px) {
  .edge-portal { padding: 20px 10px; gap: 11px; }
  .edge-portal-icon { width: 16px; height: 16px; }
  .edge-portal-label { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .edge-portal, .edge-portal::after, #edge-portal-overlay, #edge-portal-overlay::before, .edge-portal-teaser { transition: none; }
}
