/* Motion (2026-11-18): the states js/motion.js and js/cursor.js switch. Nothing here hides anything unless JS has
   started (.fg-motion) and the thing was still below the screen when the page began (.fg-wait). Reduced motion: the
   scripts don't run, so none of these classes appear. */

/* ---------- the hero's push-in: the render scales from the tower's side (styles.css: transform-origin 66% 46%) */
.fg-motion .hero-media { will-change: scale; }

/* ---------- headings: each word rises out of its own line ---------- */
.fg-rise .fg-w { display: inline-block; overflow: clip; overflow-clip-margin: 0.04em; padding-bottom: 0.12em; margin-bottom: -0.12em; vertical-align: top; }
.fg-rise .fg-wi { display: inline-block; transition: translate 900ms var(--ease-out) calc(var(--i) * 45ms); }
.fg-rise.fg-wait .fg-wi { translate: 0 110%; }

/* ---------- work: the picture opens out of a narrow band, the laptop inside settles to its size ---------- */
.fg-motion .work-thumb { transition: clip-path 900ms var(--ease-out); clip-path: inset(0 round clamp(12px, 1.1vw, 16px)); }
.fg-motion .work-thumb img { scale: 1.08; transition: scale 1300ms var(--ease-out); }
.fg-motion .work-card::before { opacity: calc(0.18 + 0.38 * var(--near, 1)); scale: calc(0.82 + 0.22 * var(--near, 1)); }
.fg-wait .work-thumb { clip-path: inset(44% 0 44% 0 round clamp(12px, 1.1vw, 16px)); }
.fg-wait .work-thumb img { scale: 1.24; }
.fg-wait .work-card::before { opacity: 0; }
.work-item:nth-child(2) .work-thumb { transition-delay: 60ms; }
@media (hover: hover) and (pointer: fine) { .fg-motion .work-card:hover::before { opacity: 0.72; } }

/* ---------- services: the pictures in the heading open sideways, one after another ----------
   Laptops: the words part to let each in (the heading's lines are fixed by its <br>, so its height never changes).
   Tablets and phones: the lines wrap freely, so the pictures open in place instead (a growing width could re-wrap a line and
   move the page under the reader). */
.fg-motion .svc-pill { transition: width 760ms var(--ease-out), margin-left 760ms var(--ease-out), clip-path 760ms var(--ease-out), opacity 300ms ease; }
.fg-motion .svc-w:nth-of-type(2) .svc-pill { transition-delay: 140ms; }
.fg-motion .svc-w:nth-of-type(3) .svc-pill { transition-delay: 280ms; }
@media (min-width: 1024px) { .svc-head.fg-wait .svc-pill { width: 0; margin-left: 0; opacity: 0; } }
@media (max-width: 1023px) { .svc-head.fg-wait .svc-pill { clip-path: inset(0 50% round 0.4em); opacity: 0; } }

/* ---------- questions: the words inside the glass unfold in reading order ---------- */
.fg-unfold { transition: opacity 600ms var(--ease-out) calc(var(--i) * 55ms), translate 700ms var(--ease-out) calc(var(--i) * 55ms); }
.fg-wait .fg-unfold { opacity: 0; translate: 0 12px; }

/* ---------- close: the line lights up word by word (opacity and blur set per word by js/motion.js) ---------- */
.fg-lw, .close-title .fg-lw { display: inline-block; }   /* .close-title span is block: its two lines */
.close-jeet img { transition: clip-path 900ms var(--ease-out); clip-path: inset(0 round 12px); }
.close-jeet.fg-wait img { clip-path: inset(100% 0 0 0 round 12px); }

/* ---------- footer: the letters rise from the floor ---------- */
.fg-wm-src { visibility: hidden; }
.fg-wm { position: absolute; inset: 0; z-index: 2; overflow: clip; pointer-events: none; }
.fg-wm-l { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }

/* ---------- the cursor (laptops with a mouse; js/cursor.js) ---------- */
html.cur-on, html.cur-on * { cursor: none !important; }
html.cur-on .close-cal-box, html.cur-on .close-cal-box * { cursor: auto !important; }
.cur-dot, .cur-ring, .cur-disc {
  position: fixed; left: 0; top: 0; z-index: 2147483000; pointer-events: none;
  opacity: 0; transition: opacity 200ms ease;
}
.cur-on .cur-dot, .cur-on .cur-ring { opacity: 1; }
.cur-dot::before, .cur-ring::before {
  content: ""; position: absolute; border-radius: 50%;
  transition: scale 250ms var(--ease-out), opacity 200ms ease, background-color 150ms ease;
}
.cur-dot, .cur-ring { mix-blend-mode: difference; }      /* reads on the light chapters and the dark ones */
.cur-dot::before { left: -4px; top: -4px; width: 8px; height: 8px; background: #fff; }
.cur-ring::before { left: -28px; top: -28px; width: 56px; height: 56px; box-shadow: inset 0 0 0 1.5px #fff; scale: 0.643; }   /* 36 px at rest */
[data-cur="link"] .cur-ring::before { scale: 1; }
[data-cur="link"] .cur-dot::before { scale: 0; }
[data-cur="view"] .cur-dot::before, [data-cur="view"] .cur-ring::before { scale: 0; opacity: 0; }
[data-cur="cta"] .cur-ring::before { scale: 0.3; opacity: 0; }
[data-cur="cta"] .cur-dot { mix-blend-mode: normal; }   /* white on the wine, never an inverted green */
.cur-press .cur-ring::before { scale: 0.52; }
.cur-press[data-cur="link"] .cur-ring::before { scale: 0.86; }
.cur-press .cur-dot::before { scale: 0.75; }
/* view: a small pane of dark glass with the action in words */
.cur-disc span {
  position: absolute; left: -44px; top: -44px; width: 88px; height: 88px; border-radius: 50%;
  display: grid; place-items: center;
  font: 500 var(--t-ui)/1 var(--sans); letter-spacing: -0.005em; color: var(--cold);
  background: rgba(42, 14, 22, 0.52);
  -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: inset 0 0 0 1px rgba(191, 217, 238, 0.42), 0 12px 28px -14px rgba(0, 0, 0, 0.5);
  scale: 0.3; transition: scale 320ms var(--ease-out);
}
.cur-on[data-cur="view"] .cur-disc { opacity: 1; }
.cur-on[data-cur="view"] .cur-disc span { scale: 1; }
.cur-press[data-cur="view"] .cur-disc span { scale: 0.92; transition-duration: 100ms; }
