/* ==========================================================================
   Pikett · division demo "div-motion" (divisions/motion.html hero stage)
   1. Shell: ratio switch, viewer, timeline (js/scenes/div-motion.js sets the
      frame geometry, the playhead and every type style inline)
   2. The film's type layer (DOM, Archivo on its wdth + wght axes)
   3. Timeline: transport, ruler, keyframe ticks, shot clips, playhead
   ========================================================================== */

/* 1. Shell ------------------------------------------------------------------ */
.mo {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 20px var(--mo-foot, 48px);
  font-family: var(--sans); color: var(--fg);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.mo.is-paused *, .mo.is-paused *::before, .mo.is-paused *::after { animation-play-state: paused !important; }

.mo__bar { position: relative; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.mo__fmt {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  font-family: var(--mono); font-size: 11px; line-height: 1; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-3); white-space: nowrap;
}
.mo__fmt b { font-weight: 400; color: var(--fg); }
.mo__rec { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); flex: none; }
.is-playing .mo__rec { animation: mo-rec 1.6s steps(1) infinite; }
@keyframes mo-rec { 50% { opacity: .25; } }

.mo__ratios {
  position: relative; display: inline-flex; flex: none; padding: 3px; border-radius: 999px;
  background: rgba(243, 242, 238, .045); box-shadow: inset 0 0 0 1px var(--line);
}
.mo__pill {
  position: absolute; left: 0; top: 3px; bottom: 3px; z-index: 0; border-radius: 999px;
  background: var(--c); box-shadow: 0 6px 22px -6px color-mix(in srgb, var(--c) 80%, transparent);
  transition: transform .6s var(--ease), width .6s var(--ease);
}
.mo__ratio {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 32px; padding: 0 13px; border-radius: 999px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em; line-height: 1; color: var(--fg-2);
  transition: color .35s var(--ease);
}
.mo__ratio i { display: block; flex: none; border: 1.25px solid currentColor; border-radius: 2px; opacity: .8; transition: transform .45s var(--ease); }
.mo__ratio:hover { color: var(--fg); }
.mo__ratio[aria-pressed="true"] { color: #0A0A0C; }
.mo__ratio[aria-pressed="true"] i { opacity: 1; }
.mo__ratio:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* the viewer: canvases fill it (pikett.css .scene canvas); the frame is placed inline */
.mo__view { position: relative; flex: 1 1 auto; min-height: 140px; touch-action: pan-y; }
.mo__back { z-index: 1; }
.mo__gl { z-index: 3; pointer-events: none; }
.mo__shade, .mo__clip, .mo__edge, .mo__ghost { position: absolute; left: 0; top: 0; border-radius: var(--mo-r, 10px); pointer-events: none; }
.mo__shade {
  z-index: 0; background: #0A0A0C;
  box-shadow: 0 34px 80px -34px rgba(0, 0, 0, .95), 0 0 70px -24px color-mix(in srgb, var(--c) 45%, transparent);
}
.mo__clip { z-index: 2; overflow: hidden; contain: layout paint; }
.mo__clip--front { z-index: 4; }
.mo__type { position: absolute; inset: 0; }
.mo__edge { z-index: 5; box-shadow: inset 0 0 0 1px rgba(243, 242, 238, .12); }
.mo__edge i { position: absolute; width: 11px; height: 11px; border-color: var(--fg-3); border-style: solid; border-width: 0; }
.mo__edge i:nth-child(1) { left: -8px; top: -8px; border-left-width: 1px; border-top-width: 1px; }
.mo__edge i:nth-child(2) { right: -8px; top: -8px; border-right-width: 1px; border-top-width: 1px; }
.mo__edge i:nth-child(3) { left: -8px; bottom: -8px; border-left-width: 1px; border-bottom-width: 1px; }
.mo__edge i:nth-child(4) { right: -8px; bottom: -8px; border-right-width: 1px; border-bottom-width: 1px; }
.mo__ghost {
  z-index: 5; opacity: 0; border-radius: var(--mo-r, 10px);
  background:
    linear-gradient(90deg, var(--c) 50%, transparent 0) 0 0 / 10px 1px repeat-x,
    linear-gradient(90deg, var(--c) 50%, transparent 0) 0 100% / 10px 1px repeat-x,
    linear-gradient(0deg, var(--c) 50%, transparent 0) 0 0 / 1px 10px repeat-y,
    linear-gradient(0deg, var(--c) 50%, transparent 0) 100% 0 / 1px 10px repeat-y;
  transition: opacity .35s var(--ease);
}
.mo__ghost.is-on { opacity: .9; }

/* 2. The film's type ------------------------------------------------------- */
.mo__blk { position: absolute; inset: 0; }
.mo__w {
  position: absolute; left: 0; top: 0; display: block; white-space: nowrap;
  font-family: var(--sans); font-weight: 800; font-stretch: 125%; line-height: 1; letter-spacing: -.03em;
  font-kerning: none; text-rendering: geometricPrecision;
  transform-origin: 0 0; will-change: transform;
}
.mo__w--mask { overflow: hidden; padding: .16em .1em .26em; }
.mo__l { display: inline-block; vertical-align: baseline; transform-origin: 50% 60%; }
.mo__blk--nums .mo__l { color: transparent; -webkit-text-stroke: 1.5px rgba(243, 242, 238, .62); }
.mo__meas { visibility: hidden; font-size: 100px; pointer-events: none; }

/* 3. Timeline ----------------------------------------------------------------- */
.mo__tl { position: relative; z-index: 6; flex: none; display: grid; gap: 10px; }
.mo__transport { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mo__play {
  display: inline-flex; align-items: center; gap: 9px; flex: none;
  height: 36px; padding: 0 16px 0 13px; border-radius: 999px;
  background: var(--fg); color: #0A0A0C;
  font-size: 14px; font-weight: 650; font-stretch: 112%; letter-spacing: -.005em;
  transition: background-color .3s var(--ease), transform .4s var(--ease);
}
.mo__play:hover { background: var(--c); }
.mo__play:active { transform: scale(.96); }
.mo__play:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }
.mo__play-i { display: inline-grid; place-items: center; width: 14px; height: 14px; }
.mo__play-i svg { width: 14px; height: 14px; display: block; }
.mo__play-l { min-width: 3.1em; }
.mo__tc { font-family: var(--mono); font-size: 15px; line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mo__tc b { font-weight: 400; color: var(--fg); }
.mo__tc span { color: var(--fg-3); }
.mo__fps { margin-left: auto; font-family: var(--mono); font-size: 11px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); white-space: nowrap; }

.mo__track {
  position: relative; height: 78px; padding: 0 14px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(243, 242, 238, .045), rgba(243, 242, 238, .02));
  box-shadow: inset 0 0 0 1px var(--line);
  touch-action: pan-y; cursor: ew-resize; outline: none;
}
.mo__track:focus-visible { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 2px var(--c); }
.mo__scale { position: relative; height: 100%; }
.mo__ruler { position: absolute; left: 0; right: 0; top: 0; height: 20px; }
.mo__tick { position: absolute; top: 0; width: 1px; height: 5px; margin-left: -.5px; background: var(--line-2); }
.mo__tick.is-major { height: 9px; background: rgba(243, 242, 238, .34); }
.mo__sec {
  position: absolute; top: 9px; padding-left: 4px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 400; line-height: 1; letter-spacing: .04em; color: var(--fg-3);
}
.mo__lane { position: absolute; left: 0; right: 0; top: 22px; height: 11px; }
.mo__lane--1 { top: 34px; }
.mo__lane::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.mo__key {
  position: absolute; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  transform: rotate(45deg); border-radius: 1px;
  box-shadow: inset 0 0 0 1.25px rgba(243, 242, 238, .42); background: #141418;
  transition: background-color .25s, box-shadow .25s, transform .35s var(--ease);
  cursor: pointer;
}
.mo__key--1 { box-shadow: inset 0 0 0 1.25px color-mix(in srgb, var(--c) 60%, transparent); }
.mo__key.is-on { background: rgba(243, 242, 238, .78); box-shadow: none; }
.mo__key--1.is-on { background: var(--c); }
.mo__key.is-now { transform: rotate(45deg) scale(1.45); box-shadow: 0 0 10px rgba(243, 242, 238, .7); }
.mo__key--1.is-now { box-shadow: 0 0 10px var(--c); }
.mo__clips { position: absolute; left: 0; right: 0; bottom: 8px; height: 23px; }
.mo__clip-bar {
  position: absolute; top: 0; bottom: 0; padding: 0 0 0 7px; margin-left: 1px; border-radius: 6px;
  display: flex; align-items: center; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(243, 242, 238, .1);
  opacity: .62; transition: opacity .35s var(--ease), box-shadow .35s var(--ease);
}
.mo__clip-bar + .mo__clip-bar { margin-left: 2px; }
.mo__clip-bar b { position: relative; z-index: 1; font-family: var(--mono); font-size: 9.5px; font-weight: 400; line-height: 1; letter-spacing: .06em; }
.mo__clip-bar i { position: absolute; left: 22px; right: 4px; top: 0; bottom: 0; }
.mo__clip-bar--0, .mo__clip-bar--3 { background: var(--c); color: #0A0A0C; }
.mo__clip-bar--0 i { background: linear-gradient(90deg, transparent 6%, rgba(10, 10, 12, .85) 6% 40%, transparent 40% 45%, rgba(10, 10, 12, .85) 45% 82%, transparent 82%) 0 50% / 100% 26% no-repeat; }
.mo__clip-bar--1 { background: #0E0E12; color: var(--fg-2); }
.mo__clip-bar--1 i { background: linear-gradient(90deg, transparent 10%, rgba(243, 242, 238, .8) 10% 42%, transparent 42% 47%, rgba(243, 242, 238, .8) 47% 80%, transparent 80%) 0 50% / 100% 22% no-repeat; }
.mo__clip-bar--1 i::after { content: ""; position: absolute; left: 4%; right: 10%; top: 18%; bottom: 18%; border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); border-radius: 2px; }
.mo__clip-bar--2 { background: radial-gradient(60% 120% at 62% 50%, rgba(255, 77, 157, .3), transparent 70%), #121216; color: var(--fg-2); }
.mo__clip-bar--2 i { background: radial-gradient(closest-side, var(--c) 62%, transparent 70%) 58% 50% / 8px 8px no-repeat, radial-gradient(closest-side, transparent 50%, #F3F2EE 56%, #8E8D98 74%, transparent 80%) 58% 50% / 17px 17px no-repeat; }
.mo__clip-bar--3 i { background: radial-gradient(circle at 18% 50%, rgba(10, 10, 12, .0) 0, transparent 40%); }
.mo__clip-bar.is-on { opacity: 1; box-shadow: inset 0 0 0 1px rgba(243, 242, 238, .32); }
.mo__played {
  position: absolute; left: 0; right: 0; top: 20px; bottom: 9px; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c) 9%, transparent));
  pointer-events: none;
}
.mo__head { position: absolute; left: 0; top: 0; bottom: 0; width: 0; z-index: 3; pointer-events: none; will-change: transform; }
.mo__head::before {
  content: ""; position: absolute; left: -1px; top: 4px; bottom: 4px; width: 2px; border-radius: 2px;
  background: var(--c); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 85%, transparent);
}
.mo__knob {
  position: absolute; left: -6px; top: -3px; width: 12px; height: 14px; border-radius: 3px 3px 6px 6px;
  background: var(--c); box-shadow: 0 2px 10px color-mix(in srgb, var(--c) 70%, transparent);
  transition: transform .3s var(--ease);
}
.mo__knob::after { content: ""; position: absolute; left: 5px; top: 3px; width: 2px; height: 6px; border-radius: 1px; background: rgba(10, 10, 12, .55); }
.mo__flag, .mo__hover b {
  position: absolute; left: 0; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px);
  padding: 5px 7px 4px; border-radius: 6px; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; font-weight: 400; line-height: 1; letter-spacing: .03em; font-variant-numeric: tabular-nums;
  background: var(--c); color: #0A0A0C; opacity: 0;
  transition: opacity .25s var(--ease), transform .35s var(--ease);
}
.is-scrubbing .mo__flag, .mo__track:focus-visible .mo__flag { opacity: 1; transform: translateX(-50%); }
.is-scrubbing .mo__knob { transform: scale(1.15); }
.mo__hover { position: absolute; left: 0; top: 0; bottom: 0; width: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .2s; }
.mo__hover::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px; background: rgba(243, 242, 238, .35); }
.mo__hover b { background: rgba(243, 242, 238, .92); opacity: 1; transform: translateX(-50%); }
.mo__hover.is-on { opacity: 1; }
.is-scrubbing .mo__hover { opacity: 0; }

/* narrow stages (phones) */
.mo--narrow { padding: 12px 12px var(--mo-foot, 60px); gap: 12px; }
.mo--narrow .mo__fmt { display: none; }
.mo--narrow .mo__bar { min-height: 0; }
.mo--narrow .mo__ratios { display: flex; width: 100%; }
.mo--narrow .mo__ratio { flex: 1 1 0; height: 36px; padding: 0 6px; gap: 6px; font-size: 11px; }
.mo--narrow .mo__tl { gap: 9px; }
.mo--narrow .mo__transport { gap: 10px; }
.mo--narrow .mo__play { height: 38px; }
.mo--narrow .mo__tc { font-size: 14px; }
.mo--narrow .mo__tc span { display: none; }
.mo--narrow .mo__track { height: 74px; padding: 0 12px; }
.mo--narrow .mo__sec:nth-of-type(even) { opacity: 0; }

@media (hover: none) { .mo__hover { display: none; } }
