/* tsubu coffee & bake — スクロールするだけで見える動きと、さわれる場所の合図
   初期の非表示は html.js-motion（motion.js が付ける）か、JS が付けた .is-wait の配下だけ。
   動かすのは transform / opacity / clip-path。 */

.sec { overflow-x: clip; }

/* ---------- さわる場所に付く黒い札（一画面目の札と同じ見た目） ---------- */
.tag { position: absolute; z-index: 6; left: 50%; top: 0; opacity: 0; pointer-events: none; transition: opacity .25s linear; }
.tag span {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-ja);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: .04em;
  white-space: nowrap;
  transform: translateX(-50%);
}
.tag span::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 10px; background: var(--ink); }
.tag.is-on { opacity: 1; }
.tag.is-on span { animation: tag-bob 1.6s ease-in-out .3s 4; }
@keyframes tag-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.visit .tag span { background: var(--paper); color: var(--ink); }
.visit .tag span::after { background: var(--paper); }

/* メニューの最初の品: 「＋」の真上に、右端をそろえて置く */
.order__group li { position: relative; }
.tag--item { left: auto; right: 0; top: 12px; }
.tag--item span { left: auto; right: 0; transform: none; }
.tag--item span::after { left: auto; right: 14px; height: 12px; }
/* 天板の 1 個の真上 */
.tag--tray { top: 6%; }
/* クッキーの真上 */
.bite { position: relative; }
.tag--bite { top: 9%; }

/* ---------- 押せる品: 右端の「＋」 ---------- */
.js .item { position: relative; padding-right: 44px; }
.js .item::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-family: var(--f-mono);
  font-size: 18px;
  line-height: 1;
  transition: background-color .2s, color .2s, transform .3s var(--ease);
}
.js .item:active::after { transform: scale(.84); background: var(--ink); color: var(--paper); }
@media (hover: hover) and (pointer: fine) {
  .js .item:hover::after { background: var(--ink); color: var(--paper); }
}
.js .item.is-demo::after { border-color: var(--red); background: var(--red); color: #fff; animation: plus-press .9s var(--ease); }
.js .item.is-demo .item__name b { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
@keyframes plus-press { 0% { transform: scale(1); } 18% { transform: scale(.72); } 46% { transform: scale(1.22); } 100% { transform: scale(1); } }
.js .item__count { position: absolute; right: -8px; top: 50%; z-index: 1; min-width: 26px; height: 20px; margin-top: -31px; padding: 0 6px; }

/* ---------- レシートの印字機: 節の右上から始め、印字口を見せる ---------- */
.printer { align-self: start; }
.printer__slot { right: 44px; height: 9px; box-shadow: 0 1px 0 rgba(251, 248, 241, .34); }
.printer__body::after { content: ""; position: absolute; right: 18px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: rgba(251, 248, 241, .28); }
.printer.is-printing .printer__body::after { background: #ff6a4d; animation: led .22s steps(1) infinite; }
@keyframes led { 0% { opacity: 1; } 50% { opacity: .25; } }
.printer.is-wait .printer__paper { visibility: hidden; }
.rc__lines .rc__demo { color: rgba(35, 33, 30, .66); }
.rc__demo em { margin-right: 7px; padding: 0 5px; border: 1px solid currentColor; font-style: normal; font-family: var(--f-ja); font-weight: 700; font-size: 10px; }

/* SP: 品に付ける札は、少し小さく */
@media (max-width: 768px) {
  .tag--item span { font-size: 12px; padding: 5px 11px; }
}

/* ---------- 長居のメーター: 数字を大きく、変わった桁を下から送る ---------- */
.stay__time { font-size: clamp(60px, 7.4vw, 116px); }
.stay__d, .stay__colon { display: inline-block; }
.js-motion .stay__colon { animation: colon 1s steps(1) infinite; }
@keyframes colon { 0% { opacity: 1; } 50% { opacity: .22; } }

/* ---------- A. 節の見出し: 1 字ずつ机に落ちて弾む。最後に朱の「.」が転がって止まる ---------- */
.ch { display: inline-block; }
.js-motion .sec__title i, .js-motion .visit__title i { display: inline-block; }
.js-motion .sec__title:not(.is-in) .ch, .js-motion .sec__title:not(.is-in) i, .js-motion .visit__title:not(.is-in) i { opacity: 0; }
.js-motion .sec__title.is-in .ch { animation: ch-drop .8s both; animation-delay: calc(var(--i) * 62ms); }
/* 朱の「.」の軌道は motion.js の rollDot が計算して再生する（重力の放物線 + 横は流れ続ける + 距離に合った回転） */
/* 文字の弾み: 落ちるときは t²、上がるときはその逆（重力の放物線）。時間の配分も高さに合わせる */
@keyframes ch-drop {
  0% { transform: translateY(-82%) rotate(var(--r, -7deg)); opacity: 0; animation-timing-function: cubic-bezier(.33, 0, .67, .33); }
  10% { opacity: 1; }
  47% { transform: translateY(0) rotate(0deg); animation-timing-function: cubic-bezier(.33, .67, .67, 1); }
  65% { transform: translateY(-12%) rotate(calc(var(--r, -7deg) * -.3)); animation-timing-function: cubic-bezier(.33, 0, .67, .33); }
  83% { transform: translateY(0) rotate(0deg); animation-timing-function: cubic-bezier(.33, .67, .67, 1); }
  91.5% { transform: translateY(-3%); animation-timing-function: cubic-bezier(.33, 0, .67, .33); }
  100% { transform: none; opacity: 1; }
}

/* ---------- B. 丸い切り抜き: 行が入るとき、横から転がって入る（移動量に合った回転） ---------- */
.bake__list .roll { display: block; width: min(52%, 150px); margin: 6px 0 14px; grid-column: 1 / -1; }
.bake__list .roll img { display: block; width: 100%; margin: 0; }
.js-motion .item__pic { --tx: -120px; --rot: -215deg; }
.js-motion .roll { --tx: -210px; --rot: -160deg; }
.js-motion .item__pic, .js-motion .roll { transition: transform 1.05s cubic-bezier(.2, .7, .2, 1), opacity .25s linear; transition-delay: calc(var(--d, 0) * 90ms); }
.js-motion .item:not(.is-in) .item__pic, .js-motion .bake__list li:not(.is-in) .roll, .js-motion .daily__list li:not(.is-in) .roll { transform: translateX(var(--tx)) rotate(var(--rot)); opacity: 0; }
.js-motion .item__pic img, .js-motion .roll img { transition: none; will-change: transform; }
.js-motion .item:not(.is-in)::after { transform: scale(0); }
.js-motion .item::after { transition-delay: 0s, 0s, calc(var(--d, 0) * 90ms + .5s); }
.js-motion .item.is-in:hover::after, .js-motion .item.is-in:active::after { transition-delay: 0s; }
.js-motion .bake__photo img { transition: clip-path 1.1s cubic-bezier(.7, 0, .2, 1); -webkit-clip-path: inset(0); clip-path: inset(0); }
.js-motion .bake__photo:not(.is-in) img { -webkit-clip-path: inset(0 100% 0 0); clip-path: inset(0 100% 0 0); }

/* ---------- D. 焼き上がり案内: 行がぱたぱたと出る。針は 7:00 から走る ---------- */
.board__needle { left: 0; width: 100%; pointer-events: none; transform: translateX(calc(var(--x, 0) * 1%)); }
.board.is-wait .board__head, .board.is-wait .board__next, .board.is-wait .board__rows li, .board.is-wait .board__needle i { opacity: 0; }
.board.is-wait .board__needle { transform: translateX(0); }
.board.is-in .board__rows { perspective: 760px; }
.board.is-in .board__head, .board.is-in .board__next { animation: board-on .35s linear both; }
.board.is-in .board__rows li { transform-origin: 50% 0; animation: flap .56s both; animation-delay: calc(var(--r) * 115ms + .2s); }
.board.is-in .board__needle { transition: transform 1.9s cubic-bezier(.3, .05, .2, 1) .5s; }
.board.is-in .board__needle i { animation: board-on .2s linear .5s both; }
@keyframes board-on { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes flap {
  0% { transform: rotateX(-94deg); opacity: 0; animation-timing-function: cubic-bezier(.3, .6, .3, 1); }
  2% { opacity: 1; }
  58% { transform: rotateX(16deg); }
  80% { transform: rotateX(-7deg); }
  100% { transform: none; opacity: 1; }
}

/* ---------- E. 混みぐあいの棒: 見えたら、下から伸びる ---------- */
.js-motion .crowd__bars i { transition: transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
.js-motion .crowd:not(.is-in) .crowd__bars i { transform: scaleY(0); }
.js-motion .crowd__bars li.is-now::before { transition: opacity .3s linear .6s; }
.js-motion .crowd:not(.is-in) .crowd__bars li.is-now::before { opacity: 0; }

/* ---------- F. 店: 写真は下から上へ開き、枠の中で少し動く。今日の行に手描きの丸 ---------- */
.js-motion .shop__photo { overflow: hidden; }
.js-motion .shop__photo img { display: block; transform: scale(1.14); will-change: transform; -webkit-clip-path: inset(0); clip-path: inset(0); transition: clip-path .9s cubic-bezier(.2, .7, .2, 1); }
.js-motion .shop__photo--front img { transition-delay: .2s; }
.js-motion .shop__photo:not(.is-in) img { -webkit-clip-path: inset(100% 0 0 0); clip-path: inset(100% 0 0 0); }
.shop__hours th { position: relative; }
.js-motion .shop__hours th, .js-motion .shop__hours td { transition: opacity .3s linear, transform .55s var(--ease); transition-delay: calc(var(--i, 0) * 65ms); }
.js-motion .shop__hours:not(.is-in) th { opacity: 0; transform: translateX(-14px); }
.js-motion .shop__hours:not(.is-in) td { opacity: 0; transform: translateX(14px); }
.today-ring { position: absolute; left: -14px; top: 50%; width: 44px; height: 34px; margin-top: -17px; overflow: visible; pointer-events: none; }
.today-ring path { fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; }
.shop__hours.is-in .today-ring path { animation: ring-draw .75s ease-out .95s forwards; }
@keyframes ring-draw { to { stroke-dashoffset: 0; } }

/* ---------- G. お知らせ: 行が順に出る（軽く） ---------- */
.js-motion .news__list li { transition: opacity .4s linear; transition-delay: calc(var(--i, 0) * 80ms); }
.js-motion .news__list time { display: block; transition: transform .55s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js-motion .news__list:not(.is-in) li { opacity: 0; }
.js-motion .news__list:not(.is-in) time { transform: translateX(-12px); }

/* ---------- H. 最後の節: 英字は行ごとに下から。レシートは落ちて傾いて止まる。クッキーは転がって入る ---------- */
.js-motion .visit__title .ln { -webkit-clip-path: inset(-90% -70% 0 -4%); clip-path: inset(-90% -70% 0 -4%); }
.js-motion .visit__title .ln__in { display: block; transition: transform 1.1s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--l, 0) * 150ms); }
.js-motion .visit__title:not(.is-in) .ln__in { transform: translateY(106%); }
.js-motion .bill:not(.is-in) { opacity: 0; }
.js-motion .bill.is-in { animation: bill-drop .95s both; }
.js-motion .bill:not(.is-in) .bill__list div, .js-motion .bill:not(.is-in) .bill__total { opacity: 0; }
.js-motion .bill.is-in .bill__list div, .js-motion .bill.is-in .bill__total { animation: board-on .1s steps(1) both; animation-delay: calc(var(--i, 0) * 140ms + .95s); }
@keyframes bill-drop {
  0% { transform: translateY(-36vh) rotate(9deg); opacity: 0; animation-timing-function: cubic-bezier(.5, 0, .9, .5); }
  6% { opacity: 1; }
  60% { transform: translateY(0) rotate(-5deg); animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  78% { transform: translateY(-16px) rotate(-1deg); animation-timing-function: cubic-bezier(.6, 0, .8, .4); }
  100% { transform: rotate(-2.5deg); opacity: 1; }
}
.js-motion .bite__cookie { transition: transform 1.15s cubic-bezier(.2, .7, .2, 1), opacity .25s linear; }
.js-motion .bite:not(.is-in) .bite__cookie { transform: translateX(230px) rotate(132deg); opacity: 0; }
.bite__cookie.is-nudge { animation: nudge .7s var(--ease) .15s; }
@keyframes nudge { 0%, 100% { transform: rotate(0deg); } 30% { transform: rotate(-9deg); } 62% { transform: rotate(6deg); } }

/* ---------- I. 流れ続けるレシートの紙 ---------- */
.tape { margin-top: clamp(64px, 8vw, 128px); padding: 18px 0; overflow: hidden; }
.tape__paper { width: 104%; margin-left: -2%; background: #fdfcf8; color: #23211e; box-shadow: 0 8px 16px rgba(58, 38, 16, .1); transform: rotate(-1.3deg); }
.tape__run { display: flex; width: max-content; will-change: transform; }
.tape__set { display: flex; align-items: baseline; flex: none; padding: 17px 0 15px; font-size: clamp(15px, 1.5vw, 21px); line-height: 1.4; white-space: nowrap; }
.tape__set span { padding: 0 clamp(18px, 2.2vw, 34px); border-right: 1.5px dashed rgba(35, 33, 30, .45); font-weight: 500; }
.tape__set b { margin-left: .5em; font-family: var(--f-mono); font-weight: 500; }
.tape__set .tape__say { font-weight: 900; }
.tape__set .tape__say b { color: var(--red); }
.tape__set .tape__en { font-family: var(--f-display); font-variation-settings: "wdth" 88; font-weight: 800; letter-spacing: -.01em; }
.tape + .sec { padding-top: clamp(56px, 7vw, 112px); }

@media (max-width: 768px) {
  .stay__time { font-size: 64px; }
  .js-motion .item__pic { --tx: -110px; --rot: -234deg; }
  .js-motion .roll { --tx: -150px; --rot: -200deg; }
  .bake__list .roll { width: 46%; margin-top: 6px; }
  .js-motion .bite:not(.is-in) .bite__cookie { transform: translateX(170px) rotate(120deg); }
  .tape { margin-top: 56px; padding: 14px 0; }
  .tape + .sec { padding-top: 48px; }
}

/* ---------- 動きを減らす設定: 全部止めて、そのまま見せる ---------- */
@media (prefers-reduced-motion: reduce) {
  .tag, .js .item::after { transition: none; }
  .tag.is-on span, .js .item.is-demo::after, .printer.is-printing .printer__body::after, .bite__cookie.is-nudge { animation: none; }
}
