.motion-preview,
.interactive-catalog {
  --motion-quick: 160ms;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --acc-expand: 250ms;
  --acc-collapse: 250ms;
  --acc-chevron: 250ms;
  --acc-ease: var(--motion-ease);
  --subtle-dur: 220ms;
  --subtle-distance: 0.14em;
  --subtle-blur: 0.042em;
  --subtle-ease: var(--motion-ease);
  --check-opacity-dur: 220ms;
  --check-rotate-dur: 220ms;
  --check-rotate-from: 12deg;
  --check-bob-dur: 220ms;
  --check-y-amount: 2px;
  --check-blur-dur: 220ms;
  --check-blur-from: 1px;
  --check-path-dur: 220ms;
  --check-path-delay: 0ms;
  --check-ease-out: var(--motion-ease);
  --check-ease-opacity: var(--motion-ease);
  --check-ease-rotate: var(--motion-ease);
  --check-ease-bob: var(--motion-ease);
  --check-ease-path: var(--motion-ease);
}

.motion-preview {
  max-width: 680px;
}

.interactive-catalog .catalog-grid {
  align-items: start;
}

.motion-photo {
  aspect-ratio: 512 / 270;
  object-position: center;
  margin-top: 24px;
}

.motion-preview .sample h2 {
  font-size: clamp(34px, 10vw, 56px);
}

.motion-weight {
  gap: 4px;
  padding: 2px;
}

.motion-weight button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #101010;
  font: inherit;
  font-size: 19px;
  cursor: pointer;
  transition: background-color var(--motion-quick) var(--motion-ease),
    transform var(--motion-quick) var(--motion-ease);
}

.motion-weight button:hover:not(:disabled) {
  background: #eef0f0;
}

.motion-weight button:disabled {
  color: #727a7e;
  cursor: default;
}

.weight-display {
  min-width: 5.2ch;
  text-align: center;
  font-size: 14px;
}

.motion-add {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 11px 32px;
  border: 1px solid #101010;
  border-radius: 7px;
  background: #101010;
  color: white;
  font: inherit;
  font-weight: 620;
  cursor: pointer;
  transition: transform var(--motion-quick) var(--motion-ease),
    background-color var(--motion-quick) var(--motion-ease),
    color var(--motion-quick) var(--motion-ease);
}

.motion-add[data-added="true"] {
  background: #f7f8f8;
  color: #101010;
}

.motion-weight button:active:not(:disabled),
.motion-add:active {
  transform: scale(0.97);
}

.motion-add .t-success-check {
  position: absolute;
  inset-inline-start: 12px;
  top: calc(50% - 8px);
}

.motion-add[data-added="false"] .t-success-check {
  visibility: hidden;
}

.motion-details {
  margin-top: 20px;
  border-top: 1px solid #dce0e2;
  border-bottom: 1px solid #dce0e2;
}

.motion-details .t-acc-head {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: #101010;
  font: inherit;
  font-weight: 620;
  text-align: start;
  cursor: pointer;
}

.motion-details dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 0;
  padding: 0 0 14px;
  color: #555d61;
  font-size: 14px;
}

.motion-details dd {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (prefers-reduced-motion: reduce) {
  .motion-preview,
  .interactive-catalog {
    --motion-quick: 0ms;
  }

  .motion-weight button:active:not(:disabled),
  .motion-add:active {
    transform: none;
  }
}

.t-subtle-number {
  display: inline-flex;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}
.t-subtle-slot { position: relative; display: inline-block; }
.t-subtle-new { display: inline-block; }
.t-subtle-old { position: absolute; inset: 0; text-align: center; pointer-events: none; }
.t-subtle-number.is-animating .t-subtle-new {
  animation: t-subtle-in var(--subtle-dur) var(--subtle-ease) both;
}
.t-subtle-number.is-animating .t-subtle-old {
  animation: t-subtle-out var(--subtle-dur) var(--subtle-ease) both;
}
@keyframes t-subtle-in {
  from {
    transform: translateY(calc(var(--subtle-distance) * var(--subtle-dir, 1)));
    opacity: 0;
    filter: blur(var(--subtle-blur));
  }
}
@keyframes t-subtle-out {
  to {
    transform: translateY(calc(var(--subtle-distance) * var(--subtle-dir, 1) * -1));
    opacity: 0;
    filter: blur(var(--subtle-blur));
  }
}

@media (prefers-reduced-motion: reduce) {
  .t-subtle-number .t-subtle-new { animation: none !important; }
  .t-subtle-number .t-subtle-old { display: none; }
}

/* grid-template-rows 0fr → 1fr gives a clean height animation
   with no JS measurement; the inner element clips overflow. */
.t-acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--acc-collapse) var(--acc-ease);
}
.t-acc[data-open="true"] .t-acc-panel {
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--acc-expand) var(--acc-ease);
}
.t-acc-panel-inner {
  overflow: hidden;
  opacity: 0;
  filter: blur(2px);
  transition:
    opacity var(--acc-collapse) var(--acc-ease),
    filter var(--acc-collapse) var(--acc-ease);
}
.t-acc[data-open="true"] .t-acc-panel-inner {
  opacity: 1;
  filter: blur(0);
  transition:
    opacity var(--acc-expand) var(--acc-ease),
    filter var(--acc-expand) var(--acc-ease);
}
/* Flip the chevron vertically to turn the "v" into a "^".
   scaleY(-1) about the centre passes through a flat line at
   the midpoint (same look as a `d:` path morph) but animates
   in every browser, unlike CSS `d:` morphing (Chromium only).
   The chevron path is symmetric about the 16x16 viewBox
   centre, so the flip lands exactly on the "^"; non-scaling
   -stroke keeps the stroke width constant through the flip. */
.t-acc-chevron {
  display: inline-flex;
  transform: scaleY(1);
  transform-origin: center;
  transition: transform var(--acc-chevron) var(--acc-ease);
}
.t-acc-chevron path { vector-effect: non-scaling-stroke; }
.t-acc[data-open="true"] .t-acc-chevron {
  transform: scaleY(-1);
}

@media (prefers-reduced-motion: reduce) {
  .t-acc-panel, .t-acc-panel-inner, .t-acc-chevron {
    transition: none !important;
  }
}

/* Wrapper drives the appear animation; it doesn't own any
   sizing or color so you can drop in any icon. */
.t-success-check {
  display: inline-block;
  transform-origin: center;
  opacity: 0;
  will-change: transform, opacity, filter;
}
/* overflow: visible keeps the stroke from clipping while it
   draws; display: block kills the inline whitespace under SVGs. */
.t-success-check svg { display: block; overflow: visible; }
/* Stroke-draw setup. Replace 20 with the result of
   path.getTotalLength() for your path; round caps mean any
   sub-pixel overshoot is invisible. */
.t-success-check svg path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}

.t-success-check[data-state="in"] {
  animation:
    t-check-fade   var(--check-opacity-dur) var(--check-ease-opacity) forwards,
    t-check-rotate var(--check-rotate-dur)  var(--check-ease-rotate)  forwards,
    t-check-blur   var(--check-blur-dur)    var(--check-ease-out)     forwards,
    t-check-bob    var(--check-bob-dur)     var(--check-ease-bob)     forwards;
}
.t-success-check[data-state="in"] svg path {
  animation: t-check-draw var(--check-path-dur) var(--check-ease-path) var(--check-path-delay, 0ms) forwards;
}

@keyframes t-check-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes t-check-rotate {
  from { transform: rotate(var(--check-rotate-from)); }
  to   { transform: rotate(0deg); }
}
@keyframes t-check-blur {
  from { filter: blur(var(--check-blur-from)); }
  to   { filter: blur(0); }
}
@keyframes t-check-bob {
  from { translate: 0 var(--check-y-amount); }
  to   { translate: 0 0; }
}
@keyframes t-check-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .t-success-check { animation: none !important; opacity: 1; }
  .t-success-check svg path { animation: none !important; stroke-dashoffset: 0 !important; }
}
