/* "Look out the window!" overlay (js/look.js). Always pastel, whatever the page theme: it is meant
   to be noticed from across the room. */

.look { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; pointer-events: none; background: radial-gradient(circle, rgba(255, 196, 220, 0.35), rgba(255, 196, 220, 0) 70%); animation: look-fade 0.4s ease-out; }
.look.out { animation: look-fade 0.45s ease-in reverse forwards; }
.look.out .look-card { animation: look-away 0.45s ease-in forwards; }
.look-card {
  --pink: #ff4f93; --pink-2: #ffc4dc; --pink-3: #fff0f6;
  position: relative; pointer-events: auto; width: min(380px, 100%); padding: 18px 18px 16px; text-align: center;
  background: #fff; color: #5b2a45; border: 3px solid var(--pink-2); border-radius: 30px;
  box-shadow: 0 8px 0 #ffd9ea, 0 24px 60px rgba(255, 79, 147, 0.35);
  font-family: "Nunito", system-ui, sans-serif;
  animation: look-in 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.look.now .look-card { animation: look-in 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) both, look-jiggle 0.6s ease-in-out 0.1s 3; }
.look-close { position: absolute; right: 12px; top: 8px; background: none; border: 0; font-size: 22px; color: #ff8fbf; cursor: pointer; }

/* bouncing letters */
.look-shout { margin: 6px 0 12px; font-size: 30px; line-height: 1.25; font-weight: 800; letter-spacing: 0.02em; color: var(--pink); text-transform: none; text-shadow: 0 3px 0 #ffd0e4; }
.look-shout span { display: inline-block; animation: look-letter 1.1s ease-in-out infinite; animation-delay: calc(var(--i) * 0.07s); }
.look.now .look-shout span { animation-duration: 0.55s; color: #ff2f7d; }

/* the window: sky, clouds, a plane crossing, curtains, the cat on the sill */
.look-window { position: relative; width: 250px; height: 170px; margin: 0 auto; border: 9px solid #ffc9de; border-bottom-width: 0; border-radius: 20px 20px 4px 4px; overflow: hidden; box-shadow: inset 0 0 0 2px #fff; }
.look.now .look-window { animation: look-glow 0.9s ease-in-out infinite alternate; }
.look-sky { position: absolute; inset: 0; background: linear-gradient(180deg, #a9d8ff 0%, #cfe8ff 45%, #ffe0ef 100%); }
.look-cloud { position: absolute; width: 60px; height: 18px; background: #fff; border-radius: 999px; animation: look-drift 14s linear infinite; }
.look-cloud::before { content: ""; position: absolute; width: 28px; height: 28px; left: 10px; top: -13px; background: #fff; border-radius: 50%; }
.look-cloud.k1 { top: 22%; left: -70px; }
.look-cloud.k2 { top: 62%; left: -70px; scale: 0.7; animation-delay: -7s; animation-duration: 18s; }
.look-flyer { position: absolute; left: 0; width: 100%; height: 34px; top: calc((1 - var(--peak)) * 58% + 6%); animation: look-fly 3.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite; }
.look-flyer svg { position: absolute; left: 0; top: 0; width: 34px; height: 34px; fill: #fff; stroke: var(--pink); stroke-width: 1.3; transform: rotate(90deg); filter: drop-shadow(0 2px 3px rgba(255, 79, 147, 0.5)); animation: look-bob 0.8s ease-in-out infinite; }
.look-hearts { position: absolute; right: 100%; top: 10px; margin-right: -4px; color: #ff7aae; font-size: 11px; letter-spacing: 5px; white-space: nowrap; }
.rtl .look-flyer { animation-name: look-fly-rtl; }
.rtl .look-flyer svg { transform: rotate(-90deg); }
.rtl .look-hearts { right: auto; left: 38px; }
.look-bar-v, .look-bar-h { position: absolute; background: #ffc9de; z-index: 2; }
.look-bar-v { left: 50%; top: 0; bottom: 0; width: 7px; margin-left: -3.5px; }
.look-bar-h { top: 46%; left: 0; right: 0; height: 7px; }
.look-curtain { position: absolute; top: 0; bottom: 0; width: 52%; z-index: 3; background: repeating-linear-gradient(90deg, #ff9cc6 0 9px, #ffb7d5 9px 18px); box-shadow: inset 0 -10px 0 rgba(255, 255, 255, 0.25); animation: look-open 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both; }
.look-curtain.l { left: 0; transform-origin: left; border-radius: 0 0 60% 0; }
.look-curtain.r { right: 0; transform-origin: right; border-radius: 0 0 0 60%; }
.look-sill { position: absolute; left: -9px; right: -9px; bottom: 0; height: 12px; background: #ffc9de; z-index: 4; }
.look-cat { position: absolute; left: 50%; bottom: 8px; width: 74px; margin-left: -37px; z-index: 3; animation: look-peek 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s both; }
.look-cat .fur { fill: #fff7fb; stroke: #ffb3d1; stroke-width: 2; stroke-linejoin: round; }
.look-cat .ear { fill: #ffc4dc; }
.look-cat .white { fill: #fff; stroke: #5b2a45; stroke-width: 1.4; }
.look-cat .eyes { transform-origin: 40px 30px; animation: look-blink 3.6s ease-in-out infinite; }
.look-cat .pupils { fill: #5b2a45; transform: translate(calc(var(--off) * 2.6px), calc(var(--peak) * -3px)); transition: transform 0.4s; }
.look-cat .nose { fill: #ff7aae; }
.look-cat .mouth { fill: none; stroke: #5b2a45; stroke-width: 1.4; stroke-linecap: round; }
.look-cat .blush { fill: #ffb3d1; opacity: 0.7; }

.look-when { margin-top: 12px; display: flex; flex-direction: column; align-items: center; }
.look-when b { font-size: 30px; font-weight: 800; color: var(--pink); font-variant-numeric: tabular-nums; }
.look-when span { font-size: 13px; color: #c08aa5; font-weight: 600; }
.look.now .look-when b { animation: look-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.look-where { margin: 8px 0 2px; font-size: 17px; font-weight: 800; }
.look-who { margin: 0 0 12px; font-size: 13px; color: #8a4a6b; }
.look-sight { margin: -6px 0 12px; font-size: 13px; font-weight: 700; color: #b06a8e; }
.look-saw { border: 0; border-radius: 999px; padding: 10px 22px; font: inherit; font-weight: 800; font-size: 15px; color: #fff; cursor: pointer; background: linear-gradient(180deg, #ff7aae, #ff4f93); box-shadow: 0 4px 0 #e23a7d; transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.look-saw:hover { transform: translateY(-2px) scale(1.04); }
.look-saw:active { transform: translateY(3px); box-shadow: 0 1px 0 #e23a7d; }

/* hearts and sparkles bursting from the middle: on arrival, again at "now", big on "I saw it" */
.look-burst { position: absolute; left: 50%; top: 45%; width: 0; height: 0; z-index: 5; pointer-events: none; }
.look-burst i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; font-style: normal; opacity: 0; animation: look-burst 1.1s ease-out 0.3s; }
.look-burst i::before { content: "♥"; font-size: 16px; color: #ff4f93; }
.look-burst i:nth-child(4n+2)::before { content: "✦"; color: #ffc94d; }
.look-burst i:nth-child(4n+3)::before { content: "♡"; color: #b06cf0; }
.look-burst i:nth-child(4n)::before { content: "✧"; color: #5fb8ff; }
.look.now .look-burst i { animation: look-burst2 1.1s ease-out; }
.look.saw .look-burst i { animation: look-burst3 1.1s ease-out; }
.look.saw .look-card { animation: look-float 1.1s ease-in forwards; }

@keyframes look-fade { from { opacity: 0; } }
@keyframes look-in { 0% { opacity: 0; transform: scale(0.3) rotate(-10deg); } 60% { opacity: 1; } }
@keyframes look-away { to { opacity: 0; transform: scale(0.85) translateY(20px); } }
@keyframes look-float { 30% { transform: scale(1.04); } to { opacity: 0; transform: translateY(-60px) scale(0.9); } }
@keyframes look-jiggle { 25% { transform: rotate(-3deg) scale(1.03); } 75% { transform: rotate(3deg) scale(1.03); } }
@keyframes look-letter { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-7px) rotate(-6deg); } 60% { transform: translateY(1px) rotate(4deg); } }
@keyframes look-open { from { transform: scaleX(1); } to { transform: scaleX(0.3); } }
@keyframes look-peek { from { transform: translateY(70px); } }
@keyframes look-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes look-fly { from { transform: translateX(-60px); } to { transform: translateX(calc(250px + 20px)); } }
@keyframes look-fly-rtl { from { transform: translateX(270px); } to { transform: translateX(-60px); } }
@keyframes look-bob { 50% { translate: 0 -3px; } }
@keyframes look-drift { to { translate: 340px 0; } }
@keyframes look-glow { from { box-shadow: inset 0 0 0 2px #fff, 0 0 0 0 rgba(255, 79, 147, 0.4); } to { box-shadow: inset 0 0 0 2px #fff, 0 0 0 10px rgba(255, 79, 147, 0); } }
@keyframes look-pop { from { transform: scale(0.4); } }
@keyframes look-burst { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(0.4); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-90px - var(--k) * 18px)) scale(1.1); } }
@keyframes look-burst2 { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(0.4); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-120px - var(--k) * 20px)) scale(1.3); } }
@keyframes look-burst3 { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(0.6); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-170px - var(--k) * 25px)) scale(1.8); } }

@media (prefers-reduced-motion: reduce) {
  .look, .look *, .look *::before { animation: none !important; transition: none !important; }
  .look-curtain { transform: scaleX(0.3); }
  .look-flyer { transform: translateX(100px); }
  .look-burst { display: none; }
}
