/* That Brand: the motion layer. One file, loaded last on every page, so it can be dropped on top of the real theme.
   Hard edges only: wipes, rolls, line draws and slow zooms. Nothing bounces, nothing glows.
   Hover effects run on devices that hover; everything is off for reduced motion. fx.js adds the button label roll,
   the Add to bag sequence and the cart count tick. */

:root { --fx-ease: cubic-bezier(.22, 1, .36, 1); --fx-inout: cubic-bezier(.65, 0, .35, 1); }

@media (prefers-reduced-motion: no-preference) {

  /* ---------- buttons: the label rolls up and a bone (or ink) block rises under it ---------- */
  .fx-btn { position: relative; overflow: hidden; isolation: isolate; }
  .fx-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fx-fill, #EAE7DF); box-shadow: inset 0 0 0 1px var(--fx-edge, #16150F); transform: translateY(101%); transition: transform .55s var(--fx-ease); }
  .fx-r { display: block; position: relative; overflow: hidden; margin: -.16em 0; }
  .fx-r1, .fx-r2 { display: block; padding: .16em 0; transition: transform .55s var(--fx-ease); }
  .fx-r2 { position: absolute; left: 0; top: 100%; width: 100%; color: var(--fx-fg, #16150F); }
  /* the light buttons (on a black slab, or outlined) invert the other way */
  .go.alt, .checkout, .tbd-btn.alt, .news button { --fx-fill: #16150F; --fx-fg: #EAE7DF; --fx-edge: #EAE7DF; }
  .tbd-btn.alt { --fx-edge: #16150F; }

  @media (hover: hover) {
    .fx-btn.fx-btn:hover { transform: none; }
    .fx-btn:hover::before { transform: none; }
    .fx-btn:hover .fx-r1, .fx-btn:hover .fx-r2 { transform: translateY(-100%); }
    .fx-btn:not(:has(.fx-r)):hover { color: var(--fx-fg, #16150F); }
  }
  .fx-btn:focus-visible::before { transform: none; }
  .fx-btn:focus-visible .fx-r1, .fx-btn:focus-visible .fx-r2 { transform: translateY(-100%); }
  .fx-btn.fx-btn:active { transform: scale(.985); }

  /* ---------- Add to bag: a bone wipe crosses the button, the label changes under it, a tick draws ---------- */
  .add.is-adding::before { transform: translateY(101%) !important; transition: none !important; }
  .add.is-adding .fx-r1, .add.is-adding .fx-r2 { transform: none !important; transition: none !important; }
  .add.is-adding::after { content: ""; position: absolute; inset: 0; z-index: -1; background: #EAE7DF; box-shadow: inset 0 0 0 1px #16150F; animation: fx-sweep 1.1s var(--fx-inout) both; }
  .add.is-adding .fx-r { animation: fx-ink 1.1s linear both; }
  @keyframes fx-sweep { 0% { transform: translateX(-101%); } 45%, 55% { transform: none; } 100% { transform: translateX(101%); } }
  @keyframes fx-ink { 0%, 16% { color: #EAE7DF; } 26%, 72% { color: #16150F; } 82%, 100% { color: #EAE7DF; } }
  .fx-check { display: inline-block; width: 13px; height: 13px; margin: 0 8px 1px 0; vertical-align: middle; overflow: visible; }
  .fx-check path { stroke-dasharray: 16; stroke-dashoffset: 16; }
  .add.is-added .fx-check path { animation: fx-draw .45s .4s var(--fx-ease) both; }
  @keyframes fx-draw { to { stroke-dashoffset: 0; } }

  /* the count in the header ticks over: a bone block drops in with the new number, then fades back to the bar */
  [data-cart-count] { display: inline-block; padding: 0 2px; margin: 0 -2px; }
  [data-cart-count].fx-tick { animation: fx-count 1.1s var(--fx-ease) both; }
  @keyframes fx-count {
    0% { transform: translateY(-70%); opacity: 0; background: #EAE7DF; color: #16150F; }
    25% { transform: none; opacity: 1; background: #EAE7DF; color: #16150F; }
    70% { background: #EAE7DF; color: #16150F; }
    100% { background: transparent; color: #EAE7DF; }
  }

  @media (hover: hover) {
    /* ---------- links: a hairline draws in from the left and leaves to the right ---------- */
    .menu a, .util a, .cols a { position: relative; }
    .cols a { display: inline-block; }
    .menu a::after, .util a::after, .cols a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: 100% 50%; transition: transform .5s var(--fx-ease); pointer-events: none; }
    .cols a::after { bottom: -2px; }
    .menu a:hover::after, .util a:hover::after, .cols a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }

    /* ---------- product tiles: slow push-in, the name underlines, a small "View" tab slides up ---------- */
    .item .tile img { transition: transform 1.2s var(--fx-ease); }
    .item:hover .tile img { transform: scale(calc(var(--z, 1) * 1.06)); }
    .item .tile::after { content: "View \2192"; position: absolute; left: 0; bottom: 0; padding: 11px 16px 10px; background: #16150F; color: #EAE7DF; font-size: 11px; line-height: 1; text-transform: uppercase; letter-spacing: .08em; transform: translateY(101%); transition: transform .5s var(--fx-ease); pointer-events: none; }
    .item:hover .tile::after, .item:focus-visible .tile::after { transform: none; }
    .item .name { padding-bottom: 3px; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .6s var(--fx-ease); }
    .item:hover .name, .item:focus-visible .name { background-size: 100% 2px; }

    /* ---------- product page photographs ---------- */
    .slide img { transition: transform 1.4s var(--fx-ease); }
    .slide:hover img { transform: scale(1.025); }

    /* ---------- home hero list, account rows ---------- */
    .drops a { transition: color .2s, transform .5s var(--fx-ease); }
    .drops a:hover { transform: translateX(8px); }
    .orders summary .no { transition: transform .5s var(--fx-ease); }
    .orders summary:hover .no { transform: translateX(6px); }
  }

  /* sizes press in */
  .size span { transition: border-color .15s, background .15s, color .15s, transform .2s var(--fx-ease); }
  .size input:active + span { transform: scale(.94); }
}
