/* SEKAILABO' front page: MOGPASS service demo (Instagram story → coupon DM).
   Static by default; the playback loop runs only under .sl-motion-on. */
body.home .sl-project-mogpass { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; row-gap: 26px; }
body.home .sl-project-mogpass .sl-project-content { grid-column: 1; grid-row: 2; max-width: 520px; }
body.home .sl-project-mogpass .sl-project-link { grid-row: 4; }

.sl-mogpass-demo { position: relative; z-index: 1; grid-column: 1; grid-row: 3; align-self: center; display: grid; grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr); align-items: center; width: 100%; max-width: 470px; margin: 0; font-family: "Noto Sans JP", sans-serif; }
.sl-mogpass-demo figcaption { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 54px; margin-top: 14px; font-size: 11px; line-height: 1.6; }
.sl-mogpass-demo figcaption b { display: block; margin-bottom: 4px; color: var(--sl-yellow); font: 600 10px "IBM Plex Mono", monospace; letter-spacing: .1em; }

.sl-phone { position: relative; display: flex; flex-direction: column; overflow: hidden; aspect-ratio: 9 / 16; border: 3px solid var(--sl-ink); border-radius: 22px; box-shadow: 7px 7px 0 var(--sl-yellow); color: var(--sl-ink); font-size: 9px; line-height: 1.4; }
.sl-phone-user { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.sl-phone-user b { flex-shrink: 0; width: 20px; height: 20px; border: 2px solid var(--sl-paper); border-radius: 50%; background: var(--sl-yellow); box-shadow: 0 0 0 2px var(--sl-red); }
.sl-phone-user em { font-style: normal; font-weight: 400; opacity: .75; }

/* Story screen */
.sl-phone--story { padding: 9px 9px 10px; background: var(--sl-red); color: #fff; }
.sl-story-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-bottom: 8px; }
.sl-story-bars i { position: relative; display: block; height: 2px; overflow: hidden; background: rgba(255, 255, 255, .4); }
.sl-story-bars i::after { position: absolute; inset: 0; background: #fff; content: ""; transform: scaleX(0); transform-origin: left; }
.sl-story-bars i:first-child::after { transform: scaleX(1); }
.sl-story-dish { display: block; width: 112%; margin: auto -6% 0; }
.sl-dish-stick { fill: var(--sl-ink); }
.sl-dish-bowl { fill: var(--sl-ink); }
.sl-dish-soup { fill: var(--sl-yellow); }
.sl-dish-pork { fill: #f1d2b8; stroke: #c47a52; stroke-width: 4; }
.sl-dish-egg { fill: #fff; }
.sl-dish-yolk { fill: #f39a1b; }
.sl-dish-nori { fill: #1d2a22; }
.sl-dish-leek { fill: #3f8f4a; }
.sl-story-mention { align-self: center; margin: 10px 0 auto; padding: 5px 9px; border-radius: 6px; background: #fff; color: var(--sl-blue); font-weight: 700; font-size: 10px; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); rotate: -4deg; }
.sl-story-reply { display: flex; align-items: center; gap: 7px; }
.sl-story-reply span { flex: 1; padding: 6px 9px; border: 1px solid rgba(255, 255, 255, .7); border-radius: 999px; font-size: 8px; }
.sl-story-reply i { font-style: normal; font-size: 11px; }

/* DM screen */
.sl-phone--dm { gap: 6px; padding: 9px; background: #fff; }
.sl-phone-user--dm { padding-bottom: 8px; border-bottom: 1px solid rgba(22, 24, 28, .12); }
.sl-dm-mention { align-self: center; margin: 4px 0 2px; color: rgba(22, 24, 28, .55); font-size: 7px; }
.sl-dm-bubble { align-self: flex-start; max-width: 92%; padding: 6px 9px; border-radius: 14px 14px 14px 4px; background: #efefef; font-size: 8.5px; }
.sl-dm-coupon { position: relative; display: grid; gap: 2px; margin-top: 4px; padding: 9px 10px; border: 2px dashed var(--sl-ink); background: var(--sl-yellow); text-align: center; }
.sl-dm-coupon small { font: 600 7px "IBM Plex Mono", monospace; letter-spacing: .1em; }
.sl-dm-coupon strong { font: 700 17px/1 "Space Grotesk", sans-serif; letter-spacing: -.03em; }
.sl-dm-coupon span { margin-top: 3px; padding: 4px; background: var(--sl-ink); color: #fff; font-size: 7.5px; font-weight: 700; }
.sl-dm-reply { align-self: flex-end; max-width: 88%; margin-top: 4px; padding: 6px 9px; border-radius: 14px 14px 4px 14px; background: var(--sl-blue); color: #fff; font-size: 8.5px; }
.sl-dm-input { margin-top: auto; padding: 6px 9px; border: 1px solid rgba(22, 24, 28, .2); border-radius: 999px; color: rgba(22, 24, 28, .5); font-size: 8px; }

/* Connector between the two screens */
.sl-mogpass-arrow { position: relative; display: grid; justify-items: center; gap: 6px; }
.sl-mogpass-arrow span { color: var(--sl-yellow); font: 600 8px "IBM Plex Mono", monospace; letter-spacing: .08em; white-space: nowrap; }
.sl-mogpass-arrow i { position: relative; display: block; width: 38px; height: 2px; background: rgba(255, 255, 255, .6); }
.sl-mogpass-arrow i::before { position: absolute; top: -4px; right: -2px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid rgba(255, 255, 255, .9); content: ""; }
.sl-mogpass-arrow i::after { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--sl-yellow); content: ""; opacity: 0; }

/* Playback loop: story plays → mention sticker → DM arrives → coupon */
@keyframes sl-mp-bar { 0% { transform: scaleX(0); } 40%, 100% { transform: scaleX(1); } }
@keyframes sl-mp-mention { 0%, 8% { opacity: 0; scale: .3; } 14% { opacity: 1; scale: 1.15; } 18%, 92% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1; } }
@keyframes sl-mp-send { 0%, 38% { opacity: 0; transform: translateX(-12px); } 42% { opacity: 1; } 52% { opacity: 1; transform: translateX(30px); } 56%, 100% { opacity: 0; transform: translateX(30px); } }
@keyframes sl-mp-in-1 { 0%, 50% { opacity: 0; transform: translateY(10px); } 54%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes sl-mp-in-2 { 0%, 58% { opacity: 0; transform: translateY(10px); } 62%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes sl-mp-in-3 { 0%, 66% { opacity: 0; transform: translateY(14px) scale(.85); } 71% { opacity: 1; transform: scale(1.06); } 74%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes sl-mp-in-4 { 0%, 80% { opacity: 0; transform: translateY(10px); } 84%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes sl-mp-ring { 0%, 50% { box-shadow: 7px 7px 0 var(--sl-yellow); } 53% { box-shadow: 7px 7px 0 var(--sl-yellow), 0 0 0 5px rgba(243, 194, 27, .9); } 60%, 100% { box-shadow: 7px 7px 0 var(--sl-yellow); } }

.sl-motion-on .sl-mogpass-demo { --sl-mp-loop: 7s; }
.sl-motion-on .sl-mogpass-demo .sl-story-bars i:first-child::after { animation: sl-mp-bar var(--sl-mp-loop) linear infinite; }
.sl-motion-on .sl-mogpass-demo .sl-story-mention { animation: sl-mp-mention var(--sl-mp-loop) var(--sl-ease-out) infinite; }
.sl-motion-on .sl-mogpass-demo .sl-mogpass-arrow i::after { animation: sl-mp-send var(--sl-mp-loop) var(--sl-ease-snap) infinite; }
.sl-motion-on .sl-mogpass-demo .sl-phone--dm { animation: sl-mp-ring var(--sl-mp-loop) ease-out infinite; }
.sl-motion-on .sl-mogpass-demo .sl-dm-mention, .sl-motion-on .sl-mogpass-demo .sl-dm-bubble:nth-of-type(3) { animation: sl-mp-in-1 var(--sl-mp-loop) var(--sl-ease-out) infinite; }
.sl-motion-on .sl-mogpass-demo .sl-dm-bubble:nth-of-type(4) { animation: sl-mp-in-2 var(--sl-mp-loop) var(--sl-ease-out) infinite; }
.sl-motion-on .sl-mogpass-demo .sl-dm-coupon { animation: sl-mp-in-3 var(--sl-mp-loop) var(--sl-ease-out) infinite; }
.sl-motion-on .sl-mogpass-demo .sl-dm-reply { animation: sl-mp-in-4 var(--sl-mp-loop) var(--sl-ease-out) infinite; }
.sl-motion-on .sl-project-mogpass:not(.is-sl-in) .sl-mogpass-demo * { animation-play-state: paused; }

@media (max-width: 820px) {
  body.home .sl-project-mogpass { row-gap: 22px; }
  .sl-mogpass-demo { grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); max-width: none; }
  .sl-mogpass-demo figcaption { gap: 34px; font-size: 10px; }
  .sl-mogpass-arrow span { display: none; }
  .sl-mogpass-arrow i { width: 24px; }
  .sl-phone { border-radius: 18px; box-shadow: 5px 5px 0 var(--sl-yellow); font-size: 8px; }
  .sl-dm-bubble, .sl-dm-reply { font-size: 7.5px; }
  .sl-dm-coupon strong { font-size: 14px; }
  .sl-phone { aspect-ratio: 9 / 17; padding: 8px 7px; }
  .sl-phone-user b { width: 16px; height: 16px; }
  .sl-dm-mention, .sl-dm-input, .sl-story-reply i:first-of-type { display: none; }
  .sl-story-reply span { overflow: hidden; padding: 5px 7px; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
  .sl-story-mention { padding: 4px 7px; font-size: 8.5px; }
  .sl-dm-bubble, .sl-dm-reply { padding: 5px 7px; }
  .sl-dm-coupon { padding: 7px 6px; }
  .sl-dm-coupon span, .sl-dm-mention { font-size: 6.5px; }
  @keyframes sl-mp-send { 0%, 38% { opacity: 0; transform: translateX(-12px); } 42% { opacity: 1; } 52% { opacity: 1; transform: translateX(16px); } 56%, 100% { opacity: 0; transform: translateX(16px); } }
}

@media (prefers-reduced-motion: reduce) {
  .sl-mogpass-demo *, .sl-mogpass-demo .sl-phone { animation: none !important; }
}
