/* ===========================================================================
   Reviamo — motion styles for services.html, about.html and the homepage
   The modules of the retired About 2 experiment, now shared: the brand tick,
   the busywork pile (Services), the scroll-lit story (Services and home), the
   deck and the silk call to action (About), the ribbons and the split-flap
   board (home). Behaviour is in assets/motion.js. Every module is readable
   as plain HTML before the script runs and when motion is reduced.
   =========================================================================== */


/* ------------------------------------------------------------------
   The brand tick: the "v" of the reviamo wordmark, traced from the
   favicon. Same geometry as about.html.
   ------------------------------------------------------------------ */
.tick { position: relative; display: inline-block; aspect-ratio: 620 / 780; }
.tick > svg { position: absolute; display: block; overflow: visible; }
.tick > .tk-a { left: .48%; top: 36.4%; width: 45.5%; height: 62.9%; }
.tick > .tk-b { left: 41.1%; top: .5%; width: 58.1%; height: 97.9%; }
.tick .tk-a path { fill: #7B6BFA; }
.tick .tk-b path { fill: var(--tick-long, #25206E); }
.tick--ondark { --tick-long: #fff; }
.tick--light { --tick-long: #fff; }
.tick--light .tk-a path { fill: #D7D3FE; }

/* ------------------------------------------------------------------
   1. The busywork pile. Each body is an absolutely positioned box whose
   transform the physics loop writes every frame; the visual lives in
   .pb-in so a pop or a tick can scale it without fighting the loop.
   ------------------------------------------------------------------ */
.pile {
  position: relative;
  min-height: max(100svh, 900px);
  overflow: hidden;
  background:
    radial-gradient(90% 55% at 50% 108%, rgba(123, 107, 250, .28), rgba(123, 107, 250, 0) 70%),
    linear-gradient(180deg, #F7F7F5 0%, #F7F7F5 55%, #EBE8FF 100%);
}

@media (min-width: 1024px) {
  .pile { min-height: max(100svh, 940px); }
}

.pile-copy { position: relative; z-index: 20; pointer-events: none; }
.pile-copy a, .pile-copy button { pointer-events: auto; }

.pile-stage { position: absolute; inset: 0; z-index: 10; }

.pile-body {
  position: absolute;
  left: var(--fx, 10%);
  bottom: var(--fy, 2%);
  width: var(--fw, 140px);
  transform: rotate(var(--fr, 0deg));
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html.js-pile .pile-body {
  left: 0;
  top: 0;
  bottom: auto;
  visibility: hidden;
  touch-action: none;
  cursor: grab;
  will-change: transform;
}

html.js-pile .pile-body.is-live { visibility: visible; }

/* On a touchscreen a vertical swipe over the pile must still scroll the
   page; a tap ticks a job off and a sideways swipe throws it. */
@media (hover: none) {
  html.js-pile .pile-body { touch-action: pan-y; }
}
html.js-pile .pile-body.is-dragging { cursor: grabbing; z-index: 5; }
html.js-pile .pile-body.is-gone { display: none; }

.pb-in { position: relative; width: 100%; height: 100%; }
.pb-in img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 12px 14px rgba(37, 32, 110, .22));
}

.pile-pill .pb-in {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 9999px;
  font-family: 'Cal Sans', 'Inter', sans-serif;
  letter-spacing: -.01em;
  line-height: 1;
  background: #fff;
  color: #0F172A;
  box-shadow: 0 0 0 1.5px rgba(15, 23, 42, .12), 0 14px 22px -12px rgba(37, 32, 110, .45);
}

html:not(.js-pile) .pile-pill .pb-in { padding: 12px 20px; font-size: 16px; }
.pile-pill--viola .pb-in { background: #7B6BFA; color: #0F172A; box-shadow: 0 14px 22px -12px rgba(37, 32, 110, .55); }
.pile-pill--notte .pb-in { background: #25206E; color: #fff; box-shadow: 0 14px 22px -12px rgba(15, 23, 42, .6); }
.pile-pill--lilac .pb-in { background: #D7D3FE; color: #25206E; box-shadow: 0 14px 22px -12px rgba(37, 32, 110, .4); }

/* the tick that lands on a body when it is tapped */
.pb-tick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  min-width: 26px;
  max-width: 70px;
  transform: translate(-42%, -62%);
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(15, 23, 42, .25));
}

.pile-pill .pb-tick { width: 30px; left: auto; right: -6px; top: -8px; transform: none; }
.pb-tick .tk-a { clip-path: inset(0 0 100% 0); transition: clip-path .16s cubic-bezier(.25, 1, .5, 1); }
.pb-tick .tk-b { clip-path: inset(100% 0 0 0); transition: clip-path .24s cubic-bezier(.16, 1, .3, 1) .13s; }
.is-ticked .pb-tick .tk-a,
.is-ticked .pb-tick .tk-b { clip-path: inset(0); }

/* ------------------------------------------------------------------
   2. Two ribbons of text crossing, after bb-movement-web.vercel.app.
   The SVG is never narrower than 1100px, so on a phone the bands are
   cropped and big rather than scaled down to a thread.
   ------------------------------------------------------------------ */
.ribbons {
  position: relative;
  height: clamp(360px, 40vw, 600px);
  overflow: hidden;
  /* the bands cross at the exact vertical centre of the SVG, so the
     white-to-midnight seam runs straight through the crossing point */
  background: linear-gradient(180deg, #fff 0 50%, #0F172A 50% 100%);
  cursor: grab;
  touch-action: pan-y;
}

.ribbons.is-dragging { cursor: grabbing; }

.ribbons svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 1100px);
  height: auto;
  transform: translate(-50%, -50%);
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
}

.band { fill: none; stroke-width: 92; }
.band--a { stroke: #7B6BFA; }
.band--b { stroke: #25206E; }

.band-text {
  font-family: 'Cal Sans', 'Inter', sans-serif;
  font-size: 46px;
  letter-spacing: .05em;
  text-transform: uppercase;
  dominant-baseline: central;
}

.band-text--a { fill: #0F172A; }
.band-text--b { fill: #D7D3FE; }

/* ------------------------------------------------------------------
   3. The story: words light up as they are read, the key phrases get
   the site's selection colour, objects drift past at their own depth.
   ------------------------------------------------------------------ */
.story { position: relative; overflow: hidden; background: #fff; }
.floater { position: absolute; z-index: 0; pointer-events: none; }
.floater > div, .floater img { display: block; width: 100%; }
.floater img { height: auto; filter: drop-shadow(0 18px 22px rgba(37, 32, 110, .22)); }
.story-copy { position: relative; z-index: 1; }

mark.hl {
  color: inherit;
  background-color: transparent;
  background-image: linear-gradient(#D7D3FE, #D7D3FE);
  background-repeat: no-repeat;
  background-position: 0 70%;
  background-size: 100% 78%;
  padding: 0 .08em;
  margin: 0 -.04em;
  border-radius: .1em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.text-link {
  color: #25206E;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(123, 107, 250, .55);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .text-link:hover { color: #0F172A; text-decoration-color: #7B6BFA; }
}

/* ------------------------------------------------------------------
   4. Sticker colours, for the .sticker labels on About. (The sentence
   that travelled sideways here was removed on 2026-10-22.)
   ------------------------------------------------------------------ */
.stk--viola { background: #7B6BFA; color: #0F172A; }
.stk--notte { background: #25206E; color: #fff; }
.stk--white { background: #fff; color: #25206E; }
.stk--midnight { background: #0F172A; color: #D7D3FE; }

/* ------------------------------------------------------------------
   5. A deck you can throw, after React Bits "Stack".
   ------------------------------------------------------------------ */
.deck { position: relative; height: 470px; width: min(100%, 400px); margin: 0 auto; }

.deck-card {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 30px 50px -28px rgba(15, 23, 42, .55);
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.deck-card img {
  position: absolute;
  right: -14px;
  top: -34px;
  width: 52%;
  pointer-events: none;
  filter: drop-shadow(0 18px 22px rgba(15, 23, 42, .35));
}

html:not(.js-deck) .deck { height: auto; display: grid; gap: 16px; }
html:not(.js-deck) .deck-card { position: relative; min-height: 300px; }

/* ------------------------------------------------------------------
   6. A split-flap board, the Solari kind from Italian stations, after
   React Bits "Split Flap Text".
   ------------------------------------------------------------------ */
.board { display: grid; gap: 18px; }
.board-row { display: grid; gap: 8px; }

@media (min-width: 900px) {
  .board-row { grid-template-columns: 250px 1fr; align-items: center; gap: 24px; }
}

.flap { display: flex; gap: .12em; font-size: clamp(22px, 5.6vw, 54px); }

.flap-tile {
  position: relative;
  width: .8em;
  height: 1.14em;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .12em;
  background: linear-gradient(180deg, #232a40 0%, #1a2033 49.5%, #121726 50.5%, #0d1220 100%);
  color: #F7F7F5;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 .12em .22em rgba(0, 0, 0, .45);
  overflow: hidden;
  perspective: 300px;
}

.flap-tile::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - .5px);
  height: 1px;
  background: rgba(0, 0, 0, .7);
}

.flap-tile::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0));
  transform-origin: 50% 100%;
  opacity: 0;
}

.flap-tile.is-flip::before { animation: flap .09s cubic-bezier(.23, 1, .32, 1); }

@keyframes flap {
  0% { transform: rotateX(0deg); opacity: 1; }
  100% { transform: rotateX(-90deg); opacity: .2; }
}

.flap-tile.is-accent { color: #B3AAFF; }

/* ------------------------------------------------------------------
   7. Closing call: a moving silk of the brand purple (shader after React
   Bits "Silk") and ticks that burst on a click.
   ------------------------------------------------------------------ */
.cta { position: relative; overflow: hidden; background: #25206E; color: #fff; }
.cta canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.cta-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, rgba(15, 23, 42, .78) 0%, rgba(25, 21, 78, .55) 48%, rgba(37, 32, 110, .12) 100%);
}

.cta-tick img { width: min(78%, 440px); margin: 0 auto; display: block; filter: drop-shadow(0 40px 50px rgba(15, 23, 42, .5)); }
.spark { position: absolute; left: 0; top: 0; width: 16px; pointer-events: none; z-index: 30; }

@media (prefers-reduced-motion: reduce) {
  .flap-tile.is-flip::before { animation: none; }
}

html.drop-wait [data-drop],
html.drop-wait [data-enter] { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .pb-tick .tk-a, .pb-tick .tk-b { transition: none; }
}
