/* ==========================================================================
   K06 — Motion & Cursor (kit/motion.html)
   Duration/easing specimens, the scroll-trigger catalog, cursor zones,
   motion personalities and the page-transition rules.

   Play state: kit-motion.js toggles .is-on on every [data-demo] element;
   the "off" styles below are the start frame, .is-on the end frame.
   ========================================================================== */

/* ---- Helpers ---------------------------------------------------------- */

/* Extra-small button (Play ↻) */
.btn--xs {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 14px;
}

/* Right-aligned action bar above a demo */
.section-actions {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 20px;
}

/* Placeholder stripes as a plain fill (for elements that are not a .ph) */
.ph-fill {
  background: repeating-linear-gradient(135deg, var(--ph) 0 10px, var(--ph-stripe) 10px 11px);
  filter: var(--img-filter);
}

/* Two-column split used in sections 01 and 05 */
.motion-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 24px 48px;
}

.motion-split--code {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

/* ---- 01 Durations ----------------------------------------------------- */
.dur-list,
.ease-list {
  display: flex;
  flex-direction: column;
}

.dur-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.dur-row__token {
  font-family: var(--f-mono);
  font-size: 13px;
}

.dur-row__track {
  height: 14px;
  background: var(--line);
}

.dur-row__fill {
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width var(--ms, 400ms) cubic-bezier(.16, 1, .3, 1);
}

.dur-list.is-on .dur-row__fill {
  width: 100%;
}

/* ---- 01 Easings ------------------------------------------------------- */
.ease-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.ease-row__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ease-row__name {
  font-weight: 600;
}

.ease-row__desc {
  font-size: 15px;
  color: var(--muted);
}

.ease-row__track {
  position: relative;
  height: 22px;
  border-bottom: 1px dashed var(--line);
}

.ease-row__dot {
  position: absolute;
  top: 1px;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  transition: left 700ms var(--curve, ease);
}

.ease-list.is-on .ease-row__dot {
  left: calc(100% - 20px);
}

/* ---- 02 Catalog cards ------------------------------------------------- */
.fx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.fx-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.fx-card__stage {
  position: relative;
  height: 200px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--canvas);
}

.fx-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.fx-card__title {
  font-size: 16px;
  font-weight: 600;
}

.fx-card__meta {
  margin-top: 2px;
}

/* Contact sheet → circle → case study (shared element) */
.sheet-demo__frame {
  position: absolute;
  top: 30%;
  width: 26%;
  aspect-ratio: 3/2;
}

.sheet-demo__frame--left  { left: 6%; }
.sheet-demo__frame--right { left: 68%; }

.sheet-demo__hero {
  position: absolute;
  z-index: 2;
  left: 37%;
  top: 30%;
  width: 26%;
  height: 27%;
  display: flex;
  align-items: flex-end;
  padding: 8px;
  transition: all 700ms cubic-bezier(.7, 0, .2, 1);
}

.sheet-demo__hero.is-open {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

/* Trim transition */
.trim-demo__page {
  position: absolute;
  inset: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.trim-demo__page--next {
  background: var(--sheet);
  color: var(--sheet-ink);
}

.trim-demo__page--current {
  color: var(--ink);
  clip-path: inset(0 0 0 0);
  transition: clip-path 700ms cubic-bezier(.7, 0, .2, 1);
}

.trim-demo__page--current.is-on {
  clip-path: inset(0 0 0 100%);
}

/* Printer's crop marks in the stage corners */
.crop-mark {
  position: absolute;
  background: var(--ink);
}

.crop-mark--tl-v { left: 18px;  top: 8px;     width: 1px;  height: 10px; }
.crop-mark--tl-h { left: 8px;   top: 18px;    width: 10px; height: 1px; }
.crop-mark--br-v { right: 18px; bottom: 8px;  width: 1px;  height: 10px; }
.crop-mark--br-h { right: 8px;  bottom: 18px; width: 10px; height: 1px; }

/* Masked image reveal */
.mask-demo {
  position: absolute;
  inset: 0;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1000ms cubic-bezier(.16, 1, .3, 1);
}

.mask-demo__img {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 10px;
  transform: scale(1.08);
  transition: transform 1000ms cubic-bezier(.16, 1, .3, 1);
}

.mask-demo.is-on {
  clip-path: inset(0 0 0 0);
}

.mask-demo.is-on .mask-demo__img {
  transform: scale(1);
}

/* Line-drawn annotation */
.anno-demo {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 0 12%;
}

.anno-demo__figure {
  position: relative;
  align-self: flex-start;
  font-size: 56px;
  line-height: 1;
}

.anno-demo__note {
  align-self: flex-end;
  font-family: var(--f-hand);
  font-size: 24px;
  color: var(--accent-text);
  transform: rotate(-3deg);
}

/* Stamp press — the stamp only exists (and animates) while .is-on */
.stamp-demo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stamp-demo__stamp {
  display: none;
  padding: 8px 16px;
  border: 2.5px solid var(--accent);
  color: var(--accent-text);
  font-family: var(--f-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  animation: proofStamp 380ms cubic-bezier(.2, 1.4, .4, 1) both;
}

.stamp-demo.is-on .stamp-demo__stamp {
  display: block;
}

/* Horizontal filmstrip */
.filmstrip {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 10px;
  padding: 36px 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  background: var(--sheet);
  cursor: grab;
}

.filmstrip__frame {
  flex: 0 0 46%;
  display: flex;
  align-items: flex-end;
  padding: 8px;
  scroll-snap-align: start;
}

/* Cursor-following preview */
.preview-list {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 16px;
}

.preview-list__row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 22px;
}

.preview-list__year {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
}

/* left/top set by JS */
.preview-list__thumb {
  position: absolute;
  width: 140px;
  aspect-ratio: 4/5;
  margin: -90px 0 0 20px;
  display: flex;
  align-items: flex-end;
  padding: 6px;
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .4);
  pointer-events: none;
  transition: left 80ms linear, top 80ms linear;
}

/* Line-by-line text reveal */
.line-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 10%;
}

.line-reveal__mask {
  overflow: hidden;
}

.line-reveal__line {
  font-size: 34px;
  line-height: 1.1;
  transform: translateY(105%);
  transition: transform 700ms cubic-bezier(.16, 1, .3, 1) var(--delay, 0ms);
}

.line-reveal.is-on .line-reveal__line {
  transform: translateY(0);
}

/* Restrained parallax (translateY set by JS) */
.parallax-demo {
  position: absolute;
  inset: 18px;
  overflow: hidden;
}

.parallax-demo__img {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 110%;
  display: flex;
  align-items: flex-end;
  padding: 10px;
}

/* Muted autoplay in view — fixed "player" colours in every preset */
.video-demo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  background: #000;
}

.video-demo__poster {
  position: absolute;
  inset: 0;
  opacity: .35;
}

.video-demo__bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.video-demo__status {
  padding: 4px 8px;
  background: #EEE9E1;
  color: #141414;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.video-demo__btn {
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #EEE9E1;
  background: transparent;
  color: #EEE9E1;
  font-family: var(--f-mono);
  font-size: 12px;
  cursor: pointer;
}

.video-demo__track {
  flex: 1;
  height: 2px;
  background: rgba(238, 233, 225, .3);
}

/* width + transition-duration set by JS (12 s while playing) */
.video-demo__fill {
  width: 0;
  height: 100%;
  background: #FF5A4E;
  transition: width 0s linear;
}

/* ---- 03 Cursor zones -------------------------------------------------- */
.cursor-zones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 12px;
}

.cursor-zone {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 150px;
  padding: 14px;
  cursor: pointer;
}

.cursor-zone__label {
  font-size: 28px;
  color: var(--ink);
}

.cursor-zone__hint {
  align-self: flex-start;
}

/* ---- 04 Motion personalities ------------------------------------------
   Each .persona sets data-preset/data-theme, so --dur and --ease resolve
   to that preset's values. */
.persona-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.persona {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--ink);
}

.persona__name {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  font-size: 22px;
  line-height: 1;
}

.persona__meta {
  margin-top: 4px;
}

.persona__track {
  position: relative;
  height: 36px;
}

.persona__block {
  position: absolute;
  top: 4px;
  left: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  background: var(--accent);
  transition: left var(--dur) var(--ease);
}

.persona-list.is-on .persona__block {
  left: calc(100% - 28px);
}

/* ---- 05 Page transitions ---------------------------------------------- */
.code-block {
  margin: 0;
  padding: 20px 24px;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--sheet-ink);
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1.75;
  white-space: pre;
}

.code-block code {
  font: inherit;
}

.rule-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rule-list__item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.rule-list__no {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
}
