/* =====================================================================
   Reel FX: eight small motion pieces, one per animation style
   ---------------------------------------------------------------------
   notifications  Event Systems band: phone lock screen, alerts pour in
   before-after   Services / Create: drag slider, old slide to new
   map-route      Workshop itinerary: the day's route draws itself
   swiss-motion   Services intro: Swiss grid, kinetic words, hopping dot
   laptop-reveal  Demos: lid opens on scroll to a live game
   globe count    Homepage world map: "N countries" ticks with the arcs
   count-up       Workshop + About outcome numbers
   highlighter    About story: marker swipes over key phrases
   Every piece shows its finished state under reduced motion.
   ===================================================================== */

/* ---------- 1. Notifications (lock screen) ---------- */
.rf-band-split { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: end; }
@media (min-width: 960px) { .rf-band-split { grid-template-columns: minmax(0, 1fr) auto; } }
.rf-phone {
  width: min(300px, 72vw);
  aspect-ratio: 9 / 18.5;
  border-radius: 42px;
  padding: 9px;
  background: linear-gradient(145deg, #3a3f52, #12141b 55%, #2a2e3d);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  justify-self: center;
}
.rf-phone-screen {
  position: relative;
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  padding: 14px 12px;
  color: #fff;
  background:
    radial-gradient(120% 70% at 20% 0%, rgba(124, 77, 255, 0.55), transparent 60%),
    radial-gradient(90% 60% at 100% 100%, rgba(32, 160, 190, 0.45), transparent 65%),
    linear-gradient(180deg, #171a2c, #0d1020);
  display: flex;
  flex-direction: column;
  font-family: var(--pp-font-body, 'Satoshi', system-ui, sans-serif);
}
.rf-phone-island { width: 34%; height: 22px; border-radius: 99px; background: #000; margin: 0 auto 10px; flex: none; }
.rf-phone-date { text-align: center; font-size: 0.78rem; font-weight: 600; opacity: 0.85; }
.rf-phone-time { text-align: center; font: 600 3.6rem/1 var(--pp-font-display, 'Clash Display', sans-serif); letter-spacing: -0.02em; margin: 2px 0 14px; }
.rf-phone-summary {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  font-size: 0.74rem;
  flex: none;
}
.rf-phone-summary b { display: block; font-size: 0.8rem; }
.rf-phone-summary small { opacity: 0.8; }
.rf-phone-summary strong { margin-left: auto; font: 600 1rem/1 var(--pp-font-display, sans-serif); font-variant-numeric: tabular-nums; }
.rf-app-ico {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #9d7bff, #5b2ee6);
}
.rf-app-ico svg { width: 16px; height: 16px; color: #fff; fill: currentColor; }
.rf-notes { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; overflow: hidden; flex: 1; min-height: 0; }
.rf-note {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 8px 10px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  font-size: 0.72rem; line-height: 1.3;
  flex: none;
}
.rf-note .rf-app-ico { width: 24px; height: 24px; border-radius: 7px; }
.rf-note .rf-app-ico svg { width: 13px; height: 13px; }
.rf-note div { min-width: 0; flex: 1; }
.rf-note b { display: flex; justify-content: space-between; gap: 6px; font-size: 0.7rem; opacity: 0.9; }
.rf-note b span { font-weight: 400; opacity: 0.7; }
.rf-note p { margin: 1px 0 0; font-size: 0.76rem; color: #fff; max-width: none; }
.rf-note.is-new { animation: rf-note-in 0.6s cubic-bezier(0.22, 1.2, 0.36, 1) both; }
@keyframes rf-note-in {
  0%   { opacity: 0; transform: translateY(-70%) scale(0.92); filter: blur(6px); }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; }
}
.rf-notes.is-pushing .rf-note:not(.is-new) { animation: rf-note-push 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes rf-note-push { from { transform: translateY(calc(-100% - 6px)); } to { transform: none; } }
.rf-bump { animation: rf-bump 0.4s ease-out; display: inline-block; }
@keyframes rf-bump { 40% { transform: scale(1.18); color: #c8b8ff; } }

/* ---------- 2. Before / after slider ---------- */
.rf-ba { margin: 0 0 2.5rem; }
.rf-ba-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1.5rem; margin-bottom: 1rem; }
.rf-ba-head h3 { font: 600 clamp(1.4rem, 2.6vw, 2rem)/1.1 var(--pp-font-display, sans-serif); margin: 0; color: var(--pp-ink, #1b1f2a); }
.rf-ba-head p { margin: 0; color: var(--pp-muted, #5c6174); font-size: 0.95rem; }
.rf-ba-stage {
  --pos: 50%;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: hidden;
  container-type: inline-size;
  box-shadow: 0 30px 60px -35px rgba(27, 31, 42, 0.55), 0 0 0 1px var(--pp-line, #e7e3f3);
  user-select: none;
  touch-action: pan-y;
}
.rf-ba-slide { position: absolute; inset: 0; }
.rf-ba-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); z-index: 1; }
/* Before: a default, text-heavy slide */
.rf-ba-before {
  background: #fff;
  color: #111;
  font-family: 'Times New Roman', Times, serif;
  padding: 5cqw 6cqw;
}
.rf-ba-before h4 { font: 700 4.4cqw/1.1 Arial, Helvetica, sans-serif; margin: 0 0 2.4cqw; color: #1f3d7a; }
.rf-ba-before ul { margin: 0; padding-left: 3cqw; font-size: 2.3cqw; line-height: 1.45; }
.rf-ba-before li { margin-bottom: 0.6cqw; }
.rf-ba-before .rf-ba-foot { position: absolute; left: 6cqw; right: 6cqw; bottom: 3.5cqw; border-top: 2px solid #1f3d7a; padding-top: 1cqw; font: 1.5cqw Arial, sans-serif; color: #555; display: flex; justify-content: space-between; }
/* After: the AI-designed version */
.rf-ba-after {
  color: #fff;
  padding: 5cqw 6cqw;
  background:
    radial-gradient(60% 80% at 85% 15%, rgba(124, 77, 255, 0.75), transparent 60%),
    radial-gradient(50% 60% at 10% 100%, rgba(94, 231, 255, 0.28), transparent 65%),
    #12141c;
  display: flex; flex-direction: column;
}
.rf-ba-chip { align-self: flex-start; font: 600 1.4cqw/1 var(--pp-font-body, sans-serif); letter-spacing: 0.18em; text-transform: uppercase; padding: 0.9cqw 1.4cqw; border-radius: 99px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.22); }
.rf-ba-after h4 { font: 600 8.4cqw/0.92 var(--pp-font-display, sans-serif); letter-spacing: -0.02em; margin: 2cqw 0 0; color: #fff; }
.rf-ba-after h4 em { font-style: normal; color: #c8b8ff; }
.rf-ba-cards { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6cqw; }
.rf-ba-cards div { padding: 1.8cqw; border-radius: 1.6cqw; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); }
.rf-ba-cards b { display: block; font: 600 3cqw/1 var(--pp-font-display, sans-serif); color: #c8b8ff; }
.rf-ba-cards span { display: block; margin-top: 0.8cqw; font-size: 1.9cqw; line-height: 1.2; }
.rf-ba-tag { position: absolute; top: 2cqw; z-index: 3; font: 700 max(10px, 1.3cqw)/1 var(--pp-font-body, sans-serif); letter-spacing: 0.16em; padding: 0.8em 1em; border-radius: 99px; pointer-events: none; }
.rf-ba-tag-before { left: 2cqw; background: #1b1f2a; color: #fff; }
.rf-ba-tag-after { right: 2cqw; background: #fff; color: #1b1f2a; }
.rf-ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; z-index: 2; box-shadow: 0 0 0 1px rgba(27, 31, 42, 0.2); pointer-events: none; }
.rf-ba-handle::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1f2a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 6 3 12 9 18'/%3E%3Cpolyline points='15 6 21 12 15 18'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 6px 18px rgba(27, 31, 42, 0.35);
}
.rf-ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 4; touch-action: pan-y; }
/* Phones: a taller frame and bigger type so both slides stay readable */
@media (max-width: 600px) {
  .rf-ba-stage { aspect-ratio: 4 / 3.6; }
  .rf-ba-before { padding: 14cqw 6cqw 7cqw; }
  .rf-ba-before h4 { font-size: 6.4cqw; }
  .rf-ba-before ul { font-size: 3.7cqw; padding-left: 5cqw; }
  .rf-ba-before li:nth-child(n+5) { display: none; }
  .rf-ba-before .rf-ba-foot { font-size: 2.8cqw; }
  .rf-ba-after { padding: 14cqw 6cqw 6cqw; }
  .rf-ba-chip { font-size: 2.6cqw; padding: 1.4cqw 2.2cqw; }
  .rf-ba-after h4 { font-size: 11.5cqw; margin-top: 3cqw; }
  .rf-ba-cards { gap: 2cqw; }
  .rf-ba-cards div { padding: 2.6cqw; border-radius: 2.4cqw; }
  .rf-ba-cards b { font-size: 5cqw; }
  .rf-ba-cards span { font-size: 3.1cqw; }
  .rf-ba-tag { top: 2.6cqw; }
}
.rf-ba-stage:has(.rf-ba-range:focus-visible) .rf-ba-handle::after { outline: 3px solid var(--pp-purple, #7c4dff); outline-offset: 3px; }

/* ---------- 3. Map route (workshop itinerary) ---------- */
.rf-route-on .ws-timeline-line { opacity: 0; }
.rf-route { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.rf-route-todo { fill: none; stroke: rgba(124, 77, 255, 0.28); stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; }
.rf-route-casing { fill: none; stroke: #fff; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.rf-route-done { fill: none; stroke: url(#rfRouteGrad); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.rf-route-pin { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; will-change: transform; }
.rf-route-pin i {
  position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--pp-purple, #7c4dff); border: 4px solid #fff; box-shadow: 0 4px 14px rgba(91, 46, 230, 0.55);
}
.rf-route-pin i::before { content: ''; position: absolute; inset: -12px; border-radius: 50%; background: rgba(124, 77, 255, 0.25); animation: rf-ping 1.8s ease-out infinite; }
@keyframes rf-ping { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
.rf-route-pin span {
  position: absolute; right: 18px; top: -13px; white-space: nowrap;
  font: 600 0.78rem/1 'Space Grotesk', var(--pp-font-body, sans-serif); font-variant-numeric: tabular-nums;
  padding: 6px 9px; border-radius: 99px; background: var(--pp-ink, #1b1f2a); color: #fff;
  box-shadow: 0 6px 16px rgba(27, 31, 42, 0.25);
}
.rf-route-on .ws-timeline-dot { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.35s; filter: grayscale(0.8) opacity(0.6); }
.rf-route-on .ws-timeline-dot.rf-visited { filter: none; transform: scale(1.18); }
.rf-route-on .ws-timeline-item { position: relative; z-index: 1; }
.rf-route-on .ws-timeline-time { position: relative; z-index: 4; }

/* ---------- 4. Swiss motion (services intro) ---------- */
.rf-swiss { padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem) 0; }
.rf-swiss-grid {
  --cols: 12; --rows: 6;
  position: relative;
  max-width: 1240px; margin: 0 auto;
  min-height: clamp(380px, 52vw, 600px);
  background: #f3f1ea;
  color: #14151a;
  border-radius: 6px;
  overflow: hidden;
  padding: clamp(1.4rem, 4vw, 3rem);
  display: flex; flex-direction: column; justify-content: center; gap: 0.2rem;
}
.rf-swiss-lines { position: absolute; inset: 0; pointer-events: none; }
.rf-swiss-lines i { position: absolute; background: rgba(20, 21, 26, 0.55); transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1); }
.rf-swiss-lines .v { top: 0; bottom: 0; width: 1px; transform: scaleY(0); transform-origin: top; }
.rf-swiss-lines .h { left: 0; right: 0; height: 1px; transform: scaleX(0); transform-origin: left; }
.rf-swiss.is-on .rf-swiss-lines i { transform: none; }
.rf-swiss-tag { position: absolute; left: clamp(1.4rem, 4vw, 3rem); bottom: clamp(1rem, 3vw, 2rem); font: 600 0.78rem/1 var(--pp-font-body, sans-serif); letter-spacing: 0.04em; z-index: 1; }
.rf-swiss-tag b { margin-right: 0.4em; }
.rf-swiss-note { position: absolute; right: clamp(1.4rem, 4vw, 3rem); bottom: clamp(1rem, 3vw, 2rem); margin: 0; font: 600 0.78rem/1.3 var(--pp-font-body, sans-serif); text-align: right; z-index: 1; color: #14151a; }
.rf-swiss-word {
  position: relative; z-index: 1;
  align-self: flex-start;
  display: inline-flex; align-items: baseline; gap: 0.6rem;
  font: 600 clamp(3rem, 11vw, 9.5rem)/0.9 var(--pp-font-display, sans-serif);
  letter-spacing: -0.035em;
  color: #14151a; text-decoration: none;
  opacity: 0;
  transform: translateX(-30%) scaleX(1.25);
  filter: blur(14px);
  transform-origin: left center;
  transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.7s ease, color 0.3s;
}
.rf-swiss-word small { font: 600 clamp(0.75rem, 1.2vw, 0.95rem)/1 var(--pp-font-body, sans-serif); letter-spacing: 0.04em; transform: translateY(-1.2em); }
.rf-swiss.is-on .rf-swiss-word { opacity: 1; transform: none; filter: none; }
.rf-swiss.is-on .rf-swiss-word:nth-of-type(2) { transition-delay: 0.12s; }
.rf-swiss.is-on .rf-swiss-word:nth-of-type(3) { transition-delay: 0.24s; }
.rf-swiss-word.is-hit, .rf-swiss-word:hover, .rf-swiss-word:focus-visible { color: var(--pp-purple, #7c4dff); }
.rf-swiss-word:focus-visible { outline: 3px solid var(--pp-purple, #7c4dff); outline-offset: 6px; border-radius: 4px; }
.rf-swiss-dot {
  position: absolute; left: 0; top: 0; z-index: 2;
  width: clamp(28px, 4.4vw, 64px); aspect-ratio: 1; border-radius: 50%;
  background: var(--pp-purple, #7c4dff);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.7, -0.4, 0.3, 1.4), opacity 0.4s;
  pointer-events: none;
}
.rf-swiss.is-on .rf-swiss-dot { opacity: 1; }
.rf-swiss-dot.is-moving { filter: blur(3px); }

/* ---------- 5. Laptop reveal (demos) ---------- */
.rf-laptop-sec { padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem); overflow: hidden; }
.rf-laptop-wrap { max-width: 1240px; margin: 0 auto; display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 960px) { .rf-laptop-wrap { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); } }
.rf-laptop-copy h2 { font: 600 clamp(2rem, 4.4vw, 3.6rem)/1 var(--pp-font-display, sans-serif); margin: 0.8rem 0 1rem; color: var(--pp-ink, #1b1f2a); }
.rf-laptop-copy p { color: var(--pp-muted, #5c6174); max-width: 44ch; margin: 0 0 1.5rem; }
.rf-laptop { --p: 1; perspective: 1600px; perspective-origin: 50% 0%; width: 100%; max-width: 560px; justify-self: center; padding: 2% 0 30%; }
@media (max-width: 600px) { .rf-laptop { width: 86%; } }
/* Lid stands on the hinge; the keyboard deck lies flat toward the viewer.
   Closed (p=0) the lid folds forward onto the deck and the camera looks down from higher up. */
.rf-laptop-3d {
  position: relative; width: 100%; aspect-ratio: 16 / 10.4; transform-style: preserve-3d;
  transform: rotateX(calc(-14deg - (1 - var(--p)) * 30deg)) rotateY(calc((1 - var(--p)) * -22deg)) scale(calc(0.9 + var(--p) * 0.1));
}
.rf-lid {
  position: absolute; inset: 0;
  transform-origin: 50% 100%;
  transform: rotateX(calc((1 - var(--p)) * -88deg));
  transform-style: preserve-3d;
}
.rf-deck {
  position: absolute; left: 0; right: 0; top: 100%; height: 92%;
  transform-origin: 50% 0;
  transform: rotateX(90deg);
  border-radius: 4px 4px 18px 18px;
  background: linear-gradient(180deg, #dfe2ea, #c4c8d4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.rf-deck::before {
  content: ''; position: absolute; left: 7%; right: 7%; top: 7%; height: 44%; border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 0 88%, #d3d6df 88%) 0 0 / 7.69% 100%,
    linear-gradient(180deg, transparent 0 80%, #d3d6df 80%) 0 0 / 100% 16.6%,
    #2b2f3c;
}
.rf-deck::after { content: ''; position: absolute; left: 33%; right: 33%; top: 57%; bottom: 7%; border-radius: 8px; background: rgba(27, 31, 42, 0.12); box-shadow: inset 0 0 0 1px rgba(27, 31, 42, 0.08); }
.rf-lid-front, .rf-lid-back { position: absolute; inset: 0; border-radius: 14px 14px 4px 4px; backface-visibility: hidden; }
.rf-lid-front { background: #0c0d12; padding: 3.2% 3.2% 4.2%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.rf-lid-back { transform: rotateY(180deg); background: linear-gradient(160deg, #e4e6ee, #b9bdcb); }
.rf-lid-back::after { content: ''; position: absolute; left: 50%; top: 50%; width: 9%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(124, 77, 255, 0.35); }
.rf-screen { position: relative; height: 100%; border-radius: 4px; overflow: hidden; background: #1b1f2a; }
.rf-screen img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: calc(var(--p) * 1.6 - 0.6); }
.rf-screen-live {
  position: absolute; left: 4%; top: 6%; display: inline-flex; align-items: center; gap: 6px;
  font: 700 clamp(9px, 1.4vw, 12px)/1 var(--pp-font-body, sans-serif); letter-spacing: 0.12em;
  padding: 0.55em 0.8em; border-radius: 99px; background: rgba(12, 13, 18, 0.75); color: #fff;
  opacity: calc(var(--p) * 3 - 2);
}
.rf-screen-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.3); }
.rf-laptop-glow { position: absolute; left: 10%; right: 10%; top: 10%; height: 70%; border-radius: 50%; background: radial-gradient(closest-side, rgba(124, 77, 255, 0.45), transparent); filter: blur(30px); opacity: var(--p); transform: translateZ(-40px); pointer-events: none; }

/* ---------- 6. World count ---------- */
.rf-world-n { display: inline-block; min-width: 1ch; font-variant-numeric: tabular-nums; }

/* ---------- 7. Count-up ---------- */
.rf-count { font-variant-numeric: tabular-nums; }

/* ---------- 8. Highlighter ---------- */
mark.rf-hl {
  color: inherit;
  background-color: transparent;
  background-image: linear-gradient(100deg, rgba(124, 77, 255, 0) 0.6%, rgba(124, 77, 255, 0.55) 2%, rgba(94, 231, 255, 0.45) 96%, rgba(94, 231, 255, 0) 99%);
  background-repeat: no-repeat;
  background-position: 0 88%;
  background-size: 0% 46%;
  padding: 0 0.15em;
  margin: 0 -0.15em;
  border-radius: 0.2em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-size 1.1s cubic-bezier(0.65, 0, 0.35, 1);
}
mark.rf-hl.is-on { background-size: 100% 58%; }

/* ---------- Reduced motion: finished states, no travel ---------- */
@media (prefers-reduced-motion: reduce) {
  .rf-note.is-new, .rf-notes.is-pushing .rf-note:not(.is-new), .rf-bump { animation: none; }
  .rf-swiss-lines i, .rf-swiss-word, .rf-swiss-dot { transition: none; }
  .rf-swiss-lines i { transform: none; }
  .rf-swiss-word { opacity: 1; transform: none; filter: none; }
  .rf-route-pin i::before { animation: none; }
  .rf-route-on .ws-timeline-dot { filter: none; transition: none; }
  mark.rf-hl { transition: none; background-size: 100% 58%; }
}
